iphone - GKVoiceChat not working on GameCenter Match -


i'm trying set voice-chat on game i'm developing ios, creates match, when try set voice-chat nothing, doing wrong? runs without throwing errors. here's code i'm using make voice-chat.

- (void)establishvoice {     if (![gkvoicechat isvoipallowed])         return;      if (![self establishplayandrecordaudiosession])         return;      nslog(@"did stablish voice chat");      chat = [match voicechatwithname:@"generalchat"];     [chat start]; // stop [chat end];     chat.active = yes; // disable mic setting no     chat.volume = 1.0f; // adjust needed.      chat.playerstateupdatehandler = ^(nsstring *playerid, gkvoicechatplayerstate state) {         switch (state)         {             case gkvoicechatplayerspeaking:                 // highlight player's picture                 nslog(@"speaking");                 break;             case gkvoicechatplayersilent:                 // dim player's picture                 nslog(@"silent");                 break;             case gkvoicechatplayerconnected:                 // show player name/picture                 nslog(@"voice connected");                 break;             case gkvoicechatplayerdisconnected:                 // hide player name/picture                 nslog(@"voice disconnected");             break;         } }; } 

where establishplayandrecordaudiosession is:

- (bool) establishplayandrecordaudiosession {     nslog(@"establishing audio session");     nserror *error;     avaudiosession *audiosession = [avaudiosession sharedinstance];     bool success = [audiosession setcategory:avaudiosessioncategoryplayandrecord error:&error];     if (!success)     {         nslog(@"error setting session category: %@", error.localizedfailurereason);         return no;     }     else     {         success = [audiosession setactive: yes error: &error];         if (success)         {             nslog(@"audio session active (play , record)");             return yes;         }         else         {             nslog(@"error activating audio session: %@", error.localizedfailurereason);             return no;         }     }      return no; } 

the code logs "did stablish voice chat", run code, when start talking, doesn't seem voice nor send it. doing wrong? missing something? p.s. i'm not getting gkvoicechatplayerconnected fired.

make sure wifi turned on on both devices.

(i banging head on hours, , realized i'd accidentally turned wifi off on 1 of 2 test devices)


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -