我正在尝试根据此处解释的程序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
组件。控制台中没有任何内容与此相关。