In general, there is a standard way to open an application from the Messages application using the URL scheme:
- Add the URL scheme to the info.plist: my-scheme file.
- Install the application on the target iPhone.
- Send an SMS with the text as follows: "my-scheme: // it-is-my-scheme.
And everything works well. But maybe one interesting case is when it does not work, and you think that the source code is incorrect. But this is not so. Let's try to investigate this case:
Before adding a URL scheme and installing the application, send an SMS. Since the expected message will be displayed as plain text:

Now add the url to info.plist:

Finally, install the application and send / receive the same SMS:

As you can see, the last message is displayed as a link, and if I touch it, then iOS will open my application. But the first message is still displayed as plain text, and it is not amenable to discussion. It seems that the logic of the Messages application is implemented in this way.
Now you can remove the application from the iPhone and send the same SMS again:

Now it is displayed again as plain text, and the second message as a link. And if I touch it, iOS does nothing and leaves the Messages message open.
Conclusion: Be sure to send / receive SMS after installing an application that supports your scheme. Only in this case it will be displayed as a link, and the user can open your application by clicking on it.
Note: I will also catch one case where at the beginning of the application it was installed without supported url schemes, and then when I add this support message, it appears as plain text, but not as a link. I can not reproduce it. But if the above steps do not solve the problem, follow these steps:
- Uninstall the application from the iPhone;
- Change the URL scheme (or even change both the URL scheme and the package identifier as a last resort);
- Install it again;
- Send SMS with the new URL scheme.
Vlad Papko
source share