1
#include <libusermetricsinput/usermetricsinput.h>
3
int main(int argc, char *argv[]) {
4
// We start with a manager object
5
UserMetricsInputMetricManager metricManager =
6
usermetricsinput_metricmanager_new();
8
// You can hold onto this shared object for as long as you want
9
UserMetricsInputMetric metric = usermetricsinput_metricmanager_add(
10
metricManager, "photo-app-photos", "<b>%1</b> photos taken today",
11
"No photos today", APP_ID);
13
// The update is sent when the update object is destroyed.
14
// Providing a blank username string will use the current
15
// user according to the USER environment variable.
16
usermetricsinput_metric_increment(metric, 1, "");
18
// Now we're done with the manager
19
usermetricsinput_metricmanager_delete(metricManager);