How do i test gamecenter multiplayer?

When I try to create match with

local parameters = {

                minPlayers = 2,

                maxPlayers = 2,

                playerGroup = 0,

                playerAttributes = { 1, 2 },

                listener = createMatchLis

}  

gameNetwork.show( “matches”, parameters )

It pops up the games center page. I try to invite my other device ,which is on another account, and I get the error (as a native pop up) Unable to create match.

Is there a certain way to test this?

I am using an adhoc.

Thanks,

Scott

It been over 3 day so i am bumping. Sorry for nagging.

Thanks,

Scott

Anything?

Hi @scottrules44,

Game Center in general requires fairly comprehensive setup/code, and multiplayer even moreso. The community/staff would need to see much more of your current code base to gather clues on what the issue may be.

Take care,

Brent

local gameNetwork = require("gameNetwork") local platformName = system.getInfo( "platformName" ) local function loadLocalPlayerCallback( event ) pluginStorage.loggedIntoGC = true end local function tempDelay( ) gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } ) end local function gameNetworkLoginCallback( event ) timer.performWithDelay( 1000, tempDelay , 1 ) end local function gpgsInitCallback( event ) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end local function authorize() if ( system.getInfo("platformName") == "Android" ) then print("logging into GPGS") gameNetwork.init( "google", gpgsInitCallback ) elseif ( system.getInfo("platformName") == "iPhone OS" ) then print("logging in to GameCenter") gameNetwork.init( "gamecenter", gameNetworkLoginCallback ) end end authorize() -- local gameCenterIcon = display.newImageRect( "images/gamecenter.png", system.DocumentsDirectory, 75 , 77) gameCenterIcon.y = display.contentCenterY gameCenterIcon.x = scale0+(.5\*gameCenterIcon.width) -- local function loadGameNetwork() if (platformName == "Android") then local function loadLocalPlayerCallback( event ) end gameNetwork.show("selectPlayers", { listener = selectPlayersListener, minPlayers = 1, maxPlayers = 1 }) elseif (platformName == "iPhone OS") then local parameters = { minPlayers = 2, maxPlayers = 2, playerGroup = 0, playerAttributes = { 1, 2 }, listener = createMatchLis } gameNetwork.show( "matches", parameters ) end end local function gameNetworkLoginCallback( event ) pluginStorage.loggedIntoGC = true loadGameNetwork() end local function googleCallBack( event ) if not event.isError then gameNetwork.request( "login", { userInitiated=false, listener=gameNetworkLoginCallback } ) else pluginStorage.loggedIntoGC = false native.showAlert( "Cannot login!", event.errorMessage, { "OK" } ) end end local function gamecenterCallBack( event ) if ( event.type == "showSignIn" ) then -- This is an opportunity to pause your game or do other things you might need to do while the Game Center Sign-In controller is up. elseif ( event.data ) then pluginStorage.loggedIntoGC = true loadGameNetwork() elseif not event.data then pluginStorage.loggedIntoGC = false native.showAlert( "Unable to Sign In", "", { "OK" } ) end end local function gameCenterTouch( event ) if (event.phase == "began") then if pluginStorage.loggedIntoGC == true then loadGameNetwork() else if (platformName == "Android") then gameNetwork.init( "google", googleCallBack ) elseif (platformName == "iPhone OS") then gameNetwork.init( "gamecenter", gamecenterCallBack ) end end return true end end gameCenterIcon:addEventListener( "touch", gameCenterTouch )

I have the plugin in build.setting

Here is my problem

https://drive.google.com/file/d/0B5swSg-cH4L6UTR6VmpFR2hXTmc/view?usp=sharing

Profile used

https://drive.google.com/file/d/0B5swSg-cH4L6dlBFVVUxbm5vT1E/view?usp=sharing

Thanks, 

Scott

Hi Scott,

Are you using an “AdHoc” or a true “distribution” provisioning profile? The fact that it says “Devices: 0 total” hints to me that it’s not AdHoc, meaning it’s for actual distribution to the App Store (which of course isn’t meant for testing). Can you configure an AdHoc profile and test using that?

Brent

same error with an ad hoc

Hi Scott,

If possible, can you trim your code down to simply Game Center for this issue? At a glance, I don’t see anything blatantly wrong with how you’re trying to load the proper game network for the proper platform, but it complicates the code considerably and there might be something awry with the listeners, initiation, etc. It would be easier to diagnose if you temporarily trimmed out (or commented out) the Google aspects.

Thanks,

Brent

Tried this still the same error.

I made a sample:

https://drive.google.com/folderview?id=0B5swSg-cH4L6N3NzOXpLbmpqR2M&usp=sharing

Thanks,

Scott

Hi Scott,

Can you remove “playerGroup” and “playerAttributes” from your match setup? I want to check if it’s something involved in those parameters (they are difficult to understand even when reading Apple’s docs).

Brent

Same Error :( , updated the drive sample above. 

Thanks,

Scott

Can’t you just open two simulators?

Going to assume you mean iOS simulators. I have tried this I get unable to create match error

Hi Scott,

Are you 100% sure that Game Center is being initialized properly? That it’s getting the local player? This might be some other issue before you even attempt to create a match.

Have you tried our Game Center sample app for leaderboards and achievements to check if it’s working with the account that you’ve used to log into GC on the device?

CoronaSDK-XXXX > SampleCode > GameNetwork > GameCenter

Brent

Tried the sample it works fine. I am able to print name but no welcome banner is showing.
Thanks,
Scott

Hi Scott,

I’ve attached a very minimalistic project that I used awhile back to test multiplayer. It worked for me at the time, but I can’t vouch that it’s perfect in every way. Still, it might serve as a method for you to test things on your side.

Brent

[quote name=“Brent Sorrentino” post=“317359” timestamp=“1453325390”]Hi Scott, I’ve attached a very minimalistic project that I used awhile back to test multiplayer. It worked for me at the time, but I can’t vouch that it’s perfect in every way. Still, it might serve as a method for you to test things on your side.   Brent[/quote] Thanks for this. Found out I just forgot to setup gamecenter group in iTunes connect.

When I add my identiter, playerTurn does not happen

Just add com.scotthinc.com to identiter in build.setttings

Hi Scott,

Game Center multiplayer is a complex machine. Many developers… Corona or otherwise… report issues with it ranging from the version of iOS to the actual device. You can search the Internet for stories of this if you’d like.

Here’s one recent example excerpt from a support case I worked on with another Corona developer, just so you can get an indication of the inconsistency which can occur for (sometimes) no apparent reason whatsoever (meaning, absolutely no change in the Corona code or the devices themselves, but more likely some internal change on Apple’s side):


Brent,

Thanks for getting back to me. Well, something has changed with Corona’s

core (or the GC plugin) and/or iOS and/or the Game Center back end along

the way. Today I tested the App Store build on two different iPhone 6

devices, an iPad Air, and an iPhone 5, all running iOS 9.1. Results were

the same as I’ve been seeing all along (fail). I then tested a 2775 build

on those same devices (again, all running iOS 9.1), and the results were

flawless. Everything worked perfectly: turns, notifications, 2 player

games, 3 player games, everything. Every test, every device. I also tried

to test on an iPhone 4 running iOS 7.1.2. Everything behaves like the App

Store build on the iPhone 4 running the 2775 build (nothing works), but if

I’m playing against a 2775 build on an iOS 9.1 device, turns and everything

else work correctly on the iOS 9.1 device.

Since I had success with the 2775 build, I decided to do a new build with

the current Corona public release (2731), and to my surprise everything

worked perfectly (same as the 2775 daily build). I know that I have tested

with that build before because I always test when a new public release of

Corona comes out (in the hopes that something has changed and things are

working again).

One other note: when I was using iOS 7 on the iPhone 4, the GC sign-in

banner had the ***Sandbox*** designation on it. I tried to turn that off

(because of Apple’s new Sandbox/live server stuff), but found that the

“Sandbox” on/off switch did not exist in the “Game Center” portion of the

settings app as it usually does in iOS 7. Not sure if that could have been

causing issues with that device or not.

-----

It is not the software or device it just the cfidentifier. I have been researching for 7 days now have found nothing like this.
Thanks,
Scott