getAttributes

Retrieves all custom attributes associated with the device.

Syntax 

1Future<Map<Object?, Object?>?> getAttributes()

Returns 

  • Future<Map<Object?, Object?>?> - Returns a map of all custom attributes, or null if no attributes are set.

Example 

1Map<Object?, Object?>? attributes = await SfmcSdk.getAttributes();
2if (attributes != null) {
3  attributes.forEach((key, value) {
4    print('$key: $value');
5  });
6} else {
7  print('No attributes found');
8}

Related Methods