TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | Aug 2015 |
Maintained by Ankudinov macmini, mitusha, Vova Zgonik.
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:
Import "PXTracker.h" in all the files where you want to track events.
Add that requirements frameworks to your project:
Level change event consists of two fields that you can use to describe a users level change in your app:
[PXTracker sendEvent:@"myCustomEvent" withParams:@{@"paramName":@"paramValue"}];
Level change event consists of two fields that you can use to describe a users level change in your app:
[PXTracker recordLevelChangeEventFromLevel:@0 toLevel:@2 andCurrency:@20];
Tutorial step change event consists of two fields that you can use to describe a users level change in your app:
[PXTracker recordTutorialChangeEventFromStep:@0 toStep:@3];
Transaction event consists of five fields that you can use to describe a users level change in your app:
[PXTracker recordTransactionEventWithName:@"test" buyVirtualCurrency:@"coins" receivingAmount:@21 usingRealCurrency:@"usd" spendingAmount:@3];
Return YES BOOL value if IAPOffer enabled for the moment:
BOOL offerPresent = [PXTracker userHasIAPOffer];
Sid99
PXSDK is available under the MIT license. See the LICENSE file for more info.