Notification Service Extension is not calling in ionic capacitor (iOS) project.

Dear Team, 

We are trying to integrate Rich Push Notification in ionic capacitor project. As per instructions, we created/added notification service extension. But it is not calling notification service and not displaying images in push notification. 

Below is the source code written to download image from the url (shared via payload)


override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {

        self.contentHandler = contentHandler

        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)



        if let bestAttemptContent = bestAttemptContent {

            if let attachmentString = bestAttemptContent.userInfo["media_attachment"] as? String,

                let attachmentUrl = URL(string: attachmentString) {

                let session = URLSession(configuration: URLSessionConfiguration.default)

                let downloadTask = session.downloadTask(with: attachmentUrl, completionHandler: { (url, _, error) in

                    if let error = error {

                        print("Error downloading attachment: \(error.localizedDescription)")

                    } else if let url = url {

                        let attachment = try! UNNotificationAttachment(identifier: attachmentString,

                                                                       url: url,

                                                                       options: [UNNotificationAttachmentOptionsTypeHintKey: kUTTypePNG])

                        bestAttemptContent.attachments = [attachment]











    "alert": {

      "title": "Test",

      "subtitle": "Test test",

      "body": "This episode we talk about Clean Architecture with Antonio Leiva."


    "mutable-content": 1


  "media_attachment": ""



POD File:


target "NotificationService" do

  pod 'AirshipExtensions/NotificationService'


Didn't find what you were looking for?

New post


1 comment

  • Hello,

    Thank you for reaching out our support.

    When adding the notification service extension, make sure to add use_frameworks! in your podfile and then proceed with a pod update command.
    This will allow you within Xcode to have the framework in your NotificationService target.

    Comment actions Permalink

Please sign in to leave a comment.