Skip to main content

Identity and devices

OpenCDP mobile SDKs use three different identifiers. Confusing them is the most common cause of “push not received” during testing.

Person ID (identifier)​

What it is: The user ID you pass to identify(). This is how OpenCDP knows who the person is.

Where to use it:

  • Console Test push notification → Test by User ID
  • Server sendPush({ identifiers: { id: '...' } })
  • In-app sync (query param person_id in API calls)

Rules:

  • Must not be an email address
  • Must be consistent across identify, push targeting, and campaigns

Example:

await OpenCDPSDK.instance.identify(
identifier: 'user_123',
properties: {
'email': '[email protected]',
'plan': 'pro',
},
);

How to find it during testing:

  • Enter it on the example app config screen before initializing
  • Read it from the example app status panel (Flutter / React Native)
  • With debug: true, look for person_id= in SDK log URLs

Device ID (deviceId)​

What it is: A stable ID for the physical device, generated by the SDK and sent in the registerDevice API body. It is not the same as the person ID or the FCM/APNs token.

How it is generated (mobile SDKs):

MD5("{device_model}-{manufacturer}-{identifier}")

Where identifier is the current person ID if identified, otherwise an anonymous device identifier stored locally.

Where it is used:

  • POST /v1/persons/registerDevice payload field deviceId
  • Server-side registerDevice when registering tokens manually

How to inspect it:

  • Enable debug: true and trace the registerDevice network request body
  • It is not shown in example app UIs by default

You typically do not need the device ID to send a push from the console — use the person ID instead.


Push token (FCM / APNs)​

What it is: The platform push registration token from Firebase (Android) or Apple (iOS). Required for the OS to deliver notifications to the device.

Where to use it:

  • Pass to registerDeviceToken(fcmToken: ...) or registerDeviceToken(apnToken: ...)
  • Console Test push notification → Enter Device Token (direct device test, bypasses user lookup)

How to obtain it:

PlatformSource
AndroidFirebaseMessaging.getInstance().token or onNewToken in your FirebaseMessagingService
iOSapplication(_:didRegisterForRemoteNotificationsWithDeviceToken:) in AppDelegate
FlutterFirebase Messaging / turnkey setupPushNotifications
React NativeFirebase Messaging or Expo notifications — then call registerDeviceToken

Quick reference​

IDPurposeConsole test fieldExample value
Person IDWho receives the messageUser IDuser_123
Device IDDevice record in CDP— (automatic)a1b2c3... (MD5 hash)
FCM/APNs tokenOS deliveryDevice TokenLong platform string

Register device flow​

When you call registerDeviceToken, the SDK sends:

{
"identifier": "user_123",
"deviceId": "<sdk-generated-md5>",
"platform": "android",
"fcmToken": "<token>",
"apnToken": null,
"model": "Pixel 8",
"osVersion": "14",
"appVersion": "1.0.0"
}

Both person ID and push token must be registered before push delivery works reliably.