SayWut / flutter_foreground_service_plugin

MIT License
12 stars 12 forks source link

handle to the application opened via notification? #8

Open yakupbaser opened 3 years ago

yakupbaser commented 3 years ago

how can i handle this? i started foreground service. And i terminated the app with sliding sideways. (app is still running in memory). When i clicked to notification, the app is openning. But how do I know if I opened the application via notification?

i need to learn that the app opened first or opened via notification. So i need two answers as like that messages:

the app says: I opened for the first time. or the app says: im coming from notification tapped, I was already working in background before.

yakupbaser commented 3 years ago

i need that in notification of flutter_foreground_service_plugin:

Future selectNotification(String payload) async { if (payload != null) { debugPrint('notification payload: $payload'); } await Navigator.push( context, MaterialPageRoute(builder: (context) => SecondScreen(payload)), ); }