The purpose of this article is to describe how to set up links to a mobile application.
First of all, a little point about what is called a url scheme. It is a unique link to the application. It is presented in the form myapplication://... . When clicking on it from a smartphone, it will open the corresponding application.
Small hitch: only if it is installed!
It gets complicated! Indeed, when sending the email, it is not possible to know if the person will open this email on his smartphone, nor on which operating system and even less if the desired application is installed
The first point (opening on mobile) can be easily countered with the usual techniques (media queries). For the last 2 points, we can use 2 approaches: the automatic approach (via javascript) or the declarative approach (by asking the user).
In both cases, it will be necessary to host an intermediate page on your site in order to set up a redirection.
The automatic approach
There are lots of scripts to detect the installation of an application. To date, the ultimate turnkey solution does not exist and you will need to have a basic knowledge of javascript to be able to combine the existing techniques to adapt them to your specific needs (OS covered by your application,...)
Here are some solution tracks and snippets:
- https://solvedstack.com/questions/check-if-url-scheme-is-supported-in-javascript
- https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system
The declarative approach, my favorite
The idea here is simply to ask the user on an intermediate page what they want to do. The ideal options are the following:
Need help?
Reading content isn't everything. The best way is to talk to us.
- Open the link in the mobile app (iOS or Android): you can also use system detection to offer only the most sensible choice.
- Download the application: this is an opportunity to trigger an additional installation of your application
- No thanks, I want to navigate to the website
A good practice is to set up a 'Keep my choice' checkbox. This way, the page will only serve as an instant redirection to direct the user in the most convenient way.
To go further...
Url schemes allow many possibilities. Of course, this requires some knowledge of mobile development. Here are some tips:
- Redirect a user to a specific section of the application
- Pre-fill a promo code in your application
But also lots of uses that are just waiting for your inspiration.
Conclusion
In summary, here are the positive and negative points of each approach.
Declarative approach:
- – We add one more page in the user's journey
- + It is reliable and transparent, the user knows exactly what is going to happen
- + Opportunity to push an installation of the application
Automatic approach:
- + It's automatic and fast for the user đ
- – It is technically more complex to set up and the reliability of your development will be questioned at each hardware and software evolution