Skip to content

Get current counter value

Returns the current value of the counter.

Future<int> Backendless.counters.getValue(String counterName);

IAtomic counter = Backendless.counters.of(String counterName);
Future<int> counter.getValue();

where:

Argument                Description
counterName name of the counter to retrieve.

Example

Function callback = (counterValue) => print("current counter value is - $counterValue");

Backendless.counters.get("my counter").then(callback);

IAtomic myCounter = Backendless.counters.of("my counter");
myCounter.get().then(callback);