【问题标题】:PushSharp notification errorPushSharp 通知错误
【发布时间】:2013-02-12 16:23:04
【问题描述】:

我在使用 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 上的说明导出(沙盒)。

【问题讨论】:

    标签: push-notification apple-push-notifications pushsharp


    【解决方案1】:

    您使用的不是设备令牌。设备令牌为 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
    
    }
    

    【讨论】:

      猜你喜欢
      • 2016-11-02
      • 1970-01-01
      • 2013-09-04
      • 1970-01-01
      • 2016-05-26
      • 2014-06-09
      • 1970-01-01
      • 2019-08-01
      • 1970-01-01
      相关资源
      最近更新 更多