The Notification Service Extension modifies the notification content by adding actions, push polls and allows you to take advantage of iOS 10+ notification features.

1. Add new target to your project (File->New->Target) and create Notification Service Extension, and name it PushbotsNSExtension , Press cancel on the "Activate PushbotsNSExtension  scheme" prompt:

Make sure deployment target of the Notification Extesion Service is set to 10 or higher under General tab.

2. Open NotificationService.m  or  NotificationService.swift  under PushbotsNSExtension Group 

and copy the code below:
Objective-C  NotificationService.m 

//  NotificationService.m
#import <Pushbots/Pushbots.h>
#import "NotificationService.h"

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@property (nonatomic, strong) UNNotificationRequest *notificationRequest;

@end

@implementation NotificationService

- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
    self.notificationRequest = request;
    self.contentHandler = contentHandler;
    self.bestAttemptContent = [request.content mutableCopy];

    [Pushbots didReceiveNotificationExtensionRequest:self.notificationRequest withContent:self.bestAttemptContent];
    self.contentHandler(self.bestAttemptContent);
}

- (void)serviceExtensionTimeWillExpire {
    // Called just before the extension will be terminated by the system.
    // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
    [Pushbots serviceExtensionTimeWillExpireRequest:self.notificationRequest withContent:self.bestAttemptContent];
    self.contentHandler(self.bestAttemptContent);
}

@end


Swift  NotificationService.swift 

//  NotificationService.swift

import UserNotifications
import Pushbots

class NotificationService: UNNotificationServiceExtension {

    var contentHandler: ((UNNotificationContent) -> Void)?
    var bestAttemptContent: UNMutableNotificationContent?
    var notificationRequest: UNNotificationRequest!
   
    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
        self.contentHandler = contentHandler
        self.notificationRequest = request;
        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
       
        if let bestAttemptContent = bestAttemptContent {
            Pushbots.didReceiveNotificationExtensionRequest(self.notificationRequest, with: self.bestAttemptContent)
            contentHandler(bestAttemptContent)
        }
    }
   
    override func serviceExtensionTimeWillExpire() {
        // Called just before the extension will be terminated by the system.
        // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
        if let contentHandler = contentHandler, let bestAttemptContent =  bestAttemptContent {
            Pushbots.serviceExtensionTimeWillExpireRequest(self.notificationRequest, with: self.bestAttemptContent)
            contentHandler(bestAttemptContent)
        }
    }

}


Ignore any error till you finish step 2 to import PushBots SDK:
https://www.pushbots.help/install-pushbots-in-your-app-or-website/ios/the-pushbots-part-integrating-pushbots-sdk-into-your-ios-project

Did this answer your question?