mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: mobile user agent set to immich_platform_version (#18478)
* fix: mobile user agent * refactor: typo in MapService
This commit is contained in:
parent
c278bb0e5b
commit
c61ea483ba
7 changed files with 39 additions and 8 deletions
15
mobile/lib/utils/user_agent.dart
Normal file
15
mobile/lib/utils/user_agent.dart
Normal 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}';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue