成功地安装并安装了本机Ionic的深松模块。
即使在冷状态下,应用程序也能很好地加载,在那里它完全关闭。
然而,我的路线并没有把我带到正确的页面。它只显示应用程序的最后一个页面,如果它从冷状态启动应用程序,则显示主页面。
app.component.ts
...
import { Deeplinks } from '@ionic-native/deeplinks';
import { Detail1Page } from '../pages/layout/app1/detail1/detail1';
...
constructor(private deeplinks: Deeplinks.........
...
this.platform.ready().then(() => {
this.splashScreen.hide();
this.deeplinks.route({
'/item/:itemId': Detail1Page
}).subscribe((match) => {
console.log('Successfully matched route', JSON.stringify(match));
}, (nomatch) => {
console.error('Got a deeplink that didn\'t match', JSON.stringify(nomatch));
});
}
...控制台日志显示:
Successfully matched route {"$args":{"itemId":"9"},"$link":{"path":"/item/9","queryString":"","fragment":"","host":"my.app.com","url":"https://my.app.com/item/9","scheme":"https"}}app.module.ts
...
import { Deeplinks } from '@ionic-native/deeplinks';
...
providers: [
Deeplinks,
...细节1.ts
...
this.itemId = this.navParams.get('itemId');
...我们非常感谢你的帮助--一整天都在为这个工作:)
发布于 2017-12-06 16:06:23
我昨天也遇到了同样的问题.
在我的例子中,我没有在我的app.module中注册我的页面。
@NgModule({
declarations: [
MyPage
],
imports: [
IonicPageModule.forChild(MyPage)
],
entryComponents: [
MyPage
]
})
export class MyPageModule {}对我来说,我错过了IonicPageModule.forChild的参考。这里是文档页面,其中讨论了如何设置一个页面以便进行深度处理。https://ionicframework.com/docs/api/navigation/IonicPage/#usage
发布于 2019-11-28 05:33:10
我知道为时已晚,但对某人来说还是有帮助的。我在订阅后重定向用户,这样如果用户登录not,您就可以添加更多的逻辑,或者您可以相应地更改内容。
this.deeplinks.route({
'/item/:itemId': {}
}).subscribe(match => {
console.log('Successfully matched route' + JSON.stringify(match));
this.nav.push(Detail1Page, { issueId: match.$args.issueId});
}
}, nomatch => {
console.error('Got a deeplink that didn\'t match' + JSON.stringify(nomatch));
});https://stackoverflow.com/questions/47389769
复制相似问题