Quick Links: Download Gideros Studio | Gideros Documentation | Ultimate Guide | Gideros Development Center
GameKit API - Gideros Forum

GameKit API

MagnusviriMagnusviri Member
edited March 2012 in Plugins
This is what I was able to glean from the GameKit plugin for how to use it. I've mostly left it as C++ code. I'm not 100% sure this is correct. If anyone notices errors please correct me.

class GameKit : public GEventDispatcherProxy
BOOL isAvailable()
// Checks to see if OS is 4.1 or newer (minimum requirement for GameKit)
authenticate()
// Connects to game center
// [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:]
// dispatches event "authenticateComplete"
loadFriends()
// dispatches event "loadFriendsComplete"
// [[GKLocalPlayer localPlayer] loadFriendsWithCompletionHandler:]
// returns array of friends
loadPlayers(NSArray* identifiers)
// dispatches event "loadPlayersComplete"
// [GKPlayer loadPlayersForIdentifiers:withCompletionHandler:]
// returns array of tables with these fields: playerID, alias, isFriend
reportScore(int64_t value, NSString* category)
// saves score to server
// GKScore* score = [[[GKScore alloc] initWithCategory:category] autorelease];
// score.value = value;
// [score reportScoreWithCompletionHandler:]
// dispatches event "reportScoreComplete"
showLeaderboard()
// presents GKLeaderboardViewController
showAchievements()
// presents GKAchievementViewController
loadAchievements()
// dispatches event "loadAchievementsComplete"
// [GKAchievement loadAchievementsWithCompletionHandler:]
// returns array of tables with these fields: identifier, percentComplete, completed, hidden
reportAchievement(NSString* identifier, double percentComplete)
// saves achievement
// GKAchievement* achievement = [[GKAchievement alloc] initWithIdentifier:identifier];
// achievement.percentComplete = percentComplete;
// [achievement reportAchievementWithCompletionHandler:]
resetAchievements()
// [GKAchievement resetAchievementsWithCompletionHandler:]
// dispatches event "resetAchievementsComplete"
loadAchievementDescriptions()
// [GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:]
// dispatches event "loadAchievementDescriptionsComplete"
// returns array of tables with these fields: identifier, title, achievedDescription, unachievedDescription, maximumPoints, hidden

If there is an error, the event will return a table with these field values: errorCode, errorDescription
+1 -1 (+4 / -0 ) Share on Facebook
Sign In or Register to comment.