Send notification with image not work?

I am trying to send notifications to my android phone, using this code
https://bobgrayblog.wordpress.com/2020/03/29/actionable-android-notifications-and-appdaemon/

But it doesn’t seem to work.
It only works if I remove the data parameter and send only the title and message

 NotificationData =  {"actions":[{"action":"URI","title":"ButtonTitle","uri": "mylink"}],"image":"https://yourdomain.duckdns.org/local/snapshots/myimage.jpg"}
self.call_service("notify/mobile_app_myphone", message="message2", title="tile2", data=NotificationData )

any idea?

i have find that the problem is the creation of the json string to pass as data

This not workd

NotificationData  = {}
NotificationData ['actions'] = [{"action": "URI", "title": "View", "uri": "mylink"}]
NotificationData ["image"] = "https://yourdomain.duckdns.org/local/snapshots/myimage.jpg"
NotificationData  = json.dumps(NotificationData )

This work

NotificationData =  {"actions":[{"action":"URI","title":"Close Garage Door","uri": "mylink"}],"image":"https://yourdomain.duckdns.org/local/snapshots/myimage.jpg"}

any idea?

1 Like