teaey / apns4j Goto Github PK
View Code? Open in Web Editor NEWApple Push Notification Service Implement with Java(java apns)
Home Page: https://github.com/teaey/apns4j
License: Apache License 2.0
Apple Push Notification Service Implement with Java(java apns)
Home Page: https://github.com/teaey/apns4j
License: Apache License 2.0
"content-available" 1
Java端发送消息后,没有报错,但是手机始终是收不到:
我的代码如下:
ApnsChannelFactory apnsChannelFactory = Apns4j.newChannelFactoryBuilder()
.keyStoreMeta(certPath)
.keyStorePwd("Rj1234567890")
.keyStoreType(KeyStoreType.PKCS12)
.apnsGateway(ApnsGateway.PRODUCTION)
.build();
//Setp 2
ApnsChannel apnsChannel = apnsChannelFactory.newChannel();
//Step 3 create & init notify payload
ApnsPayload apnsPayload = Apns4j.newPayload()
.alertTitle("Up Task消息")
.alertBody(message)
.sound("default");
//Step 4 send via channel
apnsChannel.send(token.getApnsToken().replace("<", "").replace(" ", "").replace(">", ""), apnsPayload);
//Step 5 in the end, apnsChannel can be Recycle and Reuse
apnsChannel.close();
log.debug("sendApnsMessage end");
How do I push it to multiple G
apns4j not print log self but throw exception
使用Object,没法发现传入错误对象
cn.teaey.apns4j.ApnsException: java.net.SocketException: Socket is closed
at cn.teaey.apns4j.network.ApnsChannel.recv(ApnsChannel.java:296) ~[apns4j.jar:na]
at cn.teaey.apns4j.network.ApnsChannel.recvErrorResp(ApnsChannel.java:194) ~[apns4j.jar:na]
KeyStoreWraper
My account was compromised, as a result many spam issues got created across multiple repos. I am deleting all such issues. Please check my tweet: https://x.com/arghyac35/status/1729721954909684064?s=20
弱弱的问一下,证书文件怎么生成?
在ApnsChannel类中_detectSocket启动的线程由于close方法关闭不到位检测不到关闭信号,导致该线程运行时长超出预期,错误的又把payloadCache缓存的消息再次发送,从而导致了消息的重复发送。
目前测试默认情况下大约2小时,消息会重发。
_detectSocket方法检测不到ApnsChannel.this.closed。该线程不停的跑。跑久了会出事。
deviceTokenString传入UDID,提示'
Exception in thread "main" cn.teaey.apns4j.protocol.InvalidDeviceTokenException: device token bytes must [32] length not [20]
at cn.teaey.apns4j.ApnsHelper.checkDeviceToken(ApnsHelper.java:107)
at cn.teaey.apns4j.network.ApnsChannel.send(ApnsChannel.java:121)
at cn.teaey.apns4j.network.ApnsChannel.send(ApnsChannel.java:155)
at cn.teaey.apns4j.network.ApnsChannel.send(ApnsChannel.java:179)
at com.stylefeng.guns.rest.modular.push.service.impl.Push.main(Push.java:30)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.