콘텐츠로 건너뛰기

iOS 메시지 전송 추적

Pushwoosh에는 푸시 알림 전송을 추적하는 API 메서드가 있습니다. iOS의 푸시 알림은 Pushwoosh SDK가 아닌 OS에서 처리하므로 iOS 앱은 이 메서드를 기본적으로 지원하지 않습니다. 하지만 푸시 전송 추적을 위한 Pushwoosh Notification Service Extension을 프로젝트에 추가하여 전송 추적을 구현할 수 있습니다. 여기에서 iOS 앱을 위한 메시지 전송 추적(Message Delivery Tracking)을 구현하는 단계를 확인할 수 있습니다.

Notification Service Extension 추가

Anchor link to
  1. Xcode에서 File > New > **Target…**을 선택합니다.

  2. Notification Service Extension을 선택하고 Next를 누릅니다.

  1. 제품 이름을 입력하고 Finish를 누릅니다.
  1. Activate scheme 프롬프트에서 Cancel을 누릅니다.

취소하면 방금 생성한 extension 대신 앱을 계속 Xcode에서 디버깅할 수 있습니다. 실수로 활성화한 경우, Xcode 내에서 앱 디버깅으로 다시 전환할 수 있습니다.

Notification Service Extension 종속성 (CocoaPods만 해당)

Anchor link to

참고: Swift Package Manager를 사용하여 종속성을 관리하는 경우, 종속성이 자동으로 추가되므로 이 단계를 건너뛸 수 있습니다.

Podfile을 열고 타겟에 대한 종속성을 추가합니다:

Podfile
target 'NotificationServiceExtension' do
use_frameworks!
pod 'PushwooshXCFramework'
end

터미널에서 다음 명령을 실행하여 종속성을 설치합니다:

Terminal window
rm -rf Podfile.lock
pod deintegrate
pod setup
pod repo update
pod install

메시지 전송 이벤트 추적 코드 추가

Anchor link to
  1. NotificationService.m 파일에 다음 코드를 추가합니다:
import UserNotifications
import PushwooshFramework
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
PWNotificationExtensionManager.shared().handle(request, contentHandler: contentHandler)
}
}
  1. Notification Service Extension의 info.plistPushwoosh_APPID를 추가합니다.
<key>Pushwoosh_APPID</key>
<string>XXXXX-XXXXX</string>

피드백을 공유해주세요

Anchor link to

여러분의 피드백은 더 나은 경험을 만드는 데 도움이 됩니다. SDK 통합 과정에서 문제가 발생하면 언제든지 알려주시기 바랍니다. 어려움이 있으시면 주저하지 마시고 이 양식을 통해 의견을 공유해주세요.