SFMC Core
This section provides API reference details for the SFMC Core module in the Flutter unified plugin.
Sets the profile identifier for the device’s user.
| Parameter | Type | Description |
|---|---|---|
profileId | String | The value to set as the profile ID of the device’s user. |
Future<void>
Returns the profile identifier for the device.
Future<String?>- A future that completes with the current profile ID.
Sets the value of an attribute in the identity.
| Parameter | Type | Description |
|---|---|---|
key | String | The name of the attribute to set. |
value | String | The value of the attribute to set. |
Future<void>
Clears the value of an attribute in the identity.
| Parameter | Type | Description |
|---|---|---|
key | String | The name of the attribute to clear the value of. |
Future<void>
Sets multiple attributes in the identity in one call.
| Parameter | Type | Description |
|---|---|---|
attributes | Map<String, String> | A map of key-value pairs to set. |
Future<void>
Returns a map of attributes for the identity.
Future<Map<String, String>?>- A future that completes with the current attribute map.
Clears all attributes from the identity.
Future<void>
Returns the party identification name currently for the device.
Future<String?>- A future that completes with the current party identification name.
Sets the party identification name for the device’s user.
| Parameter | Type | Description |
|---|---|---|
name | String | The display name or full name of the user. |
Future<void>
Returns the party identification number of the device.
Future<String?>- A future that completes with the current party identification number.
Sets the party identification number for the device’s user.
| Parameter | Type | Description |
|---|---|---|
number | String | A unique identifier number for the user. |
Future<void>
Returns the party identification type currently set on the device.
Future<String?>- A future that completes with the current party identification type.
Sets the party identification type for the device’s user.
| Parameter | Type | Description |
|---|---|---|
type | String | The category or classification for the user. |
Future<void>
Tracks an event, which could result in actions such as an in-app message being displayed.
| Parameter | Type | Description |
|---|---|---|
event | SFMCEvent | An SFMCEvent instance to track, such as CustomEvent or CartEvent. |
Future<void>
Tracks an event and sends it immediately without waiting for the next batch cycle.
| Parameter | Type | Description |
|---|---|---|
event | SFMCEvent | An SFMCEvent instance to send immediately, such as CustomEvent or CartEvent. |
Future<void>
Flushes all queued events to the Marketing Cloud servers immediately.
Future<void>
Sets the log level for the native Marketing Cloud SDK.
| Parameter | Type | Description |
|---|---|---|
level | LogLevel | The SDK log level. Valid values are LogLevel.debug, LogLevel.warn, LogLevel.error, and LogLevel.none. |
Future<void>
Returns the SDK state for diagnostics.
Future<dynamic>- A future that completes with the state of the SDK. The state is usually returned as aMap<dynamic, dynamic>object, but the native SDK can emit non-strict JSON that fails to parse. In this situation, the SDK returns the raw JSON string instead. Parse the result in a way that can handle both object types.