Created on 28 February 2020
icon_unfollowing
Login to follow
screen-events-plugin

Screen Events Plugin

Stable version 1.0.4 (Compatible with OutSystems 11)
Uploaded on 27 April 2020 by 
screen-events-plugin

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

Release notes (1.0.4)

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

Reviews (1)
by 
2022-01-06
in version 1.0.4
best  explaining.
Category
Device capabilities, Other device capabilities
Tags
Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
See all 1 dependencies
Application Objects
Screen Events Plugin has 0 AOs.
Team
Compatible with
Version 11
Database:
All
Asset consumers
No consumers yet.
Weekly downloads