我在iPhone 5上安装推送通知时遇到了错误,iOS版本为8:
2015-04-29 00:23:14.688 pushNotificationTest[192:6284] 注册远程通知失败 2015-04-29 00:23:14.698 pushNotificationTest[192:6284] 错误域=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x15e89820 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}, 应用程序中找不到有效的“aps-environment”授权字符串,调试器消息:发送k数据包失败
我使用这个链接来实现它
http://code.tutsplus.com/tutorials/setting-up-push-notifications-on-ios--cms-21925
我已经尝试了这个链接上不同人提供的解决方法:
我正在使用以下代码进行注册:
UIUserNotificationSettings *settings=[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];