olucurious / PyFCM

Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
http://olucurious.github.io/PyFCM/
MIT License
803 stars 206 forks source link

web_push for desktop notifications and click action #265

Closed axebelk closed 2 years ago

axebelk commented 4 years ago

Hello,

Can you make it to work the web_push object to be send along with notification data? Check here: https://firebase.google.com/docs/cloud-messaging/js/receive "webpush": { "fcm_options": { "link": "https://dummypage.com" } }

tradingstratagem commented 4 years ago

I have the same problem, can anyone have the solution? I tried to add the payload using extra_kwargs but it doesn't work

tperraut commented 2 years ago

@tradingstratagem @axebelk did you try extra_notification_kwargs instead ?

push_service.notify_multiple_devices(
    registration_ids=tokens,
    message_title=title,
    message_body=body,
    extra_notification_kwargs={'link': "https://mydomain.com/redirect_path"}
)
lordzouga commented 1 year ago

@tradingstratagem @axebelk did you try extra_notification_kwargs instead ?

push_service.notify_multiple_devices(
    registration_ids=tokens,
    message_title=title,
    message_body=body,
    extra_notification_kwargs={'link': "https://mydomain.com/redirect_path"}
)

doesn't work. This needs webpush object to be on the same level as the message body.f