WebViewer ReceivedMessage not working for Firebase alert in Thunkable

Hi Thunkable community,

I’m trying to make a patient tracking app using WebViewer + Firebase.
Here’s what I want to do:

  1. Show a map in WebViewer (Leaflet + Firebase Realtime DB).

  2. Move a marker according to the patient’s location from Firebase.

  3. Send an alert to Thunkable app (Notifier) when the patient goes out of a safe zone.

What I have:

  • WebViewer shows the map and marker correctly.

  • Marker moves and changes color inside WebViewer.

  • Sound alarm works inside WebViewer.

Problem:

  • WebViewer.ReceivedMessage in Thunkable does not work with the JSON message sent from my HTML.

  • Some blocks (like JSON.parse) are missing in Thunkable.

My question:

  • How can I catch the message from WebViewer in Thunkable if some blocks are missing?

  • Is there a full workaround to trigger a Notifier alert inside Thunkable without changing HTML?

Hi @shahdnabil2348ygv3z4
We have changed only 1 thing, and it was a needed bugfix - when we post a message through the web viewer, previously, we were sending whatever type the user has chosen - e.g., if you send the number “1”, we’re sending 1 as a number. Now, we are stringifying everything, meaning that if you send “1”, it’ll be 1 as a string and not as a number. This means that, whoever is receiving or consuming the message, should handle it accordingly.

In the case of “1”, it’s “simple”. But if you decide to send a whole object (e.g., { name: 'John Doe', age: 20 }, then this will be sent/received as a string, and the receiver must cast/parse it to an object and then they can use it as such

Could you please let me know if you have more questions?