jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.24k stars 609 forks source link

How can I add labels to fcm_options? #609

Open iiii4966 opened 3 years ago

iiii4966 commented 3 years ago

The push is being sent through the gcm device in this module. But as the title says, when send push, need to add lable to fcm_options to track. If look at the internal code, The analyticsLabel key I need does not exist. fcm

FCM_OPTIONS_KEYS = [
    "collapse_key", "priority", "content_available", "delay_while_idle", "time_to_live",
    "restricted_package_name", "dry_run"
]

Can I add it temporarily or add it?

{
   "message":{
      "data":{

      },
      "fcmOptions":{
         "analyticsLabel":"HelloWorld" <- this!!
      },
      "notification":{
         "body":"Hello world"
      },
      "token":"token"
   },
   "validateOnly":false
}
jamaalscarlett commented 11 months ago

@iiii4966 The analyticsLabel is part of the v1 api that is not yet fully supported. See https://github.com/jazzband/django-push-notifications/issues/546