Apple GameKit

Apple GameKit

by Animonger

View and activate on the Corona Store

Full iOS GameKit Plugin for Corona SDK. This Corona GameKit library provides access to all of Apple’s iOS 7 Game Center features except voice chat. Games on iOS can take advantage of Game Center, Apple’s social gaming network. Game Center enables your users to track their best scores on a leaderboard, compare their achievements, invite friends to play a game, and start a multiplayer game through auto-matching.

Documentation

Sweet!  Good job Animonger!

Thanks man :slight_smile:

@roaminggamer, @scottrules44,

Thanks and you’re welcome! I’m working on pushing the GKTester app Lua code to github now.

The GKTester app source is now up on github, which contains Lua code examples for iOS Game Center Achievements, Challenges, Leaderboards, Real-Time and Turn-Based Games.

How is this Corona SDK GameKit plugin different than the Corona SDK gameNetwork Apple Game Center plugin?

In short, it is updated to iOS 7 and it has more Apple Game Center features.

Check out this

https://youtu.be/eUVit54FGls

Project:https://github.com/scottrules44/gameKitTicTacToe

Nice, and it’s real-time game play!

Do you support GKSavedGame with this plugin?

You could just use the iCloud plugin

@rich.stupek,

No, GKSavedGame is available in iOS 8.0 and later. This plugin supports iOS 7 and earlier features only. When support for iOS 7 is no longer necessary, iOS 8.0 features will be added.

Is this plugin available anywhere for Enterprise users?

Corona hasn’t added it to the downloadable plugins bundle yet but you can download it from Bitbucket.

Thanks!

I’m sometimes having issues where calling:  

gameKit.show( "gameCenterSignInUI" ) 

doesn’t seem to work. I’ve put a print immediately before I call it in my code, and the print shows up but nothing appears on screen.

This is on devices running iOS 10.1 and 9.3.5. Has anyone else seen the same thing? Is it some Apple thing where you can only show the popup a certain number of times?

I just finished testing iOS 10.1.1 yesterday and it works fine.

What kind of event type are you getting in your callback when you call gameKit.init( onCallback )? “error”, “showSignInUI” or “authenticated”?

Are you using test AppleID accounts?

Yes, Apple stops showing the Game Center sign-in screen If the user cancels it 3 times. You should get an error from the plugin if this is the case.

Below is sniped from this link

“Important: Game Kit handles opting out of Game Center across all games that support Game Center. If a player has already declined to create an account, when your game authenticates the player, it is told there is no authenticated player. The player never sees an authentication dialog. Because Game Kit handles this process across all games, your game should not include its own mechanism to disable Game Center authentication or ask a player’s permission to authenticate. Instead, your game should simply authenticate the player every time it launches and respond appropriately when authentication completes.”

Ok, I think the 3 cancellations is probably the issue. However I don’t get any callback at all if I call 

gameKit.show( "gameCenterSignInUI" ) 

after those 3 cancellations.

Here’s what I’ve been testing:

On a fresh install, where there is no user currently signed in to Game Center on the device, I get the “showSignInUI” event type after calling init. We have a GameCenter button in our UI, if the user presses that after the “showSignInUI” event has been received I call:

gameKit.show( "gameCenterSignInUI" ) 

That works fine the first few times, but then after that it stops working completely, and with no callback so I can’t even show an alert telling them to login via the settings app or something like that.

The error would happen on the gameKit.init( onCallback ) callback. Instead of “showSignInUI” you should get an “error”.

gameKit.show( “gameCenterSignInUI” ) only shows the UI view if one is available and nothing if the UI view isn’t.

Plugin Update: I just added Rob Miracle’s feature request to get a player’s alias and displayName with a playerID.

The new method is called Get Players With PlayerIDs

Thank you!

Unfortunately, the latest update introduced an arm64 compiler bug that I need to fix so in the mean time I’ve reverted back to the previous version. When I get this bug sorted I’ll push the new feature again.