Ionic 2中的Deeplink无效

时间:2016-12-31 12:27:58

标签: ionic2 deep-linking

我正在尝试根据此处解释的程序https://ionicframework.com/docs/v2/native/ionic-deeplinks/

与离子2进行深层链接

首先我添加了插件, ionic plugin add ionic-plugin-deeplinks --variable URL_SCHEME=http --variable DEEPLINK_HOST=cityknots.com

然后在我的app.component.ts

export class MyApp {
rootPage = Wrapper;

constructor(platform:Platform) {
    platform.ready().then(() => {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        StatusBar.styleDefault();

        Deeplinks.route({
            '/test': UserHome
        }).subscribe((match) => {
            console.log('Successfully routed', match);
        }, (nomatch) => {
            console.warn('Unmatched Route', nomatch);
        });

    });
}

}

在我构建并运行应用程序之后,我尝试在ios模拟器的浏览器(safari)中点击网址(http://cityknots.com/test,但没有发生任何事情。我希望该应用应该是启动并导航到UserHome组件。控制台中没有任何内容与此相关。

0 个答案:

没有答案