1

Does anyone know how to enable/disable airplane mode in iPhone SDKs after 2.x?

I need to create an app that legitimately disables the radio for the duration of its execution. Is Apple likely to permit this soon.

I followed http://blogs.oreilly.com/iphone/2009/01/bring-airplane-mode-control-ba.html

but setAPMode pointer is null.

Regards,

Steve

sixteenk
  • 11
  • 2
  • From that article: "Airport control was moved by Apple into a separate framework, another private framework called SpringBoardServices". This is private functionality and Apple will not approve an application using it for the App Store. It's no surprise that the interface has changed for this since 2.0. – Brad Larson Oct 01 '10 at 13:59
  • Here is a [solution to the problem](http://stackoverflow.com/a/13464144/119114), although it requires jailbreaking now. – Nate Feb 26 '13 at 22:35

1 Answers1

2

AppSupport.framework's RadiosPreferences class has an airplaneMode property that works (as of iOS 4.3)

rpetrich
  • 32,196
  • 6
  • 66
  • 89
  • This seems to work fine for getting the value of `airplaneMode`. But, when I try to set that property, it doesn't work, and in the console, I see this message: _SCHelper[11223] : SCPreferences write access to "com.apple.radios.plist" denied, no entitlement for ""_. Any ideas (I'm using iOS 5.0)? – Nate Apr 28 '12 at 02:41
  • 1
    @Nate: I would bet that you need an entitlement to set this value now. – rpetrich May 02 '12 at 02:58
  • Thanks. How would one do that? I've only encountered entitlements in the context of ad-hoc distribution, and push notification. How would somebody find out which entitlement controls access to write com.apple.radios.plist? – Nate May 02 '12 at 07:23
  • As a follow-up, by running `strings` on SCHelper, I'm guessing (?) that maybe it needs `com.apple.SystemConfiguration.SCPreferences-write-access` for com.apple.radios.plist. I still don't know how to achieve this :( – Nate May 02 '12 at 21:37
  • Nevermind. [http://www.saurik.com/id/8](http://www.saurik.com/id/8) has a good description of adding entitlements, and it simply wasn't working for me originally because I had an old version of `ldid`. Thanks for the suggestion. – Nate May 05 '12 at 03:25