open_cdp_flutter_sdk library

Classes

CDPInAppManager
Manages fetching, arbitration, display dispatch and tracking for in-app messages. Designed to be initialized once per SDK instance.
CDPPushAction
A push action button delivered in the FCM data.actions JSON string.
CustomerIoConfig
Customer.io configuration
InAppArbitrationState
Public-shape mirror of the private _DeliveryState used so pure arbitration filtering can be tested without standing up the full manager. Marked @visibleForTesting because the production code never constructs these directly — they're built from _deliveryState inside _arbitrate.
InAppConfig
InAppCta
A call-to-action button on an in-app message.
InAppManagerConfig
Configuration for the in-app delivery manager.
InAppMessage
A message returned by the in-app sync endpoint.
InAppPageRules
Include / exclude screen targeting from the message definition.
InAppPersistence
Persistence rules for an in-app message (max impressions, intervals, etc.).
OpenCDPConfig
Main configuration class for Open CDP SDK
OpenCDPInAppBanner
Top banner for InAppRenderType.banner.
OpenCDPInAppHost
App-wide entry point that listens to OpenCDPSDK.instance.inApp and presents modal / banner messages automatically, and publishes inline / inbox_card into OpenCDPInAppSlotRegistry for OpenCDPInAppInlineSlot / OpenCDPInAppInboxSlot.
OpenCDPInAppInboxSlot
Place in a scrollable column / list to append inbox-style cards.
OpenCDPInAppInlineCard
Default embeddable card for InAppRenderType.inline / inbox slots.
OpenCDPInAppInlineSlot
Place this in the widget tree where an inline message should appear (e.g. above a balance row). Not GlobalKey hunting — you choose the spot.
OpenCDPInAppModalDialog
Default modal dialog for InAppRenderType.modal.
OpenCDPInAppSlotRegistry
Shared state for OpenCDPInAppInlineSlot / OpenCDPInAppInboxSlot.
OpenCDPInAppSlotScope
Makes OpenCDPInAppSlotRegistry available to descendant slots.
OpenCDPPushPayload
Helpers for push notification v2 payloads (custom_data, actions, image_url).
OpenCDPPushSetupOptions
Options for OpenCDPSDK.setupPushNotifications.
OpenCDPSDK
Main SDK class for Open CDP
PushConfig
PushConfigAndroid

Enums

CioLogLevel
Enum to define the log levels. Logs can be viewed in Xcode or Android studio.
InAppCtaAction
Action performed when a CTA is tapped.
InAppDismissReason
Reason a message was dismissed.
InAppRenderType
Render type for an in-app message (matches backend render_type).
MetricEvent
Enum representing different types of metric events for push notifications
OpenCDPLogLevel
Log level for SDK debugging
PushClickBehaviorAndroid
Enum to specify the type of metric for tracking Enum to specify the click behavior of push notification for Android
Region
ScreenView
Screen view tracking configuration

Functions

isHybridFcmMessage(RemoteMessage message) → bool
Whether the FCM message includes a top-level notification block (hybrid payload).
shouldDisplayAndroidPush(Map<String, dynamic> data) → bool
Whether the payload should trigger a local Android notification display.

Typedefs

InAppMessageListener = void Function(InAppMessage message)
Listener invoked when a new in-app message is ready to be displayed by the host app. The host is responsible for actually rendering it (modal, banner, inline, inbox card, etc.) — the SDK only schedules and tracks it.
OpenCDPFirebaseInitializer = Future<void> Function()
Initializes Firebase in the background FCM isolate.
OpenCDPInAppBannerBuilder = Widget Function(BuildContext context, InAppMessage message, {required VoidCallback onClose, required void onPrimaryCta(InAppCta cta)})
Builds a banner overlay widget. Call onPrimaryCta / onClose so the host can track and remove the overlay.
OpenCDPInAppModalBuilder = Widget Function(BuildContext context, InAppMessage message)
Builds a modal body for showDialog. Pop with a CTA id (String) or null when the user dismisses without a CTA — the host tracks click/dismiss.
OpenCDPPushOpenCallback = void Function(Map<String, dynamic> data, {String? actionClicked})
Callback when the user opens a push notification or taps an action button.
OpenCDPPushTokenCallback = FutureOr<void> Function(String token)
Callback when a new FCM device token is available.

Exceptions / Errors

CDPException
Custom exception for CDP API errors.
CDPValidationException
Custom exception class for validation errors in the CDP SDK.