Why String can’t decode back to Map after change to String?
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print(message.data);
var convertToString = (message.data).toString();
var map = jsonDecode(convertToString);
});
Error
E/flutter (17220): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: FormatException: Unexpected character (at character 2)
E/flutter (17220): {notification_type: abc, ABC: {"assigned_to_id":null,"descri...
Here my message data
{notification_type: abc, ABC: {...}, sound: default, body: ..., title: ...}