lundi 10 juin 2019

How to change `title, body, and icon` django-push-notification`?

I know lacking of document is known issue. However, the authors of the library seems very busy then I hope someone here might shed the light on me and teammates

Softwares:
Python 3.7.3
django-push-notifications: master
django: 2.2.1

Background:
I need to customize web push notification. My targets are title, body, and icon respectively.

Attempt:
I tried to mimic the APNS and FCM APIs but does not work.

In [22]: wps.send_message("Hello World!", title='test', extra={'title': 111})
Out[22]: [{'results': [{}], 'success': 1}]

Use dict in the positional argument raises TypeError

In [24]: wps.send_message({'title': 'test'})
TypeError: unhashable type: 'slice'

Question:
How to customized title, body, and message?

Aucun commentaire:

Enregistrer un commentaire