👂 Notification Listener Extension [Open Source]

now try again
Taifun

1 Like

It worked out! Thanks.

Hi, I tried that notificaton listner but didnt work so is there any help or updates?

even open its aia file on my app but didnt work as well

So why the notificatons from aia file attached not working with me?

so why dont see the notifications here when i press get and i gave it the permission?

From your last screenshot it looks like you are using the package name filter... which means, only notifications from my alarmmanager example app and the systemui will be displayed...

???
There is a notification and the system updates it continuously...
unknown
and in the example app you get all recently displayed notifications...
where exactly is the problem?

Taifun

am just creating my first app on mit app inventor and i wanna make notifications for it especially messages

The notification listener listens for notifications from other apps...

to create notifications immediately use 🔔 MelonNotification • Various styled notifications + Itoo

to create notifications at a given time in the future, use the alarmmanager extension

Taifun

A post was merged into an existing topic: Notification Listener (powered by itoox-wrapper) and Itoo

I installed version... I don't know actually, of Taifun's Notification Listener extension: App Inventor Extensions: Notification Listener | Pura Vida Apps

doesn't seem to be working, see the image attached for the blocks, they look different.

I've been trying to get my app working on my new phone, that's all, but seems like no notifications are being detected. On my old phone my original app works perfectly fine.

To find out the version of any extension, in the designer click the question mark next to the imported extension

Compared to what?
Try the example project from here

Taifun

To find out the version of any extension, in the designer click the question mark next to the imported extension

TaifunNotificationListener Extension. Version 6 as of 2024-06-29.
Extension Version: 6
Date Built: 2024-06-29

Compared to what?

Well for starters, the when.NotificationReceived, do block used to be purple I think?

I'll check your example project, does it work with Android 15?

It is an event and events have a yellow color

But as the extension is able to also do processing in the background using itoo, there also is an event handler, which looks like a procedure.

How this can be used see this example

It should work for all Android versions starting from API 21, which is Android 5.

Taifun

TaifunNotificationListener extension unable to get notifications

Hello @Taifun,

I am trying to read notifications from google maps (com.google.android.apps.maps) application. As a test I am trying to read and set label text to the notification “text”. I am running Android 16 and did allow “notification access” to my app.

However I am unable to any notification text, I tried with whatsapp (com.whatsapp). would you please point what am I missing?

TIA.

Read the documentation to find out how to use this extension. And try the example project.

If you like to filter for package names, first set the filter and then start the service. As test try without any filter first.

And concerning the event Notification Received, see this note from the documentation

If your app is up and running, new notifications can be received via this event

You might want to elaborate what exactly you are planning to do after receiving a notification from Google Maps

Taifun

Hello,

I have currently installed the example project and am able to receive a range of notifications like Spotify songs, charging status, Emails and more.

My question is if there is a way for the app to receive google maps notifications, as in the directions along the way like: ‘Left on (street) in 50 meters’, as currently I am only getting notified in the app when I have arrived at the destination.

One thing I have to mention, is these directional notifications like: ‘Left on (street) in 50 meters’ are labelled as ‘Live Notifications’ in the drop down menu. Are these ‘Live Notifications’ a potential problem?

Thanks

Most probably yes
I now asked ChatGPT and below is the (long) answer
Taifun


Yes. The key issue is that Google Maps navigation prompts are usually not delivered as normal notifications.

During active navigation, Google Maps uses ongoing/live notifications (Android's evolving notification APIs, including foreground services and, on newer Android versions, Live Updates). These are updated in place rather than posting a new notification for every turn instruction.

A NotificationListenerService can only receive what Android exposes through the notification system. Depending on the Android version and the implementation used by Google Maps:

  • You may receive the initial navigation notification.
  • You may receive onNotificationPosted() and onNotificationRemoved() callbacks.
  • You may receive onNotificationRankingUpdate() or repeated updates if the notification is modified.
  • However, the actual turn-by-turn text ("Turn left in 50 m") is often not present in the notification extras, or the updates are not exposed in a way that third-party apps can read.

If you're only seeing "Arrived"

This usually means Google Maps is not exposing the intermediate navigation instructions through the notification API. Those directions are generated internally by the app and displayed in its own UI rather than as readable notification text.

Is there a workaround?

Unfortunately, not through NotificationListenerService alone. The alternatives are:

  • Use an Accessibility Service to observe the Google Maps UI (if appropriate for your application and users grant accessibility permission).
  • Use the Google Maps Navigation SDK if you're developing your own navigation app.
  • If you're integrating with another navigation solution, use its dedicated API rather than relying on notifications.

So if your notification listener only receives the final "You've arrived" notification, that is expected behavior on many Android devices. The intermediate navigation instructions are generally not available to third-party notification listeners because they are implemented as live/ongoing updates that do not expose their contents through the standard notification APIs.

Thank you for your quick response, this has cleared my confusion.