Latest 0.1.1
License MIT
Platforms ios 6.0, requires ARC
Dependencies AFNetworking


An iOS client for harvestd analytics collector


Add it to your Podfile

pod 'Harvest', '0.1.0'

Then run

pod install


The best place to initialize everything is probably in your app delegate. Harvest is a singleton and can thus be called from anywhere you include the header.

#import <Harvest/Harvest.h>

+ (void)initialize

    [Harvest setApiToken:@"<some unique token>" andHostname:@""];    


Often times there might be some properties that you want included on every event. You can do this by passing an NSDictionary to the includeData function:

NSDictionary *includeData = @{
                                @"source": @"my cool ios app",
[Harvest includeData: includeData];

If you have potentially variable data you’d like to set before each track event is fired, you can register a block/callback by calling setPretrackBlock.

[Harvest setPretrackHandler:^void (NSString * eventName, NSDictionary *data, void(^cb)(NSString *, NSDictionary *)){
    // do some stuff then call back
    cb(eventName, data);

Tracking events

To track an event, you’ll an event name and any attributes you want recorded with the event.

[Harvest trackEvent:@"my cool event" withData:@{
    @"yo": "dawg"

Identifying users

You can also identify a user by calling the identify function. This should be called when a user goes from an anonymous to known state. The identifier passed should be something unique – an email or unique id generated by your DB would be good choices.

[Harvest identifyUser:@"1234"];

Latest podspec

    "name": "Harvest",
    "version": "0.1.1",
    "summary": "Client library for the Harvestd analytics collector",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Sean McGary": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "source_files": "Harvest",
    "exclude_files": "Classes/Exclude",
    "platforms": {
        "ios": "6.0"
    "requires_arc": true,
    "dependencies": {
        "AFNetworking": [

Pin It on Pinterest

Share This