0

I am using 'shared_preferences' plugin in my flutter project. The problem is that the app is working as expected in debug mode but not working correctly in release mode. I have tried building with the --no-shrink flag also but still it does not work. Following is the code snippet where I am implementing the logic:

SharedPreferences prefs = await SharedPreferences.getInstance();
String notificationID = prefs.getString("notificationID") ?? "";
String messageID = message.data['id'];
if (notificationID == messageID.toString()) {
   print("Notification has been displayed in the past");
} else {
...
}

1 Answers1

0

This might help first run flutter build apk --no-shrink
flutter build appbundle --no-shrink

Source: https://stackoverflow.com/a/63763638/11519962

Sayed Talha
  • 119
  • 8