I'd like to launch my app with input parameters from a Web link, or fallback on going to the market page for my app, so that user could install it.
The question is how to have the user install the app and launch it from the market app, but with the input parameters.
Something along the lines of the following:
market://search?q=<query>¶ms=start?a=foo&b=bar
You can construct a URL that will start your app from the device's browser, and to a limited extent, provide extra parameters in it.
Do thing!
You'll need to enable the BROWSABLE filter for your Activity.
This is kind of bad form, though since any non-Android browser that runs across this link will react badly to it.
Related
I have setup <intent-filter>s in my app's manifest so that when a user navigates to https://foo.bar/baz, they are automatically sent to the appropriate activity in my app. This works 100% of the time for links that are clicked in "regular" Chrome.
What I've noticed, though, is that those same links, on the same device, just navigate as normal within the browser when either
The user is in an Incognito tab in Chrome
The user is is following the link when in the In-app Browser in Twitter (and likely other apps as well, though I have not tested it).
Is there a known issue with enabling these URI-based intent filters in these circumstances, or anything special that needs to be done in the manifest to enable the scenarios? I've searched around and come up empty, so hoping someone here can help me out.
I have setup s in my app's manifest so that when a user navigates to https://foo.bar/baz, they are automatically sent to the appropriate activity in my app.
I am assuming that your <intent-filter> is for ACTION_VIEW, probably for both the BROWSEABLE and LAUNCHER categories.
This works 100% of the time for links that are clicked in "regular" Chrome.
Presumably, Chrome is querying PackageManager, seeing that there is a registered activity for that URL and ACTION_VIEW, and then starting that activity.
Alternatively, an app might just call startActivity() for an ACTION_VIEW Intent for your URL. That, and the PackageManager route, are pretty much the only ways that your activity is going to get started based upon the URL.
And both of those are opt-in. There is no requirement for any app that happens to run into your URL to do either of those things.
The user is in an Incognito tab in Chrome
Given that your <intent-filter> works in regular Chrome, my guess is that incognito mode does not do it for privacy reasons. The point behind incognito mode is to limit what all knows about your browsing, so declining to launch apps is a reasonable part of that.
There may be other limitations with browsers. For example, for a while, Chrome would not navigate to an external app for URLs entered manually in the address bar. I have not tried this in years and so I do not know if this limitation is still in force.
The user is is following the link when in the In-app Browser in Twitter (and likely other apps as well, though I have not tested it).
Many apps that use WebView have logic to keep links within that WebView, so when the user clicks, it does not launch a Web browser. That logic will also block launching apps like yours, unless the developer took special care to handle that case (akin to what Chrome is doing).
Is there a known issue with enabling these URI-based intent filters in these circumstances
Yes, insofar as developers either intentionally or accidentally disabled launching third-party apps this way. It's not a bug on your side, if that is what you are asking.
or anything special that needs to be done in the manifest to enable the scenarios?
You cannot force your developers to launch your app, just because your URL appeared in their app. After all, there is no requirement for developers to launch a Web browser just because your URL appeared in their app.
Objective : I have 2 apps (Say A & B).
Case 1:
When app B is installed and I launch a page (say product page) on app A it will land to same product page of app B.
Case 2:
When app B is not present and I launched it from app A it will land to play store and and after installing it will open the same launched page of app A in app B.
I have followed https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#google-play-url-builder
but unfortunately didn't get any success.
I want to create it without any third party library like branch/facebook etc.
Please suggest something.
What you're describing is called Deferred Deep Linking (Deep Linking refers to using a link to open your app directly to a specific piece of content, and Deferred means that it works even if the app isn't installed first).
Unfortunately there's no native way to accomplish this on either iOS or Android. The Google Play INSTALL_REFERRER could work in theory, but it's unreliable and often gets delivered too late (i.e., seconds to minutes of waiting) to provide a good UX. URL schemes don't work, because they always fail with an error if the app isn't installed. Universal Links in iOS 9+ and App Links on Android 6+ at least don't trigger an error if the app isn't installed, but you'd still have to handle redirecting the user from your website to the App Store. You still can't pass context through to the app after install with Universal Links and App Links, so you wouldn't be able to send the user to the correct item.
To make this work, you need a remote server to close the loop. You can build this yourself, but you really shouldn't for a lot of reasons, not the least of which being you have more important things to do. Free services like Branch.io (full disclosure: they're so awesome I work with them) and Firebase Dynamic Links exist precisely to handle all of this for you, and we have a number of partners who build app-to-app connections like this.
I'd love to hear any feedback on why you are hesitant to use a third-party library!
Below is my scenario:
If the app is installed, launch the app pass a referrer data and handle it inside the app.
If the app is not installed , direct to google play install the app handle the referrer data.
I am able to achieve first case
For scenario 1 , I have
link 1:
http://www.xxx.co.in/main?id=4&referrer="+referrer
My activity is configured correctly and I am able to achieve scenario 1.
For scenario 2, I have
final String url = "http://www.xxx.co.in/main?id=4&referrer="+referrer+"#Intent;scheme=market;action=android.intent.action.VIEW;package=com.xxx&referrer="+referrer+";end";
This I am not able to achieve, If the app is not installed, instead of directing me to google play, it tries to open www.xxx.co.in/main.... in browser.
What is wrong here and how to achieve this.
NOTE: I do not want to host my own server hence redirecting from a remote server is out of scope.
Are you opening this link in the native Android browser, or Chrome? That looks like an Intent link, so it will only work in Chrome even if it is formatted correctly. However, Chrome doesn't support the Android Play referrer
To be honest, this sounds like a perfect use case for an external deferred deep linking service like Branch.io (full disclosure: I'm on the Branch team). Branch links do exactly what you're describing, and they do it on all browsers while saving you from the headache of needing to handle all the different variations. All you need to worry about is defining a set of key/value parameters (for example: articleID: story123) when you create a link, and Branch makes sure those parameters are returned to you inside the app the first time it launches after the user clicks the link, whether or not the app was installed when the link was clicked. You can then use the values to route/customize however you wish.
Firstly, I'm aware of how to save a web URL to a smart device as a user as is explained in these answers (usually by saving the tab from the browser). These take multiple steps and vary depending on device, thus requiring research which most vanilla users of smart devices do not do.
Create a Android launch icon for Website
Add to homescreen on mobile phone
My question is from the perspective of the app owner. The end goal is to let create a link on the web app allowing users "Create Homescreen icon" from 1 click. I suspect this is not possible as it would create a huge security risk to the devices allowing random unsafe URL'S to potentially try and create unlimited shortcuts but I'd like to ask nonetheless.
Answers such as these make a URL support app creation, however it leaves the task of creating the shortcut to the user instead of the URL.
"Add to homescreen" button in Android does not show website as a Web App
I hope my question is clear enough, if it is not I'm more than willing to elaborate.
Chrome on Android two new features 1) Web App Manifest that describes what should be launched from the home screen and how it should look on the homescreen, and 2) Chrome now has an beforeinstallprompt event that will trigger for Web apps that we think are app-like and can be installed to the homescreen.
There are a number of criteria for the onbeforeinstallprompt event to fire.
The event only fires if:
The site has a manifest, is on https and has a service worker. (this can be quite a stretch).
The user has engaged with the site multiple times (right now, twice within at least 5 minutes).
The user has not already added your site to the home-screen.
If all you want to do is detect if you should display a banner to prompt the user to add your web-app to the homescreen then Chrome already has a solution for you.
We also have a full range of samples on our samples site.
My requirement is, There is an advertisement in an email for a shoe, if I click on that ad, it should open my app directly and take me to corresponding page without asking any available option like web browser, etc.
I tried Deep linking fundamental, But I don't know how to create deep links, from where I can get custom scheme(eg. testlink://test).
for eg. google play scheme is market://details/
Thanks in advance
To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest.
refer https://developer.android.com/training/app-indexing/deep-linking.html
https://developers.google.com/app-indexing/android/app
There are actual several questions at play here:
1 - You need to know how to create a URI scheme(the testlink:// protocol you reference).
2 - You need to make your app do something when the end user clicks on the deep link.
To begin at the beginning, you don't "get" the custom scheme from anywhere, you create a URI scheme as part of setting up your app. There is no real standardization as to what that scheme should be (despite some attempts).
The question of how to do this have been answered elsewhere (How to implement my very own URI scheme on Android and in the android docs).
And I actually just published a blog post with some suggestions on how to optimize that URI scheme (https://blog.branch.io/creating-uri-schemes-for-app-content-discovery).
The second question is easier. Once you have that scheme in place, a user who
(a) clicks on a link that matches your scheme
(b) has your app installed and
(c) doesn't have some other app installed which uses the same scheme and which they've already set as the default for that scheme
will be launched directly into your app to the exact location / experience that you defined when you were setting up your intent filters.
Now if you want your deep links to work for users who don't already have your app installed you'll need to use a deferred/contextual deeplinking service. Obviously I'm inclined towards Branch.io since I work for them, but I work for them because I think they have the best offering.
Regarding your last requirement, that there be no browser pop in between, the browser pop is usually part of the flow because it allows a deep linking service to pass some information to their servers about the user on click so that if the user does not have the app they can be directed to the app store and if they do have the app it can be launched by invoking your URI scheme. If you want to do any sort of matching between click and install for users who do not already have the app or pass any info from the click to the app once it launches it been simply unavoidable until now. Universal links on iOS (new in iOS9) change that. They can be invoked directly without needing to go through the browser and pass data directly into the app being launched, which is a pretty big deal. Google is expected to announce an equivalent for Android in the very near future. The setup is a bit intense, but worth it for the improved user experience.
Good luck!