My problem is that uploading my signed APK for my android instant app to google play console gives me the following error:
Your site 'anam-instant.mybluemix.net' has not been linked through the Digital Assets Link protocol to your app. Please link your site through the Digital Assets Link protocol to your app.
I have a single base module, with the AndroidManifest.xml intent filter as follows:
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
android:order="1" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="MYURL.net" />
<data android:pathPrefix="/hello" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://MYURL.net/hello"/>
At /.well-known/assetlinks.json
[
{
relation: [
"delegate_permission/common.handle_all_urls"
],
target: {
namespace: "android_app",
package_name: "com.example.anam.my_instantapp",
sha256_cert_fingerprints: ["SHA256-CERT"]
}
}
]
I have Google app signing enabled and got my sha256 cert from there, using the Upload certificate.
I have verified that the package name is the same as the package name in the base module's AndroidManifest.xml.
I have verified that my robots.txt allows all.
I'm trying to release this under Instant app development.
Related
I'm trying to check how App Links work on android.
Here is what I have done so far -
Set up a local server with MAMP, apache points to port 80.
Created .well-known in the htdocs & also put the assetlinks.json in the created dir.
I am able to access it using - http://192.168.0.78/.well-known/assetlinks.json
where 192.168.0.78 is my lan ip. I generated the SHA using the keytool command.
Here are the contents of the file assetlinks.json:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.pbc.deeplinking_demo",
"sha256_cert_fingerprints":
["D9:29:00:B9:30:F1:24:A0:E7:7A:58:74:43:C6:06:FF:F6:16:BB:42:F3:A2:16:10:5D:81:27:37:3A:E5:A6:14"]
}
}]
Set up an android app with the applicationId : com.pbc.deeplinking_demo
Added the intent-filters with autoVerify=true to the activity
implementation below -
<activity
android:name=".MainActivity"
android:exported="true">
<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" />
<data
android:host="192.168.0.78" />
</intent-filter>
</activity>
With this config, I continue to see the disambiguation dialog asking me to choose between the default browser and the target app.
Note: I am able to access the mamp page & also the assetlinks.json from Chrome on Android emulator.
Am I missing something here or is it not possible to test this in local environment?
I am developing an android app.
It uses AppsFlyer's Onelink kind of a Deeplink.
I set up and tested, in general, it works fine.
When I tested this using Android studio, it works fine
When I tested this with Slack messenger, it works fine too.
But If I test this with other messaging apps, it doesn't work, and just open the web browser.
I don't know why and how to fix it.
<intent-filter
android:autoVerify="true"
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="mylink.com"
android:pathPrefix="/path"
android:scheme="https" />
</intent-filter>
For deep linking to work in Android 12, you need to create intent-filters with autoVerify="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" />
<data android:scheme="https" />
<data android:host="www.example.com" />
<data android:host="mobile.example.com" />
</intent-filter>
Host a Digital Asset Links JSON on your website at the below location to declare the association between your intent filters and the website.
https://your-domain.name/.well-known/assetlinks.json
assertlinks.json should contain the following information
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "your.app.package.name",
"sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
}
}]
You can generate sha256_cert_fingerprints using java key tool
keytool -list -v -keystore my-release-key.keystore
If you're using Play App Signing, You can find Digital Asset Links JSON snippet at the following location Release > Setup > App Integrity
I have some difficulties while importing my first APK on Play Store. A simple WebView App.
I have this error message :
Importation error.
The domain name "https://chimeria.net" you specified is not valid
Enter a valid domain name.
Where https://chimeria.net is the url of the embeded website in the WebView...
After the documentation I read (https://developers.google.com/digital-asset-links/v1/getting-started):
I created a json file at
https://chimeria.net/.well-known/assetlinks.json
I took the SHA256 value from My Developer play store page, at the tab Application Signature.
screenshot of where i picked up the SHA546 KEY
I added this line in the AndroidManifest.xml of the app:
<meta-data android:name="asset_statements" android:resource="#string/asset_statements" />
I added this in the res/values/strings.xml file of the app
<string name="asset_statements">
[{
\"relation\": [\"delegate_permission/common.share_location\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"https://chimeria.net\"
}
}]
</string>
Later in my manifest file, I declared
<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="https://chimeria.net" />
<data android:scheme="https" />
</intent-filter>
The app was created with Android Studio (Android App Bundle) that gave me an .aab file.
No matter what I tried, my app was refused because the link was not accepted.
And finnaly I wasted all possible attemple in a day.
Would somebody know what I am doing wrong ?
Thanks you for your help
chimeria.net is the host, https or http is the scheme.
You probably want to change your manifest to:
<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="chimeria.net" />
<data android:scheme="https" android:host="chimeria.net" />
</intent-filter>
When I click on the link: https://example.com/abcd on android version 6/7/8 it shows disambiguation dialog. We have already verified domain by placing json at: https://example.com/.well-known/assetlinks.json. I've done everything as per the documentation and still the link doesn't open without disambiguation. Please help me find what I'm missing.
Code in 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:scheme="https"
android:host="example.com"
android:pathPattern="/abcd"
/>
</intent-filter>
Late to the party but I too experienced the disambiguation always popping up. For those who haven't managed to resolve this yet (or to come), go to Logcat and search for "IntentFilterIntentOp". You should be seeing something like Verification 8 complete. Success:true. Failed hosts:. This may fail (Verifying IntentFilter. verificationId:8 scheme:"https" hosts:"example.co.za" package:"za.co.example.qa".) if you've uploaded your assetlinks.json file to one domain whilst it's not accessible on other or subdomains that you've registered in your intent-filter.
It's also worth mentioning that your App would have to have been launched at least once before in order for "IntentFilterIntentOp" to perform the necessary verification. Accessing a link via App Link Testing in Android Studio should thereafter automatically open your app without the disambiguation dialog.
update as of 2021 with Android 12:
Android changed web intent resolution policy that effects link handling, if you follow all the new requirements your app will be given a chance if not browser will handle those, more on this here:
web intent resolution requirements
/////////////////////Below behavior might still apply today//////////////////////
The Caveat here is if you install the app through playstore the default "link-handling policy" of the application with registered domains like www.example.com is set to "Handle in the app", which will open the app directly subject to intent filter verification without any disambiguation dialogues.
If you install the app by means other than playstore like through adb even though you sign it with keystore the default link handling policy is set to "Always ask" which will show disambiguation dialog even though the intent-filter verification passes for your app link.
Please try to add autoVerify="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"
android:pathPattern="/abcd"
/>
you can try like this, both http and https:
<activity
android:name=".ui.MainActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="www.oschina.net"
android:scheme="http" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="www.oschina.net"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="my.oschina.net"
android:scheme="http" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="my.oschina.net"
android:scheme="https" />
</intent-filter>
</activity>
Got the same issue. Take a look at your sha256 fingerprint. If you test applinks with debug version of the app then you have to place the fingerprint for debug version. You can do it in Android Studio - Tools - App Links Assistant - Associate website.
When you run your app with Android studio, it is installed a debug APK on your device which might match the live config (which is for release APK or bundle) on your branch dashboard.
To handle de the debug (or test) mode in branch this is what I did
Setup test configuration in your branch dashboard:
On the top left on the dashboard there is a switch to access the test mode, click on it and fill the form for the test config.
Next create a debug link. The field values should be the same as for a live (release) mode link. the only difference the generated test link contains a prefix
yourapp.test-app.link/xxxxx
Create two Android manifest files for each type of APK or bundle:
app/src/debug/AndroidManifest.xml <- for debug APK or bundle
app/src/main/AndroidManifest.xml <- for release APK or bundle
Do the Branch SDK setup on both two manifest files
You should now be able to use the debug link without the disambiguation prompt showing
Trying to upload instant application but getting this error
You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter'.
<activity
android:name=".ui.InstantSplash"
android:screenOrientation="portrait"
android:theme="#style/splashScreenTheme">
<meta-data
android:name="default-url"
android:value="https://sample.com/base-app/salt_one" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<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" />
<data android:host="sample.com" />
<data android:pathPrefix="/base-app" />
<data android:scheme="https" />
</intent-filter>
</activity>
Upload installable APK in alpha, beta or production with same HOST web 'intent-filter'.
You are defining an Intent filter with the scheme and host:
<data android:scheme="http" />
<data android:host="sample.com" />
so you have to access your deep links with
http://sample.com
but this domain must be a valid domain, and this domain must be of your property because you need to add the assetlinks.json
The website www.example.com publishes a statement list at
https://www.example.com/.well-known/assetlinks.json. This is the
official name and location for a statement list on a site; statement
lists in any other location, or with any other name, are not valid for
this site. In our example, the statement list consists of one
statement, granting its Android app the permission to open links on
its site:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.example.app",
"sha256_cert_fingerprints": ["hash_of_app_certificate"] }
}]
Read more about it:
https://developers.google.com/digital-asset-links/v1/getting-started#quick-usage-example
Instant apps does not support HTTP. Your default-url should be HTTPS
<meta-data
android:name="default-url"
android:value="https://sample.com/base-app/salt_one" />
Your app must also define a default URL for your app. Within the same Android manifest as your entry-point activity, you define the default URL for your app by adding a element with a value attribute that provides a valid HTTPS URL that the activity can handle. Further, this default url must also be part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.
The following code snippet shows an Android manifest that defines an entry-point activity and default URL for an instant app.
<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" />
<data android:scheme="https" />
<data android:host="example.com" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.example.com/index.html" />
</activity>
Instant apps does not support HTTP. Your default-url should be HTTPS
For more details can you check android AIA documentation.
There is some inappropriate string for error message, can you ensure fix with, installable APK in alpha, beta or production with same HOST web 'intent-filter'.