File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/java/com/google/firebase/messaging
test/java/com/google/firebase/messaging Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 2828import java .util .Date ;
2929import java .util .List ;
3030import java .util .Map ;
31+ import java .util .TimeZone ;
3132import java .util .concurrent .TimeUnit ;
3233
3334/**
@@ -456,8 +457,9 @@ public Builder setSticky(boolean sticky) {
456457 * @return This builder.
457458 */
458459 public Builder setEventTimeInMillis (long eventTimeInMillis ) {
459- this .eventTime = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'" )
460- .format (new Date (eventTimeInMillis ));
460+ SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSS000000'Z'" );
461+ dateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
462+ this .eventTime = dateFormat .format (new Date (eventTimeInMillis ));
461463 return this ;
462464 }
463465
Original file line number Diff line number Diff line change @@ -859,15 +859,13 @@ public void testExtendedAndroidNotificationParameters() throws IOException {
859859 .put ("title" , "title" )
860860 .put ("body" , "body" )
861861 .build ();
862- String eventTime = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'" , Locale .US )
863- .format (new Date (1546304523123L ));
864862 Map <String , Object > androidConfig = ImmutableMap .<String , Object >builder ()
865863 .put ("notification" , ImmutableMap .<String , Object >builder ()
866864 .put ("title" , "android-title" )
867865 .put ("body" , "android-body" )
868866 .put ("ticker" , "ticker" )
869867 .put ("sticky" , true )
870- .put ("event_time" , eventTime )
868+ .put ("event_time" , "2019-01-01T01:02:03.123000000Z" )
871869 .put ("local_only" , true )
872870 .put ("notification_priority" , "PRIORITY_HIGH" )
873871 .put ("vibrate_timings" , ImmutableList .of ("1s" , "1.001000000s" ))
You can’t perform that action at this time.
0 commit comments