LawTze-Kun
LawTze-Kun

Reputation: 67

Prevent dimming screen in iOS App Extension

I'm developing an iOs app with an Action App Extension. While the Action App Extension is running, I want to prevent the device from dimming its screen.

I've added [[UIApplication sharedApplication] setIdleTimerDisabled:YES] but its giving me this error.

'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

So I want to ask, what are the "view controller based solutions" ? What Is the alternate for [[UIApplication sharedApplication] setIdleTimerDisabled:YES] in iOS App Extension ?

Upvotes: 1

Views: 265

Answers (1)

Avi
Avi

Reputation: 7552

Extensions cannot modify the host app, by design. If the host app doesn't care about screen dimming, there's nothing you can do.

Upvotes: 1

Related Questions