Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary*) userInfo {
- **if ([self.profileManager.profile.userId isEqualToString:[[userInfo objectForKey:@"payload"] objectForKey:@"userId"]]**) {
- if (application.applicationState == UIApplicationStateActive) {
- UIRemoteNotificationType apnsType = [application enabledRemoteNotificationTypes];
- if(apnsType != UIRemoteNotificationTypeNone) {
- if((apnsType & UIRemoteNotificationTypeAlert) != 0) {
- [self showNotificationAlert:userInfo];
- }
- if((apnsType & UIRemoteNotificationTypeBadge) != 0) {
- NSString* badge = [userInfo valueForKey:@"badge"];
- application.applicationIconBadgeNumber = [badge intValue];
- }
- }
- } else {
- NSString* event = [[userInfo objectForKey:@"payload"] objectForKey:@"event"];
- if ([event isEqualToString:@"QUESTION_ANSWERED"]) {
- [self presentYouAsked];
- } else if ([event isEqualToString:@"QUESTION_ASKED"]) {
- [self presentFriendsAsked];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement