cocos2d iphone - Game center didChangeState and didReceiveData fromRemotePlayer remote player is not calling in ios 8 & ios 9 -
i making realtime multiplayer game
in cocos 2d-x
ios
. according flow doing following things of link ios game center gamekit programmatic invite matchmaking:
step 1: authenticate player
step 2: right after authentication set invitehandler.
step 3: list of friend playerids (not alias)
step 4: fourth, setup gkmatchrequest this... inviting friends.
step 5: fifth, use request call findmatchforrequest:withcompletionhandler
.
step 6: sixth, sends request other player , if accept "invitehandler" second step gets called.
step 7: seventh, "invitehandler" second step gets match gkinvite!
step 8: eighth, "inviteeresponsehandler" fourth step gets called finished match!
till here code working fine after it. 3 steps after these steps not working can please me out ?
step 9: ninth, create didchangestate
gkmatchdelegate
handle finalization of match.
step 10: send message
step 11: eleventh, create didreceivedata
gkmatchdelegate
.
[_match senddata:data toplayers:_currentfriends datamode:gkmatchsenddataunreliable error:&error]; [_match senddata:data toplayers:_currentfriends withdatamode:gkmatchsenddatareliable error:&error]; [_match senddatatoallplayers:data withdatamode:gkmatchsenddataunreliable error:&error];
and delegate method is:
- (void)match:(gkmatch *)match didreceivedata:(nsdata *)data fromplayer:(nsstring *)playerid { nslog(@"received data"); [_delegate match:match didreceivedata:data fromplayer:playerid]; }
i have tried:
- (void)match:(gkmatch *)match didreceivedata:(nsdata *)data fromremoteplayer:(gkplayer *)player { nslog(@"received data"); }
try this:this tutorial shows simple application game center
Comments
Post a Comment