Loading src/ios/AppDelegate+notification.h +2 −0 Changes for src/ios/AppDelegate+notification.h: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; - (void)applicationDidBecomeActive:(UIApplication *)application; - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler; - (id) getCommandInstance:(NSString*)className; @property (nonatomic, retain) NSDictionary *launchNotification; Loading src/ios/AppDelegate+notification.m +21 −4 Changes for src/ios/AppDelegate+notification.m: 21 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -53,12 +53,12 @@ static char launchNotificationKey; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; [pushHandler didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; [pushHandler didFailToRegisterForRemoteNotificationsWithError:error]; } Loading @@ -72,7 +72,7 @@ static char launchNotificationKey; } if (appState == UIApplicationStateActive) { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; pushHandler.notificationMessage = userInfo; pushHandler.isInline = YES; [pushHandler notificationReceived]; Loading @@ -90,7 +90,7 @@ static char launchNotificationKey; application.applicationIconBadgeNumber = 0; if (self.launchNotification) { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; pushHandler.notificationMessage = self.launchNotification; self.launchNotification = nil; Loading @@ -98,6 +98,23 @@ static char launchNotificationKey; } } - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { //register to receive notifications [application registerForRemoteNotifications]; } //For interactive notification only - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler { //handle the actions if ([identifier isEqualToString:@"declineAction"]){ } else if ([identifier isEqualToString:@"answerAction"]){ } } // The accessors use an Associative Reference since you can't define a iVar in a category // http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/Chapters/ocAssociativeReferences.html - (NSMutableArray *)launchNotification Loading Loading
src/ios/AppDelegate+notification.h +2 −0 Changes for src/ios/AppDelegate+notification.h: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; - (void)applicationDidBecomeActive:(UIApplication *)application; - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler; - (id) getCommandInstance:(NSString*)className; @property (nonatomic, retain) NSDictionary *launchNotification; Loading
src/ios/AppDelegate+notification.m +21 −4 Changes for src/ios/AppDelegate+notification.m: 21 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -53,12 +53,12 @@ static char launchNotificationKey; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; [pushHandler didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; [pushHandler didFailToRegisterForRemoteNotificationsWithError:error]; } Loading @@ -72,7 +72,7 @@ static char launchNotificationKey; } if (appState == UIApplicationStateActive) { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; pushHandler.notificationMessage = userInfo; pushHandler.isInline = YES; [pushHandler notificationReceived]; Loading @@ -90,7 +90,7 @@ static char launchNotificationKey; application.applicationIconBadgeNumber = 0; if (self.launchNotification) { PushPlugin *pushHandler = [self getCommandInstance:@"PushPlugin"]; PushPlugin *pushHandler = [self getCommandInstance:@"PushNotification"]; pushHandler.notificationMessage = self.launchNotification; self.launchNotification = nil; Loading @@ -98,6 +98,23 @@ static char launchNotificationKey; } } - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { //register to receive notifications [application registerForRemoteNotifications]; } //For interactive notification only - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler { //handle the actions if ([identifier isEqualToString:@"declineAction"]){ } else if ([identifier isEqualToString:@"answerAction"]){ } } // The accessors use an Associative Reference since you can't define a iVar in a category // http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/Chapters/ocAssociativeReferences.html - (NSMutableArray *)launchNotification Loading