Silent Push Notifications
Silent notifications allow you to notify your app in the background when important events occur. You might have new instant messages to deliver, new issues of a magazine to publish, breaking news alerts to send, or the latest episode of your user’s favorite TV show ready for them to download for offline viewing. Silent notifications are great for sporadic but immediately important content, where the delay between background fetches might not be acceptable.
Silent notifications are available through our Messaging RESTful API. You need only set the
send_to_sync flag to
true within the Android Push Object. You should ensure there are no
alert fields set within the Android Push Object as it will cause errors when
send_to_sync is set to
true. You can however still include data
extras within the Android Push Object.
Silent notifications are also available within the dashboard. To send a silent notification, you need only to ensure the title and body fields of the notification are blank as pictured below:
This message will cause an intent to be received with an action
BRAZE_PUSH_INTENT_NOTIFICATION_RECEIVED. Handling of this intent to cause any action such as a refresh of app content must be defined within the broadcast receiver you defined in Step 4 of Enabling Push Notifications - Android. Please see CustomBroadcastReceiver.java for an example of this receiver.