Releases: mobeuv/react-native-user-agent
2.0.0
2.0.0 (2024-08-06): BREAKING CHANGE!
BREAKING CHANGE ⚠️
The getUserAgent function has been updated to return a promise, so it is now necessary to use await. Previously, getUserAgent could be used without a promise because it was implemented using getConstants. Technically, it was possible to access constants exported by getConstants() directly from the native module object. This approach will no longer be supported with TurboModules, so we are transitioning to the new approach to prevent future migration issues.
In version 1.0.0, constants are exported only at initialization, meaning that any changes to getConstants values at runtime will not affect the JavaScript environment. This limitation exists because getConstants was designed to provide static configuration data during module initialization. With TurboModules, getConstants() will evolve into a standard native module method, with each call interacting with the native side dynamically. To ensure a smooth migration and ongoing support for TurboModules, we are implementing this change starting now.
The following functions have been removed:
- getAll
- getDarwinVersion
- getConstants
- getSystemVersion