ios 从短信链接或电子邮件链接启动应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15880395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:06:14  来源:igfitidea点击:

Launching app from sms link or email link

iosobjective-curl-scheme

提问by Andres

I have the requirement to launch an app when an sms or email link is followed. I have already been reading about URL schemes and already test that and it works, but the problem is that if the app is not installed on the device nothing will happen. I need a way to open a web url if the app is not installed, but I couldn't find a way of doing this...

我需要在跟踪短信或电子邮件链接时启动应用程序。我已经阅读了有关 URL 方案的内容,并且已经对其进行了测试并且它可以工作,但问题是如果该应用程序未安装在设备上,则不会发生任何事情。如果未安装该应用程序,我需要一种打开网址的方法,但我找不到这样做的方法...

Any idea?

任何的想法?

Thanks

谢谢

采纳答案by Zebs

It can be done. The way I would structure it is by having a redirect from a server you control.

可以办到。我构建它的方式是从您控制的服务器进行重定向。

  1. You send the user a link that points to your server.
  2. You try to launch your app using the custom URL scheme.
  3. If it fails, you redirect the user to the app store so they can download your app.
  1. 您向用户发送指向您的服务器的链接。
  2. 您尝试使用自定义 URL 方案启动您的应用程序。
  3. 如果失败,您将用户重定向到应用商店,以便他们可以下载您的应用。

Here is an interesting questionwith several ways to check if the launch attempted via your custom URL was successful.

这是一个有趣的问题,有几种方法可以检查通过您的自定义 URL 尝试启动是否成功。

回答by Oleg

I would insert a link to the website in SMS body. Then I would write a script on the website which will either open a download link or open the app

我会在短信正文中插入一个网站链接。然后我会在网站上编写一个脚本,该脚本将打开下载链接或打开应用程序

This answerwill solve your problem

这个答案将解决您的问题