Skip to content

Commit 33ad5b7

Browse files
authored
Remove Gen2 Authentication events on Android (#8373)
1 parent 2226dc2 commit 33ad5b7

File tree

1 file changed

+0
-79
lines changed
  • src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events

1 file changed

+0
-79
lines changed

src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -130,85 +130,6 @@ RxAmplify.Analytics.flushEvents();
130130

131131
When flushing events, a [Hub event](/[platform]/build-a-backend/auth/connect-your-frontend/listen-to-auth-events/) is sent containing the events which were successfully sent to the Pinpoint service. To receive a list of these events, subscribe to the `HubChannel.ANALYTICS` channel and handle an event of the type `AnalyticsChannelEventName.FLUSH_EVENTS`.
132132

133-
## Authentication events
134-
135-
Authentication events indicate how frequently users authenticate with your application.
136-
137-
On the **Analytics** page, the **Users** tab displays charts for **Sign-ins, Sign-ups, and Authentication failures**.
138-
139-
To learn how frequently users authenticate with your app, update your application code so that Amazon Pinpoint receives the following standard event types for authentication:
140-
141-
- `_userauth.sign_in`
142-
- `_userauth.sign_up`
143-
- `_userauth.auth_fail`
144-
145-
You can report authentication events by doing either of the following:
146-
147-
- Managing user sign-up and sign-in with Amazon Cognito user pools.
148-
149-
Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplify_outputs.json** by adding the `PinpointAppId` key under `CognitoUserPool`.
150-
151-
```json
152-
"CognitoUserPool": {
153-
"Default": {
154-
"PoolId": "<your-user-pool-id>",
155-
"AppClientId": "<your-app-client-id>",
156-
"Region": "<your-app-region>",
157-
"PinpointAppId": "<your-pinpoint-app-id>"
158-
}
159-
}
160-
```
161-
162-
- Manually recording events using the `recordEvent()` API.
163-
164-
If you don't want to use Cognito user pools, you can use the Pinpoint client to record and submit authentication events, as shown in the following examples. In these examples, the event type is set to `_userauth.sign_in`, but you can substitute any authentication event type.
165-
166-
<BlockSwitcher>
167-
<Block name="Java">
168-
169-
```java
170-
/**
171-
* Call this method to log an authentication event to the analytics client.
172-
*/
173-
public void logAuthenticationEvent() {
174-
AnalyticsEvent event = AnalyticsEvent.builder()
175-
.name("_userauth.sign_in")
176-
.build();
177-
Amplify.Analytics.recordEvent(event);
178-
}
179-
```
180-
181-
</Block>
182-
<Block name="Kotlin">
183-
184-
```kotlin
185-
/**
186-
* Call this method to log an authentication event to the analytics client.
187-
*/
188-
fun logAuthenticationEvent() {
189-
val event = AnalyticsEvent.builder()
190-
.name("_userauth.sign_in")
191-
.build()
192-
Amplify.Analytics.recordEvent(event)
193-
}
194-
```
195-
</Block>
196-
<Block name="RxJava">
197-
198-
```java
199-
200-
/**
201-
* Call this method to log an authentication event to the analytics client.
202-
*/
203-
public void logAuthenticationEvent() {
204-
AnalyticsEvent event = AnalyticsEvent.builder()
205-
.name("_userauth.sign_in")
206-
.build();
207-
RxAmplify.Analytics.recordEvent(event);
208-
}
209-
```
210-
</Block>
211-
</BlockSwitcher>
212133

213134
## Global Properties
214135

0 commit comments

Comments
 (0)