Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 107

Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
08/02/13 12:09 PM (12 years ago)

New iOS Game Center Code (with download link)

Hi Everyone, I know that the Game Center code that can be downloaded from Apple Developer comes up with a lot of warnings, so I have fixed most of them. New Game Center Code for iOS: http://jworldhosting.com/Uploads/GameCenter_iOS.zip Jake
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
08/02/13 12:18 PM (12 years ago)
Nice...thanks...I've thinking about integrating Game Center into future games. Cheers
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
08/03/13 04:45 AM (12 years ago)
Nice one Jake, will come in handy.
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
08/22/13 05:04 PM (12 years ago)
After about three hours of searching I finally figured out how to get rid of the one warning that is still there - the "authenticateWithCompletionHandler" deprecation First import your app delegate into GameCenterManager.m (i.e #import "YourDelegateName_appDelegate.h") then just replace the "-(void) authenticateLocalUser" method with this updated method - - (void) authenticateLocalUser { if([GKLocalPlayer localPlayer].authenticated == NO){ YourDelegateName_appDelegate *appDelegate = (YourDelegateName_appDelegate *)[[UIApplication sharedApplication] delegate]; [GKLocalPlayer localPlayer].authenticateHandler = ^(UIViewController *vc, NSError *error){ //figure out what view to show it in BT_navigationController *theNavController = [appDelegate getNavigationController]; if (vc != nil) { [theNavController presentViewController:vc animated:YES completion:nil]; } }; } } Note: This will ONLY work for iOS 6.0+ - If you want something that works for versions before iOS 6.0 then you will need to get creative with some if/else statements
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.