From eb077e7bd79519d1ee12806b042aa9c60a1a7513 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 18 Apr 2014 21:31:51 +0200 Subject: [PATCH] ignore unsollicited push notif (2nd fix) --- Classes/LinphoneAppDelegate.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 8cded5e36..bbcaf0a1d 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -208,7 +208,12 @@ } - (void)processRemoteNotification:(NSDictionary*)userInfo{ + if ([LinphoneManager instance].pushNotificationToken==Nil){ + [LinphoneLogger log:LinphoneLoggerLog format:@"Ignoring push notification we did not subscribed."]; + } + NSDictionary *aps = [userInfo objectForKey:@"aps"]; + if(aps != nil) { NSDictionary *alert = [aps objectForKey:@"alert"]; if(alert != nil) { @@ -241,9 +246,7 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification: Receive %@", userInfo]; - if ([LinphoneManager instance].pushNotificationToken==Nil){ - [LinphoneLogger log:LinphoneLoggerLog format:@"Ignoring push notification we did not subscribed."]; - } + [self processRemoteNotification:userInfo]; }