我正在使用 Java PNS 发送通知。但是,我收到以下错误:
javapns.devices.exceptions.InvalidDeviceTokenFormatException: Device Token has a length of [140] and not the required 64 bytes!eror has occusred:Device Token has a length of [140] and not the required 64 bytes!
at javapns.devices.implementations.basic.BasicDevice.validateTokenFormat(BasicDevice.java:67)
at javapns.devices.implementations.basic.BasicDevice.<init>(BasicDevice.java:49)
at javapns.devices.implementations.basic.BasicDevice.<init>(BasicDevice.java:37)
这就是我创建设备列表的方式:
List<Device> newList = new ArrayList<Device>();
Iterator<String> tempItr = v.iterator();
while (tempItr.hasNext()) {
String myDeviceToken = (String) (vItr.next());
try {
BasicDevice device = new BasicDevice(myDeviceToken);
newList.add(device);
} catch (Exception e) { // error=2; // notification issue
System.out.println("eror has occusred:" + e.getMessage());
e.printStackTrace();
}
}
为什么它给出无效令牌格式的任何线索: