Can't link Android app with Digital Asset Link since app doesn't have a signature
I managed to find the solution to my problem. Turns out my intent-filter
had multiple empty data
tags which seemed to prevent my app to detect the website.
I forgot to specify that I'm my app's AndroidManifest
is built by Cordova since I'm using Ionic. So I cannot edit my AndroidManifest
directly. I have to use the ionic-plugin-deeplinks
plugin.
The problem is, the ionic plugin generates an intent-filter
with the data given in the package.json
with the following format.
"cordova": {
"plugins": {
"ionic-plugin-deeplinks": {
"URL_SCHEME": "my-url-scheme",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "com.example.app",
"ANDROID_PATH_PREFIX": "/",
"ANDROID_2_PATH_PREFIX": "/",
"ANDROID_3_PATH_PREFIX": "/",
"ANDROID_4_PATH_PREFIX": "/",
"ANDROID_5_PATH_PREFIX": "/",
"DEEPLINK_2_SCHEME": " ",
"DEEPLINK_2_HOST": " ",
"DEEPLINK_3_SCHEME": " ",
"DEEPLINK_3_HOST": " ",
"DEEPLINK_4_SCHEME": " ",
"DEEPLINK_4_HOST": " ",
"DEEPLINK_5_SCHEME": " ",
"DEEPLINK_5_HOST": " "
}
}
}
This format is automatically generated by the plugin and adds multiple host/scheme/prefix to allow support of multiple addresses. However I'm using only one address, so when I'm generating the AndroidManifest
with the plugin, it generates an intent-filter
with many empty data
tags in it.
<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="com.example.app" android:pathPrefix="/" android:scheme="https" />
<data android:host=" " android:pathPrefix="/" android:scheme=" " />
<data android:host=" " android:pathPrefix="/" android:scheme=" " />
<data android:host=" " android:pathPrefix="/" android:scheme=" " />
<data android:host=" " android:pathPrefix="/" android:scheme=" " />
</intent-filter>
As of now the only way I managed to remove the extra data
tags was to fork the plugin's repository and remove the package.json
extra properties from the plugin. It looks like this:
"cordova": {
"plugins": {
"ionic-plugin-deeplinks": {
"URL_SCHEME": "my-url-scheme",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "com.example.app",
"ANDROID_PATH_PREFIX": "/"
}
}
}
Which generates this intent-filter
that is working has intented:
<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="com.example.app" android:pathPrefix="/" android:scheme="https" />
</intent-filter>
Android app links intent-filter with wildcard subdomain not verified
So the problem was, that assetlinks.json was stored under
www.example.com/.well-known/
which turned out to be a different place from
example.com/.well-known/
Using wildcard subdomain app tried to verify 2 domains:
www.example.com and example.com. And failed with the second, what failed the verification in general.
Basically, www.example.com/.well-known/assetlinks.json was reached via chain of redirections
This is why it seemed to me, that example.com/.well-known/assetlinks.json was present.
And app links documentation says:
The assetlinks.json file must be accessible without any redirects (no
301 or 302 redirects).
So if you want to use wildcard subdomains, make sure to locate your assetlinks.json
under exactly example.com domain.
App-Linking in Android, assetlinks.json, IIS, can not get it work
It works now.
The wrong I did was by mistake add the "http://" DataScheme to the DataHost in the IntentFilter attribute in MainActivity class.
I juste removed it and everything works, now it looks like this when I run the command to see my app listed:
(Command: adb shell dumpsys package domain-preferred-apps)
Flutter android 12 deep link is not working
I found this issue go to browser inspect and go to network and there check content-type and its issue in server don't have permission to content-type json file permission.
in server /opt/lampp/etc httpd.config
ou can use the following code in your httpd.conf if you have access, or even your .htaccess , to force Apache, to send an UTF-8 encoding header.
AddType 'application/json;' .json
Related Topics
Android Studio 3.1 Edittext Stackoverflowerror
Isvalidfragment Android API 19
How to Play .Mp4 Video in Videoview in Android
Android: Wait on User Input from Dialog
How to Add Radio Button Dynamically as Per The Given Number of Counts
How to Fetch Data from a Web Server in an Android Application
Replace Fragment with Another Fragment Inside Viewpager
Android - Creating a New Activity in Eclipse
Export The Contacts as Vcf File
Android Sdk Install: Java Se Development Kit (Jdk) Not Found
List View Item Swipe Left and Swipe Right
How to Avoid Restarting Activity When Orientation Changes on Android
No Resource Found That Matches The Given Name '@Style/ Theme.Holo.Light.Darkactionbar'
Creating a Seterror() for The Spinner