Amplify and Kinesis
- The Analytics category enables you to collect analytics data for your App.
Set up Analytics backend
- run in the terminal amplify add analytics
- selcet :
? Select an Analytics provider (Use arrow keys)
Amazon Pinpoint
? Provide your pinpoint resource name:yourPinpointResourceName
? Apps need authorization to send analytics events. Do you want to allow guests and unauthenticated users to send analytics events? (we recommend you allow this when getting started)Yes
- amplify push
- add these dependencies :
dependencies {
// Add these lines in
dependencies
implementation ‘com.amplifyframework:aws-analytics-pinpoint:1.24.0’ implementation ‘com.amplifyframework:aws-auth-cognito:1.24.0’ } - make sync
- add : Amplify.addPlugin(new AWSCognitoAuthPlugin()); Amplify.addPlugin(new AWSPinpointAnalyticsPlugin(this));
Record events
```AnalyticsEvent event = AnalyticsEvent.builder() .name(“PasswordReset”) .addProperty(“Channel”, “SMS”) .addProperty(“Successful”, true) .addProperty(“ProcessDuration”, 792) .addProperty(“UserAge”, 120.3) .build();
Amplify.Analytics.recordEvent(event); ```
View Analytics console by using :
amplify console analytics
Get back to EMAM’S HOMEPAGE
I have created this page as a part of my project using Github, Please visit my profile, I will be more than happy to hear from you all. © Emam Shararah 2021