IOS8 remote push
1. Initialization
-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {... if (SYSTEM_VERSION> = 8.0) {// ios8 register and push UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes :( optional | attributes) categories: nil]; [[UIApplication sharedApplication] registerUserNotificationSettings: settings];} else {[[UIApplication sharedApplication] registerForRemoteNotificationTypes :( UIRemoteNotificationTypeBadge | uiremotenotiftypetypesound | uiremotenotiftypetypealert)];}...}
2. Push proxy
/// IOS8-(void) application :( UIApplication *) application didRegisterUserNotificationSettings :( UIUserNotificationSettings *) notificationSettings {# if! TARGET_IPHONE_SIMULATOR // register to receive comprehensions [application comprehensions]; # endif}-(void) application :( UIApplication *) application handleActionWithIdentifier :( NSString *) identifier forRemoteNotification :( NSDictionary *) userInfo completionHandler :( void (^) () completionHandler {# if! TARGET_IPHONE_SIMULATOR // process custom notification if ([identifier isEqualToString: @ "customAction1"]) {} else if ([identifier isEqualToString: @ "customAction2"]) {}# endif}-(void) application :( UIApplication *) application didFailToRegisterForRemoteNotificationsWithError :( NSError *) error {# if! TARGET_IPHONE_SIMULATORDLog (@ "Error in registration. error: % @ ", error); UIAlertView * alertView = [[UIAlertView alloc] initWithTitle: NSLocalizedString (@" Push notification registering error ", nil) message: [error localizedDescription] delegate: self cancelButtonTitle: NSLocalizedString (@ "OK", nil) otherButtonTitles: nil]; [alertView show]; [alertView release]; # endif}-(void) application :( UIApplication *) Application didReceiveRemoteNotification :( NSDictionary *) userInfo {# if! TARGET_IPHONE_SIMULATOR // process notification # endif}