Trying to set up branch for deep linking. In settings
for the Branch control panel the link domain is set to: get.myapp.co
. For iOS the URI Scheme is: myapp://
. Under the Associated Domains section of entitlements
I have:
applinks:get.myapp.co
applinks:get-alternate.myapp.co
I have my AppDelegate.swift
setup as described by the guide.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let branch = Branch.getInstance()
branch?.initSession(launchOptions: launchOptions) { (params, error) in
//We can handle links when an app is launched/open here
if let error = error {
print("Branch error: \(error.localizedDescription)", logType: .Error)
} else {
print("Branch params: \(params.description)")
}
}
}
Now I have a marketing ink setup in the control panel with the key: redirect
and value subscription
. When I tap on the link I output I get is:
Branch params: [AnyHashable("+clicked_branch_link"): 0, AnyHashable("+is_first_session"): 0, AnyHashable("+non_branch_link"): http://get.myapp.co/xmas-special-offer]
So +clicked_branch_link
is 0. My metadata with the key redirect
is also missing. What am I doing wrong here?
EDIT:
Note I was pasting the link from the control panel into an email and then opening it from the mail app, this doesn't work. BUT if I send the link from the control panel via sms the metadata appears and clicked_branch_link
is 1. What gives?
Spent a lot of time trying to solve the same issue. My problem was caused by opening test link while using live environment. For using test environment I had to get branch singletone like:
Branch *branch = [Branch getTestInstance];
Alex from Branch here: the +clicked_branch_link: 0
param means that the SDK is not detecting any Branch link click for that device prior to the app launching. This is why you're not getting your metadata back. The presence of +non_branch_link
in the return indicates some configuration issues, which are probably causing the failure to detect a Branch link click. Based on some of the details in your question, I think there may be some confusion around how to configure your custom domain and your URI scheme.
Without seeing the specific configuration in your dashboard, this is tough to diagnose. Could you either edit your question with more details (example links, screenshots of the dashboard, etc), or submit a ticket with the Branch integrations team for further debugging?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With