ios消息推送问题,连接的ip和duankou 是代理的。

费饭饭 发布于 2013/11/04 17:14
阅读 1K+
收藏 0
[EBUG]-[11:23:01.049] Payload:219 [Adding alert [哈哈哈哈哈]]
[EBUG]-[11:23:01.049] Payload:193 [Adding badge [1]]
[EBUG]-[11:23:01.049] Payload:205 [Adding sound [default]]
[EBUG]-[11:23:01.052] PushNotificationManager:538 [Building Raw message from deviceToken and payload]
[EBUG]-[11:23:01.052] PushNotificationManager:617 [Built raw message ID 1 of total length 108]
[EBUG]-[11:23:01.052] PushNotificationManager:396 [Attempting to send notification: {"aps":{"sound":"default","alert":"哈哈哈哈哈","badge":1}}]
[EBUG]-[11:23:01.052] PushNotificationManager:397 [  to device: 72cb925f82223a73104318bb553e10e4103034858816a7075bae790e1810d41e]
[INFO]-[11:23:01.075] PushNotificationManager:433 [Attempt failed (Unrecognized SSL message, plaintext connection?)... trying again]
[EBUG]-[11:23:01.075] ConnectionToAppleServer:149 [Creating SSLSocket to 10.241.41.6:8090]
[EBUG]-[11:23:01.109] PushNotificationManager:396 [Attempting to send notification: {"aps":{"sound":"default","alert":"哈哈哈哈哈","badge":1}}]
[EBUG]-[11:23:01.109] PushNotificationManager:397 [  to device: 72cb925f82223a73104318bb553e10e4103034858816a7075bae790e1810d41e]
[EBUG]-[11:23:01.139] UpdateChecker:56 [Checking for available updated version of Quartz...]
[INFO]-[11:23:01.146] PushNotificationManager:433 [Attempt failed (Unrecognized SSL message, plaintext connection?)... trying again]
[EBUG]-[11:23:01.146] ConnectionToAppleServer:149 [Creating SSLSocket to 10.241.41.6:8090]
[EBUG]-[11:23:01.151] PushNotificationManager:396 [Attempting to send notification: {"aps":{"sound":"default","alert":"哈哈哈哈哈","badge":1}}]
[EBUG]-[11:23:01.151] PushNotificationManager:397 [  to device: 72cb925f82223a73104318bb553e10e4103034858816a7075bae790e1810d41e]
[RROR]-[11:23:01.165] PushNotificationManager:426 [Attempt to send Notification failed and beyond the maximum number of attempts permitted]
[RROR]-[11:23:01.166] PushNotificationManager:429 [Delivery error]
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.OutputStream.write(Unknown Source)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:320)
at com.yitong.app.service.impl.InfoPush.executePush(InfoPush.java:322)
at com.yitong.app.service.impl.InfoPush.pushInfo(InfoPush.java:206)
at com.yitong.mbank.controller.pushinfo.SendRequestToPush.sendRequest(SendRequestToPush.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:311)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

[RROR]-[11:23:01.173] PushNotificationManager:450 [





源码:String certificatePath = ByteWriter.getAbsolutePathByClass()+Properties.getString("PUSH_CREDIT");// 导出的证书
String certificatePassword = Properties.getString("Credit_PW");// 此处注意导出的证书密码不能为空因为空密码会报错
System.err.println(certificatePath+";"+certificatePassword);
PushNotificationManager pushManager = new PushNotificationManager();
//AppleNotificationServer appserver = new AppleNotificationServerBasicImpl(certificatePath, certificatePassword,true);
//AppleNotificationServer appserver = new AppleNotificationServerBasicImpl(certificatePath, certificatePassword, "PKCS12",Properties.getString("Proxy_IP"),Integer.parseInt(Properties.getString("Proxy_Port")));
//AppleNotificationServer appserver = new AppleNotificationServerBasicImpl(certificatePath, certificatePassword, "PKCS12","10.241.41.6",8090);
AppleNotificationServer appserver = new AppleNotificationServerBasicImpl(certificatePath, certificatePassword,"PKCS12","gateway.push.apple.com",2195);
//AppleNotificationServer appserver = new AppleNotificationServerBasicImpl(certificatePath, certificatePassword,"PKCS12","gateway.sandbox.push.apple.com",2195);
System.err.println(appserver.getNotificationServerHost()+";"+appserver.getNotificationServerPort());
//初始化链接
        pushManager.initializeConnection(appserver);
        logger.info("apns服务器连接成功...");


PushNotificationPayload payLoad = new PushNotificationPayload();
payLoad.addAlert(content);// push的内容
payLoad.addBadge(1);// 图标小红圈的数值
payLoad.addSound("default");// 铃音
//List<PushedNotification> notifications = new ArrayList<PushedNotification>();
//pushManager.addDevice("iPhone"+i, token);
// Send Push
//Device client = pushManager.getDevice("iPhone"+i);
//pushManager.sendNotification(client, payLoad);
Device device = new BasicDevice();
        device.setToken(token);
        return pushManager.sendNotification(device, payLoad, true);



加载中
返回顶部
顶部