Open jernejrus opened 7 years ago
Hi @jernejrus,
Did you fix this?
I use onNavigationStateChange and catch it there.
Hi @jernejrus
Did you test this with the native RN webview component? They had the same problem with tel: and mailto: href problems?
Hello,
Using native RN webview works OK.
@lucasferreira Hi Sir,
For tel: can you add this block of code under RNWebview Class -> shouldOverrideWithResult.
I have to modify native android code to achieve it and to directly go to Dial intent and not let the (tel:) loaded in webview, that causes the ERR_UNKNOWN_URL_SCHEME. I know there is a clean solution for this but for the meantime this is my solution.
public void shouldOverrideWithResult(RNWebView view, ReadableArray args) {
if (!args.getBoolean(0)) {`
if(shouldOverrideUrlLoadingUrl.startsWith("tel:")){
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(shouldOverrideUrlLoadingUrl));
getModule().getActivity().startActivity(intent);
}else{
view.loadUrl(shouldOverrideUrlLoadingUrl);
}
}
}
Inside the html that I am passing as source {html}, I have an badge. Clicking on it on Android, gives me a ERR_UNKNOWN_URL_SCHEME error (opens a new screen with this message). Using react native WebView I was able to catch it with onError function, which is missing here. Also it opens new call normally on iOS.