Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone turn off bluetooth GKPeerPickerController

I agree that this question is duplicate. Please bear with me. I was also among you all to believe that is not possible to programatically turn on/off bluetooth.

But using GKPeerPickerController if bluetooth is not on user will be prompted to turn it on. Fair enough to turn on the bluetooth.

I was betting with my belief that we can not turn off the bluetooth programatically as there is no way. But this application does that so I didn't had choice to refuse.

I just want to confirm whether it is possible or not and if yes how to turn off the bluetooth using GKPeerPickerController or any other public api way ?

like image 201
Janak Nirmal Avatar asked Jun 19 '12 13:06

Janak Nirmal


People also ask

How do I turn off Bluetooth on iPhone 11?

To turn off Bluetooth, go to Settings > Bluetooth and turn off Bluetooth.

Where is advanced Bluetooth settings on iPhone?

Swipe down from the upper right corner of the screen to access the Control Center, then select the Bluetooth icon.

Why is my iPhone Bluetooth always on?

The problem is, some users have noticed Bluetooth turns itself back on automatically. This is because most users use the Control Panel to disable Bluetooth. If you want to prevent Bluetooth from turning back on automatically, you need to disable it in the Settings menu instead.


1 Answers

I know this isn't the answer you want, but no, you can't turn off bluetooth programmatically with Apple-approved APIs.

There have been a number of apps approved on the App Store this year that have done this.

But, they keep getting removed by Apple shortly after release, once they (Apple) realize what's going on. They're certainly using private APIs.

Either developers are foolish enough to think that they won't be noticed, or they are simply hoping to pull in a couple weeks of revenue before Apple pulls the app, which could be enough to pay back their cost, with some profit.

The issue is that there's a number of ways to check whether an app is using private APIs. If developers are using objective-C frameworks in the normal way, that's an easy check. In fact, Xcode does some of this automatically when you use it to upload app binaries to iTunes Connect. But, it's not a complete check. Once at Apple, the reviewers perform another check, which I've been able to deduce is more sophisticated than what Xcode does.

However, that check is still not perfect, and I'm of the opinion that it's not necessarily a matter of a lazy reviewer just forgetting to perform the check. Objective-C gives you some techniques for obfuscating method calls. Depending on how you use these techniques, you might get past the reviewers . In my experience, I have every reason (wink, wink) to believe that Apple is not running every app on a fully instrumented version of iOS, which could log all function calls, and defeat even the best attempt to hide private API usage via obfuscation techniques.

So, I can pretty much guarantee you that this explains the apps you've found on the App Store that turn off Bluetooth. Public GameKit APIs let you turn Bluetooth on, but not off.

Disclaimer: I've never worked for Apple, and no Apple insiders gave me information. But, I have gotten private APIs through the review process.

like image 158
Nate Avatar answered Sep 25 '22 15:09

Nate