1

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 ?

LawTze-Kun
  • 67
  • 7

1 Answers1

1

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

Avi
  • 7,469
  • 2
  • 21
  • 22