-
addTag(String tag, {String? value})
Adds a tag with an optional value to the user or session context.
Parameters:tag
: String, required – The tag to add.value
: String, optional – An optional value associated with the tag.
Future<MocaResult<bool?>> addTag(String tag, {String? value});
-
getTags()
Retrieves the current set of tags.Future<MocaResult<Map?>> getTags();
-
containsTag(String tag)
Checks if a specific tag is present.
Parameters:tag
: String, required – The tag to check.
Future<MocaResult<bool?>> containsTag(String tag);
-
getTagValue(String tag)
Retrieves the numerical value associated with a tag.
Parameters:tag
: String, required – The tag whose value is requested.
Future<MocaResult<double?>> getTagValue(String tag);
-
getLastKnownLocation()
Retrieves the last known location of the device.Future<MocaResult<Map?>> getLastKnownLocation();
-
setRemotePushToken(String token, String provider)
Registers a remote push token with the SDK.
Parameters:token
: String, required – The remote push token.provider
: String, required – The push token provider (e.g., "firebase").
Future<MocaResult<bool?>> setRemotePushToken(String token, String provider);
-
setProperty(String key, Object value)
Sets a custom property with a given key and value.
Parameters:key
: String, required – The property key.value
: Object, required – The property value.
Future<MocaResult<bool?>> setProperty(String key, Object value);
-
getProperty(String key)
Retrieves the value of a property by its key.
Parameters:key
: String, required – The property key.
Future<MocaResult<Object?>> getProperty(String key);
-
setProperties(Map<String, dynamic> props)
Sets multiple custom properties at once using a map of key-value pairs.
Parameters:props
: Map<String, dynamic>, required – A map containing properties to set.
Future<MocaResult<bool?>> setProperties(Map<String, dynamic> props);