Open App from Sms with My Url Scheme as a Link

Open app from SMS with my url scheme as a link

In general there is standard way to open application from Messages app by using url scheme:

  1. Add url scheme to info.plist file: my-scheme.
  2. Install application to the target iPhone.
  3. Send SMS with text like this: "my-scheme://it-is-my-scheme.

And everything works well. But it is possible one interesting case when it doesn't work and you think that source code is wrong. But it isn't so. Let's try to investigate this case:

  1. Before adding url scheme and installing application send SMS. As it expected message will be displayed as plain text:

    First SMS

  2. Now lets add url scheme to info.plist:

    Info.plist

  3. Finally install application and send/receive the same SMS:

    Second SMS

As you see last message is displayed like link and if I tap on it then iOS opens my application. But the first message is still displayed as plain text and it isn't tappable. It seems that the logic of Messages app is implemented in such manner.

Now lets delete application from iPhone and send the same SMS one more time:

Third SMS
Now it again displayed as plain text but the second message - as link. And if I tap on it iOS does nothing and leaves Messages app opened.

Conclusion: Be sure that you send/receive SMS after installing application that supports your scheme. Only in this case it will be displayed as link and user can open your application by tapping on it.

Notice: I also catch one case when at the beginning application was installed without supported url schemes and then when I add this support message has been displayed as plain text but not as link. I can't reproduce it. But if above steps won't help to resolve your issue try:

  1. Remove application from iPhone;
  2. Change url scheme (or even change both: url scheme and bundle id as a last resort);
  3. Install it again;
  4. Send SMS with new url scheme.

Launching app from sms link or email link

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.

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

Launch an app from a link in an SMS

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

Launch Android app from within SMS/MMS message?

No, the only URL recognized are:

  • Web URLs.
  • Email addresses.
  • Phone numbers.
  • Map addresses.

From TextView's android:autoLink XML attribute.



Related Topics



Leave a reply



Submit