java apns ssl错误_Java服务端程序推送消息到apns报错sslexception 大家有什么解决办法吗?挺急的谢谢啦...

使用Java程序推送apns消息报错sslException?

程序代码:

import java.util.List;

import javapns.Push;

import javapns.notification.PushedNotification;

import javapns.notification.ResponsePacket;

public class Test1 {

public static void main(String[] args) {

String[] devices = {“2f48b73df95e878bd313622ffa0c7ec06d43571dcd7d658db1c355f5beb8433f”};

try {

List notifications = Push.alert(“Hello World!”,“push.p12”, “123123”, false, devices);

for (PushedNotification notification : notifications) {

if (notification.isSuccessful()) {

System.out.println("Push notification sent successfully to: " +

notification.getDevice().getToken());

} else {

String deviceToken = notification.getDevice().getToken();

System.out.println("deviceToken = " + deviceToken);

Exception theProblem = notification.getException();

theProblem.printStackTrace();

ResponsePacket theErrorResponse = notification.getResponse();

if (theErrorResponse != null) {

System.out.println(theErrorResponse.getMessage());

}

}

}

} catch (Exception e) {

e.printStackTrace();

}

}

}

29821f3cbd9a64cd4252f9deb7b24a1e.png

本文地址:https://blog.csdn.net/woshiniezepeng/article/details/107371238

希望与广大网友互动??

点此进行留言吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值