API Reference
API Reference
  1. 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});
    
  2. getTags()
    Retrieves the current set of tags.

    Future<MocaResult<Map?>> getTags();
    
  3. containsTag(String tag)
    Checks if a specific tag is present.
    Parameters:

    • tag: String, required – The tag to check.
    Future<MocaResult<bool?>> containsTag(String tag);
    
  4. 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);
    
  5. getLastKnownLocation()
    Retrieves the last known location of the device.

    Future<MocaResult<Map?>> getLastKnownLocation();
    
  6. 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);
    
  7. 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);
    
  8. 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);
    
  9. 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);