我需要使用服务器的控制面板发送推送通知。服务器端APN推送代理后的通知
服务器是位于代理之后的Linux虚拟云框。控制面板使用专门J2EE和Tomcat
我使用的基于JAVA的https://github.com/notnoop/java-apns/releases API推送
代码
ApnsService service = APNS.newService().withSandboxDestination().withCert("mycert.p12", "mypassword").build();
String messageTobeSent = APNS.newPayload()
.alertBody("Message with badge 2")
.badge(2)
.alertTitle("Message with badge 2")
.sound("ding.wav")
.build();
service.push("d81f0080ed7bf05ac96261dc1805fbf00230073f606f1388a644469b1893446f", messageTobeSent, new Date());
我得到一个错误无法连接到服务器APNS,我的问题是
- 这是因为代理?
- APNs是否与代理一起使用?
- 此库能够或连接代理后面吗?
哦!这很简单,现在正在工作,谢谢! – Dickens
没有道具,很高兴这是有帮助的 –