Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova Android not allowing to open whitelisted intent to fb-messenger

I have an Ionic Cordova app for android which has a button to facebook messenger:

<a href="https://m.me/my-fb-page" target="_blank"><img src="assets/images/messenger.svg" /></a>

When tapped, nothing appears on the screen. I keep receiving this error through logcat:

CordovaWebViewImpl: Blocked (possibly sub-frame) navigation to non-allowed URL: intent://user/xxxxxxxxxxxxx/?intent_trigger=mme&nav=discover#Intent;scheme=fb-messenger;package=com.facebook.orca;end

I have cordova-plugin-whitelist installed.

Content of config.xml:

    ...
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-navigation href="*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-intent href="fb-messenger:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <allow-intent href="fb-messenger:*" />
        ...

I have tried a number of options for allow-intent, access and allow navigation.

The issue is not specifically related to facebook messenger, I have problems with opening other external (payment) apps as well

like image 441
JochenDB Avatar asked May 25 '19 20:05

JochenDB


1 Answers

With <allow-navigation href="*" /> you are telling your app to navigate to every url, that prevents any allow-intent from working as it will try to navigate to it instead of launching the intent.

like image 196
jcesarmobile Avatar answered Oct 05 '22 23:10

jcesarmobile