Universal link: Keep user in browser even if app is installed

We have a requirement where we want to keep user in the browser until he completes the onboarding. Is there any way to keep the user in browser even if app is installed.

Issue is once app will come in foreground and then we can manually check and open the same link in browser but in that case app will open and go back to browser will give a bad user experience.

Replies

Hi @priyankasaroha , You can choose to exclude certain paths from your AASA. Take a look at the Associated Domains documentation here, notice that you can set paths to be excluded in your components:

"components": [
               {
                  "#": "no_universal_links",
                  "exclude": true,
                  "comment": "Matches any URL with a fragment that equals no_universal_links and instructs the system not to open it as a universal link."
               },

To ensure this, it would be best to have a subdomain for your universal links that do open in the app. For instance, if you host your AASA at https://example.com/.well-known/apple-app-site-association AND https://universalLinks.example.com/.well-known/apple-app-site-association and include applinks:example.com and applinks:universalLinks.example.com in your Associated Domains, you can exclude specific paths in your example.com AASA and then when the user is finished onboarding you can present them with a link with the subdomain universalLinks.example.com. Then, Safari will know they have finished navigating as the subdomain has changed and will move them to the app.

The reason I would recommend having both example.com and universalLinks.example.com is because then you can still use universal links to move straight to the app in the future with a domain of example.com if the user has already been onboarded.