flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

didNotificationLaunchApp always true

Open kururu-abdo opened this issue 2 years ago • 5 comments

this method keeps return true every start of the app

  NotificationAppLaunchDetails? notificationAppLaunchDetails = !kIsWeb &&
          Platform.isLinux
      ? null
      : await _notification.getNotificationAppLaunchDetails();

i need a way to mark it as false after doing my logic

kururu-abdo avatar Nov 02 '23 20:11 kururu-abdo

Where are you calling this method as part of your app and what use case do you have with using the method? Asking, as it sounds like you make repeated calls when to the method and one of the things mentioned in the docs is that really should be called on the app starting up as the typical use case is to take the use to the appropriate page i.e. like deep linking. The semantics of the method are also to find out if a notification is what caused the app to launch/start. Therefore, it makes sense that it would always return true in the same app session

MaikuB avatar Nov 30 '23 08:11 MaikuB

i put it in splash screen on initState method

kururu-abdo avatar Dec 05 '23 15:12 kururu-abdo

@kururu-abdo do you find any solutions for this

MrShakila avatar Jan 23 '24 17:01 MrShakila

@MrShakila I just use shared prefs to save events when notification come I set value to true after click I set it to false

the Idea if the value is true use didNotitiocationLauchApp. logic otherwise , don't

kururu-abdo avatar Jan 29 '24 11:01 kururu-abdo