Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)initBranchAndHandleLinksWithOptions:(NSDictionary *)launchOptions
- {
- Branch *branch = [Branch getInstance];
- [branch setDebug];
- [branch accountForFacebookSDKPreventingAppLaunch];
- [branch initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
- NSLog(@"deep link data: %@", [params description]);
- NSURL *url = [NSURL URLWithString:params[@"$deeplink_path"]];
- if ([params[@"~channel"] isEqualToString:@"donation"]) {
- NSDictionary *params = [URLParser parse:url];
- if ([params[@"commandName"] isEqualToString:@"donation"]) {
- Debug(@"External donnation command sent");
- ExternalDonationCommand *command = [[ExternalDonationCommand alloc] initWithComandParameters:params];
- [command execute];
- return;
- }
- return ;
- }
- if (params[@"referral"]) {
- if (![[SharedPersistentStore objectForKey:isNotFirstInstall] boolValue]) {
- ExternalReferralCommand *command = [[ExternalReferralCommand alloc] initWithComandParameters:params];
- [command execute];
- }
- if ([params[@"~feature"] isEqualToString:@"share_profile"]) {
- if ([params[@"source"] isEqualToString:@"1"]) {
- ExternalCharityProfileCommand *command = [[ExternalCharityProfileCommand alloc] initWithComandParameters:params];
- [command execute];
- } else if ([params[@"source"] isEqualToString:@"2"]) {
- ExternalCauseProfileCommand *command = [[ExternalCauseProfileCommand alloc] initWithComandParameters:params];
- [command execute];
- } else {
- return;
- }
- } else if ([params[@"~feature"] isEqualToString:@"share_post"]) {
- ExternalPostDetailsCommand *command = [[ExternalPostDetailsCommand alloc] initWithComandParameters:params];
- [command execute];
- } else {
- }
- }
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement