i am developing a mobile application using Flutter. I was wondering if we can use Cloud Messaging for data transfer or event listening purposes without giving user an actual app notification if app is currently running.
For example;
Can i use cloud messaging for these purposes without popping up a notification?
Thank you for your answers and time..
Are saying like listening some notification data something like this
// This is when app is running not on background
FirebaseMessaging.onMessage.listen((RemoteMessage? message) {
RemoteNotification? notification = message!.notification;
// just use message!.data it depends on you
// notification!.data
// is always return Map e.g. { "id":"sampleId"}
// so call it like notification!.data["id"]
if(notification!.data!= null){
// Do your thing here.
}
});