Analytics Installation Guide
-
Download and unzip the library. There are 4 files in the zip:
README - Containing a copy of these instructions
CHANGELOG - Where all updates are documented libTMAnalytics.a - The analytics library (a "fat" binary that works in both the simulator and device)
TapMetricsAPI.h - The header file for the analytics library -
Add libTMAnalytics.a and TapMetricsAPI.h to your XCode project.
Add libsqlite3.0, SystemConfiguration.framework, and CoreLocation.framework frameworks. You can do this by right clicking on your application target under "Targets" and selecting "Get Info." Click the "+" button and select the frameworks you would like to add. -
Add the lines of code below to your AppDelegate:
#import "TapMetricsAPI.h" -(void)applicationDidFinishLaunching:(UIApplication *)application { NSString *applicationKey = @"YOUR_KEY_HERE"; [TapMetricsAPI startSession:applicationKey withLocation:YES]; } -(void)applicationWillTerminate:(UIApplication *)application { [TapMetricsAPI endSession]; }You can find your application key by editing one of your applications, it will be on the right side.
-
Add code to track events, error, rating, messages. (optional)
//Log an error NSException *exception = someException; //this can also be nil [TapMetricsAPI logError:@"ERROR MESSAGE" tag:@"TAG AN ERROR" exception:exception]; //Log an event (i.e. user action like a button being pressed) [TapMetricsAPI logEvent:@"EVENT MESSAGE" tag:@"TAG AN EVENT"]; -
Compile and run your application. Your analytics should start showing up within minutes. The iPhone analytics library supports iPhone OS 2.2.1 - OS 3.1.3. An iOS4 compatible library is expected soon.