erva 2 Posted March 8, 2020 Is there way to prevent iOS automatically lock screen? I'am my self using one fitness app and it stays visible when doing workout, so it should be possible. Share this post Link to post
Sherlock 663 Posted March 9, 2020 This SO topic should point you in the right direction: https://stackoverflow.com/questions/28329185/how-to-prevent-screen-lock-on-my-application-with-swift-on-ios 1 Share this post Link to post
Rollo62 536 Posted March 9, 2020 (edited) In Fmx this would look somewhat like this: function DoLocked(const ALock : Boolean) : Boolean; var UIApp : UIApplication; begin UIApp := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication); if ALock then begin UIApp.setIdleTimerDisabled(True); // aquire wakelock Result := True; end else begin UIApp.setIdleTimerDisabled(False); // release wakelock Result := False; end; end; I put some more functionality around that basic one, to make it workable on all platforms, and to avoid double-enabling, but I removed that from the code above. Edited March 9, 2020 by Rollo62 2 1 Share this post Link to post