Cordova Android 不允许打开 fb-messenger 的白名单意图
Cordova Android not allowing to open whitelisted intent to fb-messenger
我有一个用于 android 的 Ionic Cordova 应用程序,它有一个 facebook Messenger 按钮:
<a href="https://m.me/my-fb-page" target="_blank"><img src="assets/images/messenger.svg" /></a>
点击后,屏幕上没有任何显示。我一直通过 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
我安装了 cordova-plugin-whitelist。
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:*" />
...
我已经尝试了很多允许意图、访问和允许导航的选项。
这个问题与facebook messenger没有特别相关,我打开其他外部(支付)应用程序也有问题
使用 <allow-navigation href="*" />
您是在告诉您的应用导航到每个 url,这会阻止任何 allow-intent
工作,因为它会尝试导航到它而不是启动 Intent。
我有一个用于 android 的 Ionic Cordova 应用程序,它有一个 facebook Messenger 按钮:
<a href="https://m.me/my-fb-page" target="_blank"><img src="assets/images/messenger.svg" /></a>
点击后,屏幕上没有任何显示。我一直通过 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
我安装了 cordova-plugin-whitelist。
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:*" />
...
我已经尝试了很多允许意图、访问和允许导航的选项。
这个问题与facebook messenger没有特别相关,我打开其他外部(支付)应用程序也有问题
使用 <allow-navigation href="*" />
您是在告诉您的应用导航到每个 url,这会阻止任何 allow-intent
工作,因为它会尝试导航到它而不是启动 Intent。