Skip to end of metadata
Go to start of metadata
If your application currently integrates with an older version of the Medialets Analytics SDK, you must upgrade to the Medialets Analytics SDK 2.x. See: Upgrading from Older Version of the Medialets Analytics SDK.

Installing Medialets Analytics SDK

Using the Appropriate Apple iPhone SDK
This version of the Medialets Analytics SDK is compiled with Apple's 2.5 iOS SDK. For compatibility you must develop your app with Apple's 2.5 or higher SDK as the base SDK, but you may set your OS deployment target to version 3.0 or higher.
  1. Register your application with Medialets Muse™
    1. Go to muse.medialets.com and sign up to create your free account.
    2. After filling in your name and company details, you will be prompted to create your first app.
    3. Enter the name of your app as well as some additional info and your app will be assigned a unique App ID. You will use the App ID in your Cocoa Touch code.
    4. After receiving your App ID, you will also be prompted to download the Medialets Mobile Analytics SDK.
  2. Integrate the Medialets Analytics SDK into Your Xcode project
    1. Add a Key named MedialetsAppID to your project's Info.plist file and insert the unique, Muse-supplied App ID value. You can also supply this value when initializing analytics using the new -initalizeWithAppID:appVersion:useLocation: method.
    2. If CFBundleShortVersionString is not set with your app version, add a Key into the Info.plist for Bundle Version that contains a string noting your application's current version exactly as it was registered with Medialets Muse™.



      Location of Application Version Number
      The application's current version needs to be stored in a location where the Analytics SDK can utilize it. The SDK will look for the version number in the following order:
      1. If initializeWithAppID:appVersion:locationManager:useLocation is used to initialize the SDK, then that value with be used.
      2. Otherwise, the SDK will look for CFBundleShortVersionString in your application's main plist.
      3. Finally, the SDK will look for Bundle Version or CFBundleVersion in your application's main plist.


      MedialetsAppID
      It is very important that the MedialetsAppID value is entered correctly or your analytics data will not be stored.
    1. Add appropriate iPhone frameworks to your project, if not already linked to your project.
      1. Select Frameworks, right-click and select Add > Existing Frameworks...
      2. Add the following libraries to your project:
        1. CoreLocation.framework
        2. SystemConfiguration.framework
        3. libsqlite3.0.dylib
        4. libz.dylib


    2. Add the Medialets Mobile Analytics Libraries to your project.
      1. Select Frameworks, right-click and select Add > Existing Frameworks...
      2. Choose the library named MedialetsAnalytics.a that is included in the Medialets Analytics SDK download.


    3. Add the Analytics Manager's header file to your project.
      1. Select Other Sources, right-click and select Add > Existing Files...
      2. Choose the header files named MedialetsAnalyticsManager.h and MedialetsEvent.h that are included in the Medialets Analytics SDK download.















































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:

  • Download and install the iOS 5 SDK from Apple.
  • Login to muse.medialets.com to download the Medialets Analytics SDK v2.5.4.
  • Update your project to link with libSystem.dylib with the Optional attribute set-this is required for iPhone OS 3.x compatibility
  • Update your project to include the generic Xcode Dynamic Library, libz.dylib, instead of libz.1.2.3.dylib.
    See: Installing the Medialets Analytics SDK.

  1. 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];
    }
    
    
Optional: Disable Location-Based Analytics

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™.

Optional: Shared Location Manager

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



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.