Skip to content

다양한 푸시 알림

Braze SDK에 대한 리치 푸시 알림을 설정하는 방법을 알아보세요.

Prerequisites

이 기능을 사용하려면 먼저 Swift Braze SDK를 통합해야 합니다. 푸시 알림도 설정해야 합니다.

리치 푸시 알림 설정하기

1단계: 서비스 확장 만들기

알림 서비스 확장을 생성하려면 Xcode에서 파일 > 새로 만들기 > 대상으로 이동하고 알림 서비스 확장을 선택합니다.

애플리케이션에 임베드가 애플리케이션에 확장을 임베드하도록 설정되었는지 확인합니다.

2단계: 알림 서비스 확장 설정하기

알림 서비스 확장은 앱에 번들로 제공되는 자체 바이너리입니다. Apple 개발자 포털에서 자체 앱 ID 및 프로비저닝 프로필을 사용하여 설정해야 합니다.

알림 서비스 확장 프로그램의 번들 ID는 기본 앱 대상의 번들 ID와 구별되어야 합니다. 예를 들어 앱의 번들 ID가 com.company.appname인 경우 서비스 확장에 com.company.appname.AppNameServiceExtension을 사용할 수 있습니다.

3단계: 리치 푸시 알림 통합

리치 푸시 알림을 BrazeNotificationService와 통합하는 방법에 대한 단계별 가이드는 튜토리얼을 참조하세요.

샘플을 보려면 예제 앱의 NotificationService 의 사용법을 참조하세요.

앱에 리치 푸시 프레임워크 추가하기

스위프트 패키지 매니저 통합 가이드를 수행한 후 다음을 수행하여 Notification Service ExtensionBrazeNotificationService를 추가합니다.

  1. Xcode의 프레임워크 및 라이브러리에서 추가 아이콘을 선택하여 프레임워크를 추가합니다.

    더하기 아이콘은 Xcode의 프레임워크 및 라이브러리 아래에 있습니다.

  2. “BrazeNotificationService” 프레임워크를 선택합니다.

    "BrazeNotificationService 프레임워크는 열리는 모달에서 선택할 수 있습니다.

포드파일에 다음을 추가합니다:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
target 'YourAppTarget' do
  pod 'BrazeKit'
  pod 'BrazeUI'
  pod 'BrazeLocation'
end

target 'YourNotificationServiceExtensionTarget' do
  pod 'BrazeNotificationService'
end

# Only include the below if you want to also integrate Push Stories
target 'YourNotificationContentExtensionTarget' do
  pod 'BrazePushStory'
end

Podfile을 업데이트한 후 터미널에서 Xcode 앱 프로젝트의 디렉토리로 이동하고 pod install을 실행합니다.

Notification Service ExtensionBrazeNotificationService.xcframework 를 추가하려면 수동 통합을 참조하세요.

자체 UNNotificationServiceExtension 사용

자체 UNNotificationServiceExtension을 사용해야 하는 경우 대신 didReceive 메서드에서 brazeHandle을 호출하면 됩니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import BrazeNotificationService
import UserNotifications

class NotificationService: UNNotificationServiceExtension {

  override func didReceive(
    _ request: UNNotificationRequest,
    withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
  ) {
    if brazeHandle(request: request, contentHandler: contentHandler) {
      return
    }

    // Custom handling here

    contentHandler(request.content)
  }
}

4단계: 대시보드에서 리치 알림 만들기

마케팅팀은 대시보드에서 다양한 알림을 만들 수도 있습니다. 푸시 작성기를 통해 푸시 알림을 생성하고 이미지나 GIF를 첨부하거나 이미지, GIF 또는 비디오를 호스팅하는 URL을 제공하기만 하면 됩니다. 푸시 알림을 받으면 자산이 다운로드되므로 콘텐츠를 호스팅하는 경우 요청이 동시에 급증하는 상황에 대비해야 합니다.

Prerequisites

Before you can use this feature, you’ll need to integrate the Cordova Braze SDK. You’ll also need to set up push notifications.

Setting up rich push notifications

Step 1: Create a notification service extension

In your Xcode project, create a notification service extension. For a full walkthrough, see iOS Rich Push Notifications Tutorial.

Step 2: Add a new target

Open your Podfile and add BrazeNotificationService to the notification service extension target you just created. If BrazeNotificationService is already added to a target, remove it before continuing. To avoid duplicate symbol errors, use static linking.

1
2
3
4
target 'NOTIFICATION_SERVICE_EXTENSION' do
  use_frameworks! :linkage => :static
  pod 'BrazeNotificationService'
end

Replace NOTIFICATION_SERVICE_EXTENSION with the name of your notification service extension. Your Podfile should be similar to the following:

1
2
3
4
target 'MyAppRichNotificationService' do
  use_frameworks! :linkage => :static
  pod 'BrazeNotificationService'
end

Step 3: Reinstall your CocoaPods dependencies

In the terminal, go to your project’s iOS directory and reinstall your CocoaPod dependencies.

1
2
cd PATH_TO_PROJECT/platform/ios
pod install

Prerequisites

Before you can use this feature, you’ll need to integrate the React Native Braze SDK. You’ll also need to set up push notifications.

Using Expo to enable rich push notifications

For the React Native SDK, rich push notifications are available for Android by default.

To enable rich push notifications on iOS using Expo, configure the enableBrazeIosRichPush property to true in your expo.plugins object in app.json:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "expo": {
    "plugins": [
      [
        "@braze/expo-plugin",
        {
          ...
          "enableBrazeIosRichPush": true
        }
      ]
    ]
  }
}

Lastly, add the bundle identifier for this app extension to your project’s credentials configuration: <your-app-bundle-id>.BrazeExpoRichPush. For further details on this process, refer to Using app extensions with Expo Application Services.

이 페이지가 얼마나 도움이 되었나요?
New Stuff!