希望你们今天过得愉快!我正在学习react本机的深度链接,目前我已经成功地通过cmd使用npx uri-scheme open myapp://inv/12321312 --android打开了我的应用程序,而且我将要打开的页面也已经打开了,我还包括在链接中的:id
现在我发布了我的应用程序(还没有上传到playstore,但只运行npx react-native run-android --variant=release),那么为什么当我在浏览器中访问myapp://inv/12321312链接时,我的应用程序不打开呢?
我在我的android device中使用Google Chrome
请帮助:(
发布于 2021-11-25 14:50:04
在app.json中添加intentFilters for android
如果你用的是世博会
{
"expo": {
"scheme": "myapp",
.....
"android": {
...
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": "myapp.com",
"pathPrefix": "/"
},
{
"scheme": "myapp",
"host": "*",
"pathPrefix": "/"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
...
},
}
}或者如果您使用的是react本机CLI
https://developer.android.com/training/app-links/deep-linking#adding-filters
之后,为Android生成APK。
并在message中发送https://myapp.com/
单击聊天中的此链接
这是工作^^
更新:(测试) ipa安装应用程序: myapp://时,在浏览器手机中运行这个链接
android =>在构建apk以测试android后在消息中发送此链接(电子邮件、whatsapp、.)并单击“测试链接”(安装了应用程序后)
https://stackoverflow.com/questions/69448158
复制相似问题