Skip to content

Commit

Permalink
Merge pull request #173 from YogitTeam/feat/user-profile
Browse files Browse the repository at this point in the history
#98 refactor : APN 알림 json 변경
  • Loading branch information
shinhn authored Mar 24, 2023
2 parents ae7ca7f + 94081e6 commit a0abf28
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,13 @@ public ApplicationResponse<String> createBoardUserJoinAPN(CreateBoardUserJoinAPN

ApnsPayloadBuilder payloadBuilder = new ApnsPayloadBuilder();

String[] locArgs = new String[2];
locArgs[0] = dto.getJoinUserName();
locArgs[1] = dto.getBoardName();
payloadBuilder.setLocalizedAlertTitle("GATHERING_JOIN_TITLE", new String[1]);
payloadBuilder.setLocalizedAlertMessage("GATHERING_JOIN_BODY", locArgs);
payloadBuilder.setLocalizedAlertTitle("GATHERING_JOIN_TITLE", "");
payloadBuilder.setLocalizedAlertMessage("GATHERING_JOIN_BODY", dto.getJoinUserName(), dto.getBoardName());

payloadBuilder.addCustomProperty("boardId", dto.getBoardId());
payloadBuilder.addCustomProperty("pushType", PushType.JOINAPPLY.toString());
val payload = payloadBuilder.buildWithDefaultMaximumLength();

val payload = payloadBuilder.buildWithDefaultMaximumLength();
val token = TokenUtil.sanitizeTokenString(dto.getDestinationDeviceToken());
val pushNotification = new SimpleApnsPushNotification(token, APP_BUNDLE_ID, payload);
PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture = apnsClient.sendNotification(pushNotification);
Expand Down Expand Up @@ -126,16 +123,13 @@ public ApplicationResponse<String> delBoardUserJoinAPN(DelBoardUserJoinAPNReq dt

ApnsPayloadBuilder payloadBuilder = new ApnsPayloadBuilder();

String[] locArgs = new String[2];
locArgs[0] = dto.getDelUserName();
locArgs[1] = dto.getBoardName();
payloadBuilder.setLocalizedAlertTitle("GATHERING_WITHDRAW_TITLE", new String[1]);
payloadBuilder.setLocalizedAlertMessage("GATHERING_WITHDRAW_BODY", locArgs);
payloadBuilder.setLocalizedAlertTitle("GATHERING_WITHDRAW_TITLE", "");
payloadBuilder.setLocalizedAlertMessage("GATHERING_WITHDRAW_BODY", dto.getDelUserName(), dto.getBoardName());

payloadBuilder.addCustomProperty("boardId", dto.getBoardId());
payloadBuilder.addCustomProperty("pushType", PushType.DELAPPLY.toString());
val payload = payloadBuilder.buildWithDefaultMaximumLength();

val payload = payloadBuilder.buildWithDefaultMaximumLength();
val token = TokenUtil.sanitizeTokenString(dto.getDestinationDeviceToken());
val pushNotification = new SimpleApnsPushNotification(token, APP_BUNDLE_ID, payload);
PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture = apnsClient.sendNotification(pushNotification);
Expand All @@ -160,17 +154,13 @@ public ApplicationResponse<String> createClipBoardAPN(CreateClipBoardAPNReq dto)

ApnsPayloadBuilder payloadBuilder = new ApnsPayloadBuilder();

// String[] locArgs = new String[2];
// locArgs[0] = dto.getUserName();
// locArgs[1] = dto.getBoardName();
payloadBuilder.setLocalizedAlertTitle("CLIPBOARD_CHATTING_TITLE", "");
//payloadBuilder.setLocalizedAlertMessage("CLIPBOARD_CHATTING_BODY", dto.getUserName(), dto.getBoardName());
payloadBuilder.setLocalizedAlertMessage("CLIPBOARD_CHATTING_BODY", dto.getUserName());
payloadBuilder.setLocalizedAlertMessage("CLIPBOARD_CHATTING_BODY", dto.getUserName(), dto.getBoardName());

payloadBuilder.addCustomProperty("boardId", dto.getBoardId());
payloadBuilder.addCustomProperty("pushType", PushType.CREATE_CLIPBOARD.toString());
val payload = payloadBuilder.buildWithDefaultMaximumLength();

val payload = payloadBuilder.buildWithDefaultMaximumLength();
val token = TokenUtil.sanitizeTokenString(dto.getDestinationDeviceToken());
val pushNotification = new SimpleApnsPushNotification(token, APP_BUNDLE_ID, payload);
PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture = apnsClient.sendNotification(pushNotification);
Expand Down

0 comments on commit a0abf28

Please sign in to comment.