Skip to content

Commit

Permalink
πŸ”¨ Refactor/#153 - Notification Data ν•„λ“œμ— title, body μΆ”κ°€
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkyeomjang committed Nov 23, 2024
1 parent 604169d commit 0d0712d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/daon/onjung/core/utility/FirebaseUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class FirebaseUtil {
private static final String JSON_BODY_KEY_NOTIFICATION = "notification";
private static final String JSON_BODY_KEY_MESSAGE = "message";
private static final String JSON_BODY_KEY_VALIDATE_ONLY = "validate_only";
private static final String TITLE_DATA = "\uD83C\uDF89 1λ§Œμ› κΈˆμ•‘ μ‹κΆŒ 당첨";
private static final String BODY_DATA = "μ§€κΈˆ λ°”λ‘œ ν΄λ¦­ν•΄μ„œ λ”°λœ»ν•œ ν•œ 끼λ₯Ό 확인해 λ³΄μ„Έμš”!";

public String createFirebaseRequestUrl() {
return UriComponentsBuilder.fromHttpUrl(GOOGLE_NOTIFICATION_URL)
Expand Down Expand Up @@ -77,10 +79,12 @@ public String createFirebaseRequestBody(
JSONObject messageBody = new JSONObject();

JSONObject notificationJson = new JSONObject();
notificationJson.put(JSON_BODY_KEY_TITLE, "\uD83C\uDF89 1λ§Œμ› κΈˆμ•‘ μ‹κΆŒ 당첨");
notificationJson.put(JSON_BODY_KEY_BODY, "μ§€κΈˆ λ°”λ‘œ ν΄λ¦­ν•΄μ„œ λ”°λœ»ν•œ ν•œ 끼λ₯Ό 확인해 λ³΄μ„Έμš”!");
notificationJson.put(JSON_BODY_KEY_TITLE, TITLE_DATA);
notificationJson.put(JSON_BODY_KEY_BODY, BODY_DATA);

JSONObject dataJson = new JSONObject();
dataJson.put("title", TITLE_DATA);
dataJson.put("body", BODY_DATA);
dataJson.put("store_name", storeName);
dataJson.put("user_name", userName);
dataJson.put("category", category);
Expand Down

0 comments on commit 0d0712d

Please sign in to comment.