What is in-app routing for mobile apps?

When you click a Branch deep link, and the users open or installs the app on their devices, they are taken directly to a specific content within the app. This process involves reading the Branch link inside the app and taking the user on a custom screen based on the data you receive.

 

This troubleshooting guide will help you solve the issues related to in-app routing in iOS

 

Everything about the in-app routing of the Android App is configured via the following 3 components:

1. Configuring the Branch link on the Branch dashboard.

2. Configuring iOS app's info.pList file to support Universal Links

3. Configuring iOS app's AppDelegate file to read the Branch deep link and then route the user to the content in the app.

 

Step 1: Make sure you have followed our documentation to integrate Branch SDK

 

Step 2: Branch link verification 

Please make sure that the link you are testing with belongs to your app. This can easily be verified from the link domain that is present on your Dashboard-> Link settings->Link Domain. The Branch link domain resembles like "xxxx.app.link". If you are using the custom domain, please make sure it configured correctly as in the documentation here

 

Step 3: Configuring Branch link

This step is to configure the Branch link from the dashboard to add the relevant data which is required by the app. When you generate a Branch link, you need to add the custom deep link data which will be understood by your app. For e.g you can add the following: 


key
value
nav_here

content/123


You can get more examples of what you use as custom data in the Branch deep links in our documentation here.


Step 4: Setting up in-app routing:

  • Make sure you are reading the link data in the AppDelegate didFinishLaunchingWithOptions method only. The didFinishLaunchingWithOptions method ensures the SDK has enough resources to initialize in the app after it is launched. This is a mandatory step.

  • Once you read the link data, you can use it to navigate to a ViewController.


You need to get the Branch deep link data parameters and consume them for redirection. The code snippet for reading the Branch link is:


Branch.getInstance().initSession(launchOptions: launchOptions) { params , error in
    // Option 4: navigate to view controller
  guard let options = data["nav_to"] as? String else { return }
  switch options {
      case "landing_page": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
      case "tutorial": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
      case "content": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
      default: break
  }
}



Step 5: Advanced in-app routing(for advanced use-cases)

If you are using the $ios_deeplink_path or $deeplink_path Branch link property, you would require setting a scheme to route automatically to the ViewController. 


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.