通用链接iOS [英] Universal Links iOS

查看:74
本文介绍了通用链接iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使我的应用程序上的通用链接正常工作时遇到了一些麻烦.这是我已经完成的事情.

I am having some trouble in getting Universal links on my app working. Here are the things that i have already done.

-创建了我的apple-app-site-association文件.这是我的文件

-- Created my apple-app-site-association file. Here is my file

{

    "applinks": {
                "apps": [],
                "details": [{
                    "appID": "XXXXXXXXXX.com.companyName.app",
                    "paths": ["/view/*", "/class/*"]
                }]
            }
}

我还没有签署文件,我将项目部署目标设置为iOS 9.2(因此我不必签署该文件).

I have not signed my file and i set my project deployment target to iOS 9.2 (so that i don't have to sign this file).

-在我的项目功能中添加了相关域

-- Added the associated domain in my project capabilities

applinks:companyName.com
applinks:www.companyName.com

-在我的开发人员门户中也启用了相关域

-- Associated domains are also enabled in my developer portal

-更新了配置文件并使用了新的配置文件

-- Updated the provisioning profiles and used the new ones

-将权利添加到了版本中.

-- Added the entitlement to the build.

-覆盖了此委托方法

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

该文件可从我的HTTPS服务器上获得,并且我从此Apple验证程序检查了通用链接状态. https://search.developer.apple.com/appsearch-validation-tool/验证者正在对此进行验证.但是,当我单击iMessage中的链接并且该链接类似于companyName.com/view/7375时,它将在safari中打开,而我的应用程序没有任何回叫.

The file is available from my HTTPS server and i checked the universal links status from this apple validator. https://search.developer.apple.com/appsearch-validation-tool/ The validator is validating this. But when i click on the link which is in iMessage and the link is like companyName.com/view/7375, then it will open in safari and my app does not get any call back.

任何想法我想念的东西

推荐答案

操作系统可能现在考虑以覆盖"模式处理您的URL,这就是为什么它进入Safari的原因.

It may be that the OS now considers handling your URL in "override" mode -- why it goes into Safari.

当您的应用程序解析通用链接时,在屏幕的右上角,您将看到诸如"companyName.com->"之类的内容.如果您点击该按钮,那么这就是操作系统替代"通用链接处理方式的方式,并在那时甚至永远在Safari中打开它.

When your app resolves a Universal Link, in the upper-right corner of the screen you'll see someting like "companyName.com -->". If you tap that, that's the OS's way of "overriding" how the Universal Link is handled, and opens it in Safari at that time and forevermore.

尝试返回消息"应用,然后长按您的链接.一两秒钟后,您应该会看到一个操作表,其中提供了在Safari中打开"和在您的应用程序名称"中打开"之类的选项.选择以您的名字打开"选项.然后应该重置"操作系统如何处理您的通用链接,现在将其定向回您的应用程序.

Try going back into the Messages app and long press on your link. After a second or two, you should see an action sheet come up that gives you options like "Open in Safari" and "Open in 'Your App Name'". Select the "open in your name" option. That should then "reset" how the OS views handling your Universal Links, now directing them back into your app.

这篇关于通用链接iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆