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>
Related
I have following intent filter set up for detecting links to open in our app.
<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="share.example.tv"
android:pathPrefix="/"
android:scheme="https" />
<data
android:host="example.tv"
android:pathPrefix="/u"
android:scheme="https" />
</intent-filter>
I want my app to open below 2 links
https://share.example.tv/tv34gh
https://example.tv/u/some-user-name
But my app is showing up for these links as well
https://example.tv/anything/literally-anything
If I separate both of the links in different intent-filters for same activity like below
<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="share.example.tv"
android:pathPrefix="/"
android:scheme="https" />
</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:host="example.tv"
android:pathPrefix="/u"
android:scheme="https" />
</intent-filter>
This works but I don't know why.
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>
<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>
<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>
I just can't get visiting YouTube on the browser to launch my app. Must be because of AJAX / redirects. This works for Flickr and other websites for me but not for YouTube.
<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="youtube.com"
android:pathPattern=".*"
android:scheme="http" />
<data
android:host="*.youtube.com"
android:pathPattern=".*"
android:scheme="http" />
</intent-filter>
Is there any way doing this?
The following intent-filter works for me on 4.0+:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSEABLE" />
<data android:scheme="http"
android:host="*.youtube.com"
android:pathPrefix="/watch" />
</intent-filter>