2

My game uses Game Center, and I want to give my players an option to use its live voice chat feature.

I've got it working perfectly--the players are chatting away. I don't need help getting it to work.

I need help detecting parental control settings.

See, there are several things that can prevent Game Center voice chat from being available. I want to make it clear to my players when voice chat is and isn't available to them. On my main screen I'd like to show players a microphone if they have the option for voice chat, and remove the icon entirely if they do not have the option.

Here are the things that can prevent voice chat from being available:

  • the region and carrier forbid VoIP: I'm checking for this
  • a Wi-Fi connection is unavailable: I'm checking for this
  • it is forbidden in parental controls: I don't know how to check for this

I can easily detect the first two cases and hide the microphone icon when they arise. I can't find any reference for detecting the third case.

Can those settings be inspected somehow?

Le Mot Juiced
  • 3,761
  • 1
  • 26
  • 46
  • Under Restrictions the only items related to Game Center are Multiplayer Games and Adding Friends. Based on that it would lead me to believe that as long as they do not disable microphone once in your game the other two items would take effect. See this link for microphone detection. http://stackoverflow.com/questions/24318791/avaudiosession-swift – MwcsMac Apr 30 '15 at 17:57
  • I'm just following the Apple documentation. This is the relevant part of Apple's documentation, under 'voiceChatWithName' in the GKMatch reference section: "Parental controls may prevent a player from joining a voice chat. If the player is not permitted to join the voice channel, a nil object is returned to your application." You can't test for that nil, however, until a GKMatch has been retrieved, and to do what I want I have to test for this case before then. – Le Mot Juiced Apr 30 '15 at 19:13
  • Can you share any of your code to see what steps you have tried or what you think might work. Also try taking a look at this post and see if it leads you down a better path. http://stackoverflow.com/questions/28931276/why-doesnt-gkvoicechat-transmit-any-audio-in-ios – MwcsMac Apr 30 '15 at 20:35
  • I'm not sure what you're getting at. That link is for help in making a GKVoiceChat session work. I don't have any trouble with that. Does it seem like I'm asking how to make a GKVoiceChat session work? I will edit my question to clarify. – Le Mot Juiced Apr 30 '15 at 21:18
  • I do under stand that now. In your testing which of setting in parental controls that is producing the nil? – MwcsMac May 01 '15 at 00:12
  • As far as I can tell, the only test available to me is to check for a returned value of nil after requesting that the GKMatch object send me a GKVoiceChat object. If it's nil, I know it was blocked. But that's it. I don't get passed any information about which setting produced the nil. I could go toggling all the settings manually to test the results, but even if I located the right one, I still wouldn't know how to query the OS for its state. Are you aware of *any* API for querying *any* parental control settings directly? – Le Mot Juiced May 01 '15 at 15:49

0 Answers0