File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ class NativeAppStartHandler {
8080 return null ;
8181 }
8282
83- final appStartDateTime = DateTime . fromMillisecondsSinceEpoch (
84- nativeAppStart.appStartTime. toInt () );
83+ final appStartDateTime =
84+ DateTime . fromMillisecondsSinceEpoch ( nativeAppStart.appStartTime);
8585 final pluginRegistrationDateTime = DateTime .fromMillisecondsSinceEpoch (
8686 nativeAppStart.pluginRegistrationTime);
8787
Original file line number Diff line number Diff line change @@ -15,12 +15,22 @@ class NativeAppStart {
1515 Map <dynamic , dynamic > nativeSpanTimes;
1616
1717 static NativeAppStart ? fromJson (Map <String , dynamic > json) {
18- final appStartTime = json['appStartTime' ];
18+ final appStartTimeValue = json['appStartTime' ];
1919 final pluginRegistrationTime = json['pluginRegistrationTime' ];
2020 final isColdStart = json['isColdStart' ];
2121 final nativeSpanTimes = json['nativeSpanTimes' ];
2222
23- if (appStartTime is ! int ||
23+ // Convert appStartTime to int (iOS returns double, Android returns int)
24+ final int ? appStartTime;
25+ if (appStartTimeValue is int ) {
26+ appStartTime = appStartTimeValue;
27+ } else if (appStartTimeValue is double ) {
28+ appStartTime = appStartTimeValue.toInt ();
29+ } else {
30+ appStartTime = null ;
31+ }
32+
33+ if (appStartTime == null ||
2434 pluginRegistrationTime is ! int ||
2535 isColdStart is ! bool ||
2636 nativeSpanTimes is ! Map ) {
You can’t perform that action at this time.
0 commit comments