1

I'm using GameKit's GKMatchMaker to look for nearby players with startBrowsingForNearbyPlayers(). I got stuck for a while because I didn't know that the "Nearby Players" toggle in the Game Center pane in Settings was turned off.

enter image description here

The phone could see other nearby players, but they couldn't see it. Turning "Nearby Players" on fixed the problem.

The normal GameKit matchmaking techniques still work without "Nearby Players", so it's entirely possible for a person (even a heavy Game Center user) to have it turned off and not know it. But since my app relies on nearby player matching, it will fail silently and users will just think it doesn't work.

I would like to be able to test for the "Nearby Players" setting so I can warn a user that they're not visible to other players before wasting their time. It would be even better if I could prompt them to turn "Nearby Players" on. GKLocalPlayer doesn't seem to have any related properties, and I'm not sure where else to look.

Is there any way to check if "Nearby Players" is enabled?

Robert
  • 6,660
  • 5
  • 39
  • 62
  • You don't really need to be visible to other players in order to invite them, though. I believe Apple doesn't make any way to query this setting available intentionally, as this setting is meant to convey that the player does not want to be found. – Pedro Castilho Apr 04 '17 at 19:46
  • @PedroCastilho My concern is that a user who does want to be found may be unaware of this setting. If there's no way to check then I'll work around it. Just hoping. – Robert Apr 04 '17 at 20:13
  • Well, I just took a really long look at the Game Center docs and there really does not seem to be any way to query this. – Pedro Castilho Apr 04 '17 at 20:20

0 Answers0