I think the way we format the event_time field on AndroidNotification is wrong:
|
public Builder setEventTimeInMillis(long eventTimeInMillis) { |
|
this.eventTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'") |
|
.format(new Date(eventTimeInMillis)); |
|
return this; |
|
} |
There seems to be couple of issues with this.
- We are not specifying the timezone for the
SimpleDateFormat. Therefore the resulting timestamp string is in the local timezone while the backend expects it to be in UTC.
- The way nanoseconds are formatted seems to be wrong. For the milliseconds value
1546304523123L this generates the string 2019-01-01T01:02:03.000000123Z. I would expect the nanos to be formatted as 123000000 (i.e. 123 milliseconds in nanos).
I think the way we format the
event_timefield onAndroidNotificationis wrong:firebase-admin-java/src/main/java/com/google/firebase/messaging/AndroidNotification.java
Lines 458 to 462 in 83b7a64
There seems to be couple of issues with this.
SimpleDateFormat. Therefore the resulting timestamp string is in the local timezone while the backend expects it to be in UTC.1546304523123Lthis generates the string2019-01-01T01:02:03.000000123Z. I would expect the nanos to be formatted as123000000(i.e. 123 milliseconds in nanos).