xamarin.formsxamarin.iosidle-timer

IdleTimerDisabled not working in Xamarin Forms IOS


The app I am working on needs to able to keep device awake while the app is the foreground and a particular application user setting is enabled. The below line works fine, however there seems to be no way to turn the idle timer back on. Resetting it to false does not work. Even uninstalling the app and redeploying does not turn it back on. Does anyone have any insight on this?

// This works great UIApplication.SharedApplication.IdleTimerDisabled = true;

// This does absolutely nothing UIApplication.SharedApplication.IdleTimerDisabled = false;


Solution

  • Try unplugging your device. It might work properly if you run on a device disconnected from your debugger. See this SO Question