iOS NotificationServiceExtension is not working

Viewed 155

I have enabled NotificationServiceExtension in my app. And done the following

  1. Added .apppex under Frameworks, Libraries and Embedded contents
  2. Confirmed both deployment target version is 12.0
  3. Sending mutable-content": 1 in my apns notification payload
  4. Following is my NotificationService's didReceiveNotificationRequest method

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

    }

Don't know what I am missing here. Searched and followed so many documents. Nothing seems to be working.

I am using XCode 11.2.1 and real device with ios version 13.

0 Answers
Related