I am pleased to provide below a few examples of how you can use the excellent and remarkable itoo extension by @Kumaraswamy to generate push notifications for your apps, using dataChanged or timer events.
These examples have all been tested on Android 13 (Google Pixel 4a) as compiled apps, and use the sky 4.2 version of the itoo extension, dated 2024-07-05, and version 2 of the Notification Style extension, dated 2024-06-04.
Each example sticks very much to the basics, sending simple text notifications, and without any graphical enhancements, I will leave that up to your creativity. The examples are intended to show you how the extensions work together to generate the push notifications in your app.
-
All of these examples request the Notifications Permission on first run, you MUST ALLOW this permission, otherwise the app will not work as intended.
-
DataChanged events will generate a notification when the message is changed..., for the timer events, a notification is generated when the message is changed and the timer fires. I have the timer set to 15 seconds (15000), this is for testing... you may only want this to fire once every 24 hours (86400000) in production ?
-
None of my examples make use of any MIT provided data servers (e.g. cloudDB or Firebase)
-
In all of the examples I have included the "admin" blocks and components for setting a new/different message. In practice you would have this in a different app, but it makes it much easier to test this way.
I would like to extend my thanks to @Kumaraswamy for his help and support in getting all these examples together.