ua_client_hints 패키지는 Flutter 애플리케이션에서 User-Agent Client Hints에 접근할 수 있게 해주며, 표준화된 HTTP 헤더를 통해 브라우저 및 장치에 대한 상세한 정보를 제공합니다. 이는 Android, iOS, Web, macOS에서 플랫폼, 모델, 브랜드와 같은 클라이언트 메타데이터를 가져오는 과정을 간소화합니다. 개발자는 User-Agent 문자열의 문자열 파싱에만 의존하지 않고 사용자 디바이스 특성에 따라 콘텐츠 전달을 맞춤화할 수 있도록 도와줍니다. 이 패키지는 HTTP 클라이언트와 원활하게 통합되며, 개인정보 보호를 고려한 현대적인 웹 표준 기반의 디바이스 탐지 기능을 지원합니다.
List of browser brands and their significant version.
UA-Mobile
Sec-CH-UA-Mobile
?1
Boolean indicating if the browser is on a mobile device (?1 for true) or not (?0 for false).
UA-Full-Version
Sec-CH-UA-Full-Version
"84.0.4143.2"
The complete version for the browser.
UA-Platform
Sec-CH-UA-Platform
"Android"
The platform for the device, usually the operating system (OS).
UA-Platform-Version
Sec-CH-UA-Platform-Version
"10"
The version for the platform or OS.
UA-Arch
Sec-CH-UA-Arch
"ARM64"
The underlying architecture for the device. While this may not be relevant to displaying the page, the site may want to offer a download which defaults to the right format.
Add this to your package's pubspec.yaml file by running the following command
$ flutter pub add ua_client_hints
Usage
Supported platforms:
Android
iOS
macOS
Web
On Web, values depend on browser support for User-Agent Client Hints. Some fields such as architecture, model, or platformVersion can be empty on browsers that don't expose high-entropy hints.