Yes, you can send push notifications that include images hosted on your own server using our API. This allows you to create rich notifications without needing to upload assets to the Pushwoosh Control Panel.
To do this, you must use the correct platform-specific parameters in your /createMessage or /createTargetedMessage API call. The URL for your media must be publicly accessible so that user devices can download and display it.
- For iOS: Use the
ios_attachmentparameter. - For Android: Use the
android_bannerparameter.
The value for both of these parameters must be the full, direct URL to your image file.
Example API Payload Snippet:
{
"request": {
"application": "XXXXX-XXXXX",
"auth": "API_ACCESS_TOKEN",
"notifications": [{
"send_date": "now",
"content": "Check out our new feature!",
"ios_attachment": "https://your-server.com/path/to/image.jpg",
"android_banner": "https://your-server.com/path/to/image.png"
}]
}
}
Important Note: This method is for sending standard rich notifications with an image attachment. It is different from using the rich_media parameter, which is used to send complex web-based content created in the Pushwoosh Rich Media editor. The rich_media parameter requires a unique code generated in the Control Panel, not a URL.
Comments
0 comments
Please sign in to leave a comment.