Unable to open deeplink through gmail app - android

I recieve a link on gmail and I want to open my application whenever we click on that link.
If I click on that link, it opens in the website(not in app), but if I copy that link and open it in the browser it gives me an option to choose the application.
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="agora-frontend.herokuapp.com"
android:scheme="https" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="agora-frontend.herokuapp.com"
android:scheme="http" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="agora-frontend.herokuapp.com"
android:scheme="app" />
</intent-filter>
The link I am trying to open is
https://agora-frontend.herokuapp.com/vote/xxxxxxxxxx/xxxxxxxxxxxxxxxxxxx
I want to open my app whenever we click on that link through gmail.

Related

Two app instances are created when click on deeplink from mail

I'm navigating to the email app from X activity, I am getting an email from the backend.
On that email we have the link, once click on that link it is navigated to app Y activity.
In that process, two app instances are created.
navigating to email app activity and navigating from email app activity both are not the same.
<activity
android:name=".framework.deeplink.DeepLinkActivity"
android:exported="true"
android:noHistory="true">
<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="medicineprod.com" android:pathPrefix="/redirectpath" />
</intent-filter>
<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="medicinetest.com" android:pathPrefix="/redirectpath" />
</intent-filter>
<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="medicineapp"/>
</intent-filter>
</activity>

Android. Deep linking doesn't work with http/https scheme

I added a deep linking to my Android app this way:
<activity
android:name=".views.DeepLinkingActivity"
android:exported="true">
<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.com"/>
</intent-filter>
</activity>
When I click on https://example.com I get redirected to the web site.
When I change android:scheme="https" to android:scheme="appscheme" it works and it redirects me to my app.
How to force my app to be opened via https scheme?
UPDATE
I added a subdomain and it still doesn't work.
<activity
android:name=".views.DeepLinkActivity"
android:exported="true">
<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="www.example.ru"/>
</intent-filter>
</activity>
Thanks to veritas1 I removed android:autoVerify="true" from https-scheme. I also changed the scheme from https to http. (You can read about autoVerify).
So, currently have two different schemes:
<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="your-site.com"
android:pathPrefix="/"
android:scheme="http"
/>
</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:host="your-site.com"
android:pathPrefix="/"
android:scheme="myapp"
/>
</intent-filter>
When clicking on a link myapp://your-site.com/... an application will be opened. When clicking on http://your-site.com/... Chrome browser will offer to open in the application or another browser, while other mobile browsers ignore this and try to open themselves.
UPDATE
See https://stackoverflow.com/a/60342565/2914140 for App Linking.
Hi please use the following data and try also refer this doc
<intent-filter>
<data
android:scheme="ou unique scheme(appname,package name)" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
OR
<data
android:scheme="you unique scheme(appname,package name)"
android:host="www.example.ru"/>
You refer to deep linking but android:autoVerify="true" is used for App linking, so the domain example.com (which you don't own?) is going to get checked for a digital asset links json file. See https://developer.android.com/training/app-links/index.html
For your test to work I'd suggest removing android:autoVerify="true" and adding a subdomain to the host e.g. android:host="www.example.com"
Try this
<activity
android:name=".views.DeepLinkingActivity"
android:exported="true">
<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="open"
android:scheme="example" />
</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:host="example.com"
android:pathPrefix="/"
android:scheme="http" />
</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:host="example.com"
android:pathPrefix="/"
android:scheme="https" />
</intent-filter>
</activity>
Please check below it may be help
https://codelabs.developers.google.com/codelabs/android-deep-linking/index.html?index=..%2F..%2Findex#0
Just use http. Don't know when the implementation is changed.
But I just tested that using http will make both http and https work.
So change you intent filter by:
<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.com"/>
</intent-filter>
youe can also add to it
sub.example.com
<intent-filter android:label="#string/app_name">
<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.com" />
<data android:scheme="app" android:host="com.example.example" />
</intent-filter>

Applinks intents not working on android

I have an Android app that should open links on the app which clicks from the web browser.
I have the following intent filters:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" android:host="www.mysite.com" />
<data android:scheme="https" android:host="www.mysite.com" />
</intent-filter>
And also i checked the my signed sha256 key, package name etc from the assetjson file which is in the mysite/.well-known/assetlinks.json. Everythings looks correct. But the app still not opening when i click the links from the website.
<activity android:name=".YourActivity">
<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="https" />
<data android:scheme="http" />
<data android:host="mysite.com" />
</intent-filter>
</activity>

how to open this app via my website

<intent-filter android:label="#string/app_name">
<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="olacabs.com" android:pathPrefix="/app/launch" />
<data android:scheme="olacabs" android:host="app" android:pathPrefix="/launch" />
</intent-filter>
this is the manifest file of an android app ! how to open this app via my website?
for example i opened linkedin app using this code
Linkedin
same way i need to open above app also ! how to do that . i have tried with
OLA
OLA
OLA
please help me , thanks in advance
I'm not sure if you have figured out by now, but the correct way to have the same activity handle 2 or more URIs is to have multiple intent-filters:
<intent-filter android:label="#string/app_name">
<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="olacabs.com" android:pathPrefix="/app/launch" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="olacabs" android:host="app" android:pathPrefix="/launch" />
</intent-filter>

How to make my app show up in the list of browsers when I click on any link in Android?

<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="appname"/>
</intent-filter>
I tried that but still my app won't show up in the list of browsers when I click on any link. What might be going wrong?
use this filter:
<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"/>
</intent-filter>

Categories

Resources