关于iOS8上本地通知接收不到的问题
在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]];
}
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。