문제

I keep getting this error when using 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...

Any thoughts?
I use the DeviceToken as the long UID shown in iTunes when you pluging your phone. The certificate was exported (Sandbox) as per instruction on PushSharp Wiki.

도움이 되었습니까?

해결책

What you are using is not the device token. The device token is 32 bytes (which can also be represented as a string of 64 HEX characters). Your iOS application gets it from Apple when it registers for push notifications.

- (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

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top