Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERR_UNKNOWN_URL_SCHEME on react native webview

I'm developing an app with react-native-webview.

And when I click a link with

<a href="sms:888888&body=Test Message">Click here</a>

I'm receiving error err_unknown_url_scheme.

Thanks

like image 866
noobdeveloper Avatar asked Dec 23 '25 00:12

noobdeveloper


2 Answers

I was getting error regarding "mailto: and tel: links do not work in webview" and for my situation the fix was to adding this property in webview:

 <WebView
 // other props here
  originWhitelist={['http://*', 'https://*', 'intent://*']} 
 />
like image 83
Akshita Agarwal Avatar answered Dec 24 '25 14:12

Akshita Agarwal


Able to solve the problem by editting the webview parameters.

<WebView
    {...this.props}
    bounces={false}
    originWhitelist={["https://*", "http://*", "file://*", "sms://*"]}
    allowFileAccess={true}
    domStorageEnabled={true}
    javaScriptEnabled={true}
    geolocationEnabled={true}
    saveFormDataDisabled={true}
    allowFileAccessFromFileURLS={true}
    allowUniversalAccessFromFileURLs={true}
  />
like image 24
noobdeveloper Avatar answered Dec 24 '25 14:12

noobdeveloper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!