通知iOS 13+和JavaPNS-无效令牌

问题描述

我使用JavaPNS(2.2)发送通知。 现在,在iOS 13.x上,我遇到了问题。

这是我的(新)代码,用于将设备注册到服务器:

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDevicetoken:(NSData *)devicetoken {
    
    Nsstring *tokenNotification = nil;
    NSUInteger length = devicetoken.length;
    if(length > 0) {
        const unsigned char *buffer = devicetoken.bytes;
        NSMutableString *hexString = [NSMutableString stringWithCapacity:(length * 2)];
        for(int i=0; i<length; ++i) {
            [hexString appendFormat:@"%02x",buffer[i]];
        }
        
        tokenNotification = hexString;
    }

...
...
...

}

tokenNotification具有与devicetoken.debugDescription相同的值。

当我尝试使用JavaPNS发送通知时,返回错误:“ 无效令牌”。 我仅在iOS 13+上有此问题。 我的设备具有iOS 13.7。 在iOS最高为12的iOS上,使用devicetoken作为注册值(不带“

你能帮我吗?

解决方法

好,解决了! 这只是一个证书问题。 :)