本文整理汇总了Java中javapns.notification.AppleNotificationServer类的典型用法代码示例。如果您正苦于以下问题:Java AppleNotificationServer类的具体用法?Java AppleNotificationServer怎么用?Java AppleNotificationServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppleNotificationServer类属于javapns.notification包,在下文中一共展示了AppleNotificationServer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeConnection
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
private boolean initializeConnection() throws KeystoreException,
CommunicationException {
if (keystore != null) {
AppleNotificationServer server = new AppleNotificationServerBasicImpl(
keystore, PASSWORD, PRODUCTION);
pushManager.initializeConnection(server);
isConnected = true;
} else {
isConnected = false;
}
return isConnected;
}
开发者ID:pschuette22,项目名称:Zeppa-AppEngine,代码行数:15,代码来源:PushNotificationSender.java
示例2: initializeConnection
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
private void initializeConnection() throws KeystoreException, CommunicationException {
AppleNotificationServer server = new AppleNotificationServerBasicImpl(
keystore, password, production);
pushManager.initializeConnection(server);
isConnected = true;
}
开发者ID:googlesamples,项目名称:io2014-codelabs,代码行数:8,代码来源:Sender.java
示例3: PushNotificationTemplate
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
public PushNotificationTemplate(AppleNotificationServer appleNotificationServer) {
this.pool = new ConcurrentHolderLinkedPool<PushNotificationManager>(
new PushNotificationManagerCreator(appleNotificationServer),
Runtime.getRuntime().availableProcessors(),
Runtime.getRuntime().availableProcessors() * 4, false);
}
开发者ID:pippo1980,项目名称:upns,代码行数:8,代码来源:PushNotificationTemplate.java
示例4: APNSClient
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
public APNSClient(AppleNotificationServer appleNotificationServer) {
GenericObjectPool.Config config = new GenericObjectPool.Config();
config.testOnBorrow = true;
config.testOnReturn = true;
config.testWhileIdle = true;
config.minIdle = 1;
config.maxIdle = Runtime.getRuntime().availableProcessors();
config.maxActive = Runtime.getRuntime().availableProcessors() * 4;
this.pool = new PushNotificationManagerPool(config, appleNotificationServer);
}
开发者ID:pippo1980,项目名称:upns,代码行数:12,代码来源:APNSClient.java
示例5: initializeConnection
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
private void initializeConnection() throws KeystoreException, CommunicationException {
AppleNotificationServer server =
new AppleNotificationServerBasicImpl(keystore, password, production);
pushManager.initializeConnection(server);
isConnected = true;
}
开发者ID:GoogleCloudPlatform,项目名称:solutions-ios-push-notification-sample-backend-java,代码行数:8,代码来源:PushNotificationSender.java
示例6: pushAll4Apple
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
@Override
public void pushAll4Apple(MsgEntity msgEntity) {
//群推线程数
String pushThreads = ResourceUtil.getConfigByName("applePushAllThread");
//p12文件地址
String appleP12Path = ResourceUtil.getConfigByName("appleP12Path");
//p12文件密码
String appleP12Pwd = ResourceUtil.getConfigByName("appleP12Pwd");
//苹果推送服务器选择,true为正式服务器,false为开发者服务器
String applePushServer = ResourceUtil.getConfigByName("applePushServer");
try {
// 建立与Apple服务器连接
AppleNotificationServer server = new AppleNotificationServerBasicImpl(
appleP12Path, appleP12Pwd, Boolean.parseBoolean(applePushServer));
List<PayloadPerDevice> list = new ArrayList<PayloadPerDevice>();
// 获取要推送的tokenlist
List<AppleTokenEntity> tokenList = commonDao.loadAll(AppleTokenEntity.class);
for (AppleTokenEntity tokenEntity : tokenList) {
Gson gson = new Gson();
String msg = gson.toJson(msgEntity);
StringBuilder sb=new StringBuilder();
PushNotificationPayload payload = new PushNotificationPayload();
sb.append("{'title':").append(msgEntity.getTitle()).append(",'body':").append(msgEntity.getContent()).append("}");
payload.addBadge(0);// 图标小红圈的数值
payload.addCustomAlertBody(msgEntity.getContent());
payload.addCustomDictionary("data", msg);
// payload.addCustomDictionary("content-available", 1);
PayloadPerDevice pay = new PayloadPerDevice(payload,
tokenEntity.getToken());// 将要推送的消息和手机唯一标识绑定
list.add(pay);
}
NotificationThreads work = new NotificationThreads(server, list,
Integer.parseInt(pushThreads));//
work.setListener(DEBUGGING_PROGRESS_LISTENER);// 对线程的监听,一定要加上这个监听
work.start(); // 启动线程
work.waitForAllThreads();// 等待所有线程启动完成
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:Martin404,项目名称:jmsRestful,代码行数:43,代码来源:ActiveMQProducerServiceImpl.java
示例7: PushNotificationManagerPool
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
public PushNotificationManagerPool(
Config config, AppleNotificationServer appleNotificationServer) {
super(new PushNotificationManagerFactory(appleNotificationServer), config);
}
开发者ID:pippo1980,项目名称:upns,代码行数:5,代码来源:PushNotificationManagerPool.java
示例8: PushNotificationManagerFactory
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
private PushNotificationManagerFactory(AppleNotificationServer appleNotificationServer) {
this.appleNotificationServer = appleNotificationServer;
}
开发者ID:pippo1980,项目名称:upns,代码行数:4,代码来源:PushNotificationManagerPool.java
示例9: PushNotificationManagerCreator
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
public PushNotificationManagerCreator(AppleNotificationServer appleNotificationServer) {
this.appleNotificationServer = appleNotificationServer;
}
开发者ID:pippo1980,项目名称:upns,代码行数:4,代码来源:PushNotificationTemplate.java
示例10: getObject
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
@Override
public AppleNotificationServer getObject() throws Exception {
return new AppleNotificationServerBasicImpl(keystore.getFile(), password, type, host, port);
}
开发者ID:pippo1980,项目名称:upns,代码行数:5,代码来源:AppleNotificationServerFactoryBean.java
示例11: getObjectType
import javapns.notification.AppleNotificationServer; //导入依赖的package包/类
@Override
public Class<?> getObjectType() {
return AppleNotificationServer.class;
}
开发者ID:pippo1980,项目名称:upns,代码行数:5,代码来源:AppleNotificationServerFactoryBean.java
注:本文中的javapns.notification.AppleNotificationServer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论