I have used Java APNS in the past. It has a BSD license and is great for working and was fairly easy to use after the certificates were installed. In general, it is not an easy task to configure push notifications, but usually I get useful debug output if something else doesnβt work.
The good thing is that this solution is that you can run it autonomously java -jar MyAPNSPusher and run it with some cron job or include the logic in some .war file. I also found that the library was pretty lightweight, and I think you can also find it in the maven repo.
Example from Readme.markdown
To send a notification, you can do this in two stages:
Connection setup
ApnsService service = APNS.newService() .withCert("/path/to/certificate.p12", "MyCertPassword") .withSandboxDestination() .build();
Create and send a message
String payload = APNS.newPayload().alertBody("Can't be simpler than this!").build(); String token = "fedfbcfb...."; service.push(token, payload);
[...]
Alternatives
If hosting your own server solution is too cumbersome, you can refuse the thirdparty service, which can often be good, because hosting a server with such a service running on it is probably often underestimated. Using these services, you usually pay a small amount (fractions of a percent) for a push message. The two I came across are
Besi
source share