{"id":18270932,"url":"https://github.com/funkyvisions/DDGameKitHelper","last_synced_at":"2025-04-05T01:30:56.388Z","repository":{"id":2059721,"uuid":"2998027","full_name":"funkyvisions/DDGameKitHelper","owner":"funkyvisions","description":"A simpler GameKitHelper inspired by Steffen Itterheim's version. This version takes a different approach by synchronizing a local cache with game center and visa versa.  It uses Benjamin Borowski's GKAchievementNotification class to display achievements and highscore banners.","archived":false,"fork":false,"pushed_at":"2013-04-30T03:22:20.000Z","size":196,"stargazers_count":87,"open_issues_count":1,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-05T11:53:17.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"www.funkyvisions.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkyvisions.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-16T22:07:02.000Z","updated_at":"2023-04-19T09:25:41.000Z","dependencies_parsed_at":"2022-08-19T21:22:04.741Z","dependency_job_id":null,"html_url":"https://github.com/funkyvisions/DDGameKitHelper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyvisions%2FDDGameKitHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyvisions%2FDDGameKitHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyvisions%2FDDGameKitHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyvisions%2FDDGameKitHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkyvisions","download_url":"https://codeload.github.com/funkyvisions/DDGameKitHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:57.580Z","updated_at":"2025-04-05T01:30:55.669Z","avatar_url":"https://github.com/funkyvisions.png","language":"Objective-C","readme":"A simpler GameKitHelper inspired by Steffen Itterheim's version\n(http://www.learn-cocos2d.com). This version takes a different approach\nby synchronizing a local cache with game center and visa versa.\n\nI was having a lot of troubles getting Steffen's library to work nicely\non iOS 4.2 devices.  For one it was trying to write to the root bundle\ndirectory.  I've switch it to write to /Library.\n\nI was also having trouble with achievements not always getting reported\nsuccessfully.  I think this has to do with Game Center not being\nconsistent with callback errors on 4.x devices.  Now everything is kept\ncached locally and each time game center comes back online it synchs\nboth ways.  So if an achievement is reported on game center but not\nlocally, we re-cache it.  If it's local but not in game center, we\nreport it.  This allows a fresh install of the app to automatically get\nall achievements and scores the first time it starts up.\n\nSteffen's GameKitHelper also did not cache scores.  DDGameKitHelper\nkeeps track of the high score in each category.  So even though it\nreports the score each time (so that daily and weekly comparisons work),\nit's only cached locally if the high score has been beat. It also\ndisplays a message banner.\n\nDDGameKitHelper only deals with achievements and scores. Since none of\nmy games use multiplayer I didn't try to tackle an api for that.  I also\nhave not tackled someone else signing in to game center.  Right now I\nthink everything locally would synch with the new account, which really\nisn't what you want neccessarily.  So I will be working on a cache per\nuser. (UPDATE: I've implemented this)\n\nThe DDGameKitHelperDelegate class is dependent on Benjamin Borowski's \nGKAchievementNotification class. \n\nhttps://github.com/typeoneerror/GKAchievementNotification\n\nIt does an excellent job of display a slide down notification that fits in\nseamlessly with game center. The only thing I needed to add to it was an\nadjustFrame method to compensate for the iPad.\n\nUSING IT\n\nAuthenticating a player \n-----------------------\n\n[[DDGameKitHelper sharedGameKitHelper] authenticateLocalPlayer];\n\nChecking authentication\n-----------------------\n\n[[DDGameKitHelper sharedGameKitHelper] isLocalPlayerAuthenticated];\n\nUnlocking an achievement \n------------------------\n\n[[DDGameKitHelper sharedGameKitHelper] reportAchievement:@\"1\"\npercentComplete:100];\n\nReporting a score \n-----------------\n\n[[DDGameKitHelper sharedGameKitHelper] submitScore:newscore\ncategory:@\"1\"];\n\nShowing achievements \n--------------------\n\n[[DDGameKitHelper sharedGameKitHelper] showAchievements];\n\nShowing scores \n--------------\n\n[[DDGameKitHelper sharedGameKitHelper] showLeaderboard];\n\n[[DDGameKitHelper sharedGameKitHelper] showLeaderboardwithCategory:@\"LeaderboardID\" timeScope:GKLeaderboardTimeScopeAllTime];\nwhere GKLeaderboardTimeScopeAllTime is also available in GKLeaderboardTimeScopeToday and GKLeaderboardTimeScopeWeek\n\nResetting achievements \n----------------------\n\n[[DDGameKitHelper sharedGameKitHelper] resetAchievements];\n\n\nSUMMARY\n\nI know all of this functionality is available in iOS 5.x, but I want to\nstill support my 4.x users.  This library plays nicely with iOS 4.x and\n5.x.\n\nDoug Davies \nOwner, Funky Visions \nwww.funkyvisions.com\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkyvisions%2FDDGameKitHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkyvisions%2FDDGameKitHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkyvisions%2FDDGameKitHelper/lists"}