Foreground Notifications
By default, push notifications are suppressed when your app is open and in focus. This is useful for sensitive and urgent notifications such as chat messages and delivery notifications.
Enable or disable foreground notifications
Use the Median JavaScript Bridge to control foreground notification display at any point during the app session:
// Show notifications even when the app is open
median.onesignal.enableForegroundNotifications(true);
// Suppress notifications when the app is open (default)
median.onesignal.enableForegroundNotifications(false);You can call this from any page in your app; the setting takes effect immediately and stays active for the current session. There's no need to rebuild the app to change behavior.
You can also set a default for this behavior at build time in App Studio under Plugins > Push Notifications > OneSignal. The runtime method above overrides whatever default you've configured.
Updated about 3 hours ago