Foreground Notifications

Overview

You can control whether push notifications are displayed while your app is in the foreground on the user's device. This setting can be configured at build time or dynamically adjusted at runtime, providing flexibility for your app's notification behavior.

Implementation Guide

To prevent notifications from showing when the app is open in the foreground, you can modify this setting dynamically using the Median JavaScript Bridge method:

↔️Median JavaScript Bridge

median.onesignal.enableForegroundNotifications(true | false);

This method allows you to enable or disable foreground notifications based on your app's requirements at runtime.