I'm trying to muck with my push notification using the service extension, but it doesn't appear to be running. The body of my method just looks like so:
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
guard let bestAttemptContent = bestAttemptContent else { return }
bestAttemptContent.title = "new title here"
contentHandler(bestAttemptContent)So when iOS shows my alert, it should say 'new title here', but it still has what the payload sent. The payload looks like this. Any ideas what I've done wrong?
{
"aps": {
"alert": {
"body": "The body",
"title": "The title"
},
"category": "drawing-category",
"mutable-content": 1
}
}