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
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?
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
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
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.
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
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.
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.