Skip to content

feat: Add the option to enable idle timer on iOS #3416

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rithik-b
Copy link

What

Added support for enabling the idle timer while the camera is active on iOS. Use case is I am using this for barcode scanning and I want the phone to go to sleep if the user prefers it, in case they leave their phone on and leave it alone. On android it seems like the phone does go to sleep when left alone so I have left it as is.

Changes

Added enableIdleTimer prop (defaults to false) and implemented it for iOS.

Tested on

  • iPhone 15 Pro Max, iOS 18.3

Tested both with enableIdleTimer set to true as well as false to see if everything works as expected.

Related issues

Copy link

vercel bot commented Feb 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 15, 2025 4:58pm

@rithik-b
Copy link
Author

rithik-b commented Apr 3, 2025

Hey @mrousavy did you have a chance to take a look at this yet? Since my use case is for timing out for barcode scanning, would it make sense to disable idle timer only when a video is being recorded (and remove this prop?) I think I saw the disable idle timer was only added for not sleeping when a video is being recorded so let me know what you think.

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

Successfully merging this pull request may close these issues.

1 participant