深度链接在Phonegap android应用程序中不起作用

时间:2018-10-17 10:36:31

标签: phonegap-plugins deep-linking android-deep-link

我已经使用Phonegap创建了一个android应用程序。我想使用深度链接功能,所以我正在使用此插件。

https://www.npmjs.com/package/cordova-plugin-deeplinks

我已经按照我的phonegap android应用程序中的文档进行了配置,但是深度链接仍然无法正常工作。这是配置:

config.xml

<universal-links>
    <host name="macc.com" scheme="https" event="openNewsListPage"> 
    <path url="/news/"/> </host>
</universal-links>

在app.js中处理事件

onDeviceReady: function(){
    app.receivedEvent('deviceready');
    universalLinks.subscribe('openNewsListPage', app.onNewsListPageRequested);
},

onNewsListPageRequested: function(eventData){
    alert('Showing list of awesome news.');
},

Android网络集成-在macc.com/news页面中添加了以下代码

 <link rel="alternate" href="android-app://com.macc/https/macc.com/news/"/>

我已经在网站管理员工具和Google Play控制台上验证了我的网站。但是,如果我尝试访问URL(https://macc.com/news),则不会打开该应用程序。

我不确定是否错过了一些东西。请帮忙!预先感谢。

0 个答案:

没有答案