DeepLinks 工作,但是当我输入网站主机名时,我得到一个空白屏幕
DeepLinks work, but when I type the website hostname I get a blank screen
我成功地为 android 和 IOs 配置了深层链接并且我有一个正确的 .well-known/assetlinks.json 像这样:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.xxxx.now",
"sha256_cert_fingerprints": ["XX:XX:XX"] }
}]
此外,在应用程序上,我已经配置清单:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="xx.xxxxxx.com" />
</intent-filter>
最后,在我的脚本中:
initializeDeepLinks(): void {
App.addListener('appUrlOpen', (data: any) => {
this.zone.run(() => {
// Example url: https://beerswift.app/tabs/tab2
// slug = /tabs/tab2
const slug = data.url.split(".com").pop();
if (slug) {
this.router.navigateByUrl(slug);
}
// If no match, do nothing - let regular routing
// logic take over
});
});
}
现在,当我点击 facebook 登录时,登录后它会返回应用程序,所以效果很好。
但是,如果我转到 www.mywebsite.com,如果我安装了应用程序,我会看到一个空白屏幕。如果我卸载该应用程序,它会再次运行。
以前有人遇到过这个问题吗?
只是如果有人有同样的问题,那不是因为深层链接,而是 Localnotification.channel 在移动版本上不工作。
要在开发模式下进行调试,我建议您 运行 chrome 并激活移动网络并选择您想要的 phone 它会像您使用 phone(如果你像我一样使用 platform.is)
我成功地为 android 和 IOs 配置了深层链接并且我有一个正确的 .well-known/assetlinks.json 像这样:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.xxxx.now",
"sha256_cert_fingerprints": ["XX:XX:XX"] }
}]
此外,在应用程序上,我已经配置清单:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="xx.xxxxxx.com" />
</intent-filter>
最后,在我的脚本中:
initializeDeepLinks(): void {
App.addListener('appUrlOpen', (data: any) => {
this.zone.run(() => {
// Example url: https://beerswift.app/tabs/tab2
// slug = /tabs/tab2
const slug = data.url.split(".com").pop();
if (slug) {
this.router.navigateByUrl(slug);
}
// If no match, do nothing - let regular routing
// logic take over
});
});
}
现在,当我点击 facebook 登录时,登录后它会返回应用程序,所以效果很好。
但是,如果我转到 www.mywebsite.com,如果我安装了应用程序,我会看到一个空白屏幕。如果我卸载该应用程序,它会再次运行。
以前有人遇到过这个问题吗?
只是如果有人有同样的问题,那不是因为深层链接,而是 Localnotification.channel 在移动版本上不工作。
要在开发模式下进行调试,我建议您 运行 chrome 并激活移动网络并选择您想要的 phone 它会像您使用 phone(如果你像我一样使用 platform.is)