Screen Events Plugin

Stable Version 1.0.4 (OutSystems 11)
Published on 27 Apr by 

Screen Events Plugin

Details
Trigger events based on your device's screen state! Enables you to fire an event whenever your user turns their device's screen on or off.
Read More

Ever needed to know if your user's phone screen is turning on or off? Look no further!

All you need to do is take the web block contained in this plugin and drop it anywhere you want screen event detection and event handler to live. This might be in your layout web block, or somewhere on a specific screen where you want to listen for those events. In my demo app, I have the block in the main screen.

Then, you just have two events to worry about: ScreenTurnedOff and ScreenTurnedOn. Those should be self-explanatory, and you can define event handlers for both.

Those events are fired the moment the screen state changes, so the logic contained in ScreenTurnedOff will begin to execute as soon as the screen turns off. How long long-running logic will continue to execute while the phone screen is off, and at what speed, I can't guarantee. Ditto for if your app goes to the background before the screen turns off. But in my simple tests in Android 9/10 and iOS 13, my Javacsript handler did capture a timestamp of the moment the screen was turned off in both use cases. However, your mileage may vary by exact device and operating system.

See the source at https://github.com/wrobins/cordova-plugin-screenevents

What’s new (1.0.4)

Removed error that would get spammed if the plugin was not loaded correctly.

Reviews (0)
Category
Components, Mobile Plugins
Support Options
This component is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from Walter Robins who created this component.
Dependencies
See all 1 dependencies
Requirements
Platform:
11.0.0.200
Database:
All
Stack:
.NET
Component Consumers
No consumers yet.
Weekly Downloads