Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't disable wake lock on iOS #185

Closed
EinatK opened this issue Nov 28, 2022 · 4 comments
Closed

Can't disable wake lock on iOS #185

EinatK opened this issue Nov 28, 2022 · 4 comments

Comments

@EinatK
Copy link

EinatK commented Nov 28, 2022

Works fine on android, but on iOS both Wakelock.disable() and Wakelock.toggle(enable: false) are called without any error, but screen stays on forever.
No error or exception thrown, The code was called, but nothing happened..
As soon as I let the app the screen dimmed as expected.
Tested on real device, iPhone 11, iOS 15.4.1

Super simple code: (Tried with and without awaiting, no change)

ElevatedButton( onPressed: () async { try { if (await Wakelock.enabled) { // await Wakelock.enable(); await Wakelock.toggle(enable: false); } else { // await Wakelock.disable(); await Wakelock.toggle(enable: true); } } catch (error) { print(error); } },

@cagridurmus
Copy link

i am having the same problem. On Android, wakelock.enable() works flawlessly. But it doesn't work in apple even if I set wakelock.disable(). It is observed that the await wakelock.enabled value turns false.

@Edion-Liu
Copy link

Have you solved this problem now?

@aqueebqazi
Copy link

The problem is still present tested on ios 16.6.1

@creativecreatorormaybenot
Copy link
Owner

I will soon discontinue this repository. Please use wakelock_plus: ^1.1.6 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants