3131import java .io .FileOutputStream ;
3232import java .io .InputStream ;
3333import java .nio .charset .Charset ;
34- import java .util .Date ;
3534import java .util .HashMap ;
3635import java .util .List ;
3736import java .util .Map ;
4039import java .util .concurrent .TimeUnit ;
4140
4241import io .sentry .Breadcrumb ;
42+ import io .sentry .DateUtils ;
4343import io .sentry .HubAdapter ;
4444import io .sentry .ILogger ;
4545import io .sentry .Integration ;
4646import io .sentry .Sentry ;
47+ import io .sentry .SentryDate ;
4748import io .sentry .SentryEvent ;
4849import io .sentry .SentryLevel ;
4950import io .sentry .UncaughtExceptionHandlerIntegration ;
@@ -231,7 +232,7 @@ public void fetchNativeRelease(Promise promise) {
231232
232233 public void fetchNativeAppStart (Promise promise ) {
233234 final AppStartState appStartInstance = AppStartState .getInstance ();
234- final Date appStartTime = appStartInstance .getAppStartTime ();
235+ final SentryDate appStartTime = appStartInstance .getAppStartTime ();
235236 final Boolean isColdStart = appStartInstance .isColdStart ();
236237
237238 if (appStartTime == null ) {
@@ -241,11 +242,11 @@ public void fetchNativeAppStart(Promise promise) {
241242 logger .log (SentryLevel .WARNING , "App start won't be sent due to missing isColdStart." );
242243 promise .resolve (null );
243244 } else {
244- final double appStartTimestamp = ( double ) appStartTime .getTime ( );
245+ final double appStartTimestampMs = DateUtils . nanosToMillis ( appStartTime .nanoTimestamp () );
245246
246247 WritableMap appStart = Arguments .createMap ();
247248
248- appStart .putDouble ("appStartTime" , appStartTimestamp );
249+ appStart .putDouble ("appStartTime" , appStartTimestampMs );
249250 appStart .putBoolean ("isColdStart" , isColdStart );
250251 appStart .putBoolean ("didFetchAppStart" , didFetchAppStart );
251252
0 commit comments