public class Apns4jDemo {
private static IApnsService apnsService;
private static IApnsService getApnsService() {
if (apnsService == null) {
ApnsConfig config = new ApnsConfig();
InputStream is = Apns4jDemo.class.getClassLoader().getResourceAsStream("Certificate.p12");
config.setKeyStore(is);
config.setDevEnv(false);
config.setPassword("123123");
config.setPoolSize(3);
// 假如需要在同个java进程里给不同APP发送通知,那就需要设置为不同的name
// config.setName("welove1");
apnsService = ApnsServiceImpl.createInstance(config);
}
return apnsService;