I am sending notifications to my app (using Amazon SNS & Firebase Cloud Messaging).
I am sending data notifications, such as:
{
"GCM": "{ \"data\": { \"title\": \"Sample message title\", \"message\": \"Sample message for Android endpoints\" } }"
}
(this is being sent from Amazon SNS admin).
The notification is received to my app, in "OnMessageReceived()", which then creates / outputs a notification.
Is it possible to detect if the app is active / in the foreground, so that I can skip creating the notification (to the phone itself) and just show a message in the app instead? (Actually, the messages / notifications will be listed in the app - eventually - in a "notifications" or "messages" area)
This is for Android, but I would also like to do the same thing with iOS.