포그라운드 알림 전달 | Push | Appbox iOS SDK 가이드

포그라운드 알림 전달

앱이 foreground에 있을 때 받은 알림 요청을 SDK에 전달합니다.

포그라운드 알림 전달

AppBox.handleForegroundNotification(_ request: UNNotificationRequest) -> Bool

Swift
1 func userNotificationCenter(
2 _ center: UNUserNotificationCenter,
3 willPresent notification: UNNotification,
4 withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
5 ) {
6 _ = AppBox.handleForegroundNotification(notification.request)
7 completionHandler([.badge, .alert, .sound])
8 }
1 - (void)userNotificationCenter:(UNUserNotificationCenter *)center
2 willPresentNotification:(UNNotification *)notification
3 withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
4 [AppBox handleForegroundNotification:notification.request];
5 completionHandler(
6 UNNotificationPresentationOptionBadge |
7 UNNotificationPresentationOptionAlert |
8 UNNotificationPresentationOptionSound
9 );
10 }

Request 항목 정의

Request 항목필수여부설명기본값
request필수willPresent callback이 전달한 UNNotificationRequest-

Response 항목 정의

Response 결과값
Bool알림 요청을 Push runtime에 전달했는지 여부. 즉시 반환됩니다


UNUserNotificationCenterDelegate를 앱에서 지정해야 합니다. 알림 표시 옵션은 SDK가 아니라 앱의 completionHandler에서 결정합니다. 시스템 completion handler를 반드시 호출합니다.

AppDelegate 연결 예제는 AppBoxSampleiOS에서 확인할 수 있습니다.

www.naver.com
QR 코드를 촬영하면 입력하신 주소의
앱 예시 화면을 테스트할 수 있습니다.
* 스캔 후 바로 앱 다운로드 이동합니다.