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<PushedNotification> 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();

}

}

}


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。