Let's say I'm inside a BroadcastReceiver
class that handles push notification.
How can I check if the application, this service is running for, is in the Foreground, in the Background or is completely turned off?
Let's say I'm inside a BroadcastReceiver
class that handles push notification.
How can I check if the application, this service is running for, is in the Foreground, in the Background or is completely turned off?
You can just call AppState
API from react-native core (https://facebook.github.io/react-native/docs/appstate.html) and get this information.
If you are using react-native-push-notification
module, when you receive a notification, you also receive a boolean that indicates if the app is on foreground mode or not.