iOS:支持通用链接

时间:2017-11-28 19:13:15

标签: ios objective-c iphone ssl xcode9

我尝试实施通用链接,但出于某种原因,当我从域中加载链接时,我尝试重定向到我的应用程序无效。这是我的apple-app-site-association文件:

{
        "applinks": {
                "apps": ["44ABCDFG.com.myTeam.MyApp"],
                "details": [{
                        "appID": "44ABCDFG.com.myTeam.MyApp",
                        "paths": ["*"]
                }]
        }
}

我在Associated Domains

中添加了域名

enter image description here

这是我在app上的植入:

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler{

    NSLog(@"universal links are working!!!");

    return true;
}

链接是http,但根据文档,它不应该是一个问题。另外,根据文档,apple-app-site-association无需使用SSL证书进行签名。

use apple validation tool,我收到此错误:Error cannot fetch app site association

你们中的任何人都知道我做错了什么或者我该怎么做才能使这项工作成功?

我非常感谢你的帮助。

1 个答案:

答案 0 :(得分:0)

根据官方文件https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html

  

apple-app-site-association文件中的apps密钥必须存在,并且其值必须为空数组,如清单6-1所示。