-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PushNotification
's counts
field is not compatible with Sygnal
#1948
Comments
You can send a fake test notification to a device with Sending the following notification body: {
"notification": {
"event_id": "$3957tyerfgewrf384",
"room_id": "!slw48wfj34rtnrf:example.org",
"type": "m.room.message",
"sender": "@exampleuser:example.org",
"sender_display_name": "Major Tom",
"room_name": "Mission Control",
"room_alias": "#exampleroom:example.org",
"prio": "high",
"content": {
"msgtype": "m.text",
"body": "I'm floating in a most peculiar way."
},
"counts": {
"unread": 2,
"missed_calls": 1
},
"devices": [
{
"app_id": "<APP ID HERE>",
"pushkey": "<PUSHKEY HERE>",
"pushkey_ts": 12345678,
"data": {},
"tweaks": {
"sound": "bing"
}
}
]
}
} Results in the following message being transmitted to FCM by Sygnal: {
"sender_display_name": "Major Tom",
"room_name": "Mission Control",
"sender": "@exampleuser:example.org",
"unread": "2",
"missed_calls": "1",
"prio": "high",
"type": "m.room.message",
"event_id": "$3957tyerfgewrf384",
"content_body": "I'm floating in a most peculiar way.",
"room_alias": "#exampleroom:example.org",
"room_id": "!slw48wfj34rtnrf:example.org",
"content_msgtype": "m.text"
} This logic is defined here: https://github.com/matrix-org/sygnal/blob/v0.15.1/sygnal/gcmpushkin.py |
Well Sygnal is then sending a different model which is not part of the spec. You have to bring your own data model then. The correct model is described here: https://spec.matrix.org/v1.12/push-gateway-api/#post_matrixpushv1notify and the matrix dart sdk is parsing it correctly. |
The counts field isn't required in the link above, is it? |
See my reply in #1947 and #1949 : #1947 (comment), #1949 (comment) |
Checklist
In which Project did the bug appear?
matrix-dart-sdk
On which platform did the bug appear?
Android, iOS
SDK Version
0.34.0
Describe the problem caused by this bug
PushNotification
object inmartix-dart-sdk
is not compatible with the reference implementation of a Push Gateway for Matrix called SygnalThe
PushNotification
object in the SDK has a separatecounts
field that holds aPushNotificationCounts
object containingunread
andmissed_calls
fields.However, Sygnal sends
unread
andmissed_calls
fields at the root of the model, which means that they are not recognized bymartix-dart-sdk
:An example of an
event_id_only
push FCM message sent from Sygnal:I have only tested the GCM (FCM) implementation of Sygnal, but by reading the appropriate source code, I can confirm that this issue affects APN notifications as well
Related to #1947
The text was updated successfully, but these errors were encountered: