推送。8.0的推送

if([UIDevice currentDevice].systemVersion.doubleValue<=8.0){

        

    

    

    //udidbundleid发送给苹果的apns服务器

    [application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert];

    }else{

        /**

         UIUserNotificationTypeBadge          UIUserNotificationTypeSound           UIUserNotificationTypeAlert

         */

        UIUserNotificationType type=UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert;

        UIUserNotificationSettings *set=[UIUserNotificationSettings settingsForTypes:type categories:nil ];

        [application registerUserNotificationSettings:set];

        //主动申请

        [application registerForRemoteNotifications];

    }


你可能感兴趣的:(推送。8.0的推送)