The mobile OS’s will not allow us to show a notification for an opened app that is in the foreground. It is your responsibility as a developer to catch notification and display it inline in a proper way.
See tutorial how to handle this
Hi, we have exactly the same issue. The OnReceive handler seems not to be fired. We test it both under local and remote versions. I’m preparing the exact reproduce steps right now.
I see...That is a bummer... But I'm still confused, I've configured the OnLoad and OnReceive nanoflows for the Push Notifications widget. The OnLoad works fine when I send a test notification from the below page and tap the notification that appears in the background.
But when I do that while the app is open, my OnReceive nanoflow doesn’t seem to do anything. The OnReceive I’ve implemented has a “Log Message” and “Show Message” but it doesn’t trigger. So I thought the notification/message wasn’t sent successfully. But in the Messages tab, it says that the status was “Delivered” as seen in the screenshot below.
Not too sure what I’m missing here...
Did you match the “ActionName" from the widget, matches the action name you send from the server?
Yea I did. The OnOpen nanoflow for the ActionName works but the OnReceive nanoflow doesn’t get triggered for the same ActionName.
Also what’s that microflow in your last image? The “Send” button microflow doesn’t have the “PrepareMessageData” sub-microflow. Is that needed? Mine just looks like the image below:
I noticed I have left out a key piece of code to add into the Android manifest file during the Native Push Notification setup. Specifically, in section 4.3 of this documentation : https://docs.mendix.com/howto/mobile/setting-up-native-push-notifications#customize-android-manifest
Can’t believe I missed that. Upon making these changes to the Android manifest file I am able to trigger my OnReceive nanoflow while the app is open when sending a test message.
Hope this can help anyone that may be having the same issue as well. I had to learn this the hard way and start from scratch.