我正在为我的React Native应用程序跟踪这个guide,我正在测试iOS的Universal Link。
现在,我只希望Deep Link在/launch.html
上打开我的应用程序,而不是在root上,但似乎我域中的所有子路径都打开了我的应用程序。
是否:
https:<random-domain>.ngrok-free.app
https:<random-domain>.ngrok-free.app/test
https:<random-domain>.ngrok-free.app/launch.html
我只想让它在第三个案子里有用。
这是我的AASA档案:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "ABC123.com.test.Test",
"paths": [
"/launch/*",
"NOT *",
]
},
{
"appID": "ABC123.com.test.Test",
"paths": [
"NOT /",
"NOT *"
]
}
]
}
}
正如你所看到的,我已经尝试将它放在paths
数组的第一个对象条目中,并且还添加了第二个对象条目"root"
。
我将它部署在我的Express服务器上,使用NGROK在https://<domain>/.well-known/apple-app-site-association
下运行。
我在我的权利中添加了这个生成的域:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:<random-domain>.ngrok-free.app</string>
<string>applinks:<random-domain>.ngrok-free.app?mode=developers</string>
</array>
</dict>
</plist>
这是我的server.js
:
const express = require("express");
const app = express();
const port = 3000;
// Explicitly set content type for AASA file
app.get("/.well-known/apple-app-site-association", (req, res) => {
response.sendFile(__dirname + "/apple-app-site-association");
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
1条答案
按热度按时间9w11ddsr1#
使用
components
添加一个路径,类似这样:详情请参见applinks.Details.Components。