Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch.io link for iOS not passing data post-install but does work for cold launch

I have several branch links that are meant to deeplink into my iOS app and pre-load an image into a UIImageView. They work properly when the app is installed, regardless of whether it's simply in the background or has been terminated. However, they do not work if the app is not already installed. They do properly link to the app store, but once the app is installed the parameters don't seem to flow through correctly.

I say the parameters don't SEEM to flow through, because I can't find a way to test this since I don't think there's any way to simulate a fresh app install via deeplink in Xcode. I know I can build from Xcode to my phone without the app automatically launching, then click the deeplink, but by that point the app is already installed on my phone so it defeats the purpose of the test. If anyone knows of a way to test app installs via deeplink I'd gladly take that information and run with it for a while...

Here's an example of a deep link that should load a graphic into a shirt design:

https://bnc.lt/l/5wGbOak_QW

Does anyone know of any known issues with Branch not sending data correctly post-install?

Edit: Here's what I've got in my appDelegate Branch code now. I can't prove that the url isn't getting set, but HomeViewController isn't downloading the linked image like it does for non-post-install launches. And like I mentioned before, I don't know how to simulate this situation since the Xcode simulator always installs first so I have no opportunity to simulate clicking the link pre-install.

let branch: Branch = Branch.getInstance()
    branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { params, error in
  if (error == nil) {
    if let url = params["product_picture_url"] as? String {
      let url = NSURL(string: url)!
      HomeViewController.injectedImageUrl = url
    }
  }      
})
like image 977
othomas Avatar asked Jun 27 '15 01:06

othomas


People also ask

How do I test a branch event?

Test Your Branch Integrationvalidate in your MainActivity's onStart(). Check your ADB Logcat to make sure all the SDK Integration tests pass. Make sure to comment out or remove IntegrationValidator. validate in your production build.

What is branch.io Link?

A Branch link is an actual page on the web. When users click a Branch link, they open that webpage, and we get pinged. We use matching to detect your users' device, operating system, and browser, and combine that with cookies to either remember or check whether they have the app installed.


1 Answers

Can you confirm that you're clicking the link prior to installing the app? Here's the test flow to cause the parameters to be passed through a fresh install:

  1. Uninstall the app
  2. Paste the link into Safari, then click it. If you're on a simulator, you'll see an error message as it's trying to open up the App Store which isn't installed.
  3. Run the test app from Xcode
  4. Parameters should definitely be passed into init

If that doesn't work, here are some other troubleshooting suggestions:

  1. Can you add logging to make sure that you've added initSession to the right delegate method which executes on first open. It should be in this delegate method:

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    
  2. Another common scenario is that the link could be created using the Test key, and you've got the Live key in your plist. Branch doesn't allow deep linking across from Test -> Live or visa versa. If you are unsure which key the link is associated with, you can append ?debug=true to the link (like https://bnc.lt/l/5wGbOak_QW?debug=true) after you've selected Test or Live on the dashboard to see the details. If you've selected the wrong key, it will say 'Link not found'. Otherwise, it will show the details of the links.

like image 167
Alex Austin Avatar answered Sep 24 '22 08:09

Alex Austin