To send a message that appears directly in your app's Inbox without triggering a standard system push notification alert, you should use a "silent push notification" sent via the Pushwoosh API.
Here’s how to configure this:
-
Use the
createMessage
API Endpoint: All programmatic push notifications, including silent ones, are sent using the/createMessage
API. You can find comprehensive documentation for this endpoint here: Pushwoosh createMessage API Documentation. -
Enable Silent Mode: In your
createMessage
API request payload, you must set the platform-specific "silent" parameter to1
. This ensures the notification is delivered to the app in the background without displaying a visual alert to the user.- For iOS: Set
"ios_silent": 1
- For Android: Set
"android_silent": 1
- For Huawei: Set
"huawei_android_silent": 1
- For Web (Firefox): In
firefox_root_params
, set"silent": 1
- For Web (Chrome): In
chrome_root_params
, set"silent": 1
- For iOS: Set
-
Ensure Inbox Storage: To make sure the message is stored and can be displayed in your in-app inbox, include the
"inbox_date"
parameter in your API request. This parameter defines the date and time (in UTC) until which the message will be available in the inbox. For example:"inbox_date": "YYYY-MM-DD HH:MM"
.
Example API Request (Silent Push to Inbox): Below is an example of a createMessage
request configured to send a silent notification that will be stored in the inbox and can update the badge. Replace placeholders like YOUR_APP_CODE
, YOUR_API_TOKEN
, Your message content
, device_hardware_id
, and the inbox_date
value with your specific details.
{
"request": {
"application": "YOUR_APP_CODE",
"auth": "YOUR_API_TOKEN",
"notifications": [
{
"content": "Your message content for the inbox",
"devices": ["device_hardware_id"],
"ios_silent": 1,
"android_silent": 1,
"huawei_android_silent": 1,
"firefox_root_params": { "silent": 1 },
"chrome_root_params": { "silent": 1 },
"inbox_date": "2025-12-31 23:59"
}
]
}
}
Important Considerations:
- Your application's Pushwoosh SDK integration must be correctly configured to handle silent notifications.
- Your app needs logic to fetch messages for its inbox display.
Refer to the Pushwoosh SDK documentation specific to your platform (e.g., iOS, Android, Flutter) for detailed instructions on implementing these client-side features.
Comments
0 comments
Article is closed for comments.