Deep Linking

The Storyteller SDK makes it possible to handle the deep links. The implementing app should follow the official Android guideline.

In order to enable it separate intent filters need to be added to the implementing app's AndroidManifest.xml.

      <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="[tenant_name].ope.nstori.es"
          android:pathPattern="/open/.*/.*"
          />
        <data
          android:scheme="https"
          android:host="[tenant_name].shar.estori.es"
          android:pathPattern="/go/.*/.*"
          />
      </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="[tenant_name]stories"
          android:host="open"/>
      </intent-filter>

In the above, [tenant_name] is the lower case variant of your tenant's name. For example, if the tenant name is "MyTenant", then [tenant_name] should be "mytenant".

The deep link can be handled by using Storyteller.openDeepLink static method which opens the link. This can be done automatically by using openDeepLink or manually using Story or Page ID (openStory and openPage respectively).

Example 1:

  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.main)

      val data: Uri? = intent?.data
      if (data != null && Storyteller.isStorytellerDeepLink(data.toString()) {
        //open link automatically
        Storyteller.openDeepLink(data.toString())
      }
  }

Note: Starting from Android 6.0+, a Digital Asset Links file is required to properly handle https deep links. It can be generated inside the Storyteller CMS and it requires you to add your app's package name and SHA-256 fingerprint of certificate the app was signed with. For more information on the Digital Asset Links file, see the Android developer documentation

To generate the Digital Asset Links file in the Storyteller CMS:

  1. Navigate to the 'Apps' section on the left-hand side
  2. Click on the 'New App' button
  3. Fill out the 'Package Name' and 'SHA 256 Cert Fingerprint'
    • Package Name - this is the application ID declared in the app's build.gradle file. This value should be the same as the "App Store Identifier" entered above. E.g. com.example.myapp.
    • SHA 256 Cert Fingerprint - this is the SHA256 fingerprint of your app's signing certificate. You can use the following command to generate the fingerprint via the Java keytool: keytool -list -v -keystore my-release-key.keystore. Or, if using the Google Play Store Signing, the SHA256 signature can be downloaded using the Google Play Console:
      • Login to the Play Console
      • Select the app you want to configure
      • Go to Setup → App integrity
      • Copy the SHA-256 value under "App signing certificate"
      • This value should be entered into your Storyteller App's form without the "SHA-256: " prefix. E.g.15:8D:E9:83:C5:73...

After saving your app, the Digital Asset Links file for your tenant can be viewed at the following URLs: https://yourtenantname.ope.nstori.es/assetlinks.json and https://yourtenantname.ope.nstori.es/.well-known/assetlinks.json

Note: the file may take up to 5 minutes to appear after saving your App.

PREVIOUS
Forward Arrow