Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch Deep link not opening application

I have been trying (unsuccessfully) to use Branch to implement deep linking into our iOS application. The Branch URL redirects directly to App Store and never attempts to open the application. I must be missing something.

What I've done:

  1. Included Branch SDK (CocoaPods) Added branch_key to application plist

  2. Added URL Scheme to URL Types in application plist

  3. EnabledAssociated Domains in both the project and the App ID in the developer console.

  4. Ensured that the entitlements file is included in the build.

  5. Registered deep link handler in AppDelegate

Dashboard: Settings -> Link Settings:

  1. "Always try to open app" is checked

  2. "IOS URI Scheme" is set to the application's custom URI scheme.

  3. "Enable Universal Links" is checked.

  4. Bundle Identifier & Apple App Prefix are both set correctly.

    Within the Branch Dashboard, under "Marketing" tab, I've created a single link. I'm emailing this link to myself and opening it on the device (Mail.app). Safari opens then the App Store is opened as if the application is not installed.

Neither application:openURL:sourceApplication:annotation nor application:continueUserActivity:restorationHandler are called.

AppDelegate Methods:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {     let branch: Branch = Branch.getInstance()     branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { params, error in         if (error == nil) {             // params are the deep linked params associated with the link that the user clicked -> was re-directed to this app             // params will be empty if no data found             // ... insert custom logic here ...             NSLog("params: %@", params.description)         }     })     return true }  func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool {     // pass the url to the handle deep link call          return Branch.getInstance().continueUserActivity(userActivity) }  func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {     // pass the url to the handle deep link call     Branch.getInstance().handleDeepLink(url);          // do other deep link routing for the Facebook SDK, Pinterest SDK, etc     return true } 

Am I missing a configuration step? Is this because the application is installed via Xcode debug and not through the app store? I'm expecting to see the application delegate methods called, but they are not.

like image 625
Nick Avatar asked Feb 01 '16 19:02

Nick


People also ask

How do I open an app in deep link?

Select Open deep link URL in a browser option. Click Next. For Android, select Open the deep link in your Android app. Then select your app from the dropdown, in this case the com.

What is branch deeplink?

Deferred deep links can route users to content even if the app is not installed when the link is opened. The link will first redirect to the App Store or Play Store to download the app, and then take the user to the specific “deferred” content immediately after first launch.

Can you deep link to another app?

Yes, you can link from another app into your app, and only your app needs the Branch SDK integrated.


2 Answers

It appears that the application must be installed via App Store/Test Flight/Ad Hoc or the application will not be considered installed.

I installed the application to my device using an Ad Hoc provision and everything is working.

like image 65
Nick Avatar answered Sep 22 '22 10:09

Nick


For me, the link worked even though I installed tethered without Adhoc distribution. Then one day it stopped working. That was because I clicked on the forward link to bnc inside the app.

The fix for that was easy - just long pressed the link. An option shows "Open in App". Click this and the link is handled by app. Next time onwards, link works as expected even without long press as Safari remembers this as the default behavior.

like image 37
kdeo Avatar answered Sep 22 '22 10:09

kdeo