Search code examples
iphonebluetoothgamekitdevice

How to get the list of devices in bluetooth range using GameKit.framework?


I have trying to get the list of devices nearby having their bluetooth ON using GameKit.framework, which just shows that it is searching for devices but never finds any and gives error as follows

BTM: attaching to BTServer

<<< Session >>> +[GKBluetoothSupport _determineBluetoothStatus]: BT not available - try again later.

BTM: posting notification BluetoothAvailabilityChangedNotification

Any idea whats happening here ?

Thanks.


Solution

  • i dont think you can search for any devices with their bluetooth on. you need to create a session with a session id. Any devices withthat particular session running will show up.

    Check code game kit samplesfrom apple:

    GKAuthenticate

    GKRocket

    GKTank

    GKTapper