Notification Listener (powered by itoox-wrapper) and Itoo

yes, and as far as I can see everything you need is already there...

  • as @Kumaraswamy already mentioned, use the StoreProperty/FetchProperty methods rather than TinyDB
  • also there is no AfterSpeaking event in the background, therefore we registered that event using Itoo to use the afterSpeaking event handler (which looks like a procedure)...
  • and you might want to register another event, the Player1.Completed event, to continue with the next notification after the sound has been played

what you have to do is the following (pseudocode)

in the OnNotificationReceived event :

  • receive a message and store it using the StoreProperty method
  • get all received messages using the FetchProperty method
  • if there is only 1 message, speak it

in the afterSpeaking event handler:

  • play the sound

in the completed event handler:

  • delete the first message
  • check, if there are further messages stored, if yes, get the first message and speak it

let us know about your progress...

Taifun

In the screenshot I shared, you spoke about the way to achieve something when there is no required event in the blocks.

Here, in this case you registered the event with itoo which looks like procedure. But, when we build some other app which doesn't need background processing, Can we create our own event/event-handler (which may look like procedure) when the required events are not available in blocks?

1 Like

you will need Itoo to be able to do this, so the answer is no

which event is not available?

Taifun

1 Like

A post was merged into an existing topic: Can we do this in an App created using Notification Listener?


About event also not registering

it doesn't support saving lists

You probably forgot the block
evaluate but ignore result Player1

works fine for me
Unbenannt

Taifun

1 Like


tried both methods, but it doesn't work,
player event not registered / working.

1 Like

Can you please post all your blocks?

what is that onSound procedure? where does it come from?
the notification listener provides only the 2 background procedures OnCreate and OnNotificationReceived

your OnCreate procedure looks correct, it registers some events
if you are using Logcat, you should see the 2 informations in the log: "playerCompleted" and "OnCreate"

the most important part of your blocks you forgot to provide, your afterSpeaking event handler and playerCompleted event handler

Taifun

tried to register different methods, leave that,

but the playerCompleted event is not triggered.

Some issues with that project, i Duplicated it and doesn't do any changes but the same works fine and issues SOLVED. Thanks for your assistance @Taifun @Kumaraswamy

2 Likes

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

2 Likes

Problem Solved with the same "OnCreate" blocks as shown in this post

2 Likes

your idea was to find a solution if multiple notifications are received at the same time
it would be great, if you could share your solution here
Taifun

2 Likes

Thank you for your excellent browser extension. I have built my own application based on this extension, but I encountered a warning from the Play Store:
"Using the exact alarm feature causes issues with your app for some Android users.
Your app schedules precise alarms without checking if the SCHEDULE_EXACT_ALARM permission has been granted. This causes problems for Android 14 users as this permission is no longer granted by default.

In most cases, using alternative scheduling methods for tasks or less precise alarms would be more appropriate. If you truly need to use the exact alarm feature, please update your app to check if the permission has been granted before scheduling.

Is this a serious issue?

Android14 users need to manually grant SCHEDULE_EXACT_ALARM permission in settings. So the application should check whether it is Android 14 and, if it does not have permissions, direct the user to the settings tab, where he will be able to enable this function.

1 Like

Thank you... however it is an App Inventor extension, not a browser extension... :sweat_smile:

the itoo extension declared the permission SCHEDULE_EXACT_ALARMS in the manifest without using it. @Kumaraswamy removed that permission in the latest version of the itoo extension. Thank you @Kumaraswamy ! I now updated the example project in post 1 (version 2a) Notification Listener (powered by itoox-wrapper) and Itoo.

Taifun

2 Likes