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.

ParameterTypeDescription
profileIdStringThe 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.

ParameterTypeDescription
keyStringThe name of the attribute to set.
valueStringThe value of the attribute to set.
  • Future<void>

Clears the value of an attribute in the identity.

ParameterTypeDescription
keyStringThe name of the attribute to clear the value of.
  • Future<void>

Sets multiple attributes in the identity in one call.

ParameterTypeDescription
attributesMap<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.

ParameterTypeDescription
nameStringThe 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.

ParameterTypeDescription
numberStringA 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.

ParameterTypeDescription
typeStringThe category or classification for the user.
  • Future<void>

Tracks an event, which could result in actions such as an in-app message being displayed.

ParameterTypeDescription
eventSFMCEventAn 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.

ParameterTypeDescription
eventSFMCEventAn 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.

ParameterTypeDescription
levelLogLevelThe 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 a Map<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.