I declared an url scheme in my app, smstest
so in Safari I can write in the search bar smstest:my-test
or smstest://my-test
and my app is open.
I'm trying to achieve the same from a SMS text so the Messages app would format smstest:my-test
or smstest://my-test
as a link and the user could tap it and my app being called. But the text is not formatted as a link.
Is it possible or the only solution to open an app from a SMS is to point to an Internet page with a script?
Thank you.
EDIT: funny thing, I have installed IMO Messenger and I receive a SMS with a code as an URL scheme, and that is parsed by Messages app as a link. Why does not happens with my app? I tried with several messages, with spaces before and after the url and nothing happens.
Overview of Android App LinksApp Links use HTTP URLs associated with your website domain, and allow a specific app to be the default owner of a given type of link.
The app: URL scheme can be used by packaged applications to obtain resources that are inside a container. These resources can then be used with web platform features that accept URLs.
Custom URL schemes provide a way to reference resources inside your app. Users tapping a custom URL in an email, for example, launch your app in a specified context. Other apps can also trigger your app to launch with specific context data; for example, a photo library app might display a specified image.
In general there is standard way to open application from Messages app by using url 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:
Before adding url scheme and installing application send SMS. As it expected message will be displayed as plain text:
Now lets add url scheme to info.plist:
Finally install application and send/receive the same 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:
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With