My app has a custom URL scheme and can use deep linking to jump straight from a URL to some content. I\'d love to replicate the behaviour in the recent Facebook Groups app,
If you paste these characters into any online base64 decoder, you'll get the following:
Promote Groups or Pages
Instead of #### there is the following:
Коснитесь кнопки
ниже,
Затем коснитесь “Добавить на основной экран”
Promote Groups or Pages
Добавить на
основной экран
');
So I believe their implementation is as follows:
1) There is a web server embedded in the application (something like RoutingHTTPServer). It's running on some port like 5555 and configured to return a page with contents like:
The syntax is wrong, but the idea is to replace the current URL (http://localhost:5555) with that base64 encoded data.
2) When you tap add to home page in the app, it opens the link http://localhost:5555 in the Safari, the web server inside the app responds with the web page, containing a script that replaces the URL with base64 encoded data (this data contains the current time, when the script was generated)
3)From the contents of the base64 encoded data you can see that there are two checks:
a)if the app is running not in Safari, but standalone
b)if some time has passed since the script was generated
If any of these statements is true, you are redirected into the app using deep link.
If both of them are false, the page prompting user to add link to home screen is shown (that's what I replaced with ####).
When the link is added to home screen, all these scripts and web pages are embedded into that link as base64 encoded data.