Unable to receive messages

I have Recieving set to always enabled, and I configure the blocks to set the message received into a json object and to webviewstring. and I'm checking for change in value for webviewstring.

However when I receive messages there is no alert popped up that a string has been set to webviewstring

let lastValue = "";

    function checkWebViewString() {
      if (window.AppInventor.getWebViewString() !== lastValue) {
        lastValue = window.AppInventor.getWebViewString();
        onWebViewStringChanged(lastValue);
      }
    }

    function onWebViewStringChanged(newValue) {
      console.log("WebViewString changed:", newValue);
      // do whatever you want with the new value
      alert(newValue)
    }

    // Start polling every 300ms
    setInterval(checkWebViewString, 300);

Check in your app with an notifier alert to see if message is correctly received ?

I have permissions for notifications but a notification doesn't come up.

not a notification, a notifier component, back to basics :wink:

I did not receive an alert after this configuration

Seems you are not getting a message/message text...

I was able to get this to work before, now it doesn't. I'm trying to understand why

Seems you are not getting a message/message text..

I tried grabbing number and it didn't work when the phone got the SMS

There's a number you have to set for the texting component, 1-3.

What is the value?

Also, which companion version and flavor are you using?

2.76u?

If your app is in the background, then the event MessageReceived does NOT get triggered, you get a notification instead...
To get the notification you need post notifications permission

To do domething in the background while receiving a text message you might be interested in App Inventor Extensions: SMS Receiver | Pura Vida Apps

Taifun