In some case, you might want to check your app is running in background or foreground, such as you want to show push notification message only when the app is in background. The following method will be very easy to know app running state.
Showing posts with label app in background or foreground. Show all posts
Showing posts with label app in background or foreground. Show all posts






