iOS app always handle the previous deeplink

Asked on August 23, 2016 in Technical.

Steps:

1. Click deeplink from Notes app; goes to AppStore and DO NOT install it

2. Instead install the app to the device manually from Xcode

-right now im have not deployed this to production yet and still in development stage…and this is how I simulate the download from appstore and do the then deeplink scenario…correct me if theres a correct way to do it

3. Open the app and goes to the desired page

4. Close the app (should not be running from the background)

5. Then click the app icon

6. It will then perform #3

7. Then if I wait let say 10 mins, the issue goes away

 

Is this normal?

Will this not happen in production when downloading the app from appstore?

 

 

StationGo — Developer
1 Answer(s)
Answered on August 23, 2016.

Hey,

This seems to be a problem with Branch implementation. Can you share your App Delegate file ? Here are few pointers for your App Delegate file that will come in handy in this case.

Also, in case you have not already checked them out, there are two sample apps available to serve as reference models:

Check these resources out and let us know if they don’t help you achieve the results you are expecting.
Best!
Developer
Commented on August 23, 2016.

Heres my AppDelegate

 

@available(iOS 9.0, *)
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
SGLogger.logDebug("START")
if (!Branch.getInstance().handleDeepLink(url)) {
// do other deep link routing for the Facebook SDK, Pinterest SDK, etc
if (url.URLString.containsString("com.googleusercontent.apps")) {
return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as! String?, annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
}
else {
return FBSDKApplicationDelegate.sharedInstance().application(app, openURL: url, sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as! String?, annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
}
}
return true
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
[more codes here]
// configure Facebook
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
// for Google Conversion Tracking
ACTConversionReporter.reportWithConversionID("xxxx", label: "xxxx", value: "0.00", isRepeatable: false)
Branch.getInstance().accountForFacebookSDKPreventingAppLaunch()
// for deep linking using Branch
Branch.getInstance().initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { optParams, error in
if error == nil, let params = optParams {
}
else {
SGLogger.logDebug("error=\(error.description)")
}
})
return true
}
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool {
SGLogger.logDebug("userActivity=\(userActivity)")
// pass the url to the handle deep link call
Branch.getInstance().continueUserActivity(userActivity);
return true
}

StationGo — Developer
Commented on August 23, 2016.

btw ankit. I updated my question. Please check again.

 

StationGo — Developer
Commented on August 24, 2016.

Thanks for sharing the information. Looping in our integrations team to debug this further.

Developer