Alert notification from esp 32 even the app is closed

You are receiving this:
{
"channel": {
"id": 2453926,
"name": "drowning alert",
"latitude": "0.0",
"longitude": "0.0",
"field1": "Field Label 1",
"created_at": "2024-03-02T15:08:02Z",
"updated_at": "2024-03-02T15:08:02Z",
"last_entry_id": null
},
"feeds":
}

if you want the value of "field1" then:

thank you so much for your valuable answer . Now I can open the application but it shows list A is empty . i have provided the json url
{"channel":{"id":2453926,"name":"drowning alert","latitude":"0.0","longitude":"0.0","field1":"Field Label 1","created_at":"2024-03-02T15:08:02Z","updated_at":"2024-03-02T15:08:02Z","last_entry_id":null},"feeds":}

This makes the pair to which @Ramon has already said: the "feed" is empty.
Until you don't populate that field of the json, you couldn't unpack it correctly.
I apologise, but since I'm not familiar with ThingSpeak I have to leave some other user (maybe @Ramon :grimacing: ?), more clever than me, to help you.
Best wishes.

thank u for the valuable answer would you please edit my .aia file to resolve the error

I think you are able to do it with the example I showed you....anyway, your problem is that you're trying to get filed1 inside the feeds field.... are you sure you have populated correctly the data?

I want to send a alert message to my app from esp 32 and I need to use this thinkspeak url in my esp 32 code to make an hhtp request and need to send data from the esp 32 to thinkspeak channel . I am sending a message drowning or detected with the longitude and lattitude (location details ) to the app in real time data from the esp 32 and the sensors so can you please edit the .aia file accordingly . please edit the .aia file .

This is the data you are getting from your channel. What do you want to do with them?

Hello,

I can show you some examples relative to how get the values you need from the received data.

If you want the values of all the fields "field1" inside the feeds parameter:

how to get from "channel" the las entry id:

and how to use the last_entry_id obtained previously to get the value of the "field1" for that entry (entry_id =4 in your example):

And please, stop writing to me privately... I will assist you when I can and always through the public topics.

Check if the value is greater than 0.95

Then you need to use an extension like this:

Guidelines for using Itoo

  • First get your background functionality running in the foreground. Like this, you can find errors much easier. And as soon as you got it working in the foreground, then test it in the background.
  • Read the complete Itoo to leaarn how Itoo works and try the example projects, See also the battery checker tutorial and notification listener and itoo tutorial.
  • Do not use global variables while in the background, use local variables instead
  • Do not use any user-visible or UI components in the background
  • In the background, use the Itoo StoreProperty/FetchProperty methods rather than TinyDB. TinyDB relies on SharedPreferences which will not ensure data synchronization across background processes.

Taifun

can you forward the picture of the full block

Which full block? I gave you only some examples to show you how to get the values from the data you are receiving....with that examples you can get the values you want from input data and implement the logic you want with them.

When you say "many notifications", are you referring to the fact that a lot of data arrives within "feeds"?

you can see that you have a creation date associated to each item inside "feeds" and you have also in "channel" which is the last feed's item created.

So, if you receive a new data set you must check those dates to be sure which data is the last one.

Yes I added 4 items in the feeds . {"created_at":"2024-03-08T07:31:15Z","entry_id":4,"field1":"1.2"} this is the last feed item added . can you help with this details and the the notification comes only when the app is opened I want to get notification even if the app is closed

Regarding to the last item, I have shown you in the before examples how to get the las id, and how to get a data from that last item.

how can I introduce a map for tracking the the location of the alert message with latitude and longitude as feed data in the app with the alert notification

image

You can place a Marker on the map.

thank you for your response . how can I use the latitudes and longitudes from the feeds to get the live location gps location . Please help with how can i implement the blocks for this purpose .

please anyone give the response

Get the values from data with dictionaries blocks and set a marker, for example, in the map with the values