Closed Jpoliachik closed 1 year ago
I have also tried:
import { appendToCognitoUserAgent } from "amazon-cognito-identity-js";
appendToCognitoUserAgent("my custom user agent");
prior to Auth.signIn()
, but this seems to have no effect.
Hello! I wanted to let you know that we are no longer overriding the UserAgent for ReactNative customers.
Is this related to a new or existing framework?
React Native
Is this related to a new or existing API?
Authentication
Is this related to another service?
Cognito
Describe the feature you'd like to request
Currently, the UserAgent header supplied in requests is static "aws-amplify/0.1.x react-native".
This is not a helpful UserAgent to sufficiently identify the device making the request. It is recommended to use a formula like:
which could be generated by https://github.com/bebnev/react-native-user-agent at runtime.
But in order to use this, we need the ability to supply a custom UserAgent to the Amplify SDK.
Describe the solution you'd like
The user agent won't change at runtime, so its possible to supply this during Amplify configuration, eg:
Describe alternatives you've considered
I've tried hacking at the
UserAgent
variable to override but can't without forking the library.See
enhance-rn.js
in theamazon-cognito-identity-js
package: https://github.com/aws-amplify/amplify-js/blob/df95ea3724eb6406f64b03f25086cd3e8644cb5f/packages/amazon-cognito-identity-js/enhance-rn.jsThis value should be overrideable.
Additional context
No response
Is this something that you'd be interested in working on?