We are opening an external website in Inappbrowser using window.open(url, "_blank"); . We cannot use _self/_system because we have to listen to event listeners and do some functions on various events happening on the external website.
It works fine for all cases but when special links like Mailto:, tel:, sms: etc comes, then the application shows a error page showing ERR_UNKNOWN_URL_SCHEME error. The dialer/mail client does open but in background the page changes to error page.
Can anyone please help here?
It works fine for all cases but when special links like Mailto:, tel:, sms: etc comes, then the application shows a error page showing ERR_UNKNOWN_URL_SCHEME error. The dialer/mail client does open but in background the page changes to error page.
Can anyone please help here?
- 8 Posts
- 0 Reply Likes
Posted 5 years ago
- 1840 Posts
- 78 Reply Likes
Hi Atul,
Add this to config.xml for all URL types that are affected:
-yiming
Add this to config.xml for all URL types that are affected:
<access origin="sms:*" launch-external="yes" /> -yiming
- 8 Posts
- 0 Reply Likes
We have already done this. It works on local files of phonegap app. But if an external website is opened in inappbrowser, then it does not work.
- 1840 Posts
- 78 Reply Likes
Hi Atul,
Are those external websites also whitelisted as well in config.xml?
-yiming
Are those external websites also whitelisted as well in config.xml?
-yiming
- 8 Posts
- 0 Reply Likes
Hi, Yes they are whitelisted and opening fine. The issue comes only when any special link like mailto: is clicked in them.
- 1840 Posts
- 78 Reply Likes
Can you post a screenshot of the error in the app?
-yiming
-yiming
- 5 Posts
- 0 Reply Likes
I am getting the same error. I have attached a screenshot for the same. If we simply put a link
<a href="sms://XXXXXX">link</a> in the app and then click on that link, it works fine and doesn't show any error. Probably because it gets opened using _system but if we open it like the way it has been described by Atul it gives an error.Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 8 Posts
- 0 Reply Likes
As mentioned in the first comment, they are whitelisted and still we see error page.
- 5 Posts
- 0 Reply Likes
I have whitelisted them in the config.xml:
but it still doesn't work.
<access origin="tel:*" launch-external="yes"/>
<access origin="tel://*" launch-external="yes"/>
<access origin="geo:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<access origin="sms://*" launch-external="yes"/>
<access origin="smsto:*" launch-external="yes"/>
<access origin="market:*" launch-external="yes"/>
but it still doesn't work.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 8 Posts
- 0 Reply Likes
Yes these are in external website. They work fine on any browser. Just phonegap Inappbrowser fails
- 5 Posts
- 0 Reply Likes
- 5 Posts
- 0 Reply Likes
I got the solution. Look into the InAppBrowser.java file and you would be handling urls inside the onPageStarted(WebView view, String url, Bitmap favicon) function.
Instead override the following function:
I found the solution at http://stackoverflow.com/questions/43...
Hope it helps.
Instead override the following function:
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_DIAL,
Uri.parse(url));
startActivity(intent);
}else if(url.startsWith("http:") || url.startsWith("https:")) {
view.loadUrl(url);
}
return true;
}
I found the solution at http://stackoverflow.com/questions/43...
Hope it helps.
- 8 Posts
- 0 Reply Likes
Thanks a lot Vishwani. It worked great.
- 329 Posts
- 12 Reply Likes
Modifying plugins is not for all of us. Especially not if you are (and I am) using PhoneGap Build and don't even have access to the plugins.
Is there a solution in that case?
Cheers,
Anders
Is there a solution in that case?
Cheers,
Anders
- 1840 Posts
- 78 Reply Likes
- 329 Posts
- 12 Reply Likes
Thanks.
I solved it temporarily by using _system where this works. I have a setting for choosing the embedded browser.
I solved it temporarily by using _system where this works. I have a setting for choosing the embedded browser.
- 11 Posts
- 0 Reply Likes
Hi,
I'm also having the same problem.
I am using Intel XDK + Cordova
I use the plugin "InAppBrowser" to open an external website that I developed with Framework7.
On the contacts have links tel: and mailto: but when I click appears the error page "err_unknown_url_scheme"
How can I solve this problem?
I'm also having the same problem.
I am using Intel XDK + Cordova
I use the plugin "InAppBrowser" to open an external website that I developed with Framework7.
On the contacts have links tel: and mailto: but when I click appears the error page "err_unknown_url_scheme"
How can I solve this problem?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If you are showing the external page in the inappbrowser window (nt in the browser app on the device), then the whitelist plugin has no effect.
However, the inappbrowser plugin has been updated very recently:
http://cordova.apache.org/news/2016/0...
Which version are you trying?
However, the inappbrowser plugin has been updated very recently:
http://cordova.apache.org/news/2016/0...
Which version are you trying?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
1.3.0 can now be used, together with PGB cli-6.0.0
(doesn't automatically mean that tel:/sms:-links will work now)
(doesn't automatically mean that tel:/sms:-links will work now)
- 11 Posts
- 0 Reply Likes
The problem is that the page of contacts tel: and mailto: is an external website (window.open).
The plugin "InAppBrowser" will work on the external website?
The plugin "InAppBrowser" will work on the external website?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That's a strange question.
Do you mean "plugin Whitelist"?
Do you mean "plugin Whitelist"?
- 11 Posts
- 0 Reply Likes
I've also added these tags in xml this and continues to show the error page "err_unknown_url_scheme".
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
What tags?
(If you want to post tags, wrap them in a CODE element, as described under "some HTML allowed")
(If you want to post tags, wrap them in a CODE element, as described under "some HTML allowed")
- 11 Posts
- 0 Reply Likes
This tags:
<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Not sure if they will be converted to intents within the new IAB browser window. Have you tried?
- 11 Posts
- 0 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
What question?
"Have you tried?"?
Just build your app with cli-6.0.0 and the latest inappbrowser, and test it.
"Have you tried?"?
Just build your app with cli-6.0.0 and the latest inappbrowser, and test it.
- 11 Posts
- 0 Reply Likes
Intel XDK only appears to me the CLI version 5.1.1 and 1.1.0 plugin InAppbrower
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, you are building locally? Not with Phonegap Build?
Related Categories
-
PhoneGap Framework
- 2926 Conversations
- 60 Followers
-
Plugins
- 1283 Conversations
- 37 Followers
-
Programming (Others)
- 1167 Conversations
- 23 Followers









