Register Users and Devices

Use the SDK to register users and devices in Marketing Cloud Next. Registration is required to send messages to your users.

Prerequisite 

Before you begin, configure the SDK and initialize it.

Set the Party Identifier 

The party identifier is a unique identifier that represents an individual in Marketing Cloud. It can be a customer ID, mobile number, email address, loyalty number, or another value.

Skip this step if you want to send only to anonymous users. For an anonymous user, the party identifier is a random GUID.

Note

To set the party identifier for Android apps, use this code example.

1SFMCSdk.requestSdk { sfmcSdk ->
2  // Set/Update values in identity
3  sfmcSdk.identity.edit {
4    partyIdentificationNumber = "uniquelyIdentifyingNumber"
5    partyIdentificationName = "uniquelyIdentifyingName"
6    partyIdentificationType = "uniquelyIdentifyingType"
7  }
8  // Read values from Identity
9  val partyIdentificationNumber = sfmcSdk.identity.partyIdentificationNumber
10  val partyIdentificationName = sfmcSdk.identity.partyIdentificationName
11  val partyIdentificationType = sfmcSdk.identity.partyIdentificationType
12}

To set the party identifier for iOS apps, use this code example.

1// Set party details for all modules
2SFMCSdk.identity.edit { [self] model in
3  model.partyIdentificationNumber = "uniquelyIdentifyingNumber"
4  model.partyIdentificationName = "uniquelyIdentifyingName"
5  model.partyIdentificationType = "uniquelyIdentifyingType"
6  return model
7}
8// Retrieve the party details
9let partyIdentificationNumber = SFMCSdk.identity.get()?.partyIdentificationNumber
10let partyIdentificationName = SFMCSdk.identity.get()?.partyIdentificationName
11let partyIdentificationType = SFMCSdk.identity.get()?.partyIdentificationType

Optimize API calls to Marketing Cloud Next by updating the locally stored Individual record only when your app is in the foreground. If your app is in the background, the SDK initializes to show a notification or to pre-cache messages, resulting in unnecessary communication with Marketing Cloud Next.

Tip

Check Required Registration Fields 

A registration is considered invalid if it doesn’t contain all the required fields, or if there are errors in the required fields. If a registration is invalid, the device is set to an inactive or opted-out state.

  1. To verify that the registration information is properly recorded, review how to test and validate registrations.

Registrations are asynchronous. While the SDK can receive a successful 201 response from the server indicating that it received the registration, it can’t determine whether it successfully processed it. The SDK also can’t know whether the server marked the registration as invalid.

Note

This code sample shows an example of a registration request.

1{
2  "mobileAppVersion": "10.0.0",
3  "dateTimeInDevice": "2025-11-20T12:40:58.623Z",
4  "deviceVersion": "18.5",
5  "partyIdentificationName": "Testing-Name",
6  "devicePlatform": "iPhone OS",
7  "deviceId": "DE0AEA79-955D-4941-96A5-C51853A4168B",
8  "locale": "en_US",
9  "partyIdentificationNumber": "123456",
10  "deviceModel": "iPhone13",
11  "registrationId": "DE0AEA79-955D-4941-96A5-C51853A4168B",
12  "deviceTimeZone": "Asia/Kolkata",
13  "mobileAppName": "SDKExplorer",
14  "eventId": "166380F8-A2CB-45DD-85DA-3F2E471883A5",
15  "mobileAppId": "com.exacttarget.sdkx",
16  "pushEnabled": true,
17  "deviceSystemToken": "80ef8671f34bd9acabb375031e3036f1cb906bd30c8bba2e24bd9e078ba2e14548fd31917f32254b7c24df7db73ac8d774eb11845f63391362797d28f04f787d24337639cc15e1797c3a80fc99157d5c",
18  "sdkVersion": "1.0.0",
19  "partyIdentificationType": "Testing-iOS",
20  "attributes": [
21    {
22      "key": "CODE",
23      "value": "FREE99"
24    }
25  ]
26}