简体   繁体   English

如何根据操作系统在SMS中添加指向Android或iOS应用商店的链接?

[英]How to add a link to the Android or iOS app store in an SMS depending on OS?

I have a mobile application in iOS and Android formats. 我有iOS和Android格式的移动应用程序。 I run a server containing a database of user telephone numbers, for the purposes of sending an SMS message via Twilio. 我运行一个包含用户电话号码数据库的服务器,目的是通过Twilio发送SMS消息。 However, I don't know what operating system each number is associated with. 但是,我不知道每个数字都与哪个操作系统相关联。 The app does not make HTTP contact with the server. 该应用程序无法与服务器建立HTTP联系。

I want to send a link to each of my users by SMS, which will redirect to the appropriate app store depending on their operating system. 我想通过SMS将链接发送给我的每个用户,该链接将根据他们的操作系统重定向到相应的应用商店。 Facebook does this - does anyone know how they do it? Facebook这样做-有人知道他们是怎么做的吗? Do they detect the operating system via the phone number? 他们是否通过电话号码检测操作系统?

Basically, once user click on that link it should automatically redirects to appropriate app store. 基本上,一旦用户单击该链接,它应自动重定向到适当的应用程序商店。

Ah. 啊。 You have users DB represented by the phone number only, right? 您的用户数据库仅由电话号码代表,对不对? So you don't actually know which smartphone user has Android or iOS. 因此,您实际上并不知道哪个智能手机用户具有Android或iOS。 In this case you should use a special universal url (sent in SMS) linked to special webpage on your server where with help of js you have to detect from which type of device this user viewing your page and simply redirect the user to corresponding market. 在这种情况下,您应该使用链接到服务器上特殊网页的特殊通用URL(以SMS形式发送),在该网页上,借助于js,您必须检测到该用户查看页面的设备类型,并将用户重定向到相应的市场。

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

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