fluttercommunity / wakelock_plus

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, Linux, and web.
BSD 3-Clause "New" or "Revised" License
49 stars 38 forks source link

for iOS it donot off the screen even if i disable the wakelockplus #61

Open DeekanshuSaini opened 1 month ago

DeekanshuSaini commented 1 month ago

I turned off the feature using WakelockPlus.disable(); but it keeps the screen open in iOS.

DeekanshuSaini commented 1 month ago

@diegotori please review this asap

diegotori commented 1 month ago

iOS has known issues where it may not keep the screen on (affecting 16.4 and higher). Once I get myself an iOS device, I'm gonna port the code from Insomnia.swift into the iOS platform channel. The emulator may not be ideal for testing the wakelock.

Nevertheless, I do accept and will review PRs related to this. As long as it passes the existing integration tests, then it'll get merged and released.

If you submit a PR to this effect, then you will also have to update wakelock_plus_platform_interface and regenerate the pigeon classes so that they generate Swift instead of Objective-C.

DeekanshuSaini commented 1 month ago

@diegotori I have tested this on real device not on simulator , it is working fine in android but in iOS it always keeps the screen awake even if i disable it.

diegotori commented 1 month ago

@DeekanshuSaini please read my post. Right now, the legacy Objective-C code isn't cutting it anymore for iOS.

If you happen to port the code in Insomnia.swift, then I'll be happy to review the PR that you make.