Android app indexing not working when searched from chrome app - android

I have integrated app indexing for my android app so that whenever user search from mobile google, list of site will be listed out,on clicking my site it will take to my android app instead of webpage. This works fine when i search from google search app, whereas the same is not working when i search my chrome browser app.
Have implemented using this guide http://googlewebmastercentral.blogspot.in/2014/06/android-app-indexing-is-now-open-for.html
This was the intent filter i have used in my manifest
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="mysitedomain"/>
</intent-filter>
I have also tried with <category android:name="android.intent.category.APP_BROWSER" />
I have done site verify from developer console.
Do i am missing any configuration settings
Any suggestion would be helpful.
Thanks.

Whenever we need an app to be called by clicking link from chrome browser, definitely that app should include pathPrefix in data tag of intent filter
in my case for app indexing search from chrome browser i need to include this.
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="mysitedomain"
android:pathPrefix="/" />
</intent-filter>

Related

Android App Link opens browser instead of App and supported web link is disabled in app info

For Android 12 and 13, We recently enabled App link for deep link navigation. We created the assetlinks.json as mentioned here
Code from android manifest:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="host-name" />
<data android:pathPrefix="/path"/>
<data android:scheme="https" />
</intent-filter>
But unfortunately, everytime the deeplink to the app is accessed, the link opens in chrome instead of re-directing to the app. Also in the app info, our domain is always disabled app-info
When I run this command adb shell pm get-app-links <package_name>
I get this,
ID: <id>
Signatures: [*]
Domain verification state:
<my_domain>: 1024
I am unable to figure out why it returns 1024. In google play console, this is the content of the assetLinks.json
{"relation":["delegate_permission/common.handle_all_urls"],"target":{"namespace":"android_app","package_name":"<package-name>","sha256_cert_fingerprints":["<finger_print>"]}}]
I have tried all the steps in these pages
1024
SHA-256
But none of the fixes mentioned here has worked for me. This is creating a huge production incident.
In this post, they are saying the disabling is expected. But I have checked other apps like LinkedIn and there is no switch button beside the supported links.
I have verified the my local SHA-256 and google play app signing SHA-256 are the same. Still the domain appears disabled. Manually asking the user to enable doesnt seem like a good user experience. How can we enable this automatically?
Here is an example of an intent filter that can be added to the AndroidManifest.xml file to handle links with a specific URL scheme:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.yourUrl.com"
android:scheme="http" />
</intent-filter>
<!-- The intent filter is similar to the one above, but with a different URL scheme of http -->
<!-- so that you can open your app with the url starting with https and http as well -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.yourUrl.com"
android:scheme="http" />
</intent-filter>

Android AppLink prompting for app and chrome

I am trying to implement an AppLink (deeplink) such that when the app-link is triggered it does not bring up the popup asking for my App or Chrome, I want it to just launch my app so I can direct them to the proper place in the app.
I have read various android articles and posts and cannot get the AppLink to work the way I want.
Here is my manifest xml:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="www.example.com" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="www.example.com" />
</intent-filter>
</activity>
I read in the android doc here the following:
A deep link is an intent filter that allows users to directly enter a
specific activity in your Android app. Clicking one of these links
might open a disambiguation dialog, which allows the user to select
one of multiple apps (including yours) that can handle the given URL.
For example, figure 1 shows the disambiguation dialog after the user
clicks a map link, asking whether to open the link in Maps or Chrome.
Android App Links are a special type of deep link that allows your
website URLs to immediately open the corresponding content in your
Android app (without requiring the user to select the app).
I added auto verify to the intent and have the assetlinks.json file but still prompts to choose my app or chrome. I DO NOT want the prompt for chrome... only my app.
So, what am I missing?
Has anyone here got an app link to work that DOES NOT pop up the option for Chrome?
Can anyone point me to a sample app or code or an article that actually works?
Thanks for any assistance with this.

Associated Website not redirecting to Android Instant App

I am attempting to open an instant app from a URL by navigating to an associated link that has been tested in Android Studio and deployed to the app store. I've tested the following:
I know the instant app is available because the Google Play page has "Try It" on it, which works effectively.
App Links Assistant process fully configured, up to "Test App Links" which opens the IA and works correctly.
assetlinks.json placed on my server and can be accessed by https://example.com/.well-known/assetlinks.json
Activated the setting in the following URL: https://support.google.com/googleplay/answer/7240211?hl=en
Intent filters are also fully configured as per the instructions:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="example.app" />
</intent-filter>
However, when I navigate to my URL, it doesn't redirect to my instant app as expected. Would anybody be able to direct me towards what might be wrong?
I figured out the answer. If I enter the URL directly on a browser, it will not open an instant app, but the corresponding website. If however, I click on the URL from a link in another website or a text message it will open the instant app as expected. Weirdly, I am trying to launch from an NFC tag, which is treated as a URL entered in the browser.
#Jacobo I saw in another post someone mentioning that with Firebase Dynamic Link they fixed even for browser. I didn't test that yet because I'm actually trying to fix one step before. If I don't have the instant app cached or installed, my link is going to the website not to the InstantApp. Once I open the Instant manually or install the full version works fine but the non cached/ installed is not working. On the Google Play I already see the "Try now" button.

Chrome Custom tab links does not launch the app, but mobile chrome browser does

I'm trying to launch my android application through a browser link.
When I open the link through the chrome browser, it successfully shows the App Dialog Picker which shows the app available for the scheme like this.
app dialog picker
But when the link is opened through the Chrome Custom tab,
it just redirects to the site without showing the App Dialog Picker.
I need it to launch the app or show the dialog picker when the link is opened from another app (like gmail) which opens the in-app browser and not just in the chrome browser.
here is the current intent-filter I have.
<intent-filter>
<data
android:scheme="http"
android:host="www.myapp.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
If anyone could point out would be a great help. Thanks
So if ever anyone encounters the same problem, here's what I did. To launch your app with Chrome Custom Tabs browser, you need to make your scheme a non web-link format and make it into a custom scheme (example below). Because apparently, Chrome Custom tabs considers web link schemes as an ordinary link therefore launching it in the browser.
so from
<intent-filter>
<data
android:scheme="http"
android:host="www.myapp.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
change the scheme to a custom one, that way, your app's scheme will be the only one that gets handled by the browser. This is an example link with the scheme given below ~ myapp://myapp.app (note that this link is not clickable in android apps, but you can place it in the href of the html anchor tag of your website).
<intent-filter>
<data
android:scheme="myapp"
android:host="myapp.app" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

Messages app do not recognize my deep links schemas

I'm implementing a share feature in my app, the user will be able to share a deep link via sms or any other message app.
The issue I'm facing is that the Phone's message app does not recognize the generated deep link as a link.
I have on the manifest file the intent filter with the scheme and host declared. Also I was able test the deep link from a push notification, that means the manifest configuration works. However, I can't tap the message app deep link and open my app.
<activity
android:name=".activities.DailyGiveawayActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="${schemeBU}${schemeEnv}"
tools:ignore="AppLinkUrlError" />
<data
android:host="GiveawayRegistration"
tools:ignore="AppLinkUrlError" />
</intent-filter>
</activity>
Solved this issue using the Android App Link API.
https://developer.android.com/studio/write/app-link-indexing.html.
Using the fallowing intent filter my code is working and the OS knows how to handle the generated URL (even when doesn't exist). The OS will prompt a dialog, the user will have to pick an app capable to manage this url (browsers and my app), but that is good for now. Next stage will be eliminate this steep.
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="${schemeBU}${schemeEnv}"
android:pathPattern="/Register" />
</intent-filter>

Categories

Resources