Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GameKit (GKSession) : Is there a priority order when GKSession decides to use Wifi or Bluetooth (if both are available)

If I have two iOS devices, both on same WiFi network and both with Bluetooth turned on, and I use GameKit (specifically GKSession) to manually setup a communications channel between them (without using GKPeerPickerController), I cant tell if it is using WiFi or Bluetooth.

Does iOS prioritise one over the other? I'm hoping that it uses Wifi before Bluetooth, but id like to be sure.

If WiFi is available and bluetooth isn't, it uses Wifi, if Bluetooth is available and Wifi isn't, it uses Bluetooth. Im wondering how they're talking if both bluetooth and WiFi are available, which does GameKit choose over the other?

The only way I can see to find this out is by running a packet sniffer on my WiFi and running several tests across different devices. Kinda hoping someone can save me that effort!

Thanks :-)

like image 514
Dermot Avatar asked Dec 31 '25 00:12

Dermot


1 Answers

According to Apple's documentation if you use a GKPeerPickerController to create your GKSession you will be able to select bluetooth or wifi connectivity (see GKPeerPickerConnectionType).

I'm hoping that it uses Wifi before Bluetooth, but id like to be sure.

It seems an internet connections requires a bit of user code (but not bluetooth) so I would guess it defaults to bluetooth to avoid making this requirement mandatory.

like image 159
poupou Avatar answered Jan 02 '26 18:01

poupou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!