[Discontinued] Background Tasks [4.1] πŸ₯³

It seems that you are trying to send the battery updates to the telegram bot, isnt it?

Exactly. In the long run, I want to send a message to the telegram bot with the status of the battery and also the time. Next, I’ll see how to only send the message once the internet connection is back after the power outage (the cellphone will only work with wifi).

1 Like

You get the message sent to you from the bot, but you get it as {$Estado_Anterior} right?

That’s right

it seems your using tasks version below 4, ill try to make an example

You get that because the variable isnt initialized yet, you set the url before the status is set.

You’re right! I was using a previous version of tasks. Now I updated it to 4, but the block RegisterEvent is no longer available :S. I added the variable definition before calling the set-url function.

DetectorCortes.aia (487.9 KB)

No the RegesterEvent exists, its values are renamed, you will find it.

Almost there! haha
Found the new name :smiley: I also had to change the url for every battery change, so added new ListenEvent block. Because of the execution order, I end up sending the previous battery state instead of the current. BUT I AM HAPPY WITH THAT anyway haha. Thanks a million!!

Ari

1 Like

Thats good! Here’s mine :blush:

It sends me a status update of what the phone is connected to (normal cabel / usb).

https://api.telegram.org/bot<token>/sendMessage?chat_id=<chat_id>&text=

BotBattery.aia (485.5 KB)

1 Like

boom-mind-blown

That’s fantastic!! Thanks again :slight_smile:

1 Like

how to use blocks like this in extension?
Screenshot_2

What have you tried

1 Like

I’m trying to understand the logic.

hi,

do you have any solution to listen web radio with background ?

Best Regards

Hmm I’m not sure.


Would you please tell me how can I save the resulted value from calling the SystemTime function inside the variable?

You use the value {$invoke}

it works but unfortunatley it returns null, I want to store the current system time in firebase, and i just want to know how to get the resulted value from the SystemTime block from the clock component, would you please tell me how to get it ?

Can you show me the new blocks? Use " {$invoke}" is values you provide.