Skip to main content
All CollectionsIntegrations and ExtensionsMobile Deep Links
How to configure deep links in Android app and Short.io
How to configure deep links in Android app and Short.io
Andy K. avatar
Written by Andy K.
Updated over 2 weeks ago

Short.io provides mobile deep linking for Android and IOS apps. For 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 their browser.

Note: Deep linking is available starting from the Team Plan.

How to configure deep links

Requirements for using Android application links

  • Active short domain

  • Android 6.0 or later

Android settings

  1. Open the AndroidManifest.xml file of your application:

  2. Inform the Android system that the link must be opened in the application, not on the website. Add intent filters to the manifest between <activity>:

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

Configure deep links on Short.io

  1. Sign in to your Short.io account.

  2. Navigate to Domain Settings > Deep links:

  3. In the Configuration for Android panel fill in the following details:

    • Android App Package Name

    • Android SHA256 Certificate Fingerprint

    You can find information on how to locate the App Package Name and the Certificate Fingerprint in this article.

  4. Click on Save.

Configure 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 was not 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 have specified in the AndroidManifest.

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

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

If the link does not exist, you will get an error message. Send a link via email and browse it from an emulator. You will have the option to open the short link using either a web browser or your application:

Watch a video guide on how Short.io deep links work:

Did this answer your question?