iOS Testing

Test Deep Link

  • Create a deep link from the Branch Dashboard
    • Delete your app from the device
    • Compile and test on a device
    • Paste deep link in Apple Notes
    • Long press on the deep link (not 3D Touch)
    • Click Open in "APP_NAME" to open your app

Testing deferred deep linking

Deferred deep linking is simply deep linking into an app that is not yet installed. Once the app is installed, the context is preserved and the user's first app-open will have the deep link data from the original Branch link. To test this, uninstall the app from your device, click the Branch link, and manually launch the app from Xcode. You should be routed to the correct content within your app.

Enable Logging

  • Use the Branch test key instead of the live key

  • Add before initSession Initialize Branch

  • Remove before releasing to production

Branch.getInstance().setDebug()
[[Branch getInstance] setDebug];
  • Make sure OS_ACTIVITY_MODE is not disabled (link)

Test your Branch Integration

Test your Branch Integration by calling validateSDKIntegration in your AppDelegate. Check your Xcode logs to make sure all the SDK Integration tests pass. Make sure to comment out or remove validateSDKIntegration in your production build.

Branch.getInstance().validateSDKIntegration()
[[Branch getInstance] validateSDKIntegration];

Use Test Key

  • Use the Branch test key instead of the live key

  • Add before initSession Initialize Branch

  • Update branch_key in your Info.plist to a dictionary (example)

  • The test key of your app must match the test key of your deep link

  • Remove before releasing to production

Branch.setUseTestBranchKey(true)
[Branch setUseTestBranchKey:YES];

Sample Apps

Simulate an Install

  • Delete your app

  • iPhone Device -> Settings -> Privacy -> Advertising -> Reset Advertising Identifier -> Reset Identifier

  • Add Branch.setDebug(true) before initSession (Initialize Branch Features

  • Click on a deep link to navigate to your $fallback_url because your app is not installed

  • Install your app

  • Open your app

  • Read from params within initSession for +is_first_session = true

Test Deep Link Routing for Your Branch Links

Append ?bnc_validate=true to any of your app's Branch links and click it on your mobile device (not the Simulator!) to start the test. For instance, to validate a link like: "https://<yourapp\>.app.link/NdJ6nFzRbK" click on: "https://<yourapp\>.app.link/NdJ6nFzRbK?bnc_validate=true"

Updated about a month ago

iOS Testing


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.