diff --git a/lib/src/platform_client.dart b/lib/src/platform_client.dart index 3d38e49..59402d8 100644 --- a/lib/src/platform_client.dart +++ b/lib/src/platform_client.dart @@ -1502,13 +1502,27 @@ class PlatformClient { } else { return { 'id': (await _deviceId) ?? '', - 'model': (await DeviceInfoPlugin().deviceInfo).data['model'], + 'model': await _getDeviceModel(), 'platform': Platform.operatingSystem.toString().split('.').last, 'platformVersion': Platform.operatingSystemVersion, }; } } + Future? _getDeviceModel() { + if (kIsWeb) return null; + if (Platform.isAndroid) { + return DeviceInfoPlugin() + .androidInfo + .then((deviceInfo) => deviceInfo.model); + } else if (Platform.isIOS) { + return DeviceInfoPlugin() + .iosInfo + .then((deviceInfo) => deviceInfo.utsname.machine); // e.g: iPhone18,3 + } + return null; + } + Future get _deviceId async { if (_config.deviceId != null) { return _config.deviceId;