To get a notification sound in your Google Sheet when App Inventor app sends text

When I send text from the app to Google Sheet, I would like to trigger a notification sound on Google Sheet. Please help me.

Here is I'm getting response from my app to google sheet. I don't want to miss any inquery from my staff so I would like to get notification sound on google sheet when row cell text updated/added.

here is used this apps script but not working for me

function playNotificationSound() {
  var audio = new Audio("https://www.soundjay.com/buttons/sounds/button-1.mp3"); // URL to the sound file
  audio.play();
}

function aEdit(e) {
  var sheet = e.source.getActiveSheet();
  
  if (sheet.getName() == "Staff") {
    playNotificationSound();
  }
}

As far as I can see, it is not that simple:

It might be easier to display a toast message instead ?

Not working

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var range = e.range;
  
  if (sheet.getName() == "Staff" && range.getColumn() == 1 && range.getValue() !== "") {
    // Trigger a notification message
    Browser.msgBox("A new text has been added or updated in column A of the Staff sheet.");
  }
}


  function runEverySecond() {
  //This function checkCalls() is triggered every second
    setInterval(function() {
      checkCalls();
    }, 1000); // 1000 milliseconds = 1 seconds
  }

  window.onload = function () {
    runEverySecond()
  }

You need to create a sidebar with some html ?

I'm using this extention
image

when I open my app I'm getting notification but when I close app complitely I can NOT get notification please help to fix.

here is my aia file

TestProject (1).aia (73.9 KB)

here is my code

image

image

image


image

No need to double post the same question. I removed your other post.

Where is your itoo setup to run the notification service in the background?

Still something missing ;(((

Uploading: image.png…



Is there any other Background task listener extention (free) ?

You are using global variables in the autorefresh procedure and are trying to call that procedure in the background

Global variables as well as user interface components do not work in the background, use the StoreProperty/FetchProperty methods instead

EDIT: Also you forgot to register the Get_List_Inquery.GotText event and use that event handler to receive the data in the background

Taifun

Not working on an Android ;(
I just want to see simple Bacground message "Hello world" even it's not working for me ;((



image
image
image

Even I tried this but not working ;(

The eventName can't be empty

You only can register existing events...
Also you did not show us your updated autorefresh procedure, whjch should NOT use global variables
And if you want to use the Get method from the web component, you have to register a Web.GotText event as already mentioned...

Follow the usage tips in the itoo thread... start simple and learn from the experience

Taifun

First set the timer interval, then register the event
Taifun