我继续使用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...
有什么想法吗?
我用的是DeviceToken
当你pluging您的手机在iTunes中所示的长UID。 证书被导出(沙盒)按照指令上PushSharp维基。
你所使用的不是设备令牌。 该设备令牌是32个字节(其也可以表示为64个十六进制字符的字符串)。 iOS应用程序得到它从苹果时,它注册了推送通知。
- (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
}