Rich media
Attach high-res images, videos and audio to your notifications.
Rich media includes high-resolution images, animated GIFs, videos and audio files.
Not all platforms support all formats. This article helps you understand how to best leverage each platform's capabilities.
High-resolution images
Most devices and browser support high-resolution images, and WonderPush lets you include them in just a few clicks.
Supported formats are: JPEG, PNG and GIF.
We recommend images no larger than 1024x1024, with a maximum file size of 5 Mb.
To include high-resolution images, simply drag and drop an image on the Drop image here zone of the composition form.
Using the API, here's how to do:
curl -XPOST https://management-api.wonderpush.com/v1/deliveries?accessToken="YOUR_ACCESS_TOKEN" \
-d targetSegmentIds=@ALL \
-d notification='{"alert": {"text": "Example push notification", "ios":{"attachments":[{"url":"https://www.example.com/image.jpg"}]}, "android":{"type":"bigPicture", "bigPicture":"https://www.example.com/image.jpg"}, "web":{"image":"https://www.example.com/image.jpg"}}}'
Animated GIFs
At the moment, only iOS 10+ devices support animating GIF images. Other platforms will only display the first frame of the animation.
Sending animated GIFs works exactly like sending high-resolution images, all you have to do is use a GIF image instead.
Video
Only iOS 10+ devices support video in push notifications.
To send audio or video in a push notification, you have multiple options:
- use the Image URL field of the composition form, putting the URL of a video or audio file instead of the high-resolution image,
- use the API to specify an attachment.
Bear in mind that only iOS devices will see the video attachment. Other platforms will not show an attachment at all (but they will show the text). Remember that you can use segmentation to target iOS users.
Using the API, you can specify a video/audio attachment for iOS users, and another type of attachment for Android and Website users. The chapter Adapting notification content to each platform explains how to send platform-dependant notifications. Here is an example where we send a video to iOS users and an image to Web and Android users:
This example sends a notification to your entire userbase. You will most certainly want to adapt the
targetSegmentId
parameter.
curl -XPOST https://management-api.wonderpush.com/v1/deliveries?accessToken="YOUR_ACCESS_TOKEN" \
-d targetSegmentIds=@ALL \
-d notification='{"alert": {"text": "Example push notification", "ios":{"attachments":[{"url":"https://download.blender.org/peach/trailer/trailer_iphone.m4v"}]}, "android":{"type":"bigPicture", "bigPicture":"https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/2000px-Example.svg.png"}, "web":{"image":"https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/2000px-Example.svg.png"}}}'
Audio
Only iOS 10+ devices support audio in push notifications.
Sending audio is done exactly like sending videos:
- using the Image URL field of the composition form using the URL of an audio file,
- or using the API.
Size limitations on iOS
iOS imposes the following size limits to rich media attachments:
Type | Supported formats | Maximum size |
---|---|---|
Audio | AIFF, WAV, MP3, M4A | 5 MB |
Image | JPEG, GIF, PNG | 10 MB |
Movie | MPEG, MPEG2, MPEG4, AVI | 50 MB |
Updated over 3 years ago