ItoO - Background Tasks [special] 🥳

Firebase component is not actually meant to be used manually, there are special operations that needs to be done if you use Firebase, (try using Firebase component created by Dynamic Components extension, it would not work, it is the same here).

First you have to Call hidden “DefaultURL” property (which you cannot do directly), then FirebaseURL and at last FirebaseToken. This should be the order.

AppInventor/Kodular generally automatically does this, but isnt really easy doing that manually. I have wrote an autofix in the extension for next update, wait for that.

it will not work using firebase component as it needs to be initialized first, but there’s a firebase addon extension you can use it and it worked fine for me

1 Like

Can you share a demo aia in my PM ?

2 Likes

Edited your aia file but unfortunatley the firebase extension doesn`t support store value yet, so I used on TagChanged event handler in demonstration, Which is working only when a tag is changed in your given bucket
backGroundPlayer.aia (70.9 KB)

3 Likes

Tried but not working

ItoO Tasks 1.1


[1] Fix crashes, and event bugs
[2] Ability to call other procedures
[3] Internal optimizations
[4] Background service from now on will be ignored if the app is active.

[5] Added Cancel Block
[6] Auto Fix for components (Firebase)


The firebase bug is fixed now :grin:
First you have to set the URL, token and others…


xyz.kumaraswamy.itoo.aix (26.1 KB)

10 Likes

Hey
after upgrading to version 1.1 my test project stopped responding, even minimized or even not being active, it doesn’t seem to run the service.
When downgrading to 1.0 it worked normally again.

Hmm, please post the aia file here.

I think he is not willing to share the aia in here, you should PM him

Follow the AIA with version 1.0
TesteSegundoPlano_copy.aia (39.2 KB)

1 Like

thanks, i will check what is going wrong, btw, blocks are different from the one you posted as image?

Yes, same project, but I changed the URL and responseContent treatment because they point to a private server.

Rest is the same one I’m using to test the extension here!

1 Like

hey, i just checked the project with v1 and v1.1 and both of them are working properly.

image

I guess i know where the problem is.


image

The latency is here set to 2 seconds, the service seems to be starting before you even close the app.

In v1.1, incase the service is started and “App” is not closed yet, the service will be strictly rejected. This was done because to prevent any false/miss/bad errors from appearing.

I set the “Latency” to 7 seconds and it was fine.
In the next update, i will try to add a feature “OnlyInBackground” which makes the task/service run when the app isnt active.

thanks for the feedback
I’ll be back to testing!

1 Like

I thought about the latency issue, but came to the conclusion, “correct me if I’m wrong”.
In this way, I need to use a trigger to start the service in the background, such as a button where the user chooses such an action and in the sequence close the APP intentionally, which most of the time will not happen.
That way it wouldn’t be practical except when dealing with an alarm!

I’m sorry for my english!

1 Like

Yes you are right, sometimes you may call the block before the app closes, if you know how.

I know its not practical, there will be a feature to fix this.

1 Like

that’s a great work :heart:

I have a suggestion, what if you add a block by which it is possible to know if the feature is still working or has been killed?

This would be useful in examples like FireBase

version 1.0 and 1.1 non of them work with me i tested on two device MI 8 lite and VIVO X70 pro

change the notifaction ID to any other integer, say 1

2 Likes

Hello guys i am trying to create a loop task. But my blocks not working

Blocks

Device : Realme 3i
Android Version : 10

1 Like