简体   繁体   English

如果未安装应用,则进行iOS深度链接/重定向

[英]iOS deep linking/redirecting if app isn't installed

I'm not sure this is possible, and I've read a number of answers to questions about deep linking on SO, so I figured I'd ask. 我不确定这是否可行,并且我已经阅读了许多有关SO深层链接的问题的答案,所以我想问一下。

I understand that as developers, we can add custom URL schemes to our app, so that if I send a friend a custom link, it should open a particular page in my app. 我了解作为开发人员,我们可以向我们的应用程序添加自定义URL方案,因此,如果我向朋友发送自定义链接,则该链接应在我的应用程序中打开特定页面。 However, I'm wondering if there's any way at all to handle something like this if the app isn't installed on my friend's phone. 但是,我想知道如果没有在我朋友的手机上安装该应用程序,是否有任何办法可以处理这样的事情。 Ideally I'd like to redirect my friend to the App Store page for my app, but I can't think of any way that could be done. 理想情况下,我想将朋友重定向到我的应用程序的“ App Store”页面,但我想不出任何可行的方法。 Thanks in advance for any suggestions! 在此先感谢您的任何建议!

This is a very discussed thread ... if you search stack overflow you will find the solution already answered by someone. 这是一个讨论得很厉害的话题...如果您搜索堆栈溢出,您将找到已经有人回答的解决方案。

Let's think you will send the URL to your friend through Mail or Message app. 假设您将通过Mail或Message应用将URL发送给您的朋友。 At this moment, you don't know if your friend will open this URL from his iPhone, Android, PC, console or whatever ... so you have to think that you can not resolve this problem thinking only in Obj-C solution. 目前,您不知道您的朋友是否会从他的iPhone,Android,PC,控制台或其他任何设备上打开此URL ...,因此您不得不认为仅凭Obj-C解决方案就无法解决此问题。

You will have to prepare a server and an API, upload your real URLScheme link, get a token or something, and based on this token, make a http link to your server. 您将必须准备服务器和API,上载真实的URLScheme链接,获取令牌或其他内容,然后基于此令牌建立指向服务器的http链接。 When your friend click the link, safari will open, and using javascript etc your will check if the device is an iPhone, and if is, you will try to call your urlscheme from there, using a solution posted on this thread. 当您的朋友单击该链接时,将打开safari,然后使用javascript等检查您的设备是否为iPhone,如果是,则尝试使用线程上发布的解决方案从那里调用urlscheme。 If you are not on iPhone, you can redirect the page to your App's HomePage or somewhere explaining what's happening. 如果您不在iPhone上,则可以将页面重定向到应用程序的主页或解释发生情况的位置。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM