pusher / push-notifications-python

Pusher Beams Python Server SDK
https://pusher.com/beams
MIT License
30 stars 8 forks source link

How to send an image through the publish_to_interests method? #26

Closed 0legRadchenko closed 4 years ago

0legRadchenko commented 4 years ago

How to send an image through the publish_to_interests method? I just have tried something like this.. here I have been added key/value 'image': url to the fcm key (this is what I got from the fcm android documentation). Overall, it works fine except of the value 'image'. response = beams_client.publish_to_interests( interests=['hello'], publish_body={ 'apns': { 'aps': { 'alert': progress, } }, 'fcm': { 'notification': { 'title': str(name), 'body': 'something', 'image': url, } } } )

luismfonseca commented 4 years ago

Send the image value under the data key (https://pusher.com/docs/beams/getting-started/android/publish-notifications#custom-data)

So it reads more like:

'fcm': {
   'notification': {
      'title': str(name),
      'body': something,
   },
   'data': {
      'image': url,
   },
}