Example App — Flutter SDK
In-app messaging E2E test harness. Configure the SDK, identify a test user, switch logical screens, and sync in-app messages.
Prerequisites
- Flutter SDK installed
- Your CDP API key and gateway URL
Step 1 — Run the app
git clone https://github.com/opencdp/opencdp-flutter-sdk.git
cd opencdp-flutter-sdk/example
flutter pub get
flutter run
Step 2 — Configure on first launch
On the Configure the SDK screen, enter:
| Field | Value |
|---|---|
| CDP endpoint | YOUR_DATA_GATEWAY_URL (from workspace Settings) |
| CDP API key | YOUR_CDP_API_KEY |
| Test person id | user_123 (any non-email ID) |
| Profile fields | Optional identify properties |
Tap Initialize & continue.
Step 3 — Use the home screen
The status panel shows your person ID and current logical screen.
| Action | Purpose |
|---|---|
| Bottom tabs (Home, Cart, Profile, Inbox, Events) | Change logical screen for page rules |
| Sync now | Manual in-app sync |
| Reset local state | Clear local dismiss/session state |
| Events tab | Fire custom track() events |
Render types in the example
render_type | Where it appears |
|---|---|
modal | Full-screen dialog via InAppHost |
banner | Top overlay via InAppHost |
inline | Inline list on Home/Cart/Profile tabs |
inbox_card | Same inline list; use Inbox tab for inbox-style tests |
Step 4 — Test in-app from dashboard
- Note the person ID on the status panel.
- Create or trigger an in-app campaign targeting that person.
- Tap Sync now or wait for automatic delivery (
enableInAppMessages: true). - Render inline/inbox messages and confirm metrics.
Step 5 — Push testing
This example focuses on in-app messaging. For push:
- Wire Firebase/APNs in your host app.
- Call
registerDeviceTokenafter identify. - Use the same person ID in Test push notification → Test by User ID.
See Push notifications and Mobile E2E guide.
Verify it worked
- Status panel shows person ID and screen name
- With
debug: true, console shows sync URLs containingperson_id=your_test_id - In-app messages appear after campaign trigger + sync