Mobile integration — end to end
Use this guide to integrate any OpenCDP mobile SDK and verify push or in-app messaging on a real device. Every step uses placeholder credentials — replace them with your workspace values.
Prerequisites
- An OpenCDP workspace with a push channel configured (for push testing)
- Your CDP API key from workspace Settings
- Your workspace data-gateway URL (copy from Settings in the OpenCDP dashboard — do not use a shared example URL)
- A physical device or emulator with push capability (FCM for Android, APNs for iOS)
Master checklist
| Step | Action | Verify |
|---|---|---|
| 1 | Enable push in workspace Settings | Push channel shows connected |
| 2 | Clone the SDK example app for your platform | App builds and launches |
| 3 | Enter API key, gateway URL, and test person ID | Config screen accepts values |
| 4 | Call initialize then identify | Debug log or status UI shows your person ID |
| 5 | (Push) Register FCM/APNs token via registerDeviceToken | registerDevice request succeeds (optional network trace) |
| 6 | Send a test push from the console or server SDK | Notification appears on device |
| 7 | Tap the notification | Delivery/open metrics in SDK debug logs |
Person ID for testing
The User ID in the console “Test push notification” dialog is the same value you passed to identify() — not the device ID or FCM token. See Identity and devices.
Choose your SDK
Each platform has a dedicated quick-start and example-app guide:
| SDK | Quick start | Example app |
|---|---|---|
| Flutter | Initialize → identify → track | Flutter example app |
| Android | Initialize → identify → track | Android example app |
| iOS | Initialize → identify → track | iOS example app |
| React Native | Initialize → identify → track | React Native example app |
Path A — Push test (~15 minutes)
- Complete steps 1–5 of the master checklist for your SDK.
- In the OpenCDP dashboard, open Test push notification.
- Select your platform (Android or iOS).
- Choose Test by User ID and enter the same person ID from step 4.
- Send the test. Confirm the notification arrives.
- Tap it and check SDK debug logs for open/delivery metrics.
See also: Push notifications (console) · Rich push images
Path B — In-app messaging test
- Run any SDK example app with
enableInAppMessages: trueand identify a test user. - Note the person ID shown in the example UI.
- In the dashboard, create or trigger an in-app campaign targeting that person or segment. Set the desired render type (
modal,banner,inline, orinbox_card). - Switch logical screens in the example (
home,cart,profile,inbox) to match page rules. - Tap Sync / Sync in-app (or wait for automatic delivery).
- Confirm the message renders with the correct UI pattern and impression/click/dismiss metrics fire.
See: In-app messaging (render types + per-SDK branching)
Path C — Server-initiated push
- Identify a user on device (steps 1–4).
- Register the device token (step 5).
- From your backend, call
sendPushwith the same person ID:
await client.sendPush({
identifiers: { id: 'user_123' },
transactional_message_id: 'YOUR_TEMPLATE_ID',
title: 'Hello',
body: 'Test message',
});
See: Node.js sendPush · Python send_push
Path D — Rich push (image URL)
- Send a push with an Image URL in the editor or
image_urlin the payload. - On Android 12+: collapsed notification shows thumbnail on the right; expanded shows full image at bottom.
- On Android 7–11: collapsed preview appears on the left (OS limitation).
- On iOS: add a Notification Service Extension and set
mutable-content: 1.
Related
- Identity and devices — person ID vs device ID vs push token
- Feature matrix — capability comparison across SDKs
- Platform quick start — workspace setup (non-developers)