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

어떤 생각을?
휴대 전화를 꽂을 때 iTunes에 표시된 긴 UID로 DeviceToken을 사용합니다. 인증서는 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 

}