Open Source β€’ Background Tasks: Itoo πŸš€

I havent tried it, since it requires camera initialization onto a layout.

Hi. Is there a way I can use Itoo to keep my app listening for OneSignal notifications in order to play a sound? I have tried various processes, but I can't get anything working. Thank you.

Yes, in theory it is possible to do so but requires a Service to keep running in background.

But if you really want Notifications Customization, you should try this extension, it has Itoo integrated to it :slight_smile:

Need some help.
I basically copied your Notification every second example.
It is not working for me. If I Connect using AI Companion, there is not a notification in the notification bar.
If I build an apk file and install that, I get the notification in the notification bar as shown.
But, the labels do not get updated with the text I set them to. But, the app beeps every second.
Can I not update labels even though it is a foreground process ?
Where can I get the latest version of the extension ? If I click on the question mark, it shows
Extension Version 1
Date Built: 2023-03-08

you have to test this after building... a background task can't run in the companion app...

yes, because there is no user interface if something is running in the background, so no labels or buttons or textboxes etc.

no you can't

usually in the first post of an extension thread

this seems to be the latest version

Taifun

1 Like

Ok. I was hoping that a foreground process could interact with the user interface.
Thank you for all your help.

One last issue. Timer Interval is set for 60000, but the Simple Notification keeps firing every second, instead of the interval I choose.

Could you please show us your blocks?

Pro tip: You must set the property through blocks and not the designer section while using Itoo

Ha, I did not set the property through the blocks. I keep forgetting that even a foreground process cannot access the UI.

But, it still does not work. As an app, using the timer, works. As a process, the timer procedure, I don't think executes.

What happens if you remove the if condition and send a notification regularly to report the battery status? Does that work?

Taifun

I disabled the if condition, and have a notification. With the x variable in the timer procedure, it does not seem to work at all.
If I remove the x variable in the timer procedure as well as the if condition, the notification shows every second, even though timer interval is set to 30000.

There's one more constraint, avoid using Global variables all together, you are limited to only what happens in the procedure.

Move the property block "TimerInterval" with the value "30000" over to the procedure "timer" before the if-else condition check.

Itoo 3

This Itoo update includes a wide range of internal, and functional enhancements that improves the overall foreground and background processing

Behavior changes

  • Optimisation of internal Itoo framework to work efficiently

  • Functional stability to work seamlessly

  • StopProcess and StopService blocks are unified into a single block StopProcess

    StopProcess

    • Ends the current foreground/background service, can be called both from inside/outside the background service

Functional changes

  • Added POST_NOTIFICATIONS permission

  • Added a way for one way communication b/w the foreground/background services

    RegisterBroadcast

    • Registers a broadcast with a name and a procedure as a listener.
    • In simple, this will listen to a particular event that will be sent by the application outside the foreground/background service.
    • Corresponding procedure must include an argument that will contain the message sent.
    • To be used inside the foreground/background service.

    Broadcast

    • Broadcasts a message to the foreground/background service, message can be anything

    UnregisterBroadcast

    • Unregisters the broadcast listener previously registered

    ProcessRunning

    • Returns true if a foreground process is active

There are a lot more changes internally :-) but simply not relevant to know

xyz.kumaraswamy.itoo.aix (62.8 KB)

6 Likes
1 Like

I want to run notifications in background, but not working.

Try the example fromthe first post

Taifun

1 Like

1- The "Clock test" notification can't be removed from my phone, unless I remove app.
How to make it removable ?

2- And Simple notifications created by Itoo NOT opening the app when clicked.

That's the whole point of having a foreground notification, you would need to ask the user to supress or hide the particular channel.

You would need to use the Modified Notification Style Extension to be able to change the functionality of the notification by updating the notification.

1 Like

I'm already using the Modified Notification Style Extension :

How to to change the functionality of the notification by updating the notification ?

1 Like

Use the simple notification block with the id set to 123321 if you want to update Itoo's foreground notification.