Closed avnerbarr closed 3 years ago
I can confirm this bug. I use the command line tool as follows:
apn push “2d6314d238f695bc469dc729566423d6212027b043b5263c80071833a79a9g5e" -c aps_development.pem -p -P '{"aps": {"alert": "New push received", "badge": 0, "sound": "", "mutable-content": 1, "category": “myCategory”, "content-available": 1}}'
It works once, then I have to remove the key-value pair "mutable-content":1
, otherwise the push is never sent (or received by the device).
I can confirm this bug. I use the command line tool as follows:
apn push “2d6314d238f695bc469dc729566423d6212027b043b5263c80071833a79a9g5e" -c aps_development.pem -p -P '{"aps": {"alert": "New push received", "badge": 0, "sound": "", "mutable-content": 1, "category": “myCategory”, "content-available": 1}}'
It works once, then I have to remove the key-value pair
"mutable-content":1
, otherwise the push is never sent (or received by the device).
@beatrupp Maybe you shouldn't make the two keys exist together mutable-content
, content-available
, as the document says:
When a remote notification for your app is received, the system loads your extension and calls its didReceive(_:withContentHandler:) method only when both of the following conditions are met:
The remote notification is configured to display an alert.
The remote notification’s aps dictionary includes the mutable-content key with the value set to 1.
Note You cannot modify silent notifications or those that only play a sound or badge the app’s icon.
Not sure the push isn't sent or isn't arriving or what.
I created a UNNotificationServiceExtension. The push arrived on one of the tries but stopped working after one success.
I removed the mutable_content flag and the push started to be delivered again as expected.