Closed b-tiwari closed 1 year ago
When in doubt, check versions. Downgrading analytics to v4 worked for me @b-tiwari
Related, @chrisbonifacio is there an upcoming v5 release for core and pushnotification?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@chrisbonifacio any update? Would love to move to v5 of analytics, but this is blocking me (and supposedly others)
The same problem happens to me.
Any update on this. We are currently unable to save custom userAttributes
@b-tiwari @dwamianm @DeniferSantiago Thank you for the inputs. Can you please try giving an array to the username
or any other attribute field you may have in the userAttributes
block? It's documented in the API reference. Thank you!
const user = await Auth.currentAuthenticatedUser()
const endpoint = {
address: "token",
channelType: 'GCM',
optOut:'NONE',
userId: 'someUserId1',
userAttributes: {
username: [user.attributes.name],
sub: [user.attributes.sub]
},
demographic: {
AppVersion: '0.2.0'
}
}
const data = await Analytics.updateEndpoint(endpoint)
In the end I was able to make it work. I added the user attributes in an array (you must make sure to send valid values, filter the [undefined, null]), country
changed it to a 2-digit value (ISO 3166-1) and optOut
I put it in uppercase.
Thanks @Samaritan1011001
Hi 👋 Closing this as resolved. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with additional information so we can re-open this issue and be better able to assist you.
Thank you!
Before opening, please confirm:
I have searched for duplicate or closed issues and discussions. I have read the guide for submitting bug reports. I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React Native
Amplify APIs
Authentication, Analytics, REST API, Push Notifications
Amplify Categories
No response
Environment information
Describe the bug
Getting error
AWSPinpointProvider - updateEndpoint failed [TypeError: undefined is not a function]
when callingAnalytics.updateEndpoint
in my App.js useEffectExpected behavior
should not get the error and the endpoint should get registered with AWSPinPoint
Reproduction steps
setup Amplify Pushnotification , Firebase, andriod code as documented in Amplify docs
it created the required resources ( as I remember it created cognito identity provider, its auth/unauth roles, policies, some lambda, added amplify folder and aws-exports.js to my RN project
configured Amplify as shown in the
Configuration
section belowcalled Analytics.updateEndpoint in App.js useEffect(()=>{...}, [])
build/run app on the usb attached device
get the error at Analytics.updateEndpoint as shown in below screenshot
Code Snippet
Log output
aws-exports.js
aws-export.js
Manual configuration
Configuring Amplify:
Additional configuration
No response
Mobile Device
Honor View 10 BLN-L04
Mobile Operating System
Android version 9
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response