jazzband / django-push-notifications

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

Image is not displayed in push notification #664

Closed pankajpalmate closed 10 months ago

pankajpalmate commented 1 year ago

res = devices.send_message(title=payload['title'], message=payload['body'], extra={"title": "Notification title", "icon": "https://data-flair.training/blogs/wp-content/uploads/sites/2/2020/02/game-of-chess.jpg"})

when i am trying to send image with the notification it is not getting displayed...also it is not giving any error....I have follwed the documentation but not working

jamaalscarlett commented 1 year ago

@pankajpalmate what type of notification are you attempting to send? Web? APNS, FCM?

jamaalscarlett commented 10 months ago

If you are sending a browser notification via fcm this should work; however if you are sending a message to an android phone icon needs to be a reference to an image defined in your android app. From https://firebase.google.com/docs/cloud-messaging/http-server-ref:

Sets the notification icon to myicon for drawable resource myicon. If you don't send this key in the request, FCM displays the launcher icon specified in your app manifest.