API | 描述 |
注册推送服务, 在登录完成之后调用 | |
反注册离线推送服务,IM 账号登出时调用。 | |
关闭插件在登录后自动注册推送服务,需要在注册推送服务之前调用 |
API | 描述 |
仅支持在 Notification Service Extension 的 '- didReceiveNotificationRequest:withContentHandler:' 方法中调用;
appGroup 标识当前主 App 和 Extension 之间共享的 App Group,需要在主 App 的 Capability 中配置 App Groups 能力。 |
[TIMPush registerPush];
[TIMPush unRegisterPush];
[TIMPush disableAutoRegisterPush];
request | |
appGroupID | appGroup 标识当前主 App和 Extension 之间共享的 App Group,需要在主 App 的 Capability 中配置 App Groups 能力。 |
callback | typedef void(^TIMPushNotificationExtensionCallback)(UNNotificationContent *content) 统计函数Callback,携带content信息 |
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {self.contentHandler = contentHandler;NSString * appGroupID = kTIMPushAppGorupKey;__weak typeof(self) weakSelf = self;[TIMPush onReceiveNotificationRequest:request inAppGroupID:appGroupID callback:^(UNNotificationContent *content) {weakSelf.bestAttemptContent = [content mutableCopy];// Modify the notification content here...// self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];weakSelf.contentHandler(weakSelf.bestAttemptContent);}];}
本页内容是否解决了您的问题?