Ionic 4 中的深层链接如何工作?

Nik*_*era 5 deep-linking ionic-framework ionic4

我正在尝试在 ionic 4 中使用深层链接,但无法成功。

在 app.component.ts: @ViewChild(IonNav) nav: IonNav;

        this.deeplinks.routeWithNavController(this.nav, {
            '/auth/password/reset/:authToken': 'ForgotPasswordPage'
        })
            .subscribe((match) => {
            }, (nomatch) => {
            });
Run Code Online (Sandbox Code Playgroud)

在忘记密码.page.ts

this.authToken=this.route.snapshot.paramMap.get('authToken')
Run Code Online (Sandbox Code Playgroud)

但是,当我单击该链接时,它会打开应用程序而不是 ForgotPassword 页面并出现此错误:无法读取未定义的属性“推送”

sim*_*man 0

我想我通过将深度链接路由器调用包装在 app.component.ts 代码中来解决推送问题: ngAfterViewInit() { this.platform.ready().then(() => { .. deeplink code here .. }) }

然而,当深层链接到达时,我遇到了一个问题,因为没有组件工厂来处理页面对象,并且深层链接模块中抛出了错误。