matrix-org / sygnal

Sygnal: reference Push Gateway for Matrix
Apache License 2.0
167 stars 148 forks source link

Unable to receive custom keys in FCM Notification Payload after updating to V1 #393

Open mdhanif-simformsolutions opened 2 months ago

mdhanif-simformsolutions commented 2 months ago

Hey, we are using push notification using sygnal, recently we encountered notifications were disabled as firebase has deprecated and it's recommended to use V1 api's. So we have upgraded our Sygnal Version to the latest one v0.15.0 and there were changes regarding how we receive payload in the latest version which we found from :- https://github.com/matrix-org/sygnal/blob/main/docs/applications.md#api-v1

Now before upgrading sygnal to latest version our content used to be like this :-

....Some keys 
"sender_display_name": "Major Tom",
  "content": {
    "msgtype": "m.text",
    "body": "I'm floating in a most peculiar way.",
    "format": "org.matrix.custom.html",
    "rel_type": "m.thread",
    "m.new_content": {
    "body": "some text",
    "format": "some format",
    "rel_type": "some rel type"
    }
  },
  "room_id": "!slw48wfj34rtnrf:example.org"
...Some other keys

Now but with the new Version we don't get all the keys :-

....Some keys 
"sender_display_name": "Major Tom",
"content_msgtype": "m.text",
"content_body": "I'm floating in a most peculiar way.",
"content_format": "org.matrix.custom.html",
// Missing all other keys as well as new content 
"room_id": "!slw48wfj34rtnrf:example.org"
...Some other keys

This is how I add a pusher :-

matrixSessionFactory.getSession()?.pushersService()?.addHttpPusher(
            HttpPusher(
                pushkey = "fcmToken",
                appDisplayName = "App name",
                appId = "appId",
                profileTag = "",
                lang = "en",
                deviceDisplayName = "Display Name",
                deviceId = "Device Id",
                url = "appUrl",
                enabled = true,
                append = true,
                withEventIdOnly = false
            )
        )

Can you please share if I have missed anything or if this has been removed ?