Search packages, repositories and app categories

Package detailsv1.2.4

flutter_user_agentx

Retrieve device and webview user agent strings for Android and iOS devices. It also provides you with simple building blocks for generating your own user agent string.

AndroidiOS
30-day downloads
79
Likes
23
Pub points
130

Install package

flutter pub add flutter_user_agentx

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_user_agentx is a Flutter package that retrieves device and webview user agent strings for Android and iOS. It provides reliable access to standard user agent information used in HTTP requests, enabling accurate identification of the client environment. The package also offers modular components to help developers construct custom user agent strings when needed. Designed for simplicity and cross-platform consistency, it integrates seamlessly into apps requiring user agent handling for web views or server communication.

Use cases

  • Fetching device-specific user agents
  • Customizing user agent strings for web views
  • Identifying client environments in HTTP requests
  • Testing web compatibility across devices
  • Server-side request identification

Key features

  • Cross-platform support for Android and iOS
  • Simple API for retrieving default user agents
  • Modular building blocks for custom user agents
  • Lightweight and easy to integrate
  • Reliable device and webview string generation

Suitable for

  • Apps using web views
  • API clients needing user agent headers
  • Debugging and testing HTTP requests
  • Developers building browser-like features
  • Apps requiring client fingerprinting

Considerations

  • Does not support web platform
  • User agent strings may vary by OS version
  • Limited to device and webview contexts
  • Not intended for full user agent parsing
  • Requires manual handling of edge cases

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_user_agent

Retrieve Android/iOS device user agents in Flutter.

Example user-agents:
System User-Agent WebView User-Agent
iOS CFNetwork/897.15 Darwin/17.5.0 (iPhone/6s iOS/11.3) Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E217
Android Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X) Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36
Additionally:

Every version returns some additional constants that might be useful for custom user-agent building.

iOS version returns:

  • isEmulator
  • systemName
  • systemVersion
  • applicationName
  • applicationVersion
  • buildNumber
  • darwinVersion
  • cfnetworkVersion
  • deviceName
  • packageUserAgent

Android version returns:

  • systemName
  • systemVersion
  • packageName
  • shortPackageName
  • applicationName
  • applicationVersion
  • applicationBuildNumber
  • packageUserAgent
Credits 👍

Based off https://github.com/bebnev/react-native-user-agent

Categories

Source repository

Projects using this package

No data available yet.