API | Description |
Register the push service after log in to is complete | |
Unregister the offline push service when logging out of the IM account. | |
Disable the plugin after logging in to automatically register the push service; it needs to be called before registering the push service |
API | Description |
It is only supported to be called in the Notification Service Extension's '- didReceiveNotificationRequest:withContentHandler:' method;
appGroup indicates the App Group shared between the main App and the Extension. It needs to be configured in the Capability of the main App to enable App Groups. |
[TIMPush registerPush];
[TIMPush unRegisterPush];
[TIMPush disableAutoRegisterPush];
request | |
appGroupID | The appGroup identifier represents the App Group shared between the main App and its Extension. It needs to be configured in the main App's Capability as App Groups. |
callback | typedef void(^TIMPushNotificationExtensionCallback)(UNNotificationContent *content) Statistical function Callback, carrying content information |
- (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);}];}
Was this page helpful?