iOS 深层链接 [英] iOS deep linking

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

问题描述

我已经集成了自定义 url 调用,以使用 url 方案定义链接到我的应用程序上的特定页面

I've integrated custom url calls to link to specific pages on my app with the url scheme definitions

示例:myapp://?id=123

example: myapp://?id=123

问题是,如果我的应用程序未安装在特定设备上(就像 Pinterest 一样),我不确定如何使 ios 转到应用商店.

the problem is that I am not sure how to cause the ios to go to the appstore if my app is not installed on the specific device ( just like Pinterest ).

推荐答案

UIApplication 有一个 canOpenURL: 方法,您可以使用它来查询系统以检查它是否可以使用您的自定义方案处理 URL.如果可以,那么您可以打开 URL 并知道您的应用程序已安装.如果不能,则说明您的应用未安装,您需要改为推送到商店.

UIApplication has a canOpenURL: method that you can use to query the system to check if it can handle a URL with your custom scheme. If it can then you can open the URL and know your app is installed. If it can't then your app isn't installed and you need to push to the store instead.

这显然需要添加到应用中,无论是您的另一个应用还是您提供集成的第 3 方应用.

This obviously needs to be added to an app, whether that be another one of your apps or a 3rd party app that you offer integration with.

如果您的意思是来自网页,则请参阅此答案.

If you mean from a web page then see this answer.

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

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