开发者

Custom URL scheme embedded in an SMS on iPhone

开发者 https://www.devze.com 2023-03-06 15:44 出处:网络
Has anyone been able to successfully embed a custom url scheme in an SMS (for examplesomeApp://), such that the iPhone upon receiving the SMS creates a clickable link to launch an app?

Has anyone been able to successfully embed a custom url scheme in an SMS (for example someApp://), such that the iPhone upon receiving the SMS creates a clickable link to launch an app?

There are various questions similar to this out h开发者_如何学运维ere, however, I have not seen a working solution.

Thanks


In general a custom URL scheme is the way to solve this problem. However, this is complicated by the fact that in iOS 5 (and up through iOS 5.1.1 based on my recent testing), Apple introduced a bug into their Messages app so that custom URLs received via SMS are not recognized as links.

See Custom URL scheme not recognized as link in SMS app(only in iphone 4 iOS 5.0)


You have to create URL scheme which starts with http, https or www. but http:// and https:// will not work in URL scheme, so If you want create a click able link, you have to set your URL scheme with www.

For eg. www.myapp then the link which can open your app will be www.myapp:// but in this case only www.myapp will be click able and :// will not be click able.

For this use this format for URL scheme

www.<characters1>.<characters2>
www.my.app  //example

Now use this format to open your app with click able URL:-

www.<characters1>.<characters2>://<anyThingYouWantToAppend>
www.my.app://open  //example

www..:// is enough to open your app, but we are appending anyThingYouWantToAppend to create click able URL.


In my case on iOS 6, the link is not blue if sent from a custom sender ie text instead of a number. As soon as we started using a shortnumber as sender instead of a custom name, it was recognized as a link.


Assuming you have defined a custom url scheme as someApp:// you create a link in an SMS as follows:

"someApp://Myurl"

0

精彩评论

暂无评论...
验证码 换一张
取 消