Closed paulsjohnson91 closed 2 years ago
@chrisbonifacio , fyi. I did a little more investigating and I believe that the reason analytics failed to initialise, is that the authState was updated by Amplify to signedIn before the token was refreshed on app start. So it was being initialised with a stale token.
I've accounted for this by calling await Auth.currentAuthenticatedUser() before attepting to initialise analytics.
Maybe something to note in the documentation of the Authenticator HOC.
I'll close this ticket now.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication, Analytics
Amplify Categories
analytics
Environment information
Describe the bug
I've recently migrated to using the
withAuthenticator
built in HOC Authenticator provided by the amplify library. I have a listener set up to configure analytics once the user is logged in. When I try Analytics.configure I get the error[ERROR] 06:06.746 AWSPinpointProvider - updateEndpoint failed TypeError: Network request failed
Previously this was working as expected.
Expected behavior
No error message, and querying the users endpoints should show the new endpoint.
Reproduction steps
Configure Auth
Log in using authenticator
Listened on home page for auth state change
The authData print:
The config object passed to Analytics.configure
Code Snippet
above ^
Log output
aws-exports.js
provided in the example above
Manual configuration
No response
Additional configuration
No response
Mobile Device
run on android simulator
Mobile Operating System
Android 12
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response