Pr0Ger/PyAPNs2

How send notification with image?

MBakhtiyor opened this issue · 2 comments

I used PayloadAlert with parameters but image didn;t show.
alert = PayloadAlert(body="Hello World!", title="Hello", launch_image="my_image.jpg"

Please help me how to send push notification with custom iange?

This is the code I am using to send a notification that is then showing the image in a notification.
FYI you will need to interpret it in your iOS project - it will not show by itself.

custom_payload = {"data": {"attachment-url": public_url_to_the_image}}
alert = PayloadAlert(title=title, body=body)
p = Payload(
                    alert=alert,
                    mutable_content=True,
                    custom=custom_payload,
                    sound="default",
                    badge=0,
)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.