Skip to content

getvero/vero-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

vero-ios

This is an old library that suggests an approach for running Vero from within an existing XCode project. It is a thin wrapper for Vero's API. The full documentation for this API can be found here.

Alternatively, we would recommend using Segment.com's iOs Library.

Getting started

Vero support iOS5 and above.

Copy Vero.h and Vero.m to your XCode project

	Vero *vero = [Vero shared];
	[vero setAuthToken:@"yourVeroAuthToken"];
	vero.debug = YES;

Using the Vero API

Interacting with the Vero API using our wrapper object is super simple. Here are some common scenarios:

Example: Track an event when a user signs up from your app

#import "Vero.h"

- (void) doSomething {
  Vero *vero = [[Vero alloc] init];
  vero.authToken = @"yourVeroAuthToken";

  NSDictionary* me = [NSDictionary dictionaryWithObjectsAndKeys:
                     @"james@getvero.com", @"id",
                     [NSNumber numberWithBool:true], @"awesome", nil];
  NSDictionary* data = [NSDictionary dictionaryWithObjectsAndKeys: @"iphone", @"source", nil];
  
  [vero eventsTrack:@"Signed up" identity:me data:data developmentMode:false];
}

Example: Track or update a user's age from your app

#import "Vero.h"

- (void) doSomething {
  Vero *vero = [[Vero alloc] init];
  vero.authToken = @"yourVeroAuthToken";

  NSDictionary* me = [NSDictionary dictionaryWithObjectsAndKeys:
                     @"james@getvero.com", @"id",
                     [NSNumber numberWithInt:25], @"age", nil];
  
  [vero usersTrack:@"james@getvero" email:nil data:me developmentMode:false];
}

Example: Edit an existing user's age from your app

Note: this operation will not create a new user if they do not already exist

#import "Vero.h"

- (void) doSomething {
  Vero *vero = [[Vero alloc] init];
  vero.authToken = @"yourVeroAuthToken";

  NSDictionary* me = [NSDictionary dictionaryWithObjectsAndKeys:
                     @"james@getvero.com", @"id",
                     [NSNumber numberWithInt:25], @"age", nil];
  
  [vero usersEdit:@"james@getvero" changes:me developmentMode:false];
}

Example: Tag an existing user with "VIP" from your app

#import "Vero.h"

- (void) doSomething {
  Vero *vero = [[Vero alloc] init];
  vero.authToken = @"yourVeroAuthToken";

  NSArray* tags = [NSArray arrayWithObject:@"VIP"];
  
  [vero usersTagsEdit:@"james@getvero" add:tags remove:nil developmentMode:false];
}

Example: Unsubscribe a user from Vero emails using your app

#import "Vero.h"

- (void) doSomething {
  Vero *vero = [[Vero alloc] init];
  vero.authToken = @"yourVeroAuthToken";
  
  [vero usersUnsubscribe:@"james@getvero"];
}

For more indepth information on each of the supported APIs, see our API reference: Events API and User API.

About

A simple Vero API wrapper for iOS devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published