8
Views
2
Comments
[Barcode Plugin] Add param to prevent app going to sleep when scan is open
barcode-plugin
Mobile icon
Forge asset by OutSystems
Application Type
Mobile

Hello,

We have an scenario where we have to scan several barcodes, one by one, as some passanger are going on a bus.

Sometimes it takes a few seconds for the user to get their code, so we need to prevent the app to going to sleep while the scan is open, because it makes hard to use if the user has to wake up the app all the time

We were able to do it in a clone with only a few lines of code, but we won't lose the future changes in the main repository, so it will we great if the main component implements this feature.

Thank you, best regards

2021-11-08 11-46-16
Ishan

Hi,

When you app "app going to sleep", is it the same thing as screen timeout when the phone goes to sleep post specific idle time?

If YES, 

the issue can be solved on device level by increasing the screen timeout for that device from phone settings. 

In case of native mobile app, you can use corova plugin like "Insomnia" to keep the device awake.

In case of PWA, (not sure if it will work) one approach you can try is auto screen refresh via forge compenents or JS.

Last case approach would be to display an interactive popup after certain time intervals for the scan feature which will auto refresh the screen timeout for the user once user interacts with the popup or touches the screen.

Regards,

Ishan Wasnik

2024-01-11 07-20-54
Rodrigo Real Zoco

Hello, thanks for the response.

We already try the keepAwake plugin, because we are in O11 right now, and doesn't work when scan is open, because the plugin works on the app activity, and the plugin has its own activity.

We have so many users to the app, so change the configuration device by device is not a good solution for us.

The solution we go to in the clone is quite simple and works fine by the test we done by far, I can give you the code if you want.

Thank you, best regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.