Deep-linking implementation in Android - android

I am implementing Deep-linking in my android application. I have added the properties mentioned here but still I am not getting any logs while debugging neither its working for my application.
My manifest is looking like:
<activity
android:name=".activities.HomeActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:noHistory="false"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter android:autoVerify="true">
<data android:host="domain" android:scheme="https" />
<data android:host="domain" android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
I am testing on a device having api level 23. But still its not working. Any help will be really appreciated.
I have placed following file on my server:
I have created a directory named ".well-known" and then saved the file having content given below with name "assetlinks.json"
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app",
"package_name": "package-name",
"sha256_cert_fingerprints": ["fingerprints"] }
}]
But still neither getting any logs, nor its working.

Related

Deeplink errors displayed on Google Console different from in AndroidManifest.xml

My app shows errors with a deeplink in Google Play Console:
In which the failed link was "https:///"
In the AndroidManifest.xml has this configuration:
<activity
android:name=".AppLinksActivity"
android:resizeableActivity="false"
android:exported="true"
android:launchMode="singleTask">
<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="your_game_domain.extads.gl.com"
/>
</intent-filter>
</activity>
The other link works just fine. I don't know where the triple dashes in the faulty link come from.
Could anyone help me find the causes and how to fix this? Much appreciated.

Android App Link - Testing the flow in local environment

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?

App links not working

In my application I want to use app links.
For this in my AndroidManifest.xml I am defining activity as :
<activity
android:name="com.abc.xyz.DeepLinkActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.Transparent">
<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:scheme="https"/>
<data
android:host="*.example.com"
android:scheme="http"/>
</intent-filter>
</activity>
and for this I am defining assetlinks.json as :
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.abc.xyz",
"sha256_cert_fingerprints": ["10:0C:0C:C2:78:EA:3B:DA:CA:A3:43:57:D1:8B:EE:62:15:E6:08:99:77:F1:F7:F1:DF:9E:DF:3C:92:04:B8:62"]
}
}
where fingerprint is defult android debug keystore fingerprint.
Only thing to point is that we are hosting assetslink.json at https://www.example.com/.well-known/assetlinks.json domain and not at
https://example.com/.well-known/assetlinks.json domain.
Can it be the cause. I seem to have been following all the guideline present at
https://developer.android.com/training/app-links/verify-site-associations.html#request-verify
As pointed out here android doesn't handle wildcards, so you should probably change
<data
android:host="*.example.com"
android:scheme="https"/>
to
<data
android:host="example.com"
android:scheme="https"/>
You can also use https://developers.google.com/digital-asset-links/tools/generator to test if site verifies your app.

You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter'

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'.

unity android deep linking not working

Im developing a mobile app using unity and I want to deep link the mobile app to the website. I have edited the androidmanifest as shown in the developers site but even though the building process runs smoothly when i try to type the link on the browser and launch the app it does not work
<activity android:name="com.liveroom.liveroom.GalleryUpdater"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</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="liveroom"
android:host="liveview"/>
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
as stated in the developers article the intent should be able to access and load the app when the uri liveroom://liveview but itt does not do so. please point my mistake, thank you
When you type on browser it will not open . to test make an html file using < a href tag then it will open.
Not every browser supports deep linking, only few browser supports deep linking, like if you want to check deep linking, use google chrome latest updated browser , so when You test deep linking using QR code it will open perticular app.
Was also not working for me. What helped was to remove android:host="(...)"
So my AndroidManifest.xml now looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="#style/UnityThemeSelector" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</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="unitydl" />
</intent-filter>
</activity>
</application>
</manifest>

Categories

Resources