Closed mbenci closed 6 months ago
@mbenci
I've got the same problem and the fix is quite easy. I'm not an Android developer so it may not be an idiomatic solution but the problem lies in:
flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/NotificationDetails.java
L461
change
(Long) messageData.get(TIMESTAMP)
to
(Long) ((Integer) messageData.get(TIMESTAMP)).longValue(),
This has been addressed with a release published. You might be aware of this but the reason this is happening is due to date/time values being used that are way further in the past within the range of epoch time (i.e. 1st of January 1970) as per API docs, the timestamp is converted to milliseconds since epoch. Thought I would mention in case neither of you are aware or in case you have erroneous values for the timestamp as realistically an app wouldn't have such date/time values
Describe the bug When I try to show a notification with style MessagingStyleInformation with app in background I get error "java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long"
To Reproduce In my project the application listens to push notifications sent via FCM and shows local notifications with MessagingStyleInformation style. When the app is in the foreground the notification is shown correctly. When the app is in the background the show method has an error. No problem if I use other styles for the message, for example InboxStyleInformation or BigTextStyleInformation.
In my case: Plugin version: 17.0.0 Flutter version: 3.19.4
Sample code to reproduce the problem