I started to use https://branch.io/ in an iOS app.
The problem I am facing now is: how to catch the incoming link with its parameters?
Following the documentation here.
I got to this point, having this link:
http://myapp.app.link/A1bcDEFgHi?XP=315.0,419.0
and my code being:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
Branch *branch = [Branch getInstance];
[branch initSessionWithLaunchOptions:launchOptions
andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
if (!error && params) {
NSLog(@"Here is params: %@",params.description); // I need to replace this, with code to get XP!
}
}];
return YES;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
{
BOOL handledByBranch = [[Branch getInstance] continueUserActivity:userActivity];
return handledByBranch;
}
Here is what I get in the debugging console:
2016-06-10 11:59:44.407 TheApp[1786:591391] Here is params: {
"$identity_id" = 2712491317999770034;
"$one_time_use" = 0;
"+click_timestamp" = 1465529273;
"+clicked_branch_link" = 1;
"+is_first_session" = 0;
"+match_guaranteed" = 1;
XP = "315.0,419.0";
"~creation_source" = "iOS SDK";
"~id" = 211224109823923327;
}
Now the question is, what is the code to use (inside the app) to get hold of the chunk of data: "315.0,419.0" ?