- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { NSDictionary *dic = [NSDictionary dictionaryWithObject:notification forKey:@"notification"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"onLocalNotification" object:self userInfo:dic]; }
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo { [[NSNotificationCenter defaultCenter] postNotificationName:@"onPushNotification" object:self userInfo:userInfo]; }
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { NSDictionary *dic = [NSDictionary dictionaryWithObject:[deviceToken description] forKey:@"token"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"onPushRegistration" object:self userInfo:dic]; }
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { NSDictionary *dic = [NSDictionary dictionaryWithObject:error forKey:@"error"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"onPushRegistrationError" object:self userInfo:dic]; }