I'm trying to set up android app link for my add but they are not working.
I modified my manifest.xaml (android/app/src/main), by adding :
<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" />
<data android:scheme="https" />
</intent-filter>
and added a assetlinks.json to my website (./well-known/assetlinks.json).
And when i validate it by browsing on https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls, it says there is no errors but my app link is not working when i open it with adb shell am start -a android.intent.action.VIEW -d "https://example.com"
When i try to find the app link with adb shell dumpsys package domain-preferred-apps, it says it does not exists.
I aldready verified my sha256 key and my app package on the assetlinks.json...
Can someone please help me :)
Related
Not able to get QR code link to open my app, it always loads in browser.
I have added a intent filter in Manifest file as below -
When I have the link in as SMS message, https://pages.smart.link/abc and I click on that, it shows disambiguous dialog with my app as one of the options to open it.
<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="pages.smart.link"
android:pathPrefix="/abc"
android:scheme="https" />
</intent-filter>
But if generate this link through QR code, it loads the URL in web browser - tested on Samsung Galaxy S8+
SMS option does NOT work if I have host as "myapp" with final url as myapp://pages.smart.link/abc
myapp host works fine if launch it through command line as below -
adb shell am start -W -a android.intent.action.VIEW -d
"myapp://pages.smart.link/abc" com.abc.myapp
<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="pages.smart.link"
android:pathPrefix="/abc"
android:scheme="myapp" />
</intent-filter>
I am trying to link my app to url, so that it will open the app directly without selector option.
I added below code in android manifest file
but still it is not opening app directly.
<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="domain.com" />
<data android:scheme="https" android:host="domain.com" />
</intent-filter>
After app installation I check I ran below command
adb shell dumpsys package domain-preferred-apps
but still it is showing status undefined for my app package.
Package: <"package name">
Domains: <"domain.com">
Status: undefined
Setting up the Manifest is only half of this process — you also need to do some configuration on your server so that Android can link the two together.
This article explains the steps. Basically you need to create an applinks.json file with your SHA256 fingerprint and then serve that over HTTPS from your domain without any redirects.
Please see the two links below. When pasted in Whatsapp, first one opens with Facebook app, but the second one opens with browser.
Opens in Facebook app:
https://m.facebook.com/SriSwamiji/posts/1099353043449548:0
Opens in Browser:
https://www.facebook.com/SriSwamiji/photos/a.186720728046122.67368.108460819205447/1099353043449548/?type=3
What makes the second link open in browser ?
I want to open it via Facebook app.
I would say that is due to deep linking. In any of your apps you could add filters that trigger your app whenever the Android system tries to resolve an URL.
Probably the Facebook app has configured the deep link of thehttp://m.* urls
edit: I've tested it via adb and it is due to deep linking. You can test it with
adb shell am start -W -a android.intent.action.VIEW -d <URL>
as explained in the deep link documentation
This is the output:
$ adb shell am start -W -a android.intent.action.VIEW -d "https://m.facebook.com/SriSwamiji/posts/1099353043449548:0"
Starting: Intent { act=android.intent.action.VIEW dat=https://m.facebook.com/... }
Status: ok
Activity: com.facebook.katana/com.facebook.deeplinking.activity.StoryDeepLinkLoadingActivity
ThisTime: 127
TotalTime: 208
WaitTime: 253
Complete
As you can see the Activity launched is com.facebook.katana (the Facebook app).
$ adb shell am start -W -a android.intent.action.VIEW -d "https://www.facebook.com/SriSwamiji/photos/a.186720728046122.67368.108460819205447/1099353043449548/?type=3"
Starting: Intent { act=android.intent.action.VIEW dat=https://www.facebook.com/... }
Status: ok
Activity: com.android.chrome/org.chromium.chrome.browser.document.DocumentActivity
ThisTime: 121
TotalTime: 179
WaitTime: 223
Complete
In this case com.android.chrome is launched
Also, if you take a look to the Facebook app manifest (with some app like ManifestViewer you can see that it has some intent-filter to handle it:
<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="m.facebook.com"
android:pathPrefix="/events"/>
<data
android:scheme="https"
android:host="m.facebook.com"
android:pathPrefix="/events"/>
<data
android:scheme="http"
android:host="m.facebook.com"
android:pathPrefix="/groups"/>
<data
android:scheme="https"
android:host="m.facebook.com"
android:pathPrefix="/groups"/>
<data
android:scheme="http"
android:host="www.facebook.com"
android:pathPrefix="/groups"/>
<data
android:scheme="https"
android:host="www.facebook.com"
android:pathPrefix="/groups"/>
<data
android:scheme="http"
android:host="www.facebook.com"
android:pathPrefix="/events"/>
<data
android:scheme="https"
android:host="www.facebook.com"
android:pathPrefix="/events"/>
</intent-filter>
In your concrete case I would say that that link is handled in
<activity
android:theme="#2131625627"
android:name="com.facebook.katana.ContactUriHandler"
android:taskAffinity="com.facebook.task.ContactUriHandler"
android:excludeFromRecents="true"
android:launchMode="singleInstance">
<intent-filter>
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<data
android:mimeType="vnd.android.cursor.item/vnd.facebook.profile"
android:host="com.android.contacts"/>
<data
android:mimeType="vnd.android.cursor.item/vnd.facebook.presence"
android:host="com.android.contacts"/>
</intent-filter>
</activity>
and internally has support for posts but not for photos
I have this link which I want to link a specific activity on clicking this url.
I am able to link "http://example.com" to my application, but when I tried using this query parameter in the path prefix, it returned nothing.
I use this intent-filter to link my url :
<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.com"
android:scheme="http"
android:pathPrefix="/"/>
</intent-filter>
Here I don't know what is the path prefix for my Url.
It does not solve your problem, but to test your URL try this ADB command:
adb shell 'am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "http://example.com?path_resolution=xyz&city=abc"'
I'm trying to make my android app react to a specific deep link format. I want the app to be able to handle links in the following format:
href="android-app://website.org/http/a_path"
I have the following in my manifest file:
<intent-filter android:label="App" >
<action android:name="android.intent.action.VIEW" />
<data
android:host="website.org"
android:scheme="http" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
When I test it from the console, the app reacts to the following deeplink:
adb shell am start -a android.intent.action.VIEW -d "http://website.org/http/a_path" website.org
But it does not react to the format that I need, which is:
adb shell am start -a android.intent.action.VIEW -d "android-app://website.org/http/a_path" website.org
In this second case, I get the following error:
Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://org.website/http/a_path flg=0x10000000 pkg=website.org }
Any help is appreciated. Thanks!
You need to correctly set your scheme.
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="android-app"></data>
</intent-filter>
I do not see you having filter for android-app scheme:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data
android:host="website.org"
android:scheme="android-app" />
</intent-filter>
But anyway, do not use custom schemes. See this discussion involving android framework developer: https://groups.google.com/forum/#!topic/android-developers/-hkq8-S5-Gs