gpt4 book ai didi

java - Grails 应用程序,使用 java-apns

转载 作者:行者123 更新时间:2023-11-30 05:00:56 24 4
gpt4 key购买 nike

我有一个 grails 应用程序,并且我正在使用 java-apns 0.1.5 jar!我有一个设备 key ,它已经从中卸载了我的应用程序,所以我的问题是,我是否应该从 API 收到相同的反馈,说明设备不再启用?我的代码如下:

apnsService = APNS.newService()
.withCert(pathToCertificate, password)
.withFeedbackDestination("feedback.sandbox.push.apple.com",2196)
.withSandboxDestination()
.build();

apnsService.start();

Map<String, Date> inactiveDevices = apnsService.getInactiveDevices();
log.debug inactiveDevices

.....

我们的想法是,变量 inactiveDevices 始终为空!为什么?如果我从设备上卸载该应用程序?!我是否缺少客户端(设备)方面的一些思考?

最佳答案

如果您使用沙盒目标,反馈服务可能不会正确报告信息。这是一个已知的错误,具有已知的解决方法,检查mailing list thread

The problem comes from the "Sandbox" APNs Feedback server, probably a bug. Here is the solution if anyone has the same problem:

Create a dummy app id in the program portal, enable development push notifications on it Create and download the associated provisioning profile Create a new xcode project, and invoke the registerForRemoteNotificationTypes method on start. Install the dummy app on your device. At this point, you should have two DEVELOPMENT apps running on your device: the original app and the dummy app. Both should be registered to receive push notifications. Uninstall the original app, and try to send a push notification to that app. Invoke the feedback service, and you should receive data back.

To resume, the Sandbox Feedbacks server needs TWO DEVELOPMENT Apps registered on the SAME iPhone to work. This manipulation is not necessary for the production phase as the "Production" APNs Feedback server works fine.

我建议只切换到生产服务器测试反馈。请使用生产服务器进行测试或使用解决方法。

关于java - Grails 应用程序,使用 java-apns,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6753608/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com