gamificationframework---iOS
pod 'GamificationLib'
整合 Gamification 库
• Install GamificationLib pods
• Include the #import <GamificationLib/GamificationLib.h> in GetHot-Prefix.pch
• Initialize PSPointSystemAction class with Secret Key and User Id.
[[PSPointSystemAction sharedAction] initWithKey:@"GAMIFICATION_KEY" andUserId:@"USER_ID" andUserName:@"USER_Name" andEmail:@"USER_Email"];
如何使库与动作一起工作
• Go to admin site and add an Action. http://teensystudios.com/gamification/admin/login
• Check for its Action Identifier after adding an action.
• In iOS application, write the Button Action Method with the name of Action Identifier.
• In this method, call the method [[PSPointSystemAction sharedAction] performActionToLog].
• Thats All.
示例
-(void)EXERCISE_ACTION {
[[PSPointSystemAction sharedAction] performActionToLog];
}
获取用户获得的徽章
[PSUserBadgesAndLevels getUserBadgesAndLevels:YES completion:^(id object, NSString *error) {
}];
获取徽章详情
[PSLevelInfo getLevelsInfo:^(id object, NSString *error) {
}];