iPhone
iPhone

Reputation: 4170

iPhone:How to set AIRPLANE MODE and AUTOLOCK settings in iphone from my app

I want to set AIRPLANE MODE and AUTOLOCK settings from my app.

Initially I want to fetch it from iphone settings.

enter image description here

As shown in the figure what I want to say is if I change AIRPLANE MODE and AUTOLOCK settings from my app it should be changed in the iPhone settings.

For this any code or link which I have to refer?

Upvotes: 1

Views: 1840

Answers (3)

jrturton
jrturton

Reputation: 119242

"Auto Lock" can be controlled by the idleTimerDisabled property of UIApplication:

[UIApplication sharedApplication].idleTimerDisabled = YES;

Note that, as Steve points out, this does not change the phone settings, it just prevents the phone going to sleep while your app is running.

You cannot set airplane mode from within your app.

Upvotes: 1

Steve
Steve

Reputation: 31642

You can't.

I understand what jrturton was trying to say - and yes, you can temporarily disable auto lock while your application is running but you can't change these system setting from your app.

Upvotes: 3

alpjef
alpjef

Reputation: 57

I'm nou sure if it's possible to read this from settings. But you can NOT set this values from your app for security reasons

Upvotes: 0

Related Questions