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 a separate intent filter needs to be added to the implementing app's AndroidManifest.xml.

      <intent-filter android:label="Storyteller Links">
        <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/.*/.*"
          />
        <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 in the Activity containing StorytellerRowView and by using Storyteller.openDeepLink static method which opens the link in the single story mode and does not require any row. 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) {
        //open link automatically
        storytellerRowView.openDeepLink(data.toString())
      }
  }

Example 2:

  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 from story or page id manually
          val isHttpsScheme = deepLink?.uri?.scheme == "https"
          val storyIdSegment = if (isHttpsScheme) 1 else 0
          val pageIdSegment = if (isHttpsScheme) 2 else 1
          storytellerRowView.openStory(storyIdSegment)
          //or
          storytellerRowView.openPage(pageIdSegment)
      }
  }

Example 3:

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

      val data: Uri? = intent?.data
      if (data != null) {
        //open link automatically - in the single story mode, without the need to have a row instance
        Storyteller.openDeepLink(this, data.toString())
      }
  }
PREVIOUS
Forward Arrow