Post not yet marked as solved
Post marked as unsolved with 0 replies, 530 views
Hi
I've added new UNNotificationServiceExtension to my application. In the implementation of didReceiveNotificationRequest:withContentHandler:
I need to go through all former notification using
UNUserNotificationCenter.current().getDeliveredNotifications.
The array of notifications passed to completionHandler has always 0 elements and in the iPhone logs I can see the error:
Getting delivered notifications failed because of missing entitlement.
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
// some notification modifications here...
contentHandler(bestAttemptContent)
}
UNUserNotificationCenter.current().getDeliveredNotifications { notifications in
for notification in notifications {
// never executes
}
}
}
I have enabled push notification capabilities for the main target, both targets have set the same App Group.
Any suggestions?