DeviceIntegrityResult.fromOfflineMap constructor
Factory method to create a result from a map returned by the native platform.
Implementation
factory DeviceIntegrityResult.fromOfflineMap(Map<String, dynamic> map) {
if (Platform.isAndroid) {
return DeviceIntegrityResult(
isDeveloperModeEnabled: map['isDeveloperModeEnabled'] as bool? ?? false,
isRooted: map['isRooted'] as bool? ?? false,
isEmulator: map['isEmulator'] as bool? ?? false,
hasPotentiallyDangerousApps:
map['hasPotentiallyDangerousApps'] as bool? ?? false,
// Android specific defaults
isJailbroken: false,
isRealDevice: true,
);
} else if (Platform.isIOS) {
return DeviceIntegrityResult(
isDeveloperModeEnabled: map['isDeveloperModeEnabled'] as bool? ?? false,
isJailbroken: map['isJailbroken'] as bool? ?? false,
isRealDevice: map['isRealDevice'] as bool? ?? true,
// iOS specific defaults
isRooted: false,
isEmulator: false,
hasPotentiallyDangerousApps: false,
);
}
// Default fallback
return DeviceIntegrityResult();
}