Skip to Content
Mobile SDKsPreferences, flags & privacy

Preferences, feature flags, and privacy

Preference Center

The presentation APIs below are available on the current develop branches and are intended for the next Android, iOS, and Flutter releases.

Preference Centers are authored and published in the console from subscription lists. A center is a projection over those lists: it does not own a second copy of subscription state. Use the ready-made UI for a complete screen, or observe the same snapshot to build a custom experience.

Ready-made UI

Engage.preferenceCenter.display() Engage.preferenceCenter.display( options = PreferenceCenterDisplayOptions( key = "marketing", localeLanguageTag = "fr-FR", ), )

On Android, display opens the SDK Activity. PreferenceCenterDisplayOptions selects a center, can override the locale, and accepts a PreferenceCenterMaterialTheme when the host needs explicit Material color roles.

On iOS, display presents a ready-made UIKit controller. Use makeViewController when the host wants to push or embed that controller itself. PreferenceCenterMaterialTheme.system follows the current system appearance and can be replaced with explicit semantic colors.

The Flutter widget deliberately creates no route, Scaffold, app bar, or navigation behavior. The host owns that chrome. It inherits the surrounding Material 3 Theme and locale, and renders an explicit unavailable state when no published center matches the requested key.

Flutter can also ask the native bridge to present the Android or iOS ready-made UI:

await Engage.preferenceCenter.display( key: 'marketing', theme: EngageMaterialTheme.of(context), );

Headless UI

Observe a center when the product needs a fully custom presentation:

Engage.preferenceCenter.center("mobile-notifications").collect { snapshot -> customPreferences.render(snapshot) }

The observable initially returns null when no cached definition exists, then updates after synchronization. A missing, unpublished, or inaccessible center is an unavailable state, not an empty set of choices.

Write the user’s choice through the subscription editor represented by each item:

Choice scopeMutation APIMeaning
profileChoicesEngage.profile.editSubscriptionsfollows the identified profile across bound installations
installationChoiceEngage.installation.editSubscriptionsapplies only to the current app installation

For a custom UI, keep controls bound to the SDK snapshot and send edits through these APIs. The SDK applies the change optimistically, persists it, places the mutation in its durable outbox, and reconciles it with the server. See Audience data for complete mutation examples.

Preference Center choices are separate from OS notification authorization and Engage privacy state. A user can express a subscription preference without granting push permission, and privacy opt-out still governs whether normal synchronization is allowed.

Feature flags

Always supply a safe default. The default is returned when the flag is unavailable, inactive, incompatible, or not eligible.

Android and iOS evaluate synchronously from the local snapshot. Flutter crosses a platform channel, so getters return Future<T> even though the native lookup itself does not wait for network:

val checkoutV2 = Engage.flags.getBoolean( key = "checkout_v2", default = false, ) val resultLimit = Engage.flags.getNumber( key = "search.result_limit", default = 20.0, )

The SDK owns deterministic allocation, snapshot persistence, revision activation, and exposure deduplication.

Runtime feature controls

Disable a closed SDK capability when the application or consent model requires it:

Engage.sdkFeatures.edit { disable(SdkFeature.ANALYTICS) disable(SdkFeature.IN_APP) }

Feature state is durable and observable.

Privacy

Engage.privacy.optOut() Engage.privacy.optIn() Engage.privacy.optOutAndWipe()
  • optOut() stops normal synchronization and collection according to runtime policy while retaining recoverable local state.
  • optIn() resumes permitted behavior.
  • optOutAndWipe() is for an explicit erasure flow. It clears local Engage state and queues remote revocation where required.

Do not call wipe as a logout shortcut. Identity transition and privacy erasure are different operations.