Java APNs Open Source Library apns4j-1.0.1 released
Open Source Address: https://github.com/teaey/apns4j
Maven dependencies:
<dependency> <groupId>com.github.teaey</groupId> <artifactid>apns4j</ artifactid> <version>1.0.1</version> </dependency>
How to use: How to use
Keystorewraper KeyStore = Keystorehelper.getkeystorewraper ("Xxxxxxxx.p12", keystorepasswd); Applenotificationserver applenotificationserver = new Applenotificationserver (applegateway.env_development, KeyStore); Securityconnectionfactory connectionfactory = new Securityconnectionfactory (applenotificationserver); Securityconnection connection = Connectionfactory.getsecurityconnection (); Notifypayload notifypayload = new Notifypayload ()//notifypayload.setalert ("TEST1"); Notifypayload.setbadge (2); Notifypayload.setsound ("Default"); Notifypayload.setalertbody ("Pushed by apns4j"); Notifypayload.setalertactionlockey ("button Text"); Connection.writeandflush (devicetokenstring, notifyPayload); Connection.close ();
If you have any questions, please leave a message or contact me:
Weibo: @ cup of tea
Java APNs Open Source Library apns4j-1.0.1 released