We have two iOS apps under our control. Let’s call them apps ABC and XYZ. Using the Branch.io SDK, we want to know how to:
We’ve followed the steps at https://docs.branch.io/pages/apps/ios/ to ensure the basics work. This includes the “Test deep link” section. That worked fine.
I believe I have read every single API document related to iOS and the Dashboard that Branch.io provides.
The most interesting ones to me for this quest were:
Code is here (with content changed so as to not identify which apps in the real world we're talking about since that's not important):
private class func createBranchIoLink(someIdentifier: String) {
// Create content reference
let buo = BranchUniversalObject(canonicalIdentifier: "content/\(someIdentifier)")
buo.canonicalUrl = "xyz://content/\(someIdentifier)" // example is https://example.com/content/123
buo.title = "Some Title"
buo.contentDescription = "Add it to the other app"
// Create link reference
let lp: BranchLinkProperties = BranchLinkProperties()
lp.channel = "ios"
lp.feature = "some-feature"
buo.getShortUrl(with: lp) { (url, error) in
print(url ?? "")
print(error ?? "")
print("ok done")
// when I take the url given to us here, the URL takes me back to THIS app instead of the app I want!
}
}
Any help you can offer is appreciated. Thanks!
Brian from Branch here!
You can generate links within app ABC to open app XYZ, but this also means that you will not be able to generate links that open app ABC. To achieve this flow, you would need to integrate the Branch SDK into both iOS apps, but create one app for XYZ on your Branch dashboard.
Here are some things to keep in mind:
This basically creates links that are specific to app XYZ and should open that app if the URI Scheme and Universal Links are set up properly and consistent with the Branch dashboard for app XYZ. App ABC only needs the Branch key to generate the links, and the Entitlements file or Info.plist does not need to be modified for app ABC.
I hope this helps!