通过移动优先平台发送 Apple 推送通知时出现无效的十六进制字符错误

Getting Invalid hex character error while sending Apple push notification via Mobile First Platform

我正在尝试通过 Mobile First Server 发送 Apple 推送通知。三个月前我做了那个设置,一切正常。我在 4-5 天前开始遇到问题 java.lang.RuntimeException: Invalid hex character: y 每当我尝试调用推送通知时。 服务器日志如下。

000004ed com.ibm.pushworks.server.notification.Mediator               E FPWSE1081E: Failed sending notification. Please refer to the server log file for more details.
java.lang.RuntimeException: Invalid hex character: y
    at com.notnoop.apns.internal.Utilities.charval(Utilities.java:132)
    at com.notnoop.apns.internal.Utilities.decodeHex(Utilities.java:119)
    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:85)
    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:36)
    at com.ibm.pushworks.server.notification.apns.ApplicationConnection.sendNotification(ApplicationConnection.java:141)
    at com.ibm.pushworks.server.notification.apns.APNSMediator.sendNotification(APNSMediator.java:106)
    at com.ibm.pushworks.server.notification.Mediator.run(Mediator.java:89)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
    at java.util.concurrent.FutureTask.run(FutureTask.java:274)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
    at java.lang.Thread.run(Thread.java:809)

请提出一些建议来消除这个错误。

如果您使用的令牌包含无效的十六进制字符,则可能会发生此问题。

检查您是否传递了有效的 APNS 令牌。

使用以下 REST API: http://www.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.apiref.doc/apiref/r_restapi_push_device_registration_get.html

检查您订阅的 APNS 令牌。如果 APNS 令牌正确,请验证您是否可以使用 REST APIs.

发送推送通知

我们在 7.0 版中遇到了同样的问题。出于某种原因,PUSH_DEVICES table 中存在无效标记,其字符串为“32bytes”

我们删除了那个寄存器和 PUSH_NOTIFICATIONS table 中相关的寄存器,之后一切正常。