无法在Mac上注册Apple推送通知服务

时间:2013-02-28 03:59:51

标签: macos cocoa push-notification apple-push-notifications

我从Apple网站下载了PushyMac示例应用程序,但无法弄清楚为什么我无法在应用程序启动时注册推送通知。这是我得到的错误

2013-02-27 19:53:49.737 PushyMac[61525:303] applicationDidFinishLaunching:
2013-02-27 19:53:49.738 PushyMac[61525:303] didFinishLaunchingWithOptions: 
    notification name NSApplicationDidFinishLaunchingNotification
2013-02-27 19:53:49.753 PushyMac[61525:303] application:didFailToRegisterForRemoteNotificationsWithError: with
error = 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)

知道为什么会这样吗?

2 个答案:

答案 0 :(得分:7)

当您的应用未正确签名代码时会发生这种情况

答案 1 :(得分:1)

我在Mac上退出并重新登录iCloud后收到了同样的错误消息。我通过转到Xcode中目标的Capabilities选项卡解决了这个问题。在iCloud下,显示了一个问题,通过按下修复按钮自动修复了该问题。