标签:uilocalnotification ios8 local notification attempting to schedu 本地推送
}} with a badge number but haven‘t received permission from the user to badge the application
iOS8要实现badge、alert和sound等都需要用户同意才能进行。
先注册一下通知,弹出对话框,用户同意后,就能进行本地推送了。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//处理iOS8本地推送不能收到
float sysVersion=[[UIDevice currentDevice]systemVersion].floatValue;
if (sysVersion>=8.0) {
UIUserNotificationType type=UIUserNotificationTypeBadge | UIUserNotificationTypeAlert | UIUserNotificationTypeSound;
UIUserNotificationSettings *setting=[UIUserNotificationSettings settingsForTypes:type categories:nil];
[[UIApplication sharedApplication]registerUserNotificationSettings:setting];
}
return YES;
}解决iOS8不能正常进行本地推送问题(Attempting to schedule a local notification)
标签:uilocalnotification ios8 local notification attempting to schedu 本地推送
原文地址:http://blog.csdn.net/u011439689/article/details/43953553