我正在做这样的事情:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSApplication *application = [aNotification object];
NSRemoteNotificationType myTypes = NSRemoteNotificationTypeBadge;
[application registerForRemoteNotificationTypes:myTypes];
}
//Successful
-(void)application:(NSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
NSLog(@"device token: %@", deviceToken);
}
//Failure to register
-(void)application:(NSApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
NSLog(@"ERROR: %@\nError object: %@", [error localizedDescription], error);
}
我收到以下错误:
2014-06-14 20:47:13.656 RajamManagerStation[1878:303] ERROR: The operation couldn’t be completed. (OSStatus error 1.)
Error object: Error Domain=NSOSStatusErrorDomain Code=1 "The operation couldn’t be completed. (OSStatus error 1.)" (kCFHostErrorHostNotFound / kCFStreamErrorSOCKSSubDomainVersionCode / kCFStreamErrorSOCKS5BadResponseAddr / kCFStreamErrorDomainPOSIX / evtNotEnb / siInitSDTblErr / kUSBPending / dsBusError / kStatusIsError / kOTSerialSwOverRunErr / cdevResErr / EPERM: / Error code is the version of SOCKS which the server wishes to use / / POSIX errno; interpret using <sys/errno.h> / event not enabled at PostEvent / slot int dispatch table could not be initialized. / / bus error / / / Couldn't get a needed resource; alert / Operation not permitted)
我不明白我能做些什么来修复它。
我正在观看2011年与推送通知相关的WWDC苹果视频,其中有一张幻灯片显示:
它告诉我,如果调用错误委托回调,我应该检查我的权限配置文件的权限。
我做了我可能做的所有事情,但我仍然收到这个错误。我该怎么做才能解决它?
更新1 - 只是为了确认我已启用推送服务列表中的推送通知服务。
更新2 - 确认配置资料中存在推送通知