• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AppleNotificationServer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Status类代码示例发布时间:2022-05-22
下一篇:
Java StarGraphTest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap