首页 > 移动平台 > 详细

关于iOS8上本地通知接收不到的问题

时间:2014-11-07 16:42:46      阅读:360      评论:0      收藏:0      [点我收藏+]

在iOS8系统开发使用本地通知时,会出现如下的相关提示语:

1 Attempting to schedule a local notification
2 with an alert but haven‘t received permission from the user to display alerts
3 with a sound but haven‘t received permission from the user to play sounds

……

原因在于在iOS8系统上需要注册本地通知,这样才能正常使用

 

// iOS8注册本地通知

if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)])

{

    [application registerUserNotificationSettings:[UIUserNotificationSettingssettingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSoundcategories:nil]];

}

 

关于iOS8上本地通知接收不到的问题

原文:http://www.cnblogs.com/shuozi-love/p/4081488.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!