백그라운드 알림 전달 | Push | Appbox iOS SDK 가이드
백그라운드 알림 전달
백그라운드 알림 전달
AppBox.handleRemoteNotification(userInfo: [AnyHashable: Any])
Swift
1
func application(
2
_ application: UIApplication,
3
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
4
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
5
) {
6
AppBox.handleRemoteNotification(userInfo: userInfo)
7
completionHandler(.newData)
8
}
1
- (void)application:(UIApplication *)application
2
didReceiveRemoteNotification:(NSDictionary *)userInfo
3
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
4
[AppBox handleRemoteNotificationUserInfo:userInfo];
5
completionHandler(UIBackgroundFetchResultNewData);
6
}
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
userInfo | 필수 | AppDelegate가 받은 원격 알림 payload | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
| 없음 | 반환값과 SDK callback이 없습니다 |
시스템의 fetchCompletionHandler는 앱에서 반드시 호출합니다. 같은 알림 payload를 여러 lifecycle 경로에서 중복 전달하지 않습니다. payload 전체를 운영 로그에 출력하지 않습니다.
AppDelegate 연결 예제는 AppBoxSampleiOS에서 확인할 수 있습니다.