Prevent redirect from triggering App / Universal Link behavior - android

We have a web product and Android/iOS mobile apps with App (Android) & Universal (iOS) links enabled. This enables the OS to open our app in various scenarios where the user would otherwise have been navigated to our mobile web product.
We are now facing a problem where our apps open under this undesirable scenario:
User opens the native browser and navigates to https://www.example.com. In this case, the OS respects the user's intention to use the native browser and does not open the app.
User taps on "Login" on our web site. This sends the user to https://login.example.com where they submit their credentials.
https://login.example.com redirects the user to https://www.example.com. At this point, both Android & iOS open the app.
It would be preferable for the redirection to occur within the browser so as to continue respecting the user's intent. I believe this happens due to the redirection from a non-app/universal link domain to an app/universal link domain.
Is there a way to perform this redirection without leading to the apps getting opened? I've tried redirecting via a Location header, and via a <meta http-equiv="refresh" content="0; URL='https://www.example.com'"/> head tag with the same result. The only remaining thing to try I can see is to host our login feature under the www subdomain.

As a user, you can solve this problem by "Disabling Instant Apps" on your phone.
To opt-out of Instant Apps go into your Settings > Google > Settings for Google Apps > Google Play Instant > switch toggle to OFF.

Related

Prevent android deep link from redirecting to playstore if app doesn't exist

I am working on a website for a product which also has an android application. I want to redirect the user from mobile web browser to the android application when a particular task is performed. I use a deep link of the format as below -
intent://#Intent;package=<PACKAGE_NAME>;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;scheme=https;end
The issue is that this link is redirecting user to playstore if app is not installed. I wanted user to stay on the web browser if app is not installed. How can we achieve that?
As of now, i tried replacing the intent with https to produce link of the format as below -
https://#Intent;package=<PACKAGE_NAME>;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;scheme=https;end
But it only works if I add the supported links from the app info, which has to be done manually. I am not sure if the fix for this is to be done in android on is there a way to handle this from the website?

After processing a deep link inside the app, redirect user back to the browser

React Native [Ejected Expo Project]
I'm trying to redirect a user back to the browser after processing a deep link inside the Android app. Is there any common method for switching a user back to one app under (previously active/opened) the currently running up?
For example:
After activating deep link from Opera Browser, my app starts
I'm processing that request inside the app
I'm moving my app to the background and bringing back Opera to the foreground
I was playing around with React Native Linking but it opens either default browser or Google Chrome, depending on a custom URL Scheme. Because I couldn't find a way to open other browsers the same way I open Chrome (googlechrome://), my last hope is to find a way to switch back to a browser that triggered my deep link.
Trusona & Freja eID are apps doing exactly what I want. After authorization attempt approval on your mobile device, you're redirected back (you can even see, that transition between app and browser is in a "back manner") to the original browser from which you started authorization process.
Thank you!

How to prevent links to open in Gmail's integrated mini-browser

On Android, when the user opens a mail with Gmail and clicks a link contained in the mail, then this URL is opened in sort-of a "mini browser", with a special bar at the top.
In my case the URL is a Portable Web Application (PWA) and should be opened in the Chrome browser itself (giving the user the possibility to manually add the URL to the home screen).
Is there a way to tell Gmail to always open the URL in the normal Chrome Mobile browser (or the standard browser)?
target="_blank" doesn't seem to help...
In Gmail go to settings --) General, and uncheck the option to open links in gmail.
Users have an expectation of consistency when they interact with apps, sites, and browsers. You should let the browser defaults and user configuration control this behaviour. Surprised users will just be annoyed with your apps confusing differences with every other site they use.

How can I smartly redirect users who click on an email link, to my app or my mobile site?

I have an app and a mobile site. I also send emails to my users. I would like the following to happen if my users open these emails on their mobile phones and click on a link:
If a user has installed my app, then launch the app and open the relevant page inside it.
If a user has NOT installed my app, then launch the browser and take him to the relevant page on my mobile site.
I want this to happen seamlessly and automatically. I DON'T want to use the inbuilt android prompt as users end up choosing chrome (since it is the first option shown). How can I do this? Would ideally want solutions for both android & ios.
You can do this with a landing page. Send user to landing page, check platform, then check if they have app installed(if they have registered custom url scheme) if they have then they go to app. Otherwise they go to mobilesite.
See this answer by https://stackoverflow.com/a/29019660/1165581 by Adam
You can NOT prevent the Android prompt which lets the user choose an option. What you can do is, create a link to your mobile site and have your App react to urls containing your domain. So what will happen is:
if a user clicks the link and does NOT have your App installed, he/she will be prompted with the default url handler prompt (only the first time) and then open the mobile site in the prefered browser
if a user clicks the link and DOES have your App installed, he/she will get the same prompt, only your App will be listed there as well next to browser Apps.
Here is an explanation on how to this: Android Respond To URL in Intent
You can use URL Schemes in iOS for your requirement to be full filled. By Using URL Scheme you can do exactly same. Clicking on link will launch your app. Please go through the concept of URL Schemes.
Follow the below referral link:
http://code.tutsplus.com/tutorials/ios-sdk-working-with-url-schemes--mobile-6629
Hope this helps!!

Opening app in Google Play from a redirect link

On an Android device, opening a link to an app on Google Play:
https://play.google.com/store/apps/details?id=com.rovio.angrybirds&hl=en
will automatically open the Google Play app by default.
But if you have a link that redirects to the Google Play link, the device opens the browser and then navigates to the browser version of Google Play. Why does this behavior occur?
Unfortunately I cannot use the market:// with Intents which can open Play, I have only control over a web link.
edit:
Seems like if I have the link redirect to the market:// url, it can open with Google Play on device.
If link is opened in browser, somehow it is able to redirect to browser version of Google Play despite market:// not being supported in browser.
Use target="_top"
App
Basically, the https://play.... is just a web URL. I suspect the way this works (which is the way standard way Android works) is:
The Market Play App registers to be able to handle URLs of this kind (you can register to handle certain intents, and apply filters to further define what your app will handle).
The app launches the Intent with the https://play... URL
The User is presented with a list of all apps that are registered to handle that intent. SO, the User is able to launch the Play App - the first time (on the phone) the https:\play... intent is launched
When the user chooses which app to fulfill the Intent, if they select Browser (then set it as a default) - the Browser will launch (and will not offer the user the option the next time).
This default can be by: "Settings\Applications\All - Then find the Browser App, select it, and then select Clear Defaults"
You can either call the Play Market directly with the market intent, or use the URL way. I personally use the URL way - even though there are some additional challenges to use it (like handling this particular issue).
My guess would be that the behaviour is enforced by Google. Redirects would potentially make it easier for developers with bad intentions to install their apps. Google probably checks if the user comes from a redirect, and if yes it doesn't trigger opening of the Play app.

Categories

Resources