Giúp mình với, nếu push noti bằng device_token thì dùng pushy vs apns đc chứ dùng voip mình không biết
final ApnsClient apnsClient = new ApnsClientBuilder()
.setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST)
.setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File("api/src/main/resources/AuthKey_5727GXT3KS.p8"),
"44DD9W49GS", "5727GXT3KS"))
.build();
Gson gson = new Gson();
PushData pushData = new PushData();
pushData.setAppointmentCode("A0000455");
pushData.setAppointmentId(455);
pushData.setAppointmentStatus("WAITING_EXAMINATION");
pushData.setPatientId(403);
pushData.setProviderId(161);
final SimpleApnsPushNotification pushNotification;
final ApnsPayloadBuilder payloadBuilder = new SimpleApnsPayloadBuilder();
payloadBuilder.addCustomProperty("callerName", "Doctor4U");
payloadBuilder.addCustomProperty("handle", "[email protected]");
payloadBuilder.addCustomProperty("uuid", "8.3.0");
payloadBuilder.addCustomProperty("extraPayLoad", gson.toJson(pushData));
final String payload = payloadBuilder.build();
final String token = TokenUtil.sanitizeTokenString("<70e5e4a03891a6035dd0911c99549ccb687ca601056bf103a8f24745b46486d0>");
String token2 = "70e5e4a03891a6035dd0911c99549ccb687ca601056bf103a8f24745b46486d0";
pushNotification = new SimpleApnsPushNotification(token2, "com.doctor4u.doctor.voip", payload, null, );
System.out.println( pushNotification.getToken());
apnsClient.sendNotification(pushNotification);