1

使用 PushSharp 时,我不断收到此错误:

Waiting for Queue to Finish...
Failure: Apple -> Exception of type 'PushSharp.Apple.NotificationFailureException' was thrown. -> {"aps":{"alert":"Alert Text From .NET!","badge":7,"sound":"default"}}
Queue Finished, press return to exit...

有什么想法吗?当您插入手机时,
我使用iTunes 中显示的长 UID。DeviceToken根据 PushSharp Wiki 上的说明导出证书(沙盒)。

4

1 回答 1

2

您使用的不是设备令牌。设备令牌为 32 个字节(也可以表示为 64 个 HEX 字符的字符串)。您的 iOS 应用程序在注册推送通知时从 Apple 获取。

- (void)applicationDidFinishLaunching:(UIApplication *)app {

   // other setup tasks here....

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

}



// Delegation methods

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {

    const void *devTokenBytes = [devToken bytes];

    self.registered = YES;

    [self sendProviderDeviceToken:devTokenBytes]; // custom method

}
于 2013-02-12T16:39:59.613 回答