Launch an app from a link in an SMS

2019-01-18 13:46发布

I have a very strange requirement...
I need to launch my app from let's say, a hyperlink that is received in an SMS.
Can this be done somehow?
I mean, the person who receives the SMS simply taps on the link provided in the "special SMS", and that launches the application.
Something like a special link which invokes the app in the device...

I have stumbled into an article that shows how message body can be created and sent programmatically in iOS4 and I think that might help me in the creation of the "special message"
So creation of the message may not be an issue here... :|
It's the invocation part...
Anybody knows what can be done???
Suggestions and sample codes greatly appreciated... :)
Thanks in advance!

标签: iphone sms
4条回答
女痞
2楼-- · 2019-01-18 14:06

What you need to do is get your app to respond to a custom URL sequence, such as myApp://open

Apple has documentation on this:

https://developer.apple.com/documentation/uikit/core_app/communicating_with_other_apps_using_custom_urls

if you need more help, please ask.

This will also work with mail and webpages, anywhere you can put a clickable link...

查看更多
劳资没心,怎么记你
3楼-- · 2019-01-18 14:07

"<simpleApplication://>" should work for u...!!!

查看更多
干净又极端
4楼-- · 2019-01-18 14:08

All the reply you got from Tom H and F. Santoni are great. If you try it with Safari and it launches your application, but you don't see a clickable link in the Message application, then you just have to kill the Message app and start it again. Then it will read at the launching what scheme are registered by which application, and then you link simpleApplication:// will be clickable/touchable.

查看更多
戒情不戒烟
5楼-- · 2019-01-18 14:14

Good news, it is possible and quite simple (really easy in fact)

Take a look at this tutorial

Update : it seems that the SMS app doesn't auto recognize that address type

查看更多
登录 后发表回答