Short.io provides deep linking for Android apps. Example: When users click a short link that is correctly configured in your Android app, they will be redirected to the app, if it is installed. If the application is not installed, the URL will be opened in the browser.

Note: Deep linking requires the Team Plan.

Requirements for Using Android Application Links:

  • Active short domain.
  • Android 6.0 or later.

How to configure deep links in Short.io and Android App

  1. Open the AndroidManifest.xml file

2. Add intent filters to the manifest.

We inform the Android system that the link must be opened in the application, not on the website.

Add intent filters between <activity>.

<intent-filter android:label="Randomizer"> <!-- 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:scheme="https"
android:host="shortcm.xyz" <!-- SHORT DOMAIN -->
<!-- Any path. You can also remove the line below, if you want to configure deep links for the whole short domain, not a particular short link -->
android:pathPrefix="/myapplication"/>
<!-- Any path. You can also remove the line above, if you want to configure deep links for the whole short domain, not a particular short link -->
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

3. Configure deep links on Short.io.

  • Specify Android App Package name and SHA256 Fingerprint Certificate > Save.

Here's how to find Android App Package name and SHA256 Fingerprint Certificate: https://help.short.io/en/articles/4171170-where-to-find-android-app-package-name-and-sha256-fingerprint-certificate

4. Add commands to process deep links in the application.

Add these lines to the MainActivity.kt/.java or any other Activity file.

  • Kotlin
val data: Uri? = this.intent.data
if (data != null && data.isHierarchical()) {
val uri = this.intent.dataString
Log.i("MyApp", "Deep link clicked $uri")
}

Remember to add import android.net.Uri if it wasn't added earlier
  • Java
Uri data = this.getIntent().getData();if (data != null && data.isHierarchical()) { String uri = this.getIntent().getDataString(); Log.i("MyApp", "Deep link clicked " + uri);}

5. Run the emulator and follow the link you've specified in the AndroidManifest.

<data android:scheme="https"
android:host="shortcm.xyz"
android:pathPrefix="/myapplication"/>

In our case the link is: https://shortcm.xyz/myapplication

If the link doesn't exist, you will get an error message. Send a link via email to click it via emulator. You'll be offered to open the short link via a browser, or your app.

Here's how it works:

Did this answer your question?