setShowPushnotificationAlert
Controls whether system notifications are suppressed when the app is in the foreground.
When set to true, push notifications received while the app is in the foreground will not produce a system notification. The push data is still delivered to the SDK and any registered com.pushwoosh.notification.NotificationServiceExtension callbacks. By default this is false, meaning notifications are displayed normally regardless of the app state.
This can also be configured declaratively in AndroidManifest.xml without any Java code:
<meta-data
android:name="com.pushwoosh.foreground_push"
android:value="true" />
Content copied to clipboard
Example:
// Suppress foreground notifications at runtime
Pushwoosh.getInstance().setShowPushnotificationAlert(true);
// Re-enable foreground notifications
Pushwoosh.getInstance().setShowPushnotificationAlert(false);
Content copied to clipboard
Parameters
showAlert
true to suppress system notifications when the app is in the foreground, false to display them normally (default)