Skip to content

Commit

Permalink
Android Notification Push 추가 (#434)
Browse files Browse the repository at this point in the history
set android notification push
  • Loading branch information
sanggggg authored Nov 24, 2024
1 parent 9bd7e27 commit 3b56737
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.google.auth.oauth2.GoogleCredentials
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.ApnsConfig
import com.google.firebase.messaging.Aps
import com.google.firebase.messaging.ApsAlert
Expand All @@ -20,7 +21,7 @@ import java.util.UUID
@Component
class PushSender(
properties: PushSenderProperties,
): PushSender {
) : PushSender {
private val logger = KotlinLogging.logger { }
private val messaging by lazy {
val firebaseApp = FirebaseApp.initializeApp(
Expand Down Expand Up @@ -73,6 +74,12 @@ class PushSender(
): AndroidConfig {
return AndroidConfig.builder().apply {
notification.collapseKey?.let { setCollapseKey(it) }
setNotification(
AndroidNotification.builder()
.setBody(notification.body)
.setTitle(notification.title)
.build()
)
putAllData(customData)
notification.link?.let { putData(DEEPLINK_CUSTOM_DATA_KEY, it) }
setPriority(AndroidConfig.Priority.HIGH)
Expand Down

0 comments on commit 3b56737

Please sign in to comment.