Endpoints

You are currently viewing the AWS SDK for Mobile documentation which is a collection of low-level libraries. Use the Amplify libraries for all new app development. Learn more

When a user starts a session (for example, by launching your mobile app), your mobile or web application can automatically register (or update) an endpoint with Amazon Pinpoint. The endpoint represents the device that the user starts the session with. It includes attributes that describe the device, and it can also include custom attributes that you define. Endpoints can also represent other methods of communicating with customers, such as email addresses or mobile phone numbers.

After your application registers endpoints, you can segment your audience based on endpoint attributes. You can then engage these segments with tailored messaging campaigns. You can also use the Analytics page in the Amazon Pinpoint console to view charts about endpoint registration and activity, such as New endpoints and Daily active endpoints.

You can assign a single user ID to multiple endpoints. A user ID represents a single user, while each endpoint that is assigned the user ID represents one of the user’s devices. After you assign user IDs to your endpoints, you can view charts about user activity in the console, such as Daily active users and Monthly active users.

Adding Custom Endpoint Attributes

After you initialize the Amazon Pinpoint client in your application, you can add custom attributes to endpoints.

1import com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent;
2
3public void addCustomEndpointAttribute() {
4 // Add a custom attribute to the endpoint
5 TargetingClient targetingClient = pinpointManager.getTargetingClient();
6 String[] interests = new String[] {"science", "politics", "travel"};
7 targetingClient.addAttribute("interests", Arrays.asList(interests));
8 targetingClient.updateEndpointProfile();
9 Log.d(TAG, "Updated custom attributes for endpoint: " +
10 targetingClient.currentEndpoint().getEndpointId());
11}

Assigning User IDs to Endpoints

Assign user IDs to endpoints by doing either of the following:

Manage user sign-up and sign-in with Amazon Cognito user pools. Use the Amazon Pinpoint client to assign user IDs without using Amazon Cognito user pools. Amazon Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. When the AWS Mobile SDKs for iOS and Android register an endpoint with Amazon Pinpoint, Amazon Cognito automatically assigns a user ID from the user pool. For more information, see Using Amazon Pinpoint Analytics with Amazon Cognito User Pools in the Amazon Cognito Developer Guide.

If you don’t want to use Amazon Cognito user pools, you can use the Amazon Pinpoint client in your application to assign user IDs to endpoints.

1import com.amazonaws.mobileconnectors.pinpoint.targeting.TargetingClient;
2import com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfileUser;
3import com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfile;
4
5public void assignUserIdToEndpoint() {
6 TargetingClient targetingClient = pinpointManager.getTargetingClient();
7 EndpointProfile endpointProfile = targetingClient.currentEndpoint();
8 EndpointProfileUser endpointProfileUser = new EndpointProfileUser();
9 endpointProfileUser.setUserId("UserIdValue");
10 endpointProfile.setUser(endpointProfileUser);
11 targetingClient.updateEndpointProfile(endpointProfile);
12 Log.d(TAG, "Assigned user ID " + endpointProfileUser.getUserId() +
13 " to endpoint " + endpointProfile.getEndpointId());
14}

Endpoint Limits

The limits applicable to the endpoints using the AWS Android SDK for Pinpoint and the Amazon Pinpoint Endpoint API can be found here.