Skip to content
This repository was archived by the owner on Nov 13, 2019. It is now read-only.

sid99/PXSDK-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

104 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PXSDK

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];
}

To show APNS rewards as UIAlerView you should add

 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  .....
  if ( [processLaunchOptions:launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
    [PXTracker processLaunchOptions:launchOptions];
  }
  
  
  return YES;
}
 
- (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo {
    [PXTracker processPushNotification:userInfo];
 }

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.0%
  • Ruby 3.0%