iOS Extension SDK API (iOS 10+)
/**
@brief 信鸽推送处理抵达到终端到消息
@param request 推送请求
@param appID 信鸽应用ID
@param handler 处理消息的回执,回调方法中处理关联的富媒体文件
@note 关联的富媒体文件,需要在推送前端设置资源的完整URL地址,SDK内部会自动下载
*/
- (void)handleNotificationRequest:(nonnull UNNotificationRequest *)request
appID:(uint32_t)appID contentHandler:(nullable void(^)( NSArray
<UNNotificationAttachment *>* _Nullable attachments, NSError * _Nullable
error))handler;
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request
withContentHandler:(void (^)(UNNotificationContent *
_Nonnull))contentHandler {
[[XGExtension defaultManager] handleNotificationRequest:request appID:
<#your xg AppID#> contentHandler:nil];
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
self.contentHandler(self.bestAttemptContent);
}