Giter VIP home page Giter VIP logo

maas-analytics-ios-sdk's Introduction

Phunware Analytics SDK for iOS

Version 1.3.1

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

Requirements

  • PWCore v3.0.2 or greater
  • iOS 7.0 or greater
  • Xcode 6 or greater

Getting Started

  • Download PWAnalytics 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:

PWCore.framework

PWAnalytics has a dependency on PWCore.framework, which is available here: https://github.com/phunware/maas-core-ios-sdk

It's recommended that you add the MaaS frameworks to the 'Vendor/Phunware' directory. This directory should contain PWCore.framework and PWAnalytics.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: http://phunware.github.io/maas-analytics-ios-sdk/

Integration

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

#import <PWAnalytics/PWAnalytics.h>

Inside your application delegate, initialize PWCore in the application:didFinishLaunchingWithOptions: method. For more detailed PWCore installation instructions, please see: https://github.com/phunware/maas-core-ios-sdk#installation.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // These values can be found for your application in the MaaS portal:
    [PWCore 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 PWAnalytics:

- (void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];
	
	[PWAnalytics addEvent:@"Featured Page View"];
	...
}

Timed Events

PWAnalytics supports timed analytics:

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

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

Event Parameters

PWAnalytics 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];
	
	[PWAnalytics addEvent:@"Featured Page View" withParamaters:@{@"gender" : @"male"}];
	
	[PWAnalytics 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.
	[PWAnalytics endTimedEvent:@"My Awesome Game - Level 1" withParameters:@{@"difficulty" : @"easy", @"attempts" : @"5"}];
	...
}

Privacy

You understand and consent to Phunware’s Privacy Policy located at www.phunware.com/privacy. If your use of Phunware’s software requires a Privacy Policy of your own, you also agree to include the terms of Phunware’s Privacy Policy in your Privacy Policy to your end users.

maas-analytics-ios-sdk's People

Contributors

cchung-phunware avatar illyabusigin avatar sababado avatar

Watchers

James Cloos avatar Xiangwei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.