[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
- I am using firebase_messaging to handle push notification
- when my app going to the background and push notification arrives, that time onBackgroundMessage method call and this error occurred
- I have already tried many solutions which are related to this issue but still, I am facing this issue
- here is my onBackgroundMessage method code
Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) {
print("myBackgroundMessageHandler: $message");
if (message.containsKey('data')) {
// Handle data message
final dynamic data = message['data'];
print("myBackgroundMessageHandler: $message");
var emailMessageId = message['data']['message_id'];
SharedPreferences prefs = await SharedPreferences.getInstance();
}
- I am getting this error when getting SharedPreferences instance