안드로이드 Braze Setting 푸시 알림
적용해 볼까?
Standard Push Notification Integration for Android
A push notification is an out-of-app alert that appears on the user’s screen when an important update occurs. Push notifications are a valuable way to provide your users with time-sensitive and relevant content or to re-engage them with your app. To get
www.braze.com
이제 푸시 수신 및 표시 할 차례이다.
1. Braze Firebase 메시징 서비스 등록
여기서도 두가지 방법이 있다.
1) 자체 Firebase 메시징 서비스 사용
- 녹색 글씨엔 현재 프로젝트에서 FirebaseMessagingService를 상속받은 클래스명을 넣어야한다.
val brazeConfig = BrazeConfig.Builder()
.setFallbackFirebaseMessagingServiceEnabled(true)
.setFallbackFirebaseMessagingServiceClasspath("com.company.OurFirebaseMessagingService")
.build()
Braze.configure(this, brazeConfig)
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage?) {
super.onMessageReceived(remoteMessage)
if (BrazeFirebaseMessagingService.handleBrazeRemoteMessage(this, remoteMessage)) {
// This Remote Message originated from Braze and a push notification was displayed.
// No further action is needed.
} else {
// This Remote Message did not originate from Braze.
// No action was taken and you can safely pass this Remote Message to other handlers.
}
}
}
2) 최초 Firebase 메시징 서비스 사용
<service android:name="com.braze.push.BrazeFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
2. 알림 채널도 지원
Braze Android SDK는 Android 알림 채널을 지원합니다. . Braze 알림에 알림 채널의 ID가 포함되어 있지 않거나 Braze 알림에 잘못된 채널 ID가 포함되어 있는 경우 Braze는 SDK에 정의된 기본 알림 채널을 사용하여 알림을 표시합니다. Braze 사용자는 플랫폼 내의 Android 알림 채널을 사용하여 알림을 그룹화합니다.
기본 Braze 알림 채널의 사용자 대상 이름을 설정하려면 다음을 사용하세요.BrazeConfig.setDefaultNotificationChannelName() .
기본 Braze 알림 채널에 대한 사용자 대상 설명을 설정하려면 다음을 사용하세요.BrazeConfig.setDefaultNotificationChannelDescription() .
Android 푸시 개체 매개변수가 있는 모든 API 캠페인이 해당 필드를 포함하도록 업데이트되었는지 확인해야 합니다 notification_channel. 이 필드가 지정되지 않으면 Braze는 대시보드 대체 채널 ID와 함께 알림 페이로드를 보냅니다.
따로 채널을 설정하지 않으면 앱의 기본 defalt 알림 채널을 사용하게 된다.