简体   繁体   中英

iOS programatically check if Bluetooth on Mac is connected

I am new to iOS programming and working on a project which needs to detect if an iPod touch(or iPhone 4) is connected to a paired Mac via Bluetooth. I do not need to connect it. I just need to check if it is connected and display a log when it gets disconnected. I do not have Bluetooth LE. Also the app would not be running on the Mac so i cannot create a peer-to-peer connection. Also, i cannot use Bluetooth Manager(or any private framework) since the app would need to be accepted by Appstore at some point of time. Any help would be appreciated

It's my understanding that so long as the private framework doesn't break any of Apple's guidelines you would be able to use it in your application. It is only if it DOES break guidelines do you get rejected. Here is an example of another post on SO suggesting the use of the BluetoothManager Framework.

How to get the status of bluetooth (ON/OFF) in iphone programmatically

Edit : This slightly covers private APIs vs private frameworks: Programmatically turn on bluetooth in the iphone sdk?
Another more recent example of someone using BluetoothManager here: Minimal iOS BluetoothManager Example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM