Need help sending notifications in the background over bluetooth

Hi
I'm pretty new to app inventor and Android development in general.
I want to make an app that sends something (just a bit is enough for me) over Bluetooth when there is a notification on the Android device.
I tried TaifunNotificationListener but the Event only works when the app is open. As I read from App Inventor Extensions: Notification Listener | Pura Vida Apps it constantly works in the background and writes to tinydb. I thought of using something like Background Tasks extension [3.8 A] 🥳
to constantly read the database and send the required data over Bluetooth if there is a new record, delete the previous ones, or keep track of it so I know if there is a new notification and continue sending required data when a new one appears. but as I have no experience with it couldn't realize it.
Any help will be appreciated

Hi, you can use Itoo (a newer advanced version) with the Taifun's Notification Listener extension to constantly monitor new upcoming notifications :slight_smile:

You can see posts on Itoo's topic and see some examples.
One of the person had posted an example where he used the Itoo extension with the Bluetooth:

1 Like

Thanks a lot. I tried Itoo but still don't receive any data. bluetooth connection is established and the problem is either the background procedure is not running or I'm doing wrong with tinydb. can you take a look at my blocks?

by the way, I included CreateTask block to show that I tried both methods described in the topic

the BackgroundRegistration procedure needs a parameter x, which is missing, see again the example from the link @Kumaraswamy was providing
also there is no such event as Timer, do you mean Clock1.Timer?
But where in your blocks is your Clock1.Timer event then?

Taifun

2 Likes

Thanks for answering my dumb question. After adding a timer and the parameter x it works as intended.

Great
Please post a screenshot of your working blocks for others, who like to try this in future, too
Taifun

1 Like

Sure, but this is at an early stage. I'll share the blocks after completing it as well. now I need to add a checkbox list to select the apps I want to get notified about. besides that, it seems that if there are any permanent notifications, TaifunNotificationListener keeps adding it to the database and therefore I'll get a Bluetooth message.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.