2013-02-12 47 views
1

我繼續使用PushSharp時收到此錯誤: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作爲iTunes中顯示的長UID。按照PushSharp Wiki上的說明導出證書(沙盒)。

回答

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 

}