我正在使用离子深链接插件ionic-plugin-deeplinks,它对android很好,但是由于它在ios上没有工作,所以我不得不安装另一个插件cordova-deeplink,和cordova-universal0links-plugin.package.json:
“@离子型-原生/deeplinks”:"^4.16.0", "cordova-deeplink":"git+https://github.com/foneclay/cordova-universal-links-plugin.git#2.3.1",“cordova-universal-links plugin”:"1.2.1“,在my component.ts中:
platform.ready().then(() => {
if (this.platform.is('android')) {
this.deeplinks.routeWithNavController(this.nav, {
'/e-training/course_overview/:courseID': CourseDetailsPage,
.......
}).subscribe((match) => {
console.log('Successfully routed', match);
}, (nomatch) => {
console.log('Unmatched Route', nomatch);
});
} else {
if (this.platform.is('ios')) {
universalLinks.subscribe('openApp', this.onAppRequest.bind(this));
universalLinks.subscribe('openPage', this.onPageRequest.bind(this));
}
}
});
config.xml:
<universal-links>
<host event="openApp" name="example.com" scheme="https">
<path event="openPage" url="/" />
</host>
</universal-links>
android上的一切都很好,但只有当应用程序还在后台时,当我杀死应用程序(终止它),点击我在应用程序中共享的任何链接,打开应用程序的主页时,才能正常工作,而不是深入细节。
离子:
科多瓦:
系统:
发布于 2018-12-18 14:14:53
我刚刚删除了cordova-deeplink和cordova-universal-links-plugin插件以及与它们相关的所有内容:就像我删除了config.xml中的标记<universal-links>....</universal-links>
和app.component.ts中与ios部分相关的代码一样,并将它们替换为:
//this.platform.is('android') || this.platform.is('ios')
this.deeplinks.routeWithNavController(this.nav, {
'/e-training/course_overview/:courseID': CourseDetailsPage,
...
}).subscribe((match) => {
console.log('Successfully routed', match);
}, (nomatch) => {
console.log('Unmatched Route', nomatch);
});
https://stackoverflow.com/questions/53830092
复制相似问题