如何解决Ionic 5 Deeplinks 未找到匹配项
我正在 Cordova 上使用 Angular 10/Ionic 5 开发一个项目。我实现了如 https://github.com/ionic-team/ionic-plugin-deeplinks 中所示的深层链接。这里是我的 app.component.ts 和 package.json
this.deeplinks.route({
// register which routes and will be handled
'/password': 'ResetPassword',}).subscribe(match => {
// navigate to route if it matches
console.log('found!');
if (match.$route === 'ResetPassword') {
this.zone.run(() => {
this.router.navigate(['/auth/forget-password']);
});
}
},nomatch => {
console.log(nomatch.$link);
});
"cordova": {
"plugins": {
"cordova-sqlite-storage": {},"cordova-plugin-whitelist": {},"cordova-plugin-statusbar": {},"cordova-plugin-device": {},"cordova-plugin-splashscreen": {},"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},"cordova-plugin-ionic-keyboard": {},"ionic-plugin-deeplinks": {
"URL_SCHEME": "myapp","DEEPLINK_SCHEME": "https","DEEPLINK_HOST": "myapp.com.tr","ANDROID_PATH_PREFIX": "C:/Program Files/Git/"
},"cordova-plugin-x-socialsharing": {},"cordova-plugin-androidx": {},"cordova-plugin-androidx-adapter": {},"cordova-plugin-file-transfer": {},"cordova-plugin-file": {},"cordova-plugin-document-viewer": {},"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},"platforms": [
"ios","android"
]
}
当我尝试转到“myapp://app/password”时,它会出现“找不到匹配项”错误
{"path":"/password","queryString":"","fragment":"","host":"app","url":"myapp://app/password","方案":"myapp"}
你能告诉我该怎么做吗?
谢谢。
解决方法
尝试使用完整网址:
myapp://myapp.com.tr/app/password
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。