setProperty method

Future<bool> setProperty(
  1. String key,
  2. dynamic value
)

Updates a single subscription property.

A more convenient way to update a single property compared to updateProperties.

Parameters:

  • key: The name of the property to update
  • value: The new value for the property

Example:

await SuperFCM.instance.setProperty('isPremium', true);

Implementation

Future<bool> setProperty(String key, dynamic value) async {
  return _queueOrExecute("setProperty", () async {
    logger.i('Setting property: $key -> $value');
    if (subscription?.properties?[key] == value) {
      logger.v('Property $key already set to $value');
      return true;
    }
    return await updateProperties({key: value});
  });
}