푸시 알림
푸시 알림을 사용하면 중요한 이벤트가 발생할 때 앱에서 알림을 보낼 수 있습니다. 전달할 새 인스턴트 메시지, 송출할 뉴스 속보 알림 또는 오프라인으로 시청할 수 있도록 다운로드할 준비가 된 사용자가 좋아하는 TV 프로그램의 최신 에피소드가 있을 때 푸시 알림을 전송할 수 있습니다. 또한 애플리케이션이 필요할 때만 실행되므로 백그라운드 가져오기보다 더 효율적입니다.
Prerequisites
이 기능을 사용하려면 먼저 Android Braze SDK를 통합해야 합니다.
기본 제공 기능
Braze 소프트웨어 개발 키트에는 다음 기능이 구축되어 있습니다. 다른 푸시 알림 기능을 사용하려면 앱에 푸시 알림을 설정해야 합니다.
| Feature | 설명 |
|---|---|
| 푸시 스토리 | Android 푸시 스토리는 기본값으로 Braze Android 소프트웨어 개발 키트에 구축되어 있습니다. 자세히 알아보려면 푸시 스토리를 참조하세요. |
| 푸시 프라이머 | 푸시 프라이머 캠페인은 사용자가 기기에서 앱에 대한 푸시 알림을 활성화할 것을 권장합니다. 노코드 푸시 프라이머를 사용하면 SDK 사용자 지정 없이도 이 작업을 수행할 수 있습니다. |
푸시 알림 수명 주기 정보
다음 순서도는 권한 프롬프트, 토큰 생성 및 메시지 전달과 같은 푸시 알림 수명 주기를 Braze가 처리하는 방법을 보여줍니다.
---
config:
theme: neutral
---
flowchart TD
%% Permission flow
subgraph Permission[Push Permissions]
B{Android version of the device?}
B -->|Android 13+| C["requestPushPermissionPrompt() called"]
B -->|Android 12 and earlier| D[No permissions required]
%% Connect Android 12 path to Braze state
D --> H3[Braze: user subscription state]
H3 --> J3[Defaults to 'subscribed' when user profile created]
C --> E{Did the user grant push permission?}
E -->|Yes| F[POST_NOTIFICATIONS permission granted]
E -->|No| G[POST_NOTIFICATIONS permission denied]
%% Braze subscription state updates
F --> H1[Braze: user subscription state]
G --> H2[Braze: user subscription state]
H1 --> I1{Automatically opt in after permission granted?}
I1 -->|true| J1[Set to 'opted-in']
I1 -->|false| J2[Remains 'subscribed']
H2 --> K1[Remains 'subscribed'<br/>or 'unsubscribed']
%% Subscription state legend
subgraph BrazeStates[Braze subscription states]
L1['Subscribed' - default state<br/>when user profile created]
L2['Opted-in' - user explicitly<br/>wants push notifications]
L3['Unsubscribed' - user explicitly<br/>opted out of push]
end
%% Note about user-level states
note1[Note: These states are user-level<br/>and apply across all devices for the user]
%% Connect states to legend
J1 -.-> L2
J2 -.-> L1
J3 -.-> L1
K1 -.-> L3
note1 -.-> BrazeStates
end
%% Styling
classDef permissionClass fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
classDef tokenClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
classDef sdkClass fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef configClass fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef displayClass fill:#ffebee,stroke:#c62828,stroke-width:2px
classDef deliveryClass fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef brazeClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
class A,B,C,E,F,G permissionClass
class H,I tokenClass
class J,K sdkClass
class N,O,P configClass
class R,S,S1,T,U,V displayClass
class W,X,X1,X2,Y,Z deliveryClass
class H1,H2,H3,I1,J1,J2,J3,K1,L1,L2,L3,note1 brazeClass
---
config:
theme: neutral
---
flowchart TD
%% Token generation flow
subgraph Token[Token Generation]
H["Braze SDK initialized"] --> Q{Is FCM auto-registration enabled?}
Q -->|Yes| L{Is required configuration present?}
Q -->|No| M[No FCM token generated]
L -->|Yes| I[Generate FCM token]
L -->|No| M
I --> K[Register token with Braze]
%% Configuration requirements
subgraph Config[Required configuration]
N['google-services.json' file is present]
O['com.google.firebase:firebase-messaging' in gradle]
P['com.google.gms.google-services' plugin in gradle]
end
%% Connect config to check
N -.-> L
O -.-> L
P -.-> L
end
%% Styling
classDef permissionClass fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
classDef tokenClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
classDef sdkClass fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef configClass fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef displayClass fill:#ffebee,stroke:#c62828,stroke-width:2px
classDef deliveryClass fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef brazeClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
class A,B,C,E,F,G permissionClass
class H,I tokenClass
class J,K sdkClass
class N,O,P configClass
class R,S,S1,T,U,V displayClass
class W,X,X1,X2,Y,Z deliveryClass
class H1,H2,H3,I1,J1,J2,J3,K1,L1,L2,L3,note1 brazeClass
---
config:
theme: neutral
fontSize: 10
---
flowchart TD
subgraph Display[Push Display]
%% Push delivery flow
W[Push sent to FCM servers] --> X{Did FCM receive push?}
X -->|App is terminated| Y[FCM cannot deliver push to the app]
X -->|Delivery conditions met| X1[App receives push from FCM]
X1 --> X2[Braze SDK receives push]
X2 --> R[Push type?]
%% Push Display Flow
R -->|Standard push| S{Is push permission required?}
R -->|Silent push| T[Braze SDK processes silent push]
S -->|Yes| S1{Did the user grant push permission?}
S -->|No| V[Notification is shown to the user]
S1 -->|Yes| V
S1 -->|No| U[Notification is not shown to the user]
end
%% Styling
classDef permissionClass fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
classDef tokenClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
classDef sdkClass fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef configClass fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef displayClass fill:#ffebee,stroke:#c62828,stroke-width:2px
classDef deliveryClass fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef brazeClass fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
class A,B,C,E,F,G permissionClass
class H,I tokenClass
class J,K sdkClass
class N,O,P configClass
class R,S,S1,T,U,V displayClass
class W,X,X1,X2,Y,Z deliveryClass
class H1,H2,H3,I1,J1,J2,J3,K1,L1,L2,L3,note1 brazeClass
푸시 알림 설정하기
FCM을 사용하는 샘플 앱과 Braze Android 소프트웨어 개발 키트를 확인하려면 Braze를 참조하세요: Firebase 푸시 샘플 앱.
Rate limits
Firebase 클라우드 메시징(FCM) API의 기본 사용량 제한은 분당 600,000건의 요청입니다. 이 제한에 도달하면 Braze는 몇 분 후에 자동으로 다시 시도합니다. 증액을 요청하려면 Firebase 지원팀에 문의하세요.
1단계: 프로젝트에 Firebase 추가
먼저, Android 프로젝트에 Firebase를 추가합니다. 단계별 지침은 Google의 Firebase 설정 가이드를 참조하세요.
2단계: 종속성에 클라우드 메시징 추가
다음으로 프로젝트 종속성에 클라우드 메시징 라이브러리를 추가합니다. Android 프로젝트에서 build.gradle 을 열고 dependencies 블록에 다음 줄을 추가합니다.
1
implementation "google.firebase:firebase-messaging:+"
종속성은 다음과 비슷합니다.
1
2
3
4
dependencies {
implementation project(':android-sdk-ui')
implementation "com.google.firebase:firebase-messaging:+"
}
3단계: Firebase 클라우드 메시징 API 활성화
Google Cloud에서 Android 앱이 사용 중인 프로젝트를 선택한 다음, Firebase 클라우드 메시징 API를 활성화합니다.

4단계: 서비스 계정 만들기
다음으로 Braze가 FCM 토큰을 등록할 때 승인된 API 호출을 할 수 있도록 새 서비스 계정을 생성합니다. Google Cloud에서 서비스 계정으로 이동한 다음 프로젝트를 선택합니다. 서비스 계정 페이지에서 서비스 계정 생성을 선택합니다.

서비스 계정 이름, ID, 설명을 입력한 다음, 생성 후 계속을 선택합니다.

역할 필드의 역할 목록에서 Firebase Cloud 메시징 API 관리자를 찾아 선택합니다. 보다 제한적인 액세스를 원하면 cloudmessaging.messages.create 권한으로 커스텀 역할을 생성한 다음, 목록에서 해당 역할을 선택합니다. 완료했으면 완료를 선택합니다.
Firebase 클라우드 메시징 관리자가 아닌 Firebase 클라우드 메시징 API 관리자를 선택해야 합니다.

5단계: JSON 자격 증명 생성하기
다음으로 FCM 서비스 계정에 대한 JSON 자격 증명을 생성합니다. Google Cloud IAM 및 관리자에서 서비스 계정으로 이동한 다음, 프로젝트를 선택합니다. 이전에 만든 FCM 서비스 계정을 찾은 다음, 작업 > 키 관리를 선택합니다.

키 추가 > 새 키 생성을 선택합니다.

JSON을 선택한 다음, 생성을 선택합니다. FCM 프로젝트 ID 이외의 Google Cloud 프로젝트 ID를 사용하여 서비스 계정을 생성한 경우, JSON 파일에서 project_id에 할당된 값을 수동으로 업데이트해야 합니다.
키를 다운로드한 위치를 기억해야 합니다. 다음 단계에 필요합니다.

비공개 키는 손상될 경우 보안 위험을 초래할 수 있습니다. 지금은 JSON 자격 증명을 보안 위치에 보관하고, Braze에 업로드한 후에 키를 삭제합니다.
6단계: Braze에 JSON 자격 증명 업로드하기
다음으로, Braze 대시보드에 JSON 자격 증명을 업로드합니다. Braze에서 설정 > 앱 설정을 선택합니다.

Android 앱의 푸시 알림 설정에서 Firebase를 선택한 다음, JSON 파일 업로드를 선택하고 앞서 생성한 자격 증명을 업로드합니다. 완료했으면 저장을 선택합니다.

비공개 키는 손상될 경우 보안 위험을 초래할 수 있습니다. 키가 Braze에 업로드되었으므로 이전에 생성한 파일을 삭제합니다.
7단계: 자동 토큰 등록 설정
사용자 중 한 명이 푸시 알림을 옵트인하면 앱에서 해당 사용자의 기기에서 FCM 토큰을 생성해야 푸시 알림을 보낼 수 있습니다. Braze SDK를 사용하면 프로젝트의 Braze 구성 파일에서 각 사용자의 기기에 대한 FCM 토큰 자동 등록을 활성화할 수 있습니다.
먼저 Firebase 콘솔로 이동하여 프로젝트를 연 다음, 설정 > 프로젝트 설정을 선택합니다.

클라우드 메시징을 선택하고 Firebase 클라우드 메시징 API(V1)에서 발신자 ID 필드의 숫자를 복사합니다.

그런 다음, Android Studio 프로젝트를 열고 Firebase 발신자 ID를 사용하여 braze.xml 또는 BrazeConfig에서 FCM 토큰 자동 등록을 활성화합니다.
FCM 토큰 자동 등록을 구성하려면 braze.xml 파일에 다음 줄을 추가합니다:
1
2
<bool translatable="false" name="com_braze_firebase_cloud_messaging_registration_enabled">true</bool>
<string translatable="false" name="com_braze_firebase_cloud_messaging_sender_id">FIREBASE_SENDER_ID</string>
FIREBASE_SENDER_ID를 Firebase 프로젝트 설정에서 복사한 값으로 바꿉니다. braze.xml은 다음과 비슷합니다.
1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string translatable="false" name="com_braze_api_key">12345ABC-6789-DEFG-0123-HIJK456789LM</string>
<bool translatable="false" name="com_braze_firebase_cloud_messaging_registration_enabled">true</bool>
<string translatable="false" name="com_braze_firebase_cloud_messaging_sender_id">603679405392</string>
</resources>
FCM 토큰 자동 등록을 구성하려면 BrazeConfig 에 다음 줄을 추가합니다:
1
2
.setIsFirebaseCloudMessagingRegistrationEnabled(true)
.setFirebaseCloudMessagingSenderIdKey("FIREBASE_SENDER_ID")
1
2
.setIsFirebaseCloudMessagingRegistrationEnabled(true)
.setFirebaseCloudMessagingSenderIdKey("FIREBASE_SENDER_ID")
FIREBASE_SENDER_ID를 Firebase 프로젝트 설정에서 복사한 값으로 바꿉니다. BrazeConfig은 다음과 비슷합니다.
1
2
3
4
5
6
7
8
9
10
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setApiKey("12345ABC-6789-DEFG-0123-HIJK456789LM")
.setCustomEndpoint("sdk.iad-01.braze.com")
.setSessionTimeout(60)
.setHandlePushDeepLinksAutomatically(true)
.setGreatNetworkDataFlushInterval(10)
.setIsFirebaseCloudMessagingRegistrationEnabled(true)
.setFirebaseCloudMessagingSenderIdKey("603679405392")
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
5
6
7
8
9
10
val brazeConfig = BrazeConfig.Builder()
.setApiKey("12345ABC-6789-DEFG-0123-HIJK456789LM")
.setCustomEndpoint("sdk.iad-01.braze.com")
.setSessionTimeout(60)
.setHandlePushDeepLinksAutomatically(true)
.setGreatNetworkDataFlushInterval(10)
.setIsFirebaseCloudMessagingRegistrationEnabled(true)
.setFirebaseCloudMessagingSenderIdKey("603679405392")
.build()
Braze.configure(this, brazeConfig)
대신 FCM 토큰을 수동으로 등록하려면 앱 내에서 Braze.setRegisteredPushToken() 앱의 onCreate() 메서드를 호출하면 됩니다.
8단계: 애플리케이션 클래스에서 자동 요청 제거
무음 푸시 알림을 보낼 때마다 Braze가 불필요한 네트워크 요청을 트리거하지 않도록 하려면 Application 클래스의 onCreate() 메서드에 구성된 모든 자동 네트워크 요청을 제거합니다. 자세한 내용은 Android 개발자 참조를 참조하십시오: 애플리케이션.
알림 표시
1단계: Braze Firebase 메시징 서비스 등록
새 서비스, 기존 서비스 또는 Braze 이외의 메시징 서비스를 만들 수 있습니다. 특정 요구 사항에 가장 적합한 것을 선택하세요.
Braze에는 푸시 수신 및 공개 의도를 처리하는 서비스가 포함되어 있습니다. BrazeFirebaseMessagingService 클래스는 AndroidManifest.xml에 등록되어야 합니다.
1
2
3
4
5
6
<service android:name="com.braze.push.BrazeFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
또한 알림 코드는 BrazeFirebaseMessagingService 를 사용하여 열기 및 클릭 동작 추적을 처리합니다. 이 서비스가 제대로 작동하려면 AndroidManifest.xml 에 등록해야 합니다. 또한 Braze는 시스템에서 보낸 알림만 렌더링하도록 시스템의 알림에 고유한 키를 접두사로 추가합니다. 추가 서비스를 별도로 등록하여 다른 FCM 서비스에서 전송되는 알림을 표시할 수 있습니다. 참조 AndroidManifest.xml 를 참조하세요.
Braze SDK 3.1.1 이전에는 AppboyFcmReceiver를 사용하여 FCM 푸시를 처리했습니다. AppboyFcmReceiver 클래스는 매니페스트에서 제거하고 이전 통합으로 대체해야 합니다.
이미 Firebase 메시징 서비스가 등록되어 있는 경우, 다음을 통해 RemoteMessage 객체를 Braze에 전달할 수 있습니다. BrazeFirebaseMessagingService.handleBrazeRemoteMessage(). 이 메서드는 객체가 RemoteMessage 객체가 Braze에서 발생한 경우에만 알림을 표시하고 그렇지 않은 경우 안전하게 무시합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void 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.
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
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.
}
}
}
또한 사용하려는 다른 Firebase 메시징 서비스가 있는 경우, 애플리케이션이 Braze가 아닌 푸시를 수신할 경우 호출할 대체 Firebase 메시징 서비스를 지정할 수 있습니다.
braze.xml에서 다음을 지정합니다.
1
2
<bool name="com_braze_fallback_firebase_cloud_messaging_service_enabled">true</bool>
<string name="com_braze_fallback_firebase_cloud_messaging_service_classpath">com.company.OurFirebaseMessagingService</string>
또는 런타임 구성을 통해 설정합니다.
1
2
3
4
5
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setFallbackFirebaseMessagingServiceEnabled(true)
.setFallbackFirebaseMessagingServiceClasspath("com.company.OurFirebaseMessagingService")
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
5
val brazeConfig = BrazeConfig.Builder()
.setFallbackFirebaseMessagingServiceEnabled(true)
.setFallbackFirebaseMessagingServiceClasspath("com.company.OurFirebaseMessagingService")
.build()
Braze.configure(this, brazeConfig)
2단계: 작은 아이콘을 디자인 가이드라인에 따르기
Android 알림 아이콘에 대한 일반적인 정보는 알림 개요를 참조하세요.
Android N부터는 색상이 포함된 작은 알림 아이콘 에셋을 업데이트하거나 제거해야 합니다. Android 시스템(Braze SDK가 아님)은 작업 아이콘과 작은 알림 아이콘에서 알파 및 투명도가 아닌 모든 채널을 무시합니다. 즉, Android는 투명한 영역을 제외한 작은 알림 아이콘의 모든 부분을 흑백으로 변환합니다.
제대로 표시되는 알림 작은 아이콘 자산을 만들려면 다음과 같이 하세요:
- 이미지에서 흰색을 제외한 모든 색상을 제거합니다.
- 자산의 흰색이 아닌 다른 모든 영역은 투명해야 합니다.
부적절한 자산의 일반적인 증상은 작은 알림 아이콘이 단색 흑백 사각형으로 렌더링되는 것입니다. 이는 Android 시스템에서 알림 작은 아이콘 에셋에서 투명한 영역을 찾을 수 없기 때문입니다.
다음에 표시된 큰 아이콘 및 작은 아이콘은 적절하게 디자인된 아이콘 예제입니다.
![]()
3단계: 알림 아이콘 구성
braze.xml에서 아이콘 지정
Braze를 사용하면 braze.xml 에서 그리기 가능한 리소스를 지정하여 알림 아이콘을 구성할 수 있습니다:
1
2
<drawable name="com_braze_push_small_notification_icon">REPLACE_WITH_YOUR_ICON</drawable>
<drawable name="com_braze_push_large_notification_icon">REPLACE_WITH_YOUR_ICON</drawable>
작은 알림 아이콘을 설정해야 합니다. 설정하지 않으면 Braze는 기본적으로 애플리케이션 아이콘을 작은 알림 아이콘으로 사용하게 되며, 이는 최선이 아닌 것처럼 보일 수 있습니다.
큰 알림 아이콘을 설정하는 것은 선택 사항이지만 권장됩니다.
아이콘 강조 색상 지정
알림 아이콘 강조 색상은 braze.xml 에서 재정의할 수 있습니다. 색상을 지정하지 않으면 기본 색상은 Lollipop이 시스템 알림에 사용하는 것과 동일한 회색입니다.
1
<integer name="com_braze_default_notification_accent_color">0xFFf33e3e</integer>
선택적으로 색상 참조를 사용할 수도 있습니다:
1
<color name="com_braze_default_notification_accent_color">@color/my_color_here</color>
4단계: 딥링크 추가
자동 딥링크 열기 활성화
푸시 알림을 클릭할 때 Braze가 앱과 딥링크를 자동으로 열도록 설정하려면 braze.xml에서 com_braze_handle_push_deep_links_automatically를 true로 설정합니다.
1
<bool name="com_braze_handle_push_deep_links_automatically">true</bool>
이 플래그는 런타임 구성을 통해서도 설정할 수 있습니다:
1
2
3
4
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setHandlePushDeepLinksAutomatically(true)
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
val brazeConfig = BrazeConfig.Builder()
.setHandlePushDeepLinksAutomatically(true)
.build()
Braze.configure(this, brazeConfig)
딥링크의 커스텀 처리를 설정하려면 Braze에서 푸시를 수신하고 여는 의도를 수신 대기하는 푸시 콜백을 만들어야 합니다. 자세한 내용은 푸시 이벤트에 콜백 사용하기를 참조하세요.
사용자 지정 딥링크 만들기
앱에 딥링킹을 아직 추가하지 않은 경우 Android 개발자 설명서에 있는 딥링킹에 대한 지침을 따르세요. 딥링크 개념에 대한 자세한 내용은 FAQ 문서를 참조하세요.
딥링크 추가하기
Braze 대시보드는 푸시 알림 캠페인과 캔버스에서 알림을 클릭할 때 열 딥링크 또는 웹 URL 설정을 지원합니다.

백 스택 동작 사용자 지정
기본적으로 Android SDK는 푸시 딥링크를 따라갈 때 호스트 앱의 기본 런처 활동을 백 스택에 배치합니다. Braze를 사용하면 기본 런처 활동 대신 백 스택에서 열리도록 커스텀 활동을 설정하거나 백 스택을 완전히 비활성화할 수 있습니다.
예를 들어 런타임 구성을 사용하여 YourMainActivity 이라는 활동을 백스택 활동으로 설정합니다:
1
2
3
4
5
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setPushDeepLinkBackStackActivityEnabled(true)
.setPushDeepLinkBackStackActivityClass(YourMainActivity.class)
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
5
val brazeConfig = BrazeConfig.Builder()
.setPushDeepLinkBackStackActivityEnabled(true)
.setPushDeepLinkBackStackActivityClass(YourMainActivity.class)
.build()
Braze.configure(this, brazeConfig)
braze.xml에 해당하는 구성을 참조하세요. 클래스 이름은 Class.forName()에서 반환한 것과 동일해야 합니다.
1
2
<bool name="com_braze_push_deep_link_back_stack_activity_enabled">true</bool>
<string name="com_braze_push_deep_link_back_stack_activity_class_name">your.package.name.YourMainActivity</string>
5단계: 알림 채널 정의
Braze 안드로이드 SDK는 안드로이드 알림 채널을 지원합니다. Braze 알림에 알림 채널의 ID가 포함되어 있지 않거나 Braze 알림에 유효하지 않은 채널 ID가 포함되어 있는 경우, Braze는 SDK에 정의된 기본 알림 채널로 알림을 표시합니다. Braze 사용자는 플랫폼 내에서 Android 알림 채널을 사용하여 알림을 그룹화할 수 있습니다.
기본 Braze 알림 채널의 사용자 대면 이름을 설정하려면 BrazeConfig.setDefaultNotificationChannelName().
기본 Braze 알림 채널의 사용자 대면 설명을 설정하려면 BrazeConfig.setDefaultNotificationChannelDescription().
notification_channel 필드를 포함하도록 Android 푸시 개체 매개변수를 사용하여 모든 API 캠페인을 업데이트합니다. 이 필드를 지정하지 않으면 Braze는 대시보드 폴백 채널 ID와 함께 알림 페이로드를 전송합니다.
기본 알림 채널 외에는 Braze에서 어떠한 채널도 생성하지 않습니다. 다른 모든 채널은 호스트 앱에서 프로그래밍 방식으로 정의한 다음, Braze 대시보드에 입력해야 합니다.
기본 채널 이름과 설명은 braze.xml 에서도 구성할 수 있습니다.
1
2
<string name="com_braze_default_notification_channel_name">Your channel name</string>
<string name="com_braze_default_notification_channel_description">Your channel description</string>
6단계: 테스트 알림 표시 및 분석
디스플레이 테스트
이 시점에서 Braze에서 보낸 알림을 볼 수 있을 것입니다. 이를 테스트하려면 Braze 대시보드의 캠페인 페이지로 이동하여 푸시 알림 캠페인을 생성하세요. Android 푸시를 선택하고 메시지를 디자인합니다. 그런 다음, 작성기에서 눈 아이콘을 클릭하여 테스트 발신자를 가져옵니다. 현재 사용자의 사용자 ID 또는 이메일 주소를 입력하고 테스트 보내기를 클릭합니다. 기기에 푸시가 표시됩니다.

푸시 표시와 관련된 문제는 문제 해결 가이드를 참조하세요.
분석 테스트
이 시점에서 푸시 알림 열기에 대한 분석 로깅도 있어야 합니다. 알림이 도착했을 때 클릭하면 캠페인 결과 페이지의 직접 열기 수가 1씩 증가합니다. 푸시 분석에 대한 자세한 내용은 푸시 보고 문서를 참조하세요.
푸시 애널리틱스와 관련된 문제는 문제 해결 가이드를 참조하세요.
명령줄에서 테스트
명령줄 인터페이스를 통해 인앱 및 푸시 알림을 테스트하려면 터미널을 통해 cURL 및 메시징 API를 통해 단일 알림을 보낼 수 있습니다. 다음 필드를 테스트 케이스에 맞는 올바른 값으로 바꿔야 합니다:
YOUR_API_KEY( 설정 > API 키로 이동합니다.)YOUR_EXTERNAL_USER_ID( 사용자 검색 페이지에서 프로필을 검색합니다.)YOUR_KEY1(선택 사항)YOUR_VALUE1(선택 사항)
1
2
3
4
5
6
7
8
9
10
11
12
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer {YOUR_API_KEY}" -d '{
"external_user_ids":["YOUR_EXTERNAL_USER_ID"],
"messages": {
"android_push": {
"title":"Test push title",
"alert":"Test push",
"extra": {
"YOUR_KEY1":"YOUR_VALUE1"
}
}
}
}' https://rest.iad-01.braze.com/messages/send
이 예에서는 US-01 인스턴스를 사용합니다. 이 인스턴스를 사용하지 않는 경우 US-01 엔드포인트를 사용자 엔드포인트로 바꾸세요.
대화 푸시 알림

사람과 대화 이니셔티브는 휴대폰의 시스템 표면에서 사람과 대화의 개선을 목표로 하는 다년간의 Android 이니셔티브입니다. 이 우선순위는 모든 인구 통계학적 특성에 걸쳐 대부분의 Android 사용자에게 있어 다른 사람들과의 의사소통 및 상호작용이 여전히 가장 가치 있고 중요한 기능 영역이라는 사실에 기반합니다.
사용 요구 사항
- 이 알림 유형에는 Braze Android SDK v15.0.0 이상 및 Android 11 이상 기기가 필요합니다.
- 지원되지 않는 기기 또는 SDK에서는 표준 푸시 알림으로 대체됩니다.
이 기능은 Braze REST API를 통해서만 사용할 수 있습니다. 자세한 내용은 Android 푸시 개체를 참조하세요.
FCM 할당량 초과 오류
FCM(Firebase 클라우드 메시징) 한도를 초과하면 Google에서 “할당량 초과” 오류를 반환합니다. FCM의 기본값은 분당 600,000건의 요청입니다. Braze는 Google의 권장 모범 사례에 따라 전송을 다시 시도합니다. 그러나 이러한 오류가 대량으로 발생하면 전송 시간이 몇 분씩 길어질 수 있습니다. 잠재적인 영향을 완화하기 위해 Braze는 요금 한도가 초과되고 있다는 알림과 오류를 방지하기 위해 취할 수 있는 조치를 보내드립니다.
현재 한도를 확인하려면 Google Cloud 콘솔 > API 및 서비스 > Firebase Cloud 메시징 API > 할당량 및 시스템 제한으로 이동하거나 FCM API 할당량 페이지를 방문하세요.
Best practices
이러한 오류 볼륨을 낮게 유지하려면 다음 모범 사례를 권장합니다.
FCM에 요금 한도 인상 요청하기
FCM에 요금 한도 인상을 요청하려면 Firebase 지원팀에 직접 문의하거나 다음과 같이 하세요:
- FCM API 쿼터 페이지로 이동합니다.
- 분당 요청 보내기 할당량을 찾습니다.
- 할당량 편집을 선택합니다.
- 새 값을 입력하고 요청을 제출합니다.
Braze를 통해 글로벌 요금 제한 요청하기
Android 푸시 알림에 대해 워크스페이스 전체에 제한을 적용하려면 Braze 지원팀에 문의하세요.
요금 제한
푸시 알림은 전송 횟수에 제한이 있으므로 애플리케이션에 필요한 만큼 많이 보내는 것을 두려워하지 마세요. iOS 및 Apple 푸시 알림 서비스(APN) 서버가 알림 전송 빈도를 제어하므로 너무 많이 보내도 문제가 발생하지 않습니다. 푸시 알림이 제한되는 경우, 기기가 다음 번에 연결 유지 패킷을 보내거나 다른 알림을 받을 때까지 지연될 수 있습니다.
푸시 알림 설정하기
1단계: APN 토큰 업로드
Before you can send an iOS push notification using Braze, you need to upload your .p8 push notification file, as described in Apple’s developer documentation:
- In your Apple developer account, go to Certificates, Identifiers & Profiles.
- Under Keys, select All and click the add button (+) in the upper-right corner.
- Under Key Description, enter a unique name for the signing key.
- Under Key Services, select the Apple Push Notification service (APNs) checkbox, then click Continue. Click Confirm.
- Note the key ID. Click Download to generate and download the key. Make sure to save the downloaded file in a secure place, as you cannot download this more than once.
- In Braze, go to Settings > App Settings and upload the
.p8file under Apple Push Certificate. You can upload either your development or production push certificate. To test push notifications after your app is live in the App Store, its recommended to set up a separate workspace for the development version of your app. - When prompted, enter your app’s bundle ID, key ID, and team ID. You’ll also need to specify whether to send notifications to your app’s development or production environment, which is defined by its provisioning profile.
- When you’re finished, select Save.
2단계: 푸시 기능 사용
Xcode에서 기본 앱 대상의 서명 및 기능 섹션으로 이동하여 푸시 알림 기능을 추가합니다.

3단계: 푸시 처리 설정
Swift SDK를 사용하여 Braze에서 수신한 원격 알림의 처리를 자동화할 수 있습니다. 이는 푸시 알림을 처리하는 가장 간단한 방법이며 권장되는 처리 방법입니다.
3.1 단계: 푸시 속성에서 자동화 사용 설정
자동 푸시 통합을 활성화하려면 push 구성의 automation 속성정보를 true로 설정합니다.
1
2
let configuration = Braze.Configuration(apiKey: "{YOUR-BRAZE-API-KEY}", endpoint: "{YOUR-BRAZE-API-ENDPOINT}")
configuration.push.automation = true
1
2
BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:@"{YOUR-BRAZE-API-KEY}" endpoint:@"{YOUR-BRAZE-API-ENDPOINT}"];
configuration.push.automation = [[BRZConfigurationPushAutomation alloc] initEnablingAllAutomations:YES];
이렇게 하면 SDK에 다음을 지시합니다:
- 시스템에서 푸시 알림 신청을 등록하세요.
- 초기화 시 푸시 알림 승인/허가를 요청하세요.
- 푸시 알림 관련 시스템 위임 메서드에 대한 구현을 동적으로 제공합니다.
SDK에서 수행하는 자동화 단계는 코드베이스의 기존 푸시 알림 처리 통합과 호환됩니다. SDK는 Braze에서 수신한 원격 알림의 처리만 자동화합니다. 자체 또는 다른 서드파티 SDK 원격 알림을 처리하기 위해 구현된 모든 시스템 핸들러는 automation이 활성화되어 있어도 계속 작동합니다.
푸시 알림 자동화를 활성화하려면 기본 스레드에서 SDK를 초기화해야 합니다. SDK 초기화는 애플리케이션 실행이 완료되기 전 또는 AppDelegate application(_:didFinishLaunchingWithOptions:) 구현에서 수행해야 합니다.
애플리케이션에 SDK를 초기화하기 전에 추가 설정이 필요한 경우 지연된 초기화 문서 페이지를 참조하세요.
3.2 단계: 개별 구성 재정의(선택 사항)
보다 세분화된 제어를 위해 각 자동화 단계를 개별적으로 활성화 또는 비활성화할 수 있습니다:
1
2
3
// Enable all automations and disable the automatic notification authorization request at launch.
configuration.push.automation = true
configuration.push.automation.requestAuthorizationAtLaunch = false
1
2
3
// Enable all automations and disable the automatic notification authorization request at launch.
configuration.push.automation = [[BRZConfigurationPushAutomation alloc] initEnablingAllAutomations:YES];
configuration.push.automation.requestAuthorizationAtLaunch = NO;
사용 가능한 모든 옵션은 Braze.Configuration.Push.Automation을 참조하고, 자동화 동작에 대한 자세한 내용은 automation을 참조하세요.
앱에 특정한 추가 동작을 위해 푸시 알림에 의존하는 경우 여전히 수동 푸시 알림 통합 대신 자동 푸시 통합을 사용할 수 있습니다. subscribeToUpdates(_:) 메서드를 통해 Braze에서 처리된 원격 알림을 수신할 수 있습니다.
3.1 단계: APN으로 푸시 알림 등록하기
앱의 application:didFinishLaunchingWithOptions: 델리게이트 메서드에 적절한 코드 샘플을 포함시켜 사용자의 디바이스가 APN에 등록할 수 있도록 합니다. 애플리케이션의 메인 스레드에서 모든 푸시 연동 코드를 호출해야 합니다.
Braze는 푸시 액션 버튼 지원을 위한 기본 푸시 카테고리도 제공하며, 이 카테고리는 푸시 등록 코드에 수동으로 추가해야 합니다. 추가 통합 단계는 푸시 작업 버튼을 참조하세요.
앱 위임의 application:didFinishLaunchingWithOptions: 메소드에 다음 코드를 추가합니다.
다음 코드 샘플에는 임시 푸시 인증(5번째 줄 및 6번째 줄)을 위한 통합 기능이 포함되어 있습니다. 앱에서 프로비전 권한 부여를 사용하지 않으려면 requestAuthorization 옵션에 UNAuthorizationOptionProvisional을 추가하는 코드 줄을 제거할 수 있습니다.
푸시 프로비전 인증에 대한 자세한 내용은 iOS 알림 옵션을 참조하세요.
1
2
3
4
5
6
7
8
9
10
11
application.registerForRemoteNotifications()
let center = UNUserNotificationCenter.current()
center.setNotificationCategories(Braze.Notifications.categories)
center.delegate = self
var options: UNAuthorizationOptions = [.alert, .sound, .badge]
if #available(iOS 12.0, *) {
options = UNAuthorizationOptions(rawValue: options.rawValue | UNAuthorizationOptions.provisional.rawValue)
}
center.requestAuthorization(options: options) { granted, error in
print("Notification authorization, granted: \(granted), error: \(String(describing: error))")
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[application registerForRemoteNotifications];
UNUserNotificationCenter *center = UNUserNotificationCenter.currentNotificationCenter;
[center setNotificationCategories:BRZNotifications.categories];
center.delegate = self;
UNAuthorizationOptions options = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
if (@available(iOS 12.0, *)) {
options = options | UNAuthorizationOptionProvisional;
}
[center requestAuthorizationWithOptions:options
completionHandler:^(BOOL granted, NSError *_Nullable error) {
NSLog(@"Notification authorization, granted: %d, "
@"error: %@)",
granted, error);
}];
앱 실행이 완료되기 전에 center.delegate = self를 사용하여 위임 오브젝트를 동기적으로 할당해야 합니다(가급적이면 application:didFinishLaunchingWithOptions:에서 할당). 그렇게 하지 않으면 앱에서 수신 푸시 알림을 놓칠 수 있습니다. Apple의 UNUserNotificationCenterDelegate 문서를 참조하세요.
3.2 단계: Braze에 푸시 토큰 등록
APN 등록이 완료되면 결과 deviceToken을 Braze에 전달하여 사용자에 대한 푸시 알림을 활성화합니다.
앱의 application(_:didRegisterForRemoteNotificationsWithDeviceToken:) 메소드에 다음 코드를 추가합니다:
1
AppDelegate.braze?.notifications.register(deviceToken: deviceToken)
앱의 application:didRegisterForRemoteNotificationsWithDeviceToken: 메소드에 다음 코드를 추가합니다:
1
[AppDelegate.braze.notifications registerDeviceToken:deviceToken];
application:didRegisterForRemoteNotificationsWithDeviceToken: 위임 메서드는 application.registerForRemoteNotifications() 호출 후 항상 호출됩니다.
다른 푸시 서비스에서 Braze로 마이그레이션하고 사용자 기기가 이미 APN에 등록되어 있는 경우, 이 메서드는 다음에 메서드를 호출할 때 기존 등록에서 토큰을 수집하며, 사용자는 푸시에 다시 옵트인하지 않아도 됩니다.
3.3 단계: 푸시 처리 사용
다음으로, 수신한 푸시 알림을 Braze에 전달합니다. 이 단계는 푸시 분석 및 링크 처리를 로깅하는 데 필요합니다. 애플리케이션의 메인 스레드에서 모든 푸시 연동 코드를 호출해야 합니다.
기본 푸시 처리
Braze 기본 푸시 처리를 활성화하려면 앱의 application(_:didReceiveRemoteNotification:fetchCompletionHandler:) 메소드에 다음 코드를 추가하세요:
1
2
3
4
5
6
7
if let braze = AppDelegate.braze, braze.notifications.handleBackgroundNotification(
userInfo: userInfo,
fetchCompletionHandler: completionHandler
) {
return
}
completionHandler(.noData)
다음으로 앱의 userNotificationCenter(_:didReceive:withCompletionHandler:) 메소드에 다음을 추가합니다:
1
2
3
4
5
6
7
if let braze = AppDelegate.braze, braze.notifications.handleUserNotification(
response: response,
withCompletionHandler: completionHandler
) {
return
}
completionHandler()
Braze 기본 푸시 처리를 활성화하려면 애플리케이션의 application:didReceiveRemoteNotification:fetchCompletionHandler: 메소드에 다음 코드를 추가하세요:
1
2
3
4
5
6
7
BOOL processedByBraze = AppDelegate.braze != nil && [AppDelegate.braze.notifications handleBackgroundNotificationWithUserInfo:userInfo
fetchCompletionHandler:completionHandler];
if (processedByBraze) {
return;
}
completionHandler(UIBackgroundFetchResultNoData);
다음으로 앱의 (void)userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: 메소드에 다음 코드를 추가합니다:
1
2
3
4
5
6
7
BOOL processedByBraze = AppDelegate.braze != nil && [AppDelegate.braze.notifications handleUserNotificationWithResponse:response
withCompletionHandler:completionHandler];
if (processedByBraze) {
return;
}
completionHandler();
포 그라운드 푸시 처리
포그라운드 푸시 알림을 활성화하고 수신 시 Braze에서 이 알림을 인식하려면 UNUserNotificationCenter.userNotificationCenter(_:willPresent:withCompletionHandler:)를 구현합니다. 사용자가 포그라운드 알림을 탭하면 userNotificationCenter(_:didReceive:withCompletionHandler:) 푸시 델리게이트가 호출되고 Braze는 푸시 클릭 이벤트를 기록합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions
) -> Void) {
if let braze = AppDelegate.braze {
// Forward notification payload to Braze for processing.
braze.notifications.handleForegroundNotification(notification: notification)
}
// Configure application's foreground notification display options.
if #available(iOS 14.0, *) {
completionHandler([.list, .banner])
} else {
completionHandler([.alert])
}
}
포그라운드 푸시 알림을 활성화하고 수신 시 Braze에서 이 알림을 인식하려면 userNotificationCenter:willPresentNotification:withCompletionHandler:를 구현합니다. 사용자가 포그라운드 알림을 탭하면 userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: 푸시 델리게이트가 호출되고 Braze는 푸시 클릭 이벤트를 기록합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
if (AppDelegate.braze != nil) {
// Forward notification payload to Braze for processing.
[AppDelegate.braze.notifications handleForegroundNotificationWithNotification:notification];
}
// Configure application's foreground notification display options.
if (@available(iOS 14.0, *)) {
completionHandler(UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner);
} else {
completionHandler(UNNotificationPresentationOptionAlert);
}
}
테스트 알림
명령줄을 통해 인앱 및 푸시 알림을 테스트하려면 터미널을 통해 CURL 및 메시징 API를 통해 단일 알림을 보낼 수 있습니다. 다음 필드를 테스트 케이스에 맞는 올바른 값으로 바꿔야 합니다:
YOUR_API_KEY- 설정 > API 키에서 사용할 수 있습니다.YOUR_EXTERNAL_USER_ID- 사용자 검색 페이지에서 사용할 수 있습니다. 자세한 내용은 사용자 ID 할당하기를 참조하세요.YOUR_KEY1(선택 사항)YOUR_VALUE1(선택 사항)
다음 예제에서는 US-01 인스턴스를 사용하고 있습니다. 이 인스턴스를 사용하고 있지 않다면 API 설명서를 참조하여 요청할 엔드포인트를 확인하세요.
1
2
3
4
5
6
7
8
9
10
11
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer {YOUR_API_KEY}" -d '{
"external_user_ids":["YOUR_EXTERNAL_USER_ID"],
"messages": {
"apple_push": {
"alert":"Test push",
"extra": {
"YOUR_KEY1":"YOUR_VALUE1"
}
}
}
}' https://rest.iad-01.braze.com/messages/send
푸시 알림 업데이트 구독하기
Braze에서 처리하는 푸시 알림 페이로드에 액세스하려면 Braze.Notifications.subscribeToUpdates(payloadTypes:_:) 메서드를 사용합니다.
payloadTypes 매개변수를 사용하여 푸시 열람 이벤트, 푸시 수신 이벤트 또는 둘 다와 관련된 알림의 가입 여부를 지정할 수 있습니다.
1
2
3
4
5
6
// This subscription is maintained through a Braze cancellable, which will observe for changes until the subscription is cancelled.
// You must keep a strong reference to the cancellable to keep the subscription active.
// The subscription is canceled either when the cancellable is deinitialized or when you call its `.cancel()` method.
let cancellable = AppDelegate.braze?.notifications.subscribeToUpdates(payloadTypes: [.open, .received]) { payload in
print("Braze processed notification with title '\(payload.title)' and body '\(payload.body)'")
}
푸시 수신 이벤트는 포그라운드 알림 및 content-available 백그라운드 알림에 대해서만 트리거됩니다. 종료된 상태에서 받은 알림이나 content-available 필드가 없는 백그라운드 알림에 대해서는 트리거되지 않습니다.
1
2
3
4
5
NSInteger filtersValue = BRZNotificationsPayloadTypeFilter.opened.rawValue | BRZNotificationsPayloadTypeFilter.received.rawValue;
BRZNotificationsPayloadTypeFilter *filters = [[BRZNotificationsPayloadTypeFilter alloc] initWithRawValue: filtersValue];
BRZCancellable *cancellable = [notifications subscribeToUpdatesWithPayloadTypes:filters update:^(BRZNotificationsPayload * _Nonnull payload) {
NSLog(@"Braze processed notification with title '%@' and body '%@'", payload.title, payload.body);
}];
푸시 수신 이벤트는 포그라운드 알림 및 content-available 백그라운드 알림에 대해서만 트리거됩니다. 종료된 상태에서 받은 알림이나 content-available 필드가 없는 백그라운드 알림에 대해서는 트리거되지 않습니다.
자동 푸시 통합을 사용하는 경우, subscribeToUpdates(_:)는 Braze에서 처리한 원격 알림을 받을 수 있는 유일한 방법입니다. Braze에서 알림을 자동으로 처리하는 경우 UIAppDelegate 및 UNUserNotificationCenterDelegate 시스템 메서드는 호출되지 않습니다.
application(_:didFinishLaunchingWithOptions:) 에서 푸시 알림 구독을 생성하여 최종 사용자가 앱이 종료된 상태에서 알림을 탭한 후 구독이 트리거되도록 합니다.
푸시 프라이머
푸시 프라이머 캠페인은 사용자가 기기에서 앱에 대한 푸시 알림을 활성화할 것을 권장합니다. 노코드 푸시 프라이머를 사용하면 SDK 사용자 지정 없이도 이 작업을 수행할 수 있습니다.
동적 APN 게이트웨이 관리
동적 APN(Apple 푸시 알림 서비스) 게이트웨이 관리는 올바른 APN 환경을 자동으로 감지하여 iOS 푸시 알림의 안정성과 효율성을 향상시킵니다. 이전에는 푸시 알림을 위한 APN 환경(개발 또는 프로덕션)을 수동으로 선택해야 했기 때문에 잘못된 게이트웨이 구성, 배달 실패 및 BadDeviceToken 오류가 발생하는 경우가 있었습니다.
동적 APN 게이트웨이 관리를 사용하면 다음과 같은 이점이 있습니다:
- 안정성이 향상되었습니다: 알림은 항상 올바른 APN 환경으로 전달되므로 전달 실패가 줄어듭니다.
- 간소화된 구성: 더 이상 APN 게이트웨이 설정을 수동으로 관리할 필요가 없습니다.
- 오류 복원력: 유효하지 않거나 누락된 게이트웨이 값은 정상적으로 처리되어 중단 없는 서비스를 제공합니다.
Prerequisites
Braze는 다음 SDK 버전 요구 사항과 함께 iOS에서 푸시 알림을 위한 동적 APN 게이트웨이 관리를 지원합니다:
How it works
iOS 앱이 Braze Swift SDK와 통합되면 다음과 같은 디바이스 관련 데이터를 전송합니다. aps-environment 를 포함한 기기 관련 데이터를 Braze SDK API로 전송합니다(가능한 경우). apns_gateway 값은 앱이 개발(dev) 또는 프로덕션(prod) APN 환경을 사용하는지 여부를 나타냅니다.
Braze는 또한 각 디바이스에 대해 보고된 게이트웨이 값을 저장합니다. 유효한 새 게이트웨이 값이 수신되면 Braze는 저장된 값을 자동으로 업데이트합니다.
Braze에서 푸시 알림을 보내는 경우:
- 디바이스에 대해 유효한 게이트웨이 값(개발 또는 프로덕트)이 저장되어 있으면, Braze는 이를 사용하여 올바른 APN 환경을 확인합니다.
- 게이트웨이 값이 저장되지 않은 경우, Braze는 앱 설정 페이지에서 구성된 APN 환경으로 기본 설정됩니다.
Frequently asked questions
이 기능이 도입된 이유는 무엇인가요?
동적 APN 게이트웨이 관리를 사용하면 올바른 환경이 자동으로 선택됩니다. 이전에는 APN 게이트웨이를 수동으로 구성해야 했기 때문에 BadDeviceToken 오류, 토큰 무효화 및 잠재적인 APN 속도 제한 문제가 발생할 수 있었습니다.
이것이 푸시 전송 성능에 어떤 영향을 미칠까요?
이 기능은 푸시 토큰을 항상 올바른 APN 환경으로 라우팅하여 잘못 구성된 게이트웨이로 인한 오류를 방지함으로써 전송 속도를 향상시킵니다.
이 기능을 비활성화할 수 있나요?
동적 APN 게이트웨이 관리는 기본적으로 켜져 있으며 안정성 향상을 제공합니다. 수동 게이트웨이 선택이 필요한 특정 사용 사례가 있는 경우 Braze 지원팀에 문의하세요.
이 가이드는 Braze Web SDK 4.0.0+의 코드 샘플을 사용합니다. 최신 웹 SDK 버전으로 업그레이드하려면 SDK 업그레이드 가이드를 참조하세요.
Prerequisites
Before you can use this feature, you’ll need to integrate the Web Braze SDK.
Push protocols
Web push notifications are implemented using the W3C push standard, which most major browsers support. For more information on specific push protocol standards and browser support, you can review resources from Apple Mozilla and Microsoft.
Setting up push notifications
Step 1: Configure your service worker
In your project’s service-worker.js file, add the following snippet and set the manageServiceWorkerExternally initialization option to true when initializing the Web SDK.
Your web server must return a Content-Type: application/javascript when serving your service worker file. Additionally, if your service worker file is not service-worker.js named, you’ll need to use the serviceWorkerLocation initialization option.
Step 2: Register the browser
To immediately request push permissions from a user so their browser can receive push notifications, call braze.requestPushPermission(). To test if push is supported in their browser first, call braze.isPushSupported().
You can also send a soft push prompt to the user before requesting push permission to show your own push-related UI.
On macOS, both Google Chrome and Google Chrome Helper (Alerts) must be enabled by the end-user in System Settings > Notifications before push notifications can be displayed—even if permissions are granted.
Step 3: Disable skipWaiting (optional)
The Braze service worker file will automatically call skipWaiting upon install. If you’d like to disable this functionality, add the following code to your service worker file, after importing Braze:
Unsubscribing a user
To unsubscribe a user, call braze.unregisterPush().
Recent versions of Safari and Firefox require that you call this method from a short-lived event handler (such as from a button-click handler or soft push prompt). This is consistent with Chrome’s user experience best practices for push registration.
Alternate domains
To integrate web push, your domain must be secure, which generally means https, localhost, and other exceptions as defined in the W3C push standard. You’ll also need to be able to register a Service Worker at the root of your domain, or at least be able to control the HTTP headers for that file. This article covers how to integrate Braze Web Push on an alternate domain.
Use cases
If you can’t meet all of the criteria outlined in the W3C push standard, you can use this method to add a push prompt dialog to your website instead. This can be helpful if you want to let your users opt-in from an http website or a browser extension popup that’s preventing your push prompt from displaying.
Considerations
Keep in mind, like many workarounds on the web, browsers continually evolve, and this method may not be viable in the future. Before continuing, ensure that:
- You own a separate secure domain (
https://) and permissions to register a Service Worker on that domain. - Users are logged in to your website which ensures push tokens are match to the correct profile.
You cannot use this method to implement push notifications for Shopify. Shopify will automatically remove the headers need to deliver push this way.
Setting up an alternate push domain
To make the following example clear, we’ll use use http://insecure.com and https://secure.com as our two domains with the goal of getting visitors to register for push on http://insecure.com. This example could also be applied to a chrome-extension:// scheme for a browser extension’s popup page.
Step 1: Initiate prompting flow
On insecure.com, open a new window to your secure domain using a URL parameter to pass the currently logged-in user’s Braze external ID.
http://insecure.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<button id="opt-in">Opt-In For Push</button>
<script>
// the same ID you would use with `braze.changeUser`:
const user_id = getUserIdSomehow();
// pass the user ID into the secure domain URL:
const secure_url = `https://secure.com/push-registration.html?external_id=${user_id}`;
// when the user takes some action, open the secure URL in a new window
document.getElementById("opt-in").onclick = function(){
if (!window.open(secure_url, 'Opt-In to Push', 'height=500,width=600,left=150,top=150')) {
window.alert('The popup was blocked by your browser');
} else {
// user is shown a popup window
// and you can now prompt for push in this window
}
}
</script>
Step 2: Register for push
At this point, secure.com will open a popup window in which you can initialize the Braze Web SDK for the same user ID and request the user’s permission for Web push.
https://secure.com/push-registration.html
Step 3: Communicate between domains (optional)
Now that users can opt-in from this workflow originating on insecure.com, you may want to modify your site based on if the user is already opted-in or not. There’s no point in asking the user to register for push if they already are.
You can use iFrames and the postMessage API to communicate between your two domains.
insecure.com
On our insecure.com domain, we will ask the secure domain (where push is actually registered) for information on the current user’s push registration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!-- Create an iframe to the secure domain and run getPushStatus onload-->
<iframe id="push-status" src="https://secure.com/push-status.html" onload="getPushStatus()" style="display:none;"></iframe>
<script>
function getPushStatus(event){
// send a message to the iframe asking for push status
event.target.contentWindow.postMessage({type: 'get_push_status'}, 'https://secure.com');
// listen for a response from the iframe's domain
window.addEventListener("message", (event) => {
if (event.origin === "http://insecure.com" && event.data.type === 'set_push_status') {
// update the page based on the push permission we're told
window.alert(`Is user registered for push? ${event.data.isPushPermissionGranted}`);
}
}
}
</script>
secure.com/push-status.html
Frequently Asked Questions (FAQ)
Service workers
What if I can’t register a service worker in the root directory?
By default, a service worker can only be used within the same directory it is registered in. For example, if your service worker file exists in /assets/service-worker.js, it would only be possible to register it within example.com/assets/* or a subdirectory of the assets folder, but not on your homepage (example.com/). For this reason, it is recommended to host and register the service worker in the root directory (such as https://example.com/service-worker.js).
If you cannot register a service worker in your root domain, an alternative approach is to use the Service-Worker-Allowed HTTP header when serving your service worker file. By configuring your server to return Service-Worker-Allowed: / in the response for the service worker, this will instruct the browser to broaden the scope and allow it to be used from within a different directory.
Can I create a service worker using a Tag Manager?
No, service workers must be hosted on your website’s server and can’t be loaded via Tag Manager.
Site security
Is HTTPS required?
Yes. Web standards require that the domain requesting push notification permission be secure.
When is a site considered “secure”?
A site is considered secure if it matches one of the following secure-origin patterns. Braze Web push notifications are built on this open standard, so man-in-the-middle attacks are prevented.
(https, , *)(wss, *, *)(, localhost, )(, .localhost, *)(, 127/8, )(, ::1/128, *)(file, *, —)(chrome-extension, *, —)
What if a secure site is not available?
While industry best practice is to make your whole site secure, customers who cannot secure their site domain can work around the requirement by using a secure modal. Read more in our guide to using Alternate push domain or view a working demo.
About push notifications for Android TV

While not a native feature, Android TV push integration is made possible by leveraging the Braze Android SDK and Firebase Cloud Messaging to register a push token for Android TV. It is, however, necessary to build a UI to display the notification payload after it is received.
Prerequisites
To use this feature, you’ll need to complete the following:
Setting up push notifications
To set up push notifications for Android TV:
- Create a custom view in your app to display your notifications.
- Create a custom notification factory. This will override the default SDK behavior and allow you to manually display the notifications. By returning
null, this will prevent the SDK from processing and will require custom code to display the notification. After these steps have been completed, you can start sending push to Android TV! - (Optional) To track click analytics effectively, set up click analytics tracking. This can be achieved by creating a push callback to listen for Braze push opened and received intents.
These notifications will not persist and will only be visible to the user when the device displays them. This is due to Android TV’s notification center not supporting historical notifications.
Testing Android TV push notifications
To test if your push implementation is successful, send a notification from the Braze dashboard as you would normally for an Android device.
- If the application is closed: The push message will display a toast notification on the screen.
- If the application is open: You have the opportunity to display the message in your own hosted UI. We recommend following the UI styling of our Android Mobile SDK in-app messages.
Best practices
For marketers using Braze, launching a campaign to Android TV will be identical to launching a push to Android mobile apps. To target these devices exclusively, we recommend selecting the Android TV App in segmentation.
The delivered and clicked response returned by FCM will follow the same convention as a mobile Android device; therefore, any errors will be visible in the message activity log.
Prerequisites
Before you can use this feature, you’ll need to integrate the Cordova Braze SDK. After you integrate the SDK, basic push notification functionality is enabled by default. To use rich push notifications and push stories, you’ll need to set them up individually.
Anytime you add, remove, or update your Cordova plugins, Cordova will overwrite the Podfile in your iOS app’s Xcode project. This means you’ll need to set these features up again anytime you modify your Cordova plugins.
Disabling basic push notifications (iOS only)
After you integrate the Braze Cordova SDK for iOS, basic push notification functionality is enabled by default. To disable this functionality in your iOS app, add the following to your config.xml file. For more information, see Optional configurations.
1
2
3
4
<platform name="ios">
<preference name="com.braze.ios_disable_automatic_push_registration" value="NO" />
<preference name="com.braze.ios_disable_automatic_push_handling" value="NO" />
</platform>
Prerequisites
이 기능을 사용하려면 먼저 Flutter Braze SDK를 통합해야 합니다.
Setting up push notifications
Step 1: Complete the initial setup
Step 1.1: Register for push
Register for push using Google’s Firebase Cloud Messaging (FCM) API. For a full walkthrough, refer to the following steps from the Native Android push integration guide:
- Add Firebase to your project.
- Add Cloud Messaging to your dependencies.
- Create a service account.
- Generate JSON credentials.
- Upload your JSON credentials to Braze.
Step 1.2: Get your Google Sender ID
First, go to Firebase Console, open your project, then select Settings > Project settings.

Select Cloud Messaging, then under Firebase Cloud Messaging API (V1), copy the Sender ID to your clipboard.

Step 1.3: Update your braze.xml
Add the following to your braze.xml file. Replace FIREBASE_SENDER_ID with the sender ID you copied previously.
1
2
<bool translatable="false" name="com_braze_firebase_cloud_messaging_registration_enabled">true</bool>
<string translatable="false" name="com_braze_firebase_cloud_messaging_sender_id">FIREBASE_SENDER_ID</string>
Step 1.1: Upload APNs certificates
Generate an Apple Push Notification service (APNs) certificate and uploaded it to the Braze dashboard. For a full walkthrough, see Uploading your APNs certificate.
Step 1.2: Add push notification support to your app
Follow the native iOS integration guide.
Step 2: Listen for push notification events (optional)
To listen for push notification events that Braze has detected and handled, call subscribeToPushNotificationEvents() and pass in an argument to execute.
Braze push notification events are available on both Android and iOS. Due to platform differences, iOS will only detect Braze push events when a user has interacted with a notification.
1
2
3
4
5
6
7
8
9
10
// Create stream subscription
StreamSubscription pushEventsStreamSubscription;
pushEventsStreamSubscription = braze.subscribeToPushNotificationEvents((BrazePushEvent pushEvent) {
print("Push Notification event of type ${pushEvent.payloadType} seen. Title ${pushEvent.title}\n and deeplink ${pushEvent.url}");
// Handle push notification events
});
// Cancel stream subscription
pushEventsStreamSubscription.cancel();
Push notification event fields
Because of platform limitations on iOS, the Braze SDK can only process push payloads while the app is in the foreground. Listeners will only trigger for the push_opened event type on iOS after a user has interacted with a push.
For a full list of push notification fields, refer to the table below:
| Field Name | Type | Description |
|---|---|---|
payloadType |
String | Specifies the notification payload type. The two values that are sent from the Braze Flutter SDK are push_opened and push_received. Only push_opened events are supported on iOS. |
url |
String | Specifies the URL that was opened by the notification. |
useWebview |
Boolean | If true, URL will open in-app in a modal webview. If false, the URL will open in the device browser. |
title |
String | Represents the title of the notification. |
body |
String | Represents the body or content text of the notification. |
summaryText |
String | Represents the summary text of the notification. This is mapped from subtitle on iOS. |
badgeCount |
Number | Represents the badge count of the notification. |
timestamp |
Number | Represents the time at which the payload was received by the application. |
isSilent |
Boolean | If true, the payload is received silently. For details on sending Android silent push notifications, refer to Silent push notifications on Android. For details on sending iOS silent push notifications, refer to Silent push notifications on iOS. |
isBrazeInternal |
Boolean | This will be true if a notification payload was sent for an internal SDK feature, such as geofences sync, Feature Flag sync, or uninstall tracking. The payload is received silently for the user. |
imageUrl |
String | Specifies the URL associated with the notification image. |
brazeProperties |
Object | Represents Braze properties associated with the campaign (key-value pairs). |
ios |
Object | Represents iOS-specific fields. |
android |
Object | Represents Android-specific fields. |
Step 3: Test displaying push notifications
To test your integration after configuring push notifications in the native layer:
- Set an active user in the Flutter application. To do so, initialize your plugin by calling
braze.changeUser('your-user-id'). - Head to Campaigns and create a new push notification campaign. Choose the platforms that you’d like to test.
- Compose your test notification and head over to the Test tab. Add the same
user-idas the test user and click Send Test. - You should receive the notification on your device shortly. You may need to check in the Notification Center or update Settings if it doesn’t display.
Starting with Xcode 14, you can test remote push notifications on an iOS simulator.
Prerequisites
이 기능을 사용하려면 먼저 Android Braze SDK를 통합해야 합니다.
푸시 알림 설정하기
Huawei에서 제조한 최신 휴대폰에는 Google의 Firebase 클라우드 메시징(FCM) 대신 푸시 전송에 사용되는 서비스인 Huawei 모바일 서비스(HMS)가 탑재되어 있습니다.
1단계: Huawei 개발자 계정 등록
시작하기 전에 Huawei 개발자 계정을 등록하고 설정해야 합니다. Huawei 계정에서 내 프로젝트 > 프로젝트 설정 > 앱 정보로 이동하고 App ID 및 App secret을 기록해 둡니다.

2단계: Braze 대시보드에서 새 Huawei 앱 생성
Braze 대시보드의 설정 탐색 아래에 있는 앱 설정으로 이동합니다.
+ 앱 추가를 클릭하고 이름(예: 내 Huawei 앱)을 입력한 다음, 플랫폼으로 Android를 선택합니다.

새 Braze 앱이 생성되면 푸시 알림 설정에서 푸시 공급자로 Huawei를 선택합니다. 다음으로, Huawei Client Secret 및 Huawei App ID를 입력합니다.

3단계: 앱에 Huawei 메시징 SDK 통합
Huawei는 애플리케이션에 Huawei 메시징 서비스를 통합하는 방법을 자세히 설명하는 Android 통합 코드랩을 제공합니다. 시작하려면 다음 단계를 따르세요.
코드랩을 완료한 후에는 커스텀 Huawei 메시지 서비스를 생성하여 푸시 토큰을 얻고 메시지를 Braze SDK로 전달해야 합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class CustomPushService extends HmsMessageService {
@Override
public void onNewToken(String token) {
super.onNewToken(token);
Braze.getInstance(this.getApplicationContext()).setRegisteredPushToken(token);
}
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
if (BrazeHuaweiPushHandler.handleHmsRemoteMessageData(this.getApplicationContext(), remoteMessage.getDataOfMap())) {
// Braze has handled the Huawei push notification
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
class CustomPushService: HmsMessageService() {
override fun onNewToken(token: String?) {
super.onNewToken(token)
Braze.getInstance(applicationContext).setRegisteredPushToken(token!!)
}
override fun onMessageReceived(hmsRemoteMessage: RemoteMessage?) {
super.onMessageReceived(hmsRemoteMessage)
if (BrazeHuaweiPushHandler.handleHmsRemoteMessageData(applicationContext, hmsRemoteMessage?.dataOfMap)) {
// Braze has handled the Huawei push notification
}
}
}
커스텀 푸시 서비스를 추가한 후 AndroidManifest.xml에 다음을 추가합니다.
1
2
3
4
5
6
7
<service
android:name="package.of.your.CustomPushService"
android:exported="false">
<intent-filter>
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>
4단계: 푸시 알림 테스트(선택 사항)
지금까지 Braze 대시보드에서 새 Huawei Android 앱을 생성하고, Huawei 개발자 자격 증명으로 앱을 구성한 후 Braze 및 Huawei SDK를 앱에 통합했습니다.
다음으로, Braze에서 새로운 푸시 캠페인을 테스트하여 통합을 테스트할 수 있습니다.
4.1 단계: 새 푸시 알림 캠페인 생성
캠페인 페이지에서 새 캠페인을 생성하고 메시지 유형으로 푸시 알림을 선택합니다.
캠페인 이름을 지정한 후 푸시 플랫폼으로 Android 푸시를 선택합니다.

다음으로, 제목과 메시지와 함께 푸시 캠페인을 작성합니다.
4.2 단계: 테스트 푸시 전송
테스트 탭에서 changeUser(USER_ID_STRING) 메서드를 사용하여 앱에서 설정한 사용자 ID를 입력하고 테스트 보내기를 클릭하여 테스트 푸시를 보냅니다.

이 시점에서 Braze로부터 Huawei(HMS) 기기로 테스트 푸시 알림을 받습니다.
4.3 단계: Huawei 세분화 설정(선택 사항)
Braze 대시보드의 Huawei 앱은 Android 푸시 플랫폼을 기반으로 빌드되었으므로 모든 Android 사용자(Firebase 클라우드 메시징 및 Huawei 모바일 서비스)에게 푸시를 보내거나 특정 앱으로 캠페인 오디언스를 세분화할 수 있는 유연성을 지원합니다.
Huawei 앱에만 푸시를 보내려면 새 세그먼트 생성을 수행하고 앱 섹션에서 Huawei 앱을 선택합니다.

물론 모든 Android 푸시 공급자로 동일한 푸시를 보내려면 현재 워크스페이스 내에 구성된 모든 Android 앱에 보낼 앱을 지정하지 않도록 선택할 수 있습니다.
Prerequisites
Before you can use this feature, you’ll need to integrate the React Native Braze SDK.
푸시 알림 설정하기
1단계: 초기 설정을 완료하십시오
필수 조건
푸시 알림에 Expo를 사용하려면 먼저 Braze Expo 플러그인을 설정해야 합니다.
1.1단계: app.json 파일 업데이트
다음으로 Android 및 iOS용 app.json 파일을 업데이트합니다:
- Android:
enableFirebaseCloudMessaging옵션을 추가합니다. - iOS:
enableBrazeIosPush옵션을 추가합니다.
1.2단계: Google 발신자 ID 추가
먼저 Firebase 콘솔로 이동하여 프로젝트를 연 다음, 설정 > 프로젝트 설정을 선택합니다.

클라우드 메시징을 선택하고 Firebase 클라우드 메시징 API(V1)에서 발신자 ID를 클립보드에 복사합니다.

그런 다음, 프로젝트의 app.json 파일을 열고 firebaseCloudMessagingSenderId 속성정보를 클립보드의 발신자 ID로 설정합니다. 예를 들어, 다음과 같습니다.
1
"firebaseCloudMessagingSenderId": "693679403398"
1.3단계: Google 서비스 JSON에 경로 추가
프로젝트의 app.json 파일에 google-services.json 파일의 경로를 추가합니다. 이 파일은 구성에서 enableFirebaseCloudMessaging: true를 설정할 때 필요합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"expo": {
"android": {
"googleServicesFile": "PATH_TO_GOOGLE_SERVICES"
},
"plugins": [
[
"@braze/expo-plugin",
{
"androidApiKey": "YOUR-ANDROID-API-KEY",
"iosApiKey": "YOUR-IOS-API-KEY",
"enableBrazeIosPush": true,
"enableFirebaseCloudMessaging": true,
"firebaseCloudMessagingSenderId": "YOUR-FCM-SENDER-ID",
"androidHandlePushDeepLinksAutomatically": true
}
],
]
}
}
Expo 알림과 같은 추가 푸시 알림 라이브러리를 사용하는 경우 기본 설정 지침 대신 이 설정을 사용해야 합니다.
Braze Expo 플러그인을 사용하지 않거나 대신 이러한 설정을 네이티브로 구성하려는 경우 네이티브 Android 푸시 통합 가이드를 참조하여 푸시 등록을 하세요.
Braze Expo 플러그인을 사용하지 않거나 대신 이러한 설정을 네이티브로 구성하려는 경우 네이티브 iOS 푸시 통합 가이드의 다음 단계를 참조하여 푸시 등록을 하세요:
1.1단계: 푸시 권한 요청하기
앱이 실행될 때 푸시 권한을 요청하지 않을 계획이라면 앱디렉티브에서 requestAuthorizationWithOptions:completionHandler: 호출을 생략하세요. 그런 다음 2단계로 건너뜁니다. 그렇지 않은 경우 기본 iOS 통합 가이드를 따르세요.
1.2단계(선택 사항): 푸시 키 마이그레이션
이전에 expo-notifications를 사용하여 푸시 키를 관리했다면 애플리케이션의 루트 폴더에서 expo fetch:ios:certs를 실행합니다. 이렇게 하면 푸시 키(.p8 파일)가 다운로드되며, 이를 Braze 대시보드에 업로드할 수 있습니다.
2단계: 푸시 알림 권한 요청하기
Braze.requestPushPermission() 메서드(v1.38.0 이상에서 사용 가능)를 사용하여 iOS 및 Android 13 이상에서 사용자에게 푸시 알림에 대한 권한을 요청합니다. Android 12 이하에서는 이 방법을 사용할 수 없습니다.
이 메서드는 SDK가 iOS에서 사용자에게 요청할 권한을 지정하는 필수 매개변수를 사용합니다. 이러한 옵션은 Android에는 적용되지 않습니다.
1
2
3
4
5
6
7
8
const permissionOptions = {
alert: true,
sound: true,
badge: true,
provisional: false
};
Braze.requestPushPermission(permissionOptions);
2.1단계: 푸시 알림 듣기(선택 사항)
Braze가 수신 푸시 알림을 감지하고 처리한 이벤트를 추가로 구독할 수 있습니다. 리스너 키 Braze.Events.PUSH_NOTIFICATION_EVENT를 사용합니다.
iOS 푸시 수신 이벤트는 포그라운드 알림과 content-available 백그라운드 알림에 대해서만 트리거됩니다. 종료된 상태에서 받은 알림이나 content-available 필드가 없는 백그라운드 알림에 대해서는 트리거되지 않습니다.
1
2
3
4
Braze.addListener(Braze.Events.PUSH_NOTIFICATION_EVENT, data => {
console.log(`Push Notification event of type ${data.payload_type} seen. Title ${data.title}\n and deeplink ${data.url}`);
console.log(JSON.stringify(data, undefined, 2));
});
푸시 알림 이벤트 필드
푸시 알림 필드의 전체 목록은 아래 표를 참조하세요:
| 필드 이름 | 유형 | Description |
|---|---|---|
payload_type |
문자열 | 알림 페이로드 유형을 지정합니다. Braze React Native SDK에서 전송되는 두 개의 값은 push_opened 및 push_received입니다. |
url |
문자열 | 알림에 의해 열린 URL을 지정합니다. |
use_webview |
부울 | true인 경우 URL은 Modal 웹 보기에서 인앱으로 열립니다. false인 경우 기기 브라우저에서 URL이 열립니다. |
title |
문자열 | 알림의 제목을 나타냅니다. |
body |
문자열 | 알림의 본문 또는 콘텐츠 텍스트를 나타냅니다. |
summary_text |
문자열 | 알림의 요약 텍스트를 표시합니다. 이는 iOS의 subtitle 에서 매핑됩니다. |
badge_count |
숫자 | 알림의 배지 개수를 나타냅니다. |
timestamp |
숫자 | 애플리케이션이 페이로드를 수신한 시간을 나타냅니다. |
is_silent |
부울 | true인 경우 페이로드가 자동으로 수신됩니다. Android 무음 푸시 알림을 보내는 방법에 대한 자세한 내용은 Android에서 무음 푸시 알림을 참조하세요. iOS 무음 푸시 알림을 보내는 방법에 대한 자세한 내용은 iOS에서 무음 푸시 알림을 참조하세요. |
is_braze_internal |
부울 | 지오펜스 동기화, 기능 플래그 동기화 또는 제거 추적과 같은 내부 SDK 기능에 대한 알림 페이로드가 전송된 경우 true입니다. 페이로드는 사용자 측에서 자동으로 수신됩니다. |
image_url |
문자열 | 알림 이미지와 연결된 URL을 지정합니다. |
braze_properties |
객체 | 캠페인과 관련된 Braze 속성(키-값 쌍)을 나타냅니다. |
ios |
객체 | iOS 관련 필드를 나타냅니다. |
android |
객체 | Android 전용 필드를 나타냅니다. |
3단계: 딥링킹 활성화(선택 사항)
푸시 알림을 클릭했을 때 Braze가 React 컴포넌트 내부의 딥링킹을 처리하도록 인에이블먼트하려면 먼저 React Native 링크 라이브러리 또는 선택한 솔루션에 설명된 단계를 구현하세요. 그런 다음 아래의 추가 단계를 따르세요.
딥링크 개념에 대한 자세한 내용은 FAQ 문서를 참조하세요.
Braze Expo 플러그인을 사용하는 경우 app.json 에서 androidHandlePushDeepLinksAutomatically 을 true 으로 설정하여 푸시 알림 딥링크를 자동으로 처리할 수 있습니다.
대신 딥링크를 수동으로 처리하려면 기본 Android 설명서를 참조하세요: 딥링크 추가하기.
3.1 단계: 앱 실행 시 푸시 알림 페이로드 저장하기
이 단계는 자동으로 처리되는 기능이므로 Braze Expo 플러그인을 사용하는 경우 3.1단계를 건너뛰세요.
iOS의 경우 AppDelegate의 didFinishLaunchingWithOptions 메서드에 populateInitialPayloadFromLaunchOptions를 추가합니다. 예를 들어, 다음과 같습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"BrazeProject";
self.initialProps = @{};
BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:apiKey endpoint:endpoint];
configuration.triggerMinimumTimeInterval = 1;
configuration.logger.level = BRZLoggerLevelInfo;
Braze *braze = [BrazeReactBridge initBraze:configuration];
AppDelegate.braze = braze;
[self registerForPushNotifications];
[[BrazeReactUtils sharedInstance] populateInitialPayloadFromLaunchOptions:launchOptions];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
3.2 단계: 닫힌 상태에서 딥링크 처리하기
React Native Linking에서 처리하는 기본 시나리오 외에도 Braze.getInitialPushPayload 메서드를 구현하고 url 값을 검색하여 앱이 실행 중이 아닐 때 앱을 여는 푸시 알림의 딥링킹을 고려하세요. For example:
1
2
3
4
5
6
7
8
9
// Handles deep links when an iOS app is launched from a hard close via push click.
// This edge case is not handled in the React Native Linking library and is provided as a workaround by Braze.
Braze.getInitialPushPayload(pushPayload => {
if (pushPayload) {
console.log('Braze.getInitialPushPayload is ' + pushPayload);
showToast('Initial URL is ' + pushPayload.url);
handleOpenUrl({ pushPayload.url });
}
});
React Native의 링킹 API는 앱 시작 시 경합 조건으로 인해 이 시나리오를 지원하지 않으므로 Braze는 이 해결 방법을 제공합니다.
3.3 단계: 유니버설 링크 인에이블먼트(선택 사항)
유니버설 링크 지원을 인에이블하려면 iOS 디렉터리에 BrazeReactDelegate.h 파일을 만든 다음 다음 코드 스니펫을 추가하세요.
1
2
3
4
5
6
#import <Foundation/Foundation.h>
#import <BrazeKit/BrazeKit-Swift.h>
@interface BrazeReactDelegate: NSObject<BrazeDelegate>
@end
그런 다음 BrazeReactDelegate.m 파일을 만든 다음 다음 코드 스니펫을 추가합니다. YOUR_DOMAIN_HOST 을 실제 도메인으로 바꿉니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#import "BrazeReactDelegate.h"
#import <UIKit/UIKit.h>
@implementation BrazeReactDelegate
/// This delegate method determines whether to open a given URL.
///
/// Reference the `BRZURLContext` object to get additional details about the URL payload.
- (BOOL)braze:(Braze *)braze shouldOpenURL:(BRZURLContext *)context {
if ([[context.url.host lowercaseString] isEqualToString:@"YOUR_DOMAIN_HOST"]) {
// Sample custom handling of universal links
UIApplication *application = UIApplication.sharedApplication;
NSUserActivity* userActivity = [[NSUserActivity alloc] initWithActivityType:NSUserActivityTypeBrowsingWeb];
userActivity.webpageURL = context.url;
// Routes to the `continueUserActivity` method, which should be handled in your `AppDelegate`.
[application.delegate application:application
continueUserActivity:userActivity restorationHandler:^(NSArray<id<UIUserActivityRestoring>> * _Nullable restorableObjects) {}];
return NO;
}
// Let Braze handle links otherwise
return YES;
}
@end
그런 다음 프로젝트의 AppDelegate.m 파일에 BrazeReactDelegate 을 생성하고 didFinishLaunchingWithOptions 에 등록합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#import "BrazeReactUtils.h"
#import "BrazeReactDelegate.h"
@interface AppDelegate ()
// Keep a strong reference to the BrazeDelegate to ensure it is not deallocated.
@property (nonatomic, strong) BrazeReactDelegate *brazeDelegate;
@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Other setup code
self.brazeDelegate = [[BrazeReactDelegate alloc] init];
braze.delegate = self.brazeDelegate;
}
통합 예시는 여기에서 샘플 앱을 참조하세요.
4단계: 테스트 푸시 알림 보내기
이 시점에서 기기에 알림을 보낼 수 있어야 합니다. 다음 단계에 따라 푸시 연동을 테스트하세요.
macOS 13부터 특정 기기에서는 Xcode 14 이상에서 실행되는 iOS 16 이상 시뮬레이터에서 푸시 알림을 테스트할 수 있습니다. 자세한 내용은 Xcode 14 릴리스 노트를 참조하세요.
Braze.changeUserId('your-user-id')메서드를 호출하여 React Native 애플리케이션에서 활성 사용자를 설정합니다.- 캠페인으로 이동하여 새 푸시 알림 캠페인을 만듭니다. 테스트할 플랫폼을 선택합니다.
- 테스트 알림을 작성하고 테스트 탭으로 이동합니다. 테스트 사용자와 동일한
user-id를 추가하고 테스트 보내기를 클릭합니다. 곧 기기에서 알림을 받습니다.
.
엑스포 플러그인 사용
엑스포에 대한 푸시 알림을 설정한 후에는 기본 Android 또는 iOS 레이어에서 코드를 작성할 필요 없이 다음 푸시 알림 동작을 처리하는 데 사용할 수 있습니다.
Android 푸시를 추가 FMS로 전달하기
추가 Firebase 메시징 서비스(FMS)를 사용하려는 경우 애플리케이션에서 Braze에서 보낸 푸시가 아닌 푸시를 수신할 경우 호출할 대체 FMS를 지정할 수 있습니다. For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"expo": {
"plugins": [
[
"@braze/expo-plugin",
{
...
"androidFirebaseMessagingFallbackServiceEnabled": true,
"androidFirebaseMessagingFallbackServiceClasspath": "com.company.OurFirebaseMessagingService"
}
]
]
}
}
Expo 애플리케이션 서비스로 앱 확장 사용
Expo 애플리케이션 서비스(EAS)를 사용하고 enableBrazeIosRichPush 또는 enableBrazeIosPushStories를 활성화한 경우 프로젝트의 각 앱 확장에 해당하는 번들 식별자를 선언해야 합니다. 이 단계에는 EAS로 코드 서명을 관리하도록 프로젝트를 구성한 방식에 따라 여러 가지 방법으로 접근할 수 있습니다.
한 가지 방법은 Expo의 앱 확장 설명서에 따라 app.json 파일에서 appExtensions 구성을 사용하는 것입니다. 또는 Expo의 로컬 자격 증명 설명서에 따라 credentials.json 파일에서 multitarget 설정을 구성할 수도 있습니다.
문제 해결
다음은 Braze React Native SDK 및 Expo 플러그인과의 푸시 알림 통합에 대한 일반적인 문제 해결 단계입니다.
푸시 알림이 작동을 멈췄습니다.
엑스포 플러그인을 통한 푸시 알림이 작동을 멈춘 경우:
- Braze 소프트웨어 개발 키트에서 세션을 추적하고 있는지 확인합니다.
wipeData에 대한 명시적 또는 암시적 호출로 소프트웨어 개발 키트가 비활성화되지 않았는지 확인합니다.- 최근 업그레이드된 Expo 또는 관련 라이브러리가 Braze 구성과 충돌할 수 있으므로 이를 검토하세요.
- 최근에 추가된 프로젝트 종속성을 검토하고 기존 푸시 알림 델리게이트 메서드를 수동으로 재정의하고 있는지 확인하세요.
iOS 통합의 경우 푸시 알림 설정 튜토리얼을 참조하여 프로젝트 종속성과의 잠재적 충돌을 식별할 수도 있습니다.
기기 토큰이 Braze에 등록되지 않습니다.
기기 토큰이 Braze에 등록되지 않는 경우 먼저 푸시 알림 작동 중지를 검토하세요.
문제가 지속되면 별도의 종속성이 Braze 푸시 알림 구성을 방해하고 있을 수 있습니다. 대신 제거하거나 Braze.registerPushToken 으로 직접 문의할 수 있습니다.
Prerequisites
Before you can use this feature, you’ll need to integrate the Web Braze SDK. 웹 소프트웨어 개발 키트에 대한 푸시 알림도 설정해야 합니다. Safari v16.4 이상을 사용하는 iOS 및 iPadOS 사용자에게만 푸시 알림을 보낼 수 있다는 점에 유의하세요.
모바일용 Safari 푸시 설정하기
1단계: 매니페스트 파일 만들기
웹 애플리케이션 매니페스트는 웹사이트가 사용자의 홈 화면에 설치될 때 표시되는 방식을 제어하는 JSON 파일입니다.
예를 들어 앱 스위처에서 사용하는 배경 테마 색상과 아이콘, 기본 앱과 비슷하게 전체 화면으로 렌더링할지, 앱을 가로 또는 세로 모드로 열지 여부를 설정할 수 있습니다.
웹사이트의 루트 디렉터리에 다음과 같은 필수 필드를 사용하여 manifest.json 파일을 새로 만듭니다.
1
2
3
4
5
6
7
8
9
{
"name": "your app name",
"short_name": "your app name",
"display": "fullscreen",
"icons": [{
"src": "favicon.ico",
"sizes": "128x128",
}]
}
지원되는 전체 필드 목록은 여기에서 확인할 수 있습니다.
2단계: 매니페스트 파일 링크
웹사이트의 <head> 요소에 매니페스트 파일이 호스팅되는 위치를 가리키는 다음 <link> 태그를 추가합니다.
1
<link rel="manifest" href="/manifest.json" />
3단계: 서비스 종사자 추가
웹 푸시 통합 가이드에 설명된 대로 웹사이트에 Braze 서비스 워커 라이브러리를 가져오는 서비스 워커 파일이 있어야 합니다.
4단계: 홈 화면에 추가
인기 있는 웹 브라우저(예: Safari, Chrome, FireFox, Edge)는 모두 이후 버전에서 웹 푸시 알림을 지원합니다. iOS 또는 iPadOS에서 푸시 권한을 요청하려면 공유 대상 > 홈 화면에 추가를 선택하여 웹사이트를 사용자의 홈 화면에 추가해야 합니다. 홈 화면에 추가를 사용하면 사용자가 웹사이트를 북마크에 추가하여 귀사의 아이콘을 소중한 홈 화면 공간에 추가할 수 있습니다.

5단계: 기본 푸시 프롬프트 표시
앱을 홈 화면에 추가한 후 사용자가 버튼을 클릭하는 등의 동작을 수행할 때 푸시 권한을 요청할 수 있습니다. requestPushPermission 메서드를 사용하거나 노코드 푸시 프라이머 인앱 메시지를 사용하여 수행할 수 있습니다.
프롬프트를 수락하거나 거부한 후 홈 화면에 웹사이트를 삭제하고 다시 설치해야 프롬프트가 다시 표시될 수 있습니다.

예를 들어, 다음과 같습니다.
1
2
3
4
5
6
7
8
9
import { requestPushPermission } from "@braze/web-sdk";
button.onclick = function(){
requestPushPermission(() => {
console.log(`User accepted push prompt`);
}, (temporary) => {
console.log(`User ${temporary ? "temporarily dismissed" : "permanently denied"} push prompt`);
});
};
다음 단계
그런 다음 테스트 메시지를 보내 통합을 검증합니다. 통합이 완료되면 코드가 없는 푸시 프라이머 메시지를 사용하여 푸시 옵트인율을 최적화할 수 있습니다.
Prerequisites
이 기능을 사용하려면 먼저 Unity Braze SDK를 통합해야 합니다.
Setting up push notification
Step 1: Set up the platform
Step 1.1: Enable Firebase
To get started, follow the Firebase Unity setup documentation.
Integrating the Firebase Unity SDK may cause your AndroidManifest.xml to be overridden. If that occurs, make sure to revert it to the original.
Step 1.2: Set your Firebase credentials
You need to input your Firebase Server Key and Sender ID into the Braze dashboard. To do this, log in to the Firebase Developers Console and select your Firebase project. Next, select Cloud Messaging under Settings and copy the Server Key and Sender ID:
In Braze, select your Android app on the App Settings page under Manage Settings. Next, enter your Firebase Server Key in the Firebase Cloud Messaging Server Key field and Firebase Sender ID in the Firebase Cloud Messaging Sender ID field.

Step 1.1: Verify integration method
Braze provides a native Unity solution for automating iOS push integrations. If you you’d like to set up and manage your integration manually instead, see Swift: Push Notifications.
Otherwise, continue to the next step.
Our automatic push notification solution takes advantage of iOS 12’s Provisional Authorization feature and is not available to use with the native push prompt pop-up.
Step 1.1: Enable ADM
- Create an account with the Amazon Apps & Games Developer Portal if you have not already done so.
- Obtain OAuth credentials (Client ID and Client Secret) and an ADM API key.
- Enable Automatic ADM Registration Enabled in the Unity Braze Configuration window.
- Alternatively, you may add the following line to your
res/values/braze.xmlfile to enable ADM registration:
- Alternatively, you may add the following line to your
1
<bool name="com_braze_push_adm_messaging_registration_enabled">true</bool>
Step 2: Configure push notifications
Step 2.1: Configure push settings
The Braze SDK can automatically handle push registration with the Firebase Cloud Messaging Servers to have devices receive push notifications. In Unity, enable Automate Unity Android Integration, then configure the following Push Notification settings.
| Setting | Description |
|---|---|
| Automatic Firebase Cloud Messaging Registration Enabled | Instructs the Braze SDK to automatically retrieve and send an FCM push token for a device. |
| Firebase Cloud Messaging Sender ID | The Sender ID from your Firebase console. |
| Handle Push Deeplinks Automatically | Whether the SDK should handle opening deep links or opening the app when push notifications are clicked. |
| Small Notification Icon Drawable | The drawable should be displayed as the small icon whenever a push notification is received. The notification will use the application icon as the small icon if no icon is provided. |
Step 2.1: Upload your APNs token
Before you can send an iOS push notification using Braze, you need to upload your .p8 push notification file, as described in Apple’s developer documentation:
- In your Apple developer account, go to Certificates, Identifiers & Profiles.
- Under Keys, select All and click the add button (+) in the upper-right corner.
- Under Key Description, enter a unique name for the signing key.
- Under Key Services, select the Apple Push Notification service (APNs) checkbox, then click Continue. Click Confirm.
- Note the key ID. Click Download to generate and download the key. Make sure to save the downloaded file in a secure place, as you cannot download this more than once.
- In Braze, go to Settings > App Settings and upload the
.p8file under Apple Push Certificate. You can upload either your development or production push certificate. To test push notifications after your app is live in the App Store, its recommended to set up a separate workspace for the development version of your app. - When prompted, enter your app’s bundle ID, key ID, and team ID. You’ll also need to specify whether to send notifications to your app’s development or production environment, which is defined by its provisioning profile.
- When you’re finished, select Save.
Step 2.2: Enable automatic push
Open the Braze Configuration Settings in the Unity Editor by navigating to Braze > Braze Configuration.
Check Integrate Push With Braze to automatically register users for push notifications, pass push tokens to Braze, track analytics for push opens, and take advantage of our default push notification handling.
Step 2.3: Enable background push (optional)
Check Enable Background Push if you want to enable background mode for push notifications. This allows the system to wake your application from the suspended state when a push notification arrives, enabling your application to download content in response to push notifications. Checking this option is required for our uninstall tracking functionality.

Step 2.4: Disable automatic registration (optional)
Users who have not yet opted-in to push notifications will automatically be authorized for push upon opening your application. To disable this feature and manually register users for push, check Disable Automatic Push Registration.
- If Disable Provisional Authorization is not checked on iOS 12 or later, the user will be provisionally (silently) authorized to receive quiet push. If checked, the user will be shown the native push prompt.
- If you need to configure exactly when the prompt is shown at runtime, disable automatic registration from the Braze configuration editor and use
AppboyBinding.PromptUserForPushPermissions()instead.

Step 2.1: Update AndroidManifest.xml
If your app does not have an AndroidManifest.xml, you can use the following as a template. Otherwise, if you already have an AndroidManifest.xml, ensure that any of the following missing sections are added to your existing AndroidManifest.xml.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="REPLACE_WITH_YOUR_PACKAGE_NAME">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<permission
android:name="REPLACE_WITH_YOUR_PACKAGE_NAME.permission.RECEIVE_ADM_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="REPLACE_WITH_YOUR_PACKAGE_NAME.permission.RECEIVE_ADM_MESSAGE" />
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
<application android:icon="@drawable/app_icon"
android:label="@string/app_name">
<!-- Calls the necessary Braze methods to ensure that analytics are collected and that push notifications are properly forwarded to the Unity application. -->
<activity android:name="com.braze.unity.BrazeUnityPlayerActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:screenOrientation="sensor">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.braze.push.BrazeAmazonDeviceMessagingReceiver" android:permission="com.amazon.device.messaging.permission.SEND">
<intent-filter>
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
<category android:name="REPLACE_WITH_YOUR_PACKAGE_NAME" />
</intent-filter>
</receiver>
</application>
</manifest>
Step 2.2: Store your ADM API key
First, generate an ADM API Key for your app, then save the key to a file named api_key.txt and add it in your project’s Assets/ directory.
Amazon will not recognize your key if api_key.txt contains any white space characters, such as a trailing line break.
Next, in your mainTemplate.gradle file, add the following:
1
2
3
4
5
6
7
task copyAmazon(type: Copy) {
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
from unityProjectPath + '/Assets/api_key.txt'
into new File(projectDir, 'src/main/assets')
}
preBuild.dependsOn(copyAmazon)
Step 2.3: Add ADM Jar
The required ADM Jar file may be placed anywhere in your project according to the Unity JAR documentation.
Step 2.4: Add Client Secret and Client ID to your Braze dashboard
Lastly, you must add the Client Secret and Client ID you obtained in Step 1 to the Braze dashboard’s Manage Settings page.

Step 3: Set push listeners
Step 3.1: Enable push received listener
The push received listener is fired when a user receives a push notification. To send the push payload to Unity, set the name of your game object and push the received listener callback method under the Set Push Received Listener.
Step 3.2: Enable push opened listener
The push opened listener is fired when a user launches the app by clicking on a push notification. To send the push payload to Unity, set the name of your game object and push opened listener callback method under the Set Push Opened Listener.
Step 3.3: Enable push deleted listener
The push deleted listener is fired when a user swipes away or dismisses a push notification. To send the push payload to Unity, set the name of your game object and push deleted listener callback method under the Set Push Deleted Listener.
Push listener example
The following example implements the BrazeCallback game object using a callback method name of PushNotificationReceivedCallback, PushNotificationOpenedCallback, and PushNotificationDeletedCallback respectively.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class MainMenu : MonoBehaviour {
void PushNotificationReceivedCallback(string message) {
#if UNITY_ANDROID
Debug.Log("PushNotificationReceivedCallback message: " + message);
PushNotification pushNotification = new PushNotification(message);
Debug.Log("Push Notification received: " + pushNotification);
#elif UNITY_IOS
ApplePushNotification pushNotification = new ApplePushNotification(message);
Debug.Log("Push received Notification event: " + pushNotification);
#endif
}
void PushNotificationOpenedCallback(string message) {
#if UNITY_ANDROID
Debug.Log("PushNotificationOpenedCallback message: " + message);
PushNotification pushNotification = new PushNotification(message);
Debug.Log("Push Notification opened: " + pushNotification);
#elif UNITY_IOS
ApplePushNotification pushNotification = new ApplePushNotification(message);
Debug.Log("Push opened Notification event: " + pushNotification);
#endif
}
void PushNotificationDeletedCallback(string message) {
#if UNITY_ANDROID
Debug.Log("PushNotificationDeletedCallback message: " + message);
PushNotification pushNotification = new PushNotification(message);
Debug.Log("Push Notification dismissed: " + pushNotification);
#endif
}
}
Step 3.1: Enable push received listener
The push received listener is fired when a user receives a push notification while actively using the application (such as when the app is foregrounded). Set the push received listener in the Braze configuration editor. If you need to configure your game object listener at runtime, use AppboyBinding.ConfigureListener() and specify BrazeUnityMessageType.PUSH_RECEIVED.

Step 3.2: Enable push opened listener
The push opened listener is fired when a user launches the app by clicking on a push notification. To send the push payload to Unity, set the name of your game object and push opened listener callback method under the Set Push Opened Listener option:

If you need to configure your game object listener at runtime, use AppboyBinding.ConfigureListener() and specify BrazeUnityMessageType.PUSH_OPENED.
Push listener example
The following example implements the AppboyCallback game object using a callback method name of PushNotificationReceivedCallback and PushNotificationOpenedCallback, respectively.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class MainMenu : MonoBehaviour {
void PushNotificationReceivedCallback(string message) {
#if UNITY_ANDROID
Debug.Log("PushNotificationReceivedCallback message: " + message);
PushNotification pushNotification = new PushNotification(message);
Debug.Log("Push Notification received: " + pushNotification);
#elif UNITY_IOS
ApplePushNotification pushNotification = new ApplePushNotification(message);
Debug.Log("Push received Notification event: " + pushNotification);
#endif
}
void PushNotificationOpenedCallback(string message) {
#if UNITY_ANDROID
Debug.Log("PushNotificationOpenedCallback message: " + message);
PushNotification pushNotification = new PushNotification(message);
Debug.Log("Push Notification opened: " + pushNotification);
#elif UNITY_IOS
ApplePushNotification pushNotification = new ApplePushNotification(message);
Debug.Log("Push opened Notification event: " + pushNotification);
#endif
}
}
By updating your AndroidManifest.xml in the previous step, push listeners were automatically set up when you added the following lines. So, no further setup is required.
1
2
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
To learn more about ADM push listeners, see Amazon: Integrate Amazon Device Messaging.
Optional configurations
Deep linking to in-app resources
Although Braze can handle standard deep links (such as website URLs, Android URIs, etc.) by default, creating custom deep links requires an additional Manifest setup.
For setup guidance, visit Deep Linking to In-App Resources.
Adding Braze push notification icons
To add push icons to your project, create an Android Archive (AAR) plug-in or Android library that contains the icon image files. For steps and information, refer to Unity’s documentation: Android Library Projects and Android Archive plug-ins.
Push token callback
To receive a copy of Braze device tokens from the OS, set a delegate using AppboyBinding.SetPushTokenReceivedFromSystemDelegate().
There are no optional configurations for ADM at this time.
Prerequisites
Before you can use this feature, you’ll need to integrate the Unreal Engine Braze SDK.
푸시 알림 설정하기
1단계: 프로젝트 설정
먼저, Android 프로젝트에 Firebase를 추가합니다. 단계별 지침은 Google의 Firebase 설정 가이드를 참조하세요.
Before you can send an iOS push notification using Braze, you need to upload your .p8 push notification file, as described in Apple’s developer documentation:
- In your Apple developer account, go to Certificates, Identifiers & Profiles.
- Under Keys, select All and click the add button (+) in the upper-right corner.
- Under Key Description, enter a unique name for the signing key.
- Under Key Services, select the Apple Push Notification service (APNs) checkbox, then click Continue. Click Confirm.
- Note the key ID. Click Download to generate and download the key. Make sure to save the downloaded file in a secure place, as you cannot download this more than once.
- In Braze, go to Settings > App Settings and upload the
.p8file under Apple Push Certificate. You can upload either your development or production push certificate. To test push notifications after your app is live in the App Store, its recommended to set up a separate workspace for the development version of your app. - When prompted, enter your app’s bundle ID, key ID, and team ID. You’ll also need to specify whether to send notifications to your app’s development or production environment, which is defined by its provisioning profile.
- When you’re finished, select Save.
2단계: 푸시 알림 사용 설정
프로젝트의 engine.ini 파일에 다음 줄을 추가합니다. Firebase 프로젝트에서 YOUR_SEND_ID 을 발신자 ID로 바꾸어야 합니다.
1
2
3
bEnableFirebaseCloudMessagingSupport=true
bIsFirebaseCloudMessagingRegistrationEnabled=true
FirebaseCloudMessagingSenderIdKey=YOUR_SENDER_ID
와 같은 디렉터리 내에 BrazeUPLAndroid.xml와 같은 디렉토리에 AndroidCopies 라는 이름의 새 디렉토리를 만들고 google-services.json 파일을 추가합니다.
프로젝트에서 설정 > 프로젝트 설정 > iOS > 온라인으로 이동한 다음 원격 알림 지원 활성화에 체크합니다. 완료되면 프로비저닝에 푸시 기능이 사용 설정되어 있는지 확인합니다.
iOS용 푸시 기능을 사용하려면 프로젝트가 소스에서 빌드되어 있어야 합니다. 자세한 내용은 언리얼 엔진을 참조하세요: 소스에서 빌드.
선택적 구성
작은 아이콘과 큰 아이콘 설정하기
작은 알림 아이콘과 큰 알림 아이콘을 설정하려면 다음과 같이 하세요:
AndroidCopies/res폴더 안에 있는 적절한 그리기 가능한 폴더(기본값은drawable)에 아이콘을 추가합니다.AndroidCopies/res/values폴더에braze.xml을 추가하여 아이콘을 설정합니다. 아주 기본적인 braze.xml 파일입니다:1 2 3 4 5
<?xml version="1.0" encoding="utf-8"?> <resources> <drawable name="com_braze_push_small_notification_icon">@drawable/notification_small_icon</drawable> <drawable name="com_braze_push_large_notification_icon">@drawable/notification_large_icon</drawable> </resources>
AndroidCopies 폴더의 파일은 BrazeUPLAndroid.xml 에 정의된 대로 생성된 안드로이드 프로젝트 구조에 복사됩니다.
원격 실행 알림
언리얼 엔진 4.25.3 버전부터 UE4 에는 애플리케이션 초기 실행을 유발하는 원격 알림 수신 기능이 제대로 지원되지 않습니다. 이 알림 수신을 지원하기 위해 UE4용과 Braze SDK 플러그인용 두 개의 git 패치를 만들었습니다.
- UE4 엔진
Source디렉터리에서 git 패치UE4_Engine-Cache-Launch-Remote-Notification.patch를 적용합니다. - Braze 언리얼 SDK 디렉터리에서 git 패치
Braze_SDK-Read-Cached-Remote-Launch-Notification.patch를 적용합니다.
Prerequisites
이 기능을 사용하기 전에 Xamarin Braze 소프트웨어 개발 키트를 통합해야 합니다.
Setting up push notifications
To see how namespaces change between Java and C#, check out our Xample sample app on GitHub.
To integrate push notifications for Xamarin, you’ll need to complete the steps for native Android push notifications. The following steps are only a summary. For a full walkthrough, see the native push notification guide.
Step 1: Update your project
- Add Firebase to your Android project.
- Add the Cloud Messaging library to your Android project’s
build.gradle:1
implementation "google.firebase:firebase-messaging:+"
Step 2: Create your JSON credentials
- In Google Cloud, enable the Firebase Cloud Messaging API.
- Select Service Accounts > your project > Create Service Account, then enter a service account name, ID, and description. When you’re finished, select Create and continue.
- In the Role field, find and select Firebase Cloud Messaging API Admin from the list of roles.
- In Service Accounts, choose your project, then select Actions > Manage Keys > Add Key > Create new key. Choose JSON, then select Create.
Step 3: Upload your JSON credentials
- In Braze, select Settings > App Settings. Under your Android app’s Push Notification Settings, choose Firebase, then select Upload JSON File and upload the credentials you generated earlier. When you’re finished, select Save.
- Enable automatic FCM token registration, by going to Firebase Console. Open your project, then select Settings > Project settings. Select Cloud Messaging, then under Firebase Cloud Messaging API (V1), copy the number in the Sender ID field.
- In your Android Studio project and the following to your
braze.xml.
1
2
<bool translatable="false" name="com_braze_firebase_cloud_messaging_registration_enabled">true</bool>
<string translatable="false" name="com_braze_firebase_cloud_messaging_sender_id">FIREBASE_SENDER_ID</string>
To prevent Braze from triggering unnecessary network requests every time you send silent push notifications, remove any automatic network requests configured in your Application class’s onCreate() method. For more information see, Android Developer Reference: Application.
Step 1: Complete the initial setup
See the Swift integration instructions for information about setting up your application with push and storing your credentials on our server. Refer to the iOS MAUI sample application for more details.
Step 2: Request push notifications permission
Our Xamarin SDK now supports automatic push set up. Set up push automation and permissions by adding the following code to your Braze instance configuration:
1
2
configuration.Push.Automation = new BRZConfigurationPushAutomation(true);
configuration.Push.Automation.RequestAuthorizationAtLaunch = false;
Refer to the iOS MAUI sample application for more details. For more details, see the Xamarin documentation for Enhanced User Notifications in Xamarin.iOS.
GitHub 에서 이 페이지를 편집합니다.