I’ve noticed a discrepancy between iOS and Android behaviour for the payload received by the listener registered with extension-push.
In the sample project, on Android, the following is printed:
DEBUG:SCRIPT: Push payload received: (activated: false)
DEBUG:SCRIPT: data = {
field2 = Other value,
field = Some value,
}
In both cases, type(payload) == “table”
On iOS, that table has a string member called “payload” which is the JSON-encoded payload. It also supplies the id.
On Android, the table is the payload, and I don’t get the id.
It’s a local notification triggered by the ‘Local 10s’ button in the extension-push sample which converts the received payload to a string and displays it in the GUI - device screenshots below.
iOS
Android
Ah, ok, a local notification. It looks like there is an issue in the extension code where we associate the payload with the key “payload” in the NSMutableDictionary here:
But later when we receive the local notification we take the whole notification and serialize it back to JSON:
I believe we should grab only the payload from the userInfo dictionary, ie replace:
That crashes, and unfortunately I don’t know enough Objective-C to do anything with it.
Just to mention, I am working around if for now, so it isn’t urgent.