How to prevent Chrome from opening App Links - android

I have an android application say Sample App. I want to add App Links according to Android Developer Guide. I was successful in implementing them, but there was an problem with Chrome. When I access the corresponding Sample Web App and there is <a> tag with href="https://www.sample.com/profile" and it's also supported by App, it opens in app instead of continuing in Chrome.
I checked documentation and it is supposed to be default behavior of Chrome. But then I came across Linkedin app. The My Network tab they have when clicked in browser continues in browser but same link if I save to docs or any other application and click it then it opens in native app.
I want to know how this is done?

I believe this is because, as you said, the standard deep linking behavior is to route to the app if it is installed. This behavior is handed-off immediately when the link is clicked because your app overriders that url to be handled by app instead of Chrome.
First, I believe that you should route users to your application because its a better, more engaging experience, presumably.
If you are convinced, then I would change your manifest to strictly handle links that you want to handle. See this post to see how to handle only certain links.

Related

Android App Links settings, How to set App Link URL always open in this app?

Android introduced the App Links with Android 6.0 Marshmallow to provide a more secure way of launching a specific app from a (https) link.
Further, I thought Android App Links covers main vulnerabilities exposed by Custom Schemes.
One of the major vulnerability is that a malicious app waiting to intercept the same URL with a similar intent filter. And then the OS will show the Ambiguous Dialog to the user to select which app to open the link.
See: Measuring the Insecurity of Mobile Deep Links of Android
The App Link URL should take the user straight to the app if the App Link has been setup properly as per the documentation for the Android AppLinks.
However, I found that this may not always be the case. For some devices, the "Ambiguous Dialog" could be shown for the first usage of the App Link URL.
Why ?
There is this strange setting called "Go to supported URLs" under the App setting -> Set as default below App Links sub heading which App Link depend upon. This setting allows the user to change the App Link behaviour. It gives three options as below.
In this app
Always ask
In other app
The strangest thing is that the default for this setting will be different from each vendors devices.
If the setting is not "In this app" then the OS will show the Ambiguous Dialog with at least your own app and browser.
Question?
Is there a way of preventing the setting being changed (prevent URL being intercepted by any other app)?
Is there a way of setting the default to 'In this app' or change the setting programatically to 'In this app' to prevent being intercepted by other apps?

Firebase Dynamic Link when typed into Android Address Bar

As you can see here, i want to change the behavior of my Firebase Dynamic Link when it is typed into the Android Browser, because right now it redirects me to the PlayStore instead of Deep Linking into the app. How can i achieve such behavior?
While creating dynamic link you need to specify either you want to open any specific URL in browser or you need to open your app.
If you need to open your app when dynamic link gets clicked then at the time of creating new dynamic link you need to choose your app from drop down list instead of giving url.
If the app is installed already it will open it otherwise redirect you towards playstore.
For opening app from deep link you need to write code into your activity that can handle the coming deep link.
Chrome doesn't open the deep links some time due to wontfix bug in Chrome 40+.
Mentioned in link for detail.
Same is the case with Firebox and other browsers.
firefox broswer issue
Related Problem

Get referring url for Android or iOS installation

We have several landing pages that link to Google Play and iOS App Store. I would love to know the landing page that a person came from within the app code. I have searched around and can't find any clear answer. Lots of gray area.
I just want to access the landing page URL in Java or Swift.
I realize iOS and Android are two separate beasts. But does anyone know how I could achieve this?
You will need to use Firebase Dynamic Links this helps you create various links using various alternatives as shown in this quote from the official Firebase source:
You create a Dynamic Link either by using the Firebase console, using a REST API, iOS or Android Builder API, or by forming a URL by adding Dynamic Link parameters to a domain specific to your app.
Then your app can access the link in code using Java or Swift and the link will work even if the user has your app already in their phone and you can set a logic to handle that too and the links are also automatically direct the user to AppStore or PlayStore depending on which device is used.
Dont worry about whether the link will work for both Android and iOS and you can use the api to access the link as this quote says.
With Dynamic Links, your users get the best available experience for the platform they open your link on. If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content on your website.
In addition, Dynamic Links work across app installs: if a user opens a Dynamic Link on iOS or Android and doesn't have your app installed, the user can be prompted to install it; then, after installation, your app starts and can access the link.
You can get more information on dynamic links here and check if it will solve your problem.

Check my Google App Indexing Android app in a Google Search

I am implementing Google App Indexing in my app. I have followed the tutorials and my app support this kind of deep links:
http://mywebsite.tk
And I have the required code so that it supports also:
android-app://com.my.package/http/mywebsite.tk/
I can open with my app any link with both structures, opening urls from an email, and even pasting the deeplink in Chrome directly. I have also passed the tests for Google App Indexing in Android Studio.
But what I want is the following button:
I have a custom parameter inside the url so that I can show different info. How can I make Google show that button? I don't have a website, only a domain to handle the deep link, but a website is not required.
Unfortunately you can't 'make' Google show this button. All you can do is set out the bait (which you have done in spades, based on everything you've mentioned above — the only thing I can think of is that you didn't mention whether you've set up Digital Asset Links or not) and hope they eventually bite. It takes some time for them to find and then recognize the App->URL association you've set up.
Is your content currently showing in the results list at all, even without that button?

How to call android application from web browser

I want to call android application on clicking of button on some website from mobile.
Suppose I am opening one url on android browser and I want to call my application on clicking on button provided by that site. How to do that??
Suppose we are using browser other than Chrome then is it allowing??
If you link to your application as "myapp://foo/bar", can't you use some sort of intent filter to start your application.
I mean, if you press a youtube link in the browser it asks if you want to complete the action with the YouTube app or the browser.
I have seen similar examples regarding Google Maps links (which would open in either browser, google maps(?) or GeoBeagle).
Please take a look at the WebViewDemo. Javascript code in the web page can call into your Activity. As well as the other way around.
You cannot... if the site is being browsed in the default browser (Chrome).
If you already have an application that embeds the WebView, then you can do some bit of handling of - mouse clicks, window alerts, navigation etc. Otherwise, not!

Categories

Resources