I'm testing notifications in XCode 12.2. It is very easy to test alert style notifications. You just drag them onto your app in simulator and the payload shows up in:
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { notificationsDispatcher.process(userInfo) completionHandler(.newData) }
Now, when testing silent notifications I can get the silent notification to fire after setting "Background fetch" in background modes. I then get into:
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
debugPrint("hello silence ")
}
This is fine if i want the app to do something unrelated to the data in the payload. How do I see the actual apns payload data?
I'm trying to access this payload example that i'm using:
{
"aps": {
"category": "tasks",
"content-available": 1,
"thread-id": "tasks"
},
"resource": {
"resourceType": null,
"additionalProperties": {
"taskIds": [
"xxx"
],
"classification": "xxx",
"status": "xxx"
}
}
}