iOS push新的调用方法
// IOS8 新系统需要使用新的代码
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
//这里还是原来的代码
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
让明天,不后悔今天的所作所为
posted on 2015-09-16 17:12 Sinner_Yun 阅读(298) 评论(0) 收藏 举报
浙公网安备 33010602011771号