Latest 0.2.9
Homepage https://github.com/agilie/PXSDK
License GPLv2
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

SDK integration instructions

PXSDK is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "PXSDK"

Import "PXTracker.h" to your AppDelegate.m file, and init PXTracker with your game API key in didFinishLaunchingWithOptions delegate passing YES param if you want to use APNS for tracking:

[PXTracker initializeWithGameKey:@"Testgame01" enableDeviceToken:NO];

If you want to enable device token just perform method setupUserPredictionsForToken in didRegisterForRemoteNotificationsWithDeviceToken:


- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
  [PXTracker setupUserPredictionsForToken:[deviceToken description]];
}

To show APNS rewards as UIAlerView you should add


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  .....
  if ([launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
    [PXTracker processLaunchOptions:launchOptions];
  }

  return YES;
}

- (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo {
    [PXTracker processPushNotification:userInfo];
 }

To handle virtual currency from rewards your class should conforms to protocol PXTrackerProtocol and responds to selector:

  • (void)addVirtualCurrency:(NSNumber *)virtualCurrency;

Import "PXTracker.h" in all the files where you want to track events.

Add that requirements frameworks to your project:

  • MobileCoreServices.framework
  • SystemConfiguration.framework
  • CFNetwork.framework

List of tracking events and offer availability

  • sendEvent – eventName, parameters dictonary
  • levelChange – timeStamp, fromLevel, toLevel, currency
  • tutorialChange – timeStamp, fromStep, toStep
  • transactionEvent – timeStamp, withName, buyVirtualCurrenct, receivingAmount, usingRealCurrency, spendingAmount
  • userHasIAPOffer – no parameters, return YES if IAPOffer is avaible

Custom event

Level change event consists of two fields that you can use to describe a users level change in your app:

  • NSString eventName
  • NSDictionary custom parametersList
[PXTracker sendEvent:@"myCustomEvent" withParams:@{@"paramName":@"paramValue"}];

Level change event

Level change event consists of two fields that you can use to describe a users level change in your app:

  • NSNumber fromLevel
  • NSNumber toLevel
[PXTracker recordLevelChangeEventFromLevel:@0 toLevel:@2 andCurrency:@20];

Tutorial step change event

Tutorial step change event consists of two fields that you can use to describe a users level change in your app:

  • NSNumber fromStep
  • NSNumber toStep
[PXTracker recordTutorialChangeEventFromStep:@0 toStep:@3];

Transaction event

Transaction event consists of five fields that you can use to describe a users level change in your app:

  • NSString WithName
  • NSString buyVirtualCurrency
  • NSNumber receivingAmount
  • NSString usingRealCurrency
  • NSNumber spendingAmount
[PXTracker recordTransactionEventWithName:@"test" buyVirtualCurrency:@"coins" receivingAmount:@21 usingRealCurrency:@"usd" spendingAmount:@3];

Availability of IAPOffer

Return YES BOOL value if IAPOffer enabled for the moment:

BOOL offerPresent = [PXTracker userHasIAPOffer];

Author

Sid99

License

PXSDK is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "PXSDK",
    "version": "0.2.9",
    "summary": "PXSDK is iOS game analytics SDK",
    "description": "                       Here goes a very long description for PXSDK is iOS game analytics SDKnn                       * Markdown format.n                       * Don't worry about the indent, we strip it!n",
    "homepage": "https://github.com/agilie/PXSDK",
    "license": "GPLv2",
    "authors": {
        "Sid sid99": "[email protected]"
    },
    "source": {
        "git": "https://github.com/agilie/PXSDK.git",
        "tag": "0.2.9"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "PXSDK/Classes/**/*",
    "public_header_files": "PXSDK/Classes/**/*.h"
}

Pin It on Pinterest

Share This