Skip to content

Commit

Permalink
release: 0.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Feb 16, 2024
1 parent c33c936 commit ae5bc0e
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/main/java/net/teumteum/alert/infra/FcmAlertPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
import com.google.firebase.ErrorCode;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.messaging.AndroidConfig;
import com.google.firebase.messaging.AndroidNotification;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.Message;
import com.google.firebase.messaging.Notification;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.util.Map;
Expand Down Expand Up @@ -42,7 +39,6 @@ public void publish(String token, Alert alert, Map<String, String> data) {
private Message buildMessage(String token, Alert alert, Map<String, String> data) {
return Message.builder()
.setToken(token)
.setAndroidConfig(buildAndroidConfig(alert))
.putData("title", alert.getTitle())
.putData("body", alert.getBody())
.putData("publishedAt", alert.getCreatedAt().toString())
Expand Down Expand Up @@ -71,23 +67,6 @@ private void publishWithRetry(int currentRetryCount, Message message, @Nullable
}
}

private Notification buildNotification(Alert alert) {
return Notification.builder()
.setTitle(alert.getTitle())
.setBody(alert.getBody())
.build();
}

private AndroidConfig buildAndroidConfig(Alert alert) {
return AndroidConfig.builder()
.setNotification(AndroidNotification.builder()
.setTitle(alert.getTitle())
.setBody(alert.getBody())
.setClickAction("push_click")
.build())
.build();
}

@PostConstruct
private void fcmCredential() {
try {
Expand Down

0 comments on commit ae5bc0e

Please sign in to comment.