Installing Medialets Analytics SDK
|
Upgrading apps to run on iOS5 If you are upgrading your application to run on iOS SDK 5.0, you will need to do the following:
|
- Hooking Up The Medialets Analytics SDK To Your Activities
There are two options by which your activities can interact with the Medialets Analytics SDK.
Option One:
We recommend this option if you have a simple application or want to write a quick test application that incorporates the Medialets Analytics SDK.
#import "AppDelegate.h" #import "MyViewController.h" #import "MedialetsAnalyticsManager.h" @implementation AppDelegate @synthesize window; @synthesize viewController; + (void)initialize { [[MedialetsAnalyticsManager sharedInstance] initialize:NO]; }
Option Two:
We recommend this option if you need to programatically set your appID or your application is using a locationManager that you want to also utilize for analytics with the Medialets Analytics SDK.
#import "AppDelegate.h" #import "MyViewController.h" #import "MedialetsAnalyticsManager.h" @implementation AppDelegate @synthesize window; @synthesize viewController; + (void)initialize { [[MedialetsAnalyticsManager sharedInstance] initializeWithAppID:@"PutYourIDHere" appVersion:@"1.0" locationManager:nil useLocation:NO]; }
If you don't want your users to see the one-time, pop-up window requesting permission for your application to use their location, you can disable location-based analytics entirely by initializing with NO instead of YES for the useLocation parameter :
[[MedialetsAnalyticsManager sharedInstance] initialize:NO];
Please keep in mind that if you use this optional line to disable location-based analytics, location-based reports for your application will not be available on Medialets Muse™.
If your application uses the iPhone's location manager, you'll want to share your application's location manager instance with the Medialets Analytics SDK. This will prevent multiple pop-up windows requesting permission for your application to use their location.
To do this, call the method: initializeWithAppID: and pass it an initialized location manager instance along with your appID, appVersion:
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
[[MedialetsAnalyticsManager sharedInstance] initializeWithAppID:<YourAppID>
appVersion:<YourAppVersion>
locationManager:self.locationManager
useLocation:YES];
Your application must set the delegate before this call. This delegate cannot be changed.
To save battery power, the Medialets Analytics SDK updates the location only at startup.
Congratulations! You are done with the installation of the Medialets Analytics SDK!
Sample Project
In the SDK, you will find a complete project, called SampleApp, which uses the Medialets Analytics SDK. Within the sample project you will find:
- an appropriately-configured plist.info file
- a simple application demonstrating how to initialize and create events using the Medialets Analytics SDK
- examples of both simple and complex events that demonstrate the use of trackEvent() method

