Need help with Notification Listener Extension

I need some assistance with Notification Listener Extension here

I want to save the json response into 3 lists. Can you please help me how can i achieve it ?

image

Example response:
image

Thanks
Bossx

You need the Web component, which has a JSONDecode and a JSONDecodeWithDictionaries block.

Loop through the TinyDB tags and values like in the example where you got the extension, and decode each JSON value into either a dictionary or list of pairs, per your taste.
Look up each of the three keys in the current dictionary or list of pairs as you loop, and add it to that key's list.

Hello Bossx

Post the json string here as text.

Hello @ChrisWard

Please find the requested details:

2022-08-02 17:09:30 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:09:42 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:09:50 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:09:53 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:01 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:04 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:07 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:10 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:15 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:20 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:34 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:38 {"packageName":"com.android.systemui","text":"Charging: 98%","title":"Cable charging"} 2022-08-02 17:10:53 {"packageName":"com.whatsapp","text":"Syncing with WhatsApp on Microsoft Edge (Windows)","title":""} 2022-08-02 17:11:14 {"packageName":"com.whatsapp","text":"Syncing with WhatsApp on Microsoft Edge (Windows)","title":""} 2022-08-02 17:11:23

Pardon my previous misfire. I remembered the wrong procedure.

You need a shred procedure:


shred.aia (2.6 KB)





P.S. Watch out for the Blocks Editor if you try to put a double quote (") in a block. It trims trailing double quotes and trailing blanks. You have to go back and edit the text block to re-insert it.

3 Likes

Thank you so much @ABG :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.