addOnMessage method
Called when notification is received when app is in the foreground. Remember to unsubscribe. Multiple listeners can be listening.
Implementation
VoidCallback addOnMessage(MessageHandler handler) {
_sendAndroidReadyToProcessMessages();
_onMessageHandlers.add(handler);
return () {
_onMessageHandlers.remove(handler);
};
}