App Links (Android)
App Links let Android users tap a link and open your app directly, without a disambiguation dialog. Tolinku automatically hosts the Digital Asset Links file for your Appspace’s domain.
How it works
Section titled “How it works”When a user taps a link to your Tolinku domain (e.g. https://myapp.tolinku.com/merchant/abc123):
- Android checks the
assetlinks.jsonfile athttps://myapp.tolinku.com/.well-known/assetlinks.json. - If the app’s package name and signing certificate match, Android opens your app and passes the URL via an Intent.
- If the app is not installed, Android opens the URL in the browser, where the user sees your landing page.
-
Configure your Android settings in Tolinku.
Go to Appspace Settings > Android and enter:
- Package Name: Your app’s package name (e.g.
com.example.myapp) - SHA-256 Certificate Fingerprint(s): The SHA-256 fingerprint of your app’s signing certificate
You can add multiple fingerprints (comma-separated) for debug and release certificates.
- Package Name: Your app’s package name (e.g.
-
Add the intent filter to your
AndroidManifest.xml.<activity android:name=".DeepLinkActivity"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" /><dataandroid:scheme="https"android:host="myapp.tolinku.com" /></intent-filter></activity>The
android:autoVerify="true"attribute tells Android to verify domain ownership via theassetlinks.jsonfile. -
Handle incoming links in your Activity.
See the Android SDK guide for code examples.
Digital Asset Links file
Section titled “Digital Asset Links file”Tolinku generates and serves the assetlinks.json file automatically at:
https://your-domain/.well-known/assetlinks.jsonExample output:
[ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.example.myapp", "sha256_cert_fingerprints": [ "AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99" ] } }]Getting your SHA-256 fingerprint
Section titled “Getting your SHA-256 fingerprint”Debug certificate
Section titled “Debug certificate”keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass androidLook for the SHA256: line in the output.
Release certificate
Section titled “Release certificate”keytool -list -v -keystore your-release-key.jks -alias your-aliasGoogle Play App Signing
Section titled “Google Play App Signing”If you use Google Play App Signing (recommended), find your SHA-256 fingerprint in the Google Play Console:
- Go to Setup > App signing
- Copy the SHA-256 certificate fingerprint under “App signing key certificate”
Custom domains
Section titled “Custom domains”If you use a custom domain, Tolinku serves the assetlinks.json file on that domain as well. Update your intent filter to include the custom domain:
<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="myapp.tolinku.com" /> <data android:scheme="https" android:host="links.myapp.com" /></intent-filter>Troubleshooting
Section titled “Troubleshooting”Links open in the browser instead of your app:
- Check that
android:autoVerify="true"is set on the intent filter. - Verify the package name and SHA-256 fingerprint are correct in Appspace Settings.
- If using Google Play App Signing, ensure you are using the app signing key fingerprint (not the upload key).
- Run the verification check:
The output should show your domain as
Terminal window adb shell pm get-app-links com.example.myappverified.
Verification fails:
- Ensure the
assetlinks.jsonfile is accessible. Test by visitinghttps://your-domain/.well-known/assetlinks.jsonin a browser. - The file must be served with
Content-Type: application/jsonand accessible without redirects. - If you recently added or changed fingerprints, it may take a few minutes for the change to take effect.
Links work but show a disambiguation dialog:
- This means
autoVerifyfailed. Check the steps above. - On some Android versions, the user may need to manually set your app as the default handler in Settings > Apps > Default apps > Opening links.
Testing
Section titled “Testing”To verify App Links during development:
- Install your app on a device or emulator.
- Run the verification command:
Terminal window adb shell pm verify-app-links --re-verify com.example.myapp - Check the verification status:
Terminal window adb shell pm get-app-links com.example.myapp - Open a link using adb:
Terminal window adb shell am start -a android.intent.action.VIEW \-d "https://myapp.tolinku.com/merchant/abc123" com.example.myapp