Skip to end of metadata
Go to start of metadata

This section provides the iOS software development kit (SDK) for Phunware's Analytics & Business Intelligence module. Visit http://maas.phunware.com/ for more details and to sign up.

iOS SDK Table of Contents

ON THIS PAGE

Version 1.2.4

This is Phunware's iOS SDK for the Analytics module. Visit http://maas.phunware.com/ for more details and to sign up.

Requirements

  • MaaS Core v1.3.0 or greater
  • iOS 6.0 or greater
  • Xcode 6 or greater

Getting Started

  • Download MaaS Analytics and run the included sample app.
  • Continue reading below for installation and integration instructions.
  • Be sure to read the documentation for additional details.

Installation

The following frameworks are required:

MaaSCore.framework

MaaS Analytics has a dependency on MaaSCore.framework, which is available here: Core SDK

It's recommended that you add the MaaS frameworks to the 'Vendor/Phunware' directory. This directory should contain MaaSCore.framework and MaaSAnalytics.framework, as well as any other MaaS frameworks that you are using.

Documentation

Documentation is included in the Documents folder in the repository as both HTML and as a .docset. You can also find the latest documentation here: Analytics API Reference (iOS)

Integration

You'll need to import the MaaSAnalytics.framework wherever you'd like to add analytic events. You may want to include it in your Prefix.pch.

#import <MaaSAnalytics/MaaSAnalytics.h>

Inside your application delegate, initialize MaaSCore in the application:didFinishLaunchingWithOptions: method. For more detailed MaaSCore installation instructions, please see: Core SDK Integration Guide (iOS) > Installation

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // These values can be found for your application in the MaaS portal:
    [MaaSCore setApplicationID:@"APPLICATION_ID"
    			   setAccessKey:@"ACCESS_KEY"
                  signatureKey:@"SIGNATURE_KEY"
                 encryptionKey:@"ENCRYPT_KEY"]; // Currently unused. You can place any NSString value here.
    ...
} 

Adding Events

To add events with MaaS Analytics:

- (void)viewWillAppear:(BOOL)animated 
{ 
	[super viewWillAppear:animated];


	[MaaSAnalytics addEvent:@"Featured Page View"];
	...
} 

Timed Events

MaaS Analytics supports timed analytics:

- (void)startLevel:(PWGameLevel *)level 
{ 
	// Start a timed event like so: 
	[MaaSAnalytics startTimedEvent:@"My Awesome Game - Level 1"]; 
	... 
}


- (void)endLevel:(PWGameLevel *)level
{ 
	// And end a timed event like so: 
	[MaaSAnalytics endTimedEvent:@"My Awesome Game - Level 1"]; 
	... 
} 

Event Parameters

MaaS Analytics allows you to paramaterize your all of your events with up to 10 key / value pairs. All parameter keys and values must be alphanumeric strings.

- (void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];
	
	[MaaSAnalytics addEvent:@"Featured Page View" withParamaters:@{@"gender" : @"male"}];
	
	[MaaSAnalytics addEvent:@"My Awesome Game - Level 1" withParameters:@{@"difficulty" : @"easy"}];
	
	// Keep in mind that calling endTimedEvent:withParameters will replace any parameters that you specified in startTimedEvent:withParameters.
	[MaaSAnalytics endTimedEvent:@"My Awesome Game - Level 1" withParameters:@{@"difficulty" : @"easy", @"attempts" : @"5"}];
	...
} 

ON THIS PAGE

  • No labels