# How do i test gamecenter multiplayer?

**URL:** <https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352>\
**Category:** Newbie Questions\
**Created:** [January 4, 2016, 3:18am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352 "2016-01-04T03:18:24Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 28, 2016, 2:22am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/21 "2016-01-28T02:22:32Z")

</div>

If my test identifier works but yours doesn’t, that seems to point to something in your iTunes Connect setup. Did you set up your app on that side for everything related to multiplayer?

Brent

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 28, 2016, 2:25am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/22 "2016-01-28T02:25:05Z")

</div>

> [@bjsorrentino](#):
>
> If my test identifier works but yours doesn’t, that seems to point to something in your iTunes Connect setup. Did you set up your app on that side for everything related to multiplayer?
> 
> Brent

Should my Game Center be turned on in my 1 version even though I have not published it yet.  
Thanks  
Scott

Edit: here are images I have enabled in Game Center

[https://drive.google.com/file/d/0B5swSg-cH4L6ZXlFR3FrTDF0LW8/view?usp=sharing](https://drive.google.com/file/d/0B5swSg-cH4L6ZXlFR3FrTDF0LW8/view?usp=sharing)

[https://drive.google.com/file/d/0B5swSg-cH4L6OEhBQ2NIN3ZFRVU/view?usp=sharing](https://drive.google.com/file/d/0B5swSg-cH4L6OEhBQ2NIN3ZFRVU/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![simeonaronk](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@simeonaronk](https://forums.solar2d.com/u/simeonaronk)\
**Post date:** [January 29, 2016, 4:48am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/23 "2016-01-29T04:48:18Z")

</div>

Hi,

&nbsp;

&nbsp; I’m new to Game Centre&nbsp;Turn Based Multiplayer Game,I do Some basic Code from the Sample.Once i Tested it in device it works well ,but i faced below Problems.

&nbsp;

1. Player1 Finished Turns , But not Received At Player 2 ( No notification , Some times Shared Data Missing )

&nbsp;

2.Once Player1 Created Match , Want to store The Initial Data(Grid),So Player1 can Get Same Data(Grid),when Logging in Another Device.Even if Player1 Not end His Turn.

&nbsp;

Ex: player1 -\> Create Match -\> Grid Created -\> Go Back to Menu -\> Re enter into Same Match -\> Need Same Grid(Initial) [Even User log in from Diff Device].

&nbsp;

1. Communication Between 2 Devices Failed Some times(low Network),Which Makes game Misleading.

&nbsp;

&nbsp;

Please help me to Solve this.

&nbsp;

Thanks.

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 29, 2016, 4:49am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/24 "2016-01-29T04:49:48Z")

</div>

> [@simeonaronk](#):
>
> Hi,
> 
> I’m new to Game Centre Turn Based Multiplayer Game,I do Some basic Code from the Sample.Once i Tested it in device it works well ,but i faced below Problems.
> 
> 1. Player1 Finished Turns , But not Received At Player 2 ( No notification , Some times Shared Data Missing )
> 
> 2.Once Player1 Created Match , Want to store The Initial Data(Grid),So Player1 can Get Same Data(Grid),when Logging in Another Device.Even if Player1 Not end His Turn.
> 
> Ex: player1 -\> Create Match -\> Grid Created -\> Go Back to Menu -\> Re enter into Same Match -\> Need Same Grid(Initial) [Even User log in from Diff Device].
> 
> 1. Communication Between 2 Devices Failed Some times(low Network),Which Makes game Misleading.
> 
> Please help me to Solve this.
> 
> Thanks.

Same here  
I called apple going to talk to them tomorrow.

---

<div class="post-metadata">

**Author:** ![simeonaronk](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@simeonaronk](https://forums.solar2d.com/u/simeonaronk)\
**Post date:** [January 29, 2016, 6:25pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/25 "2016-01-29T18:25:50Z")

</div>

No Possible way in Corona to Solve this.

Thanks

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 29, 2016, 6:47pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/26 "2016-01-29T18:47:17Z")

</div>

> [@simeonaronk](#):
>
> No Possible way in Corona to Solve this.
> 
> Thanks

It is your apple bundle I’d that is the problem if you are having the problem I am having.

---

<div class="post-metadata">

**Author:** ![simeonaronk](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@simeonaronk](https://forums.solar2d.com/u/simeonaronk)\
**Post date:** [January 30, 2016, 5:03am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/27 "2016-01-30T05:03:22Z")

</div>

I’m Not having the Same problem , My App Running well in Device.But Sometimes Communication failed between devices and i need to store data in GC.

Thanks

---

<div class="post-metadata">

**Author:** ![simeonaronk](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@simeonaronk](https://forums.solar2d.com/u/simeonaronk)\
**Post date:** [January 31, 2016, 7:12pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/28 "2016-01-31T19:12:13Z")

</div>

waiting for suggestions…

---

<div class="post-metadata">

**Author:** ![simeonaronk](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@simeonaronk](https://forums.solar2d.com/u/simeonaronk)\
**Post date:** [February 2, 2016, 5:26am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/29 "2016-02-02T05:26:21Z")

</div>

Handling the Current Player’s Turn

- saveCurrentTurnWithMatchData:completionHandler:

Update the match data without advancing the game to another player.

This method in IOS was used to Update Data in GC , is this Possible in Corona.

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [February 2, 2016, 5:34am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/30 "2016-02-02T05:34:30Z")

</div>

> [@simeonaronk](#):
>
> Handling the Current Player’s Turn
> 
> - saveCurrentTurnWithMatchData:completionHandler:
> 
> Update the match data without advancing the game to another player.
> 
> This method in IOS was used to Update Data in GC , is this Possible in Corona.

What if you set&nbsp;nextParticipant&nbsp;to your own gc id?

[https://docs.coronalabs.com/daily/plugin/gameNetwork-apple/request.html#end-turn](https://docs.coronalabs.com/daily/plugin/gameNetwork-apple/request.html#end-turn)

Also if you don’t mind me asking how did your app ready for gamecenter?

Thanks,

Scott

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 6, 2016, 11:48pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/31 "2016-01-06T23:48:00Z")

</div>

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

Thanks,

Scott

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 15, 2016, 4:29am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/32 "2016-01-15T04:29:33Z")

</div>

Anything?

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 15, 2016, 9:16pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/33 "2016-01-15T21:16:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 15, 2016, 10:18pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/34 "2016-01-15T22:18:39Z")

</div>

> [@bjsorrentino](#):
>
> 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](https://drive.google.com/file/d/0B5swSg-cH4L6UTR6VmpFR2hXTmc/view?usp=sharing)

Profile used

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

Thanks,&nbsp;

Scott

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 16, 2016, 10:22pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/35 "2016-01-16T22:22:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 16, 2016, 10:57pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/36 "2016-01-16T22:57:15Z")

</div>

> [@bjsorrentino](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 18, 2016, 8:47pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/37 "2016-01-18T20:47:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 19, 2016, 2:51am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/38 "2016-01-19T02:51:45Z")

</div>

> [@bjsorrentino](#):
>
> 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](https://drive.google.com/folderview?id=0B5swSg-cH4L6N3NzOXpLbmpqR2M&usp=sharing)

Thanks,

Scott

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 19, 2016, 10:53pm UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/39 "2016-01-19T22:53:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Scott\_Harrison](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Scott\_Harrison](https://forums.solar2d.com/u/Scott_Harrison)\
**Post date:** [January 20, 2016, 2:32am UTC](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352/40 "2016-01-20T02:32:43Z")

</div>

> [@bjsorrentino](#):
>
> 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 :(&nbsp;, updated the drive sample above.&nbsp;

Thanks,

Scott

[Previous page](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352.md?page=1)

[Next page](https://forums.solar2d.com/t/how-do-i-test-gamecenter-multiplayer/337352.md?page=3)
