Marketing Cloud Engagement SDK
This section provides API reference details for the Marketing Cloud Engagement SDK module in the Flutter unified plugin.
Requests an updated list of inbox messages from the Marketing Cloud servers.
Future<bool>- Indicates whether the refresh request succeeded.
Retrieves all active inbox messages, including read and unread messages. Doesn’t retrieve deleted inbox messages.
Future<List<InboxMessage>>- A future that completes with the list of inbox messages.
Retrieves all active, unread inbox messages. Doesn’t retrieve deleted inbox messages.
Future<List<InboxMessage>>- A future that completes with the list of unread inbox messages.
Retrieves all active, read inbox messages. Doesn’t retrieve unread inbox messages.
Future<List<InboxMessage>>- A future that completes with the list of read inbox messages.
Retrieves all active, deleted inbox messages.
Future<List<InboxMessage>>- A future that completes with the list of deleted inbox messages.
Retrieves the total number of inbox messages, excluding deleted messages.
Future<int?>- A future that completes with the total inbox message count.
Retrieves the total number of unread inbox messages, excluding deleted messages.
Future<int?>- A future that completes with the unread inbox message count.
Retrieves the total number of read inbox messages, excluding deleted messages.
Future<int?>- A future that completes with the read inbox message count.
Retrieves the total number of deleted inbox messages.
Future<int?>- A future that completes with the deleted inbox message count.
Marks an inbox message as read in local storage.
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the inbox message to mark as read. |
Future<void>
Marks an inbox message as deleted in local storage.
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the inbox message to mark as deleted. |
Future<void>
Marks all active, unread inbox messages as read.
Future<void>
Marks all active inbox messages as deleted.
Future<void>
Tracks the opening of an inbox message for analytics.
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the inbox message that was opened. |
Future<void>
Adds a tag to the list of tags in the registration.
| Parameter | Type | Description |
|---|---|---|
tag | String | The tag to add. |
Future<void>
Adds multiple tags to the list of tags in the registration.
| Parameter | Type | Description |
|---|---|---|
tags | List<String> | The list of tags to add. |
Future<void>
Removes a tag from the list of tags in the registration.
| Parameter | Type | Description |
|---|---|---|
tag | String | The tag to remove. |
Future<void>
Removes multiple tags from the list of tags in the registration.
| Parameter | Type | Description |
|---|---|---|
tags | List<String> | The list of tags to remove. |
Future<void>
Returns the tags currently set on the device.
Future<List<String>?>- A future that completes with the list of tags currently set on the device.
Returns a map of attributes set in the registration.
This method is deprecated. Use SFMCSdkModule.getAttributes from sfmc_core instead. SFMCSdkModule.getAttributes coerces null attribute values to an empty string ('') rather than the literal string "null".
Future<Map<String, String>?>- A future that completes with the map of attributes set in the registration.
Returns the device ID that Marketing Cloud uses to send push messages to the device.
Future<String?>- A future that completes with the device ID.
Returns the contact key for the device.
This method is deprecated. Use SFMCSdkModule.getProfileId from sfmc_core instead.
Future<String?>- A future that completes with the contact key currently set on the device.
Sets the signed string for device/contact authentication. The signed string is typically a JWT used to authenticate the device or contact, and this feature must be enabled on the Marketing Cloud account.
| Parameter | Type | Description |
|---|---|---|
signedString | String? | The signed string to set. Pass null to clear the value. |
Future<void>
Returns the signed string for the device. The signed string is usually a JWT used to authenticate the device or contact. If no signed string is set, this method returns null.
Future<String?>- A future that completes with the signed string, ornullif no signed string is set.
Enables Predictive Intelligence analytics in the Marketing Cloud SDK.
Future<void>
Disables Predictive Intelligence analytics in the Marketing Cloud SDK.
Future<void>
Checks if Predictive Intelligence analytics is enabled.
Future<bool>- Indicates whether Predictive Intelligence analytics is enabled.
Enables analytics in the Marketing Cloud SDK.
Future<void>
Disables analytics in the Marketing Cloud SDK.
Future<void>
Checks if analytics is enabled in the Marketing Cloud SDK.
Future<bool>- Indicates whether analytics is enabled.
Enables verbose logging within the native Marketing Cloud SDK.
Future<void>
Disables verbose logging within the native Marketing Cloud SDK.
Future<void>
Registers a callback to receive registration change events from the SDK.
Future<void>
Unregisters the registration change callback.
Future<void>
A broadcast stream of registration events. Emits a map that contains registration data when the registration changes.
Stream<Map<String, dynamic>>- A broadcast stream that emits a map of registration data when the registration changes.
Registers a listener for inbox message changes.
| Parameter | Type | Description |
|---|---|---|
listener | InboxResponseListener | The callback invoked when an inbox message changes. |
Future<void>
Unregisters a previously registered inbox response listener.
| Parameter | Type | Description |
|---|---|---|
listener | InboxResponseListener | The callback to remove. |
Future<void>
Enables the location (geofence) feature at runtime. In iOS apps, flips the developer override on MarketingCloudSdk. In Android apps, enables geofence messaging using RegionMessageManager. Request the required OS location permissions before you call this method.
Future<void>
Disables the location (geofence) feature at runtime. In iOS apps, flips the developer override on MarketingCloudSdk. In Android apps, disables geofence messaging using RegionMessageManager.
Future<void>
Reports whether the location, or the geofence feature, is enabled.
Future<bool>- Indicates whether the location (geofence) feature is enabled.
In iOS apps, starts tracking the coordinates of an app user. In Android apps, geofence transitions are driven by enableLocation and disableLocation.
Future<void>
In iOS apps, stops tracking the app user’s location.
Future<void>
In iOS apps, reports whether the SDK actively watches the app user’s location. In Android apps, always returns false.
Future<bool>- Indicates whether the SDK is actively watching the app user’s location.
Returns the last known device location as reported by the native SDK. iOS returns a raw [String: String] dictionary, which usually includes latitude and longitude keys. Returns null when the app hasn’t captured any data. Always returns null in Android apps.
Future<Map<String, String>?>- A future that completes with the last known location, ornullif unavailable.
In Android apps, enables proximity (beacon) messaging and requires ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION.
Future<void>