TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
ObjectiveMetrics is a Objective-C implementation of the desktop application analytics service DeskMetrics. You link against ObjectiveMetrics and specify what events you want to track via an intuitive API, and we take care of having them delivered to DeskMetrics, so that they'll show up on your dashboard.
There's no known reason it wouldn't work on earlier iOS versions, but it has not been tested.
To track any event, you need the following at the start of the file:
#import <ObjectiveMetrics/ObjectiveMetrics.h>
Or, under iOS (iPhone):
#import "DMTracker.h"
Then, anywhere you want to track an event, retrieve the DMTracker singleton instance using:
[DMTracker defaultTracker]
On this instance, you can call any number of tracking events. It is very
important that you call the startWithApplicationId:
method soon after your app
starts. This is because it initializes the session and prepares the DMTracker
for more tracking events:
[[DMTracker defaultInstance] startWithApplicationId:@"MY APP ID HERE"];
You should then call stop
when your application is shutting down, to track an
"app exiting" event and attempt to send the events to the server. If they can't
be sent, they'll be sent the next time the application starts.
Here are the different methods you can call: (See DMTracker.h for a list that's guaranteed updated)
DMTracker *tracker = [DMTracker defaultInstance];
[tracker trackEvent:@"Event"];
[tracker trackEvent:@"Event with properties"
withProperties:@{@"Name": @"Joe Smith"}];
[tracker trackLog:@"Time is now %@", [NSDate date]];
ObjectiveMetrics uses other open-source libraries, and is covered by a couple of licenses: