fix: mobile user agent set to immich_platform_version (#18478)

* fix: mobile user agent

* refactor: typo in MapService
This commit is contained in:
Zack Pollard 2025-05-22 16:35:24 +01:00 committed by GitHub
parent c278bb0e5b
commit c61ea483ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 39 additions and 8 deletions

View file

@ -0,0 +1,15 @@
import 'dart:io' show Platform;
import 'package:package_info_plus/package_info_plus.dart';
Future<String> getUserAgentString() async {
final packageInfo = await PackageInfo.fromPlatform();
String platform;
if (Platform.isAndroid) {
platform = 'Android';
} else if (Platform.isIOS) {
platform = 'iOS';
} else {
platform = 'Unknown';
}
return 'Immich_${platform}_${packageInfo.version}';
}