iOS 9中的applinks无法正常工作 [英] applinks in iOS 9 not working
问题描述
我没有应用链接:每当我在iOS 9设备上打开 https://www.example.com/something
之类的链接时,iOS均不起作用,它会在Safari中打开。
I don't get applinks: in iOS not working, whenever I open a link like https://www.example.com/something
on my iOS 9 device, it gets opened in Safari.
我正在通过调试配置文件运行该应用程序,在我的服务器上有一个名为 apple-app的文件-site-association
。
I'm running the app via debug provisioning profile, on my server there is a file called apple-app-site-association
.
我发现了两种不同的格式:
There are two different formats I found:
{
"applinks": {
"apps": [],
"details": {
"AB1CDEFGHI.com.mydomain.myapp": {
"paths": ["*"]
}
}
}
}
以及
{
"applinks": {
"apps": [],
"details": [
{
"appID": "AB1CDEFGHI.com.mydomain.myapp",
"paths": [ "*" ]
}
]
}
}
所以这是第一件事,我不确定要使用哪个。
so that's the first thing I'm not sure which one to use.
山高nd是 AB1CDEFGHI部分;该应用程序的 Team-ID?
The second is the 'AB1CDEFGHI'-part; the "Team-ID" of the app? Is it the stuff that's included in the appid or really the team id of the developer account?
那么这完全被涂黑了吗?
So is it this one completely blacked out?
还是这里的那个(再次,该部分完全被涂黑了) ?
or is it this one here (again, the part completely blacked out)?
编辑 >
我只是尝试在其他应用中进行设置,第一次运行没有任何问题-真的不知道有什么区别。
I just tried setting it up in another app, worked the first time without any problems - really don't know the difference.
- AppId包含权利
- apple-app-site-association相同
- associated在应用中添加的域
-
-(BOOL)应用程序:(UIApplication *)application conti nueUserActivity:(NSUserActivity *)userActivity restoreHandler:(void(^)(NSArray * restorableObjects))restorationHandler
已实现
- AppId includes entitlements
- apple-app-site-association is the same
- associated domains added in app
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
implemented
我可能会丢失什么?
编辑2
我只是看到这两个应用程序有所不同(一个正常工作,一个不正常):正在工作的应用程序在开发人员门户中具有一个AppId,其前缀与TeamID匹配,而一个不工作的应用程序的前缀与TeamID。我已经尝试过在apple-association-file中使用AppID中的前缀,但是它也不起作用...
I just saw a difference in both apps (the one that's working and the one that doesn't): the working app has an AppId in the developer portal with a prefix matching the TeamID, the not-working app has a prefix which is different from the TeamID. I already tried using the prefix from the AppID in the apple-association-file, but it doesn't work either...
推荐答案
我发现了我的错误:我必须在 apple-app-site-association
文件中使用App ID前缀,该前缀与TeamID有所不同应用程序。
I found the error on my side: I had to use the App IDs prefix in the apple-app-site-association
file which was different than the TeamID for this specific app.
我找不到文档,其中没有TeamID,这就是我花了这么长时间的原因。只有将我与两个应用程序进行比较之后,我才发现唯一的区别,现在它可以正常工作了。
I didn't find a documentation where it says something other than TeamID, that's why it took me so long. Only after I compared with two apps I found the only difference and now it's working.
这篇关于iOS 9中的applinks无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!