javapns 2.3 + java 1.7使用
System.setProperty("javax.net.debug", "error");
System.setProperty("https.protocols", "TLSv1.0,TLSv1.1,TLSv1.2");
List<String> tokens = new ArrayList<String>(); // tokens
String devices = "device Token";
tokens.add(devices);
try{
PushNotificationPayload payload = PushNotificationPayload.complex();
payload.addAlert("hi");
payload.addBadge(1);
payload.addSound("default");
System.out.println(payload);
PushedNotifications notice = Push.payload(payload, "p12", "password", false, tokens);
System.out.println( "fail : " + notice.getFailedNotifications() );
System.out.println( "success : " + notice.getSuccessfulNotifications() );
}catch(Exception e){
e.printStackTrace();
}
失败的消息
未传输给令牌aab38..e65ff javax.net.ssl.SSLException: 收到致命警报:protocol_version
我该如何解决?