Last active
October 10, 2018 21:04
-
-
Save flurrydev/3ec905de3d11fd523b1e260cb7edf9bd to your computer and use it in GitHub Desktop.
Deep link option 1: Using AppDelegate callbacks (Obj-C)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler API_AVAILABLE(ios(10.0)){ | |
if ([FlurryMessaging isFlurryMsg:response.notification.request.content.userInfo]) { | |
[FlurryMessaging receivedNotificationResponse:response withCompletionHandler:^{ | |
completionHandler(); | |
// ... add your handling here, assume having a key named article | |
NSDictionary *userInfo = response.notification.request.content.userInfo; | |
// appData here contains all the keyvalue information decalred by user in flurry protal | |
NSDictionary *appData = userInfo[@"appData"]; | |
if ([appData objectForKey:@"article"]) { | |
NSString *article = appData[@"article"]; | |
NSLog(@"%@", article); | |
} else { | |
NSLog(@"no such key"); | |
} | |
// if user enter a deeplink | |
if ([appData objectForKey:@"deeplink"]) { | |
NSString *link = appData[@"deeplink"]; | |
NSLog(@"%@", link); | |
// open link code here | |
} else { | |
NSLog(@"no deeplink entered"); | |
} | |
}]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment