Android: Add support for custom icon and pictures in notification

Created on 16 Dec 2019  路  10Comments  路  Source: home-assistant/android

Home Assistant Android version:
1.2.0 (42)

Android version:
9

Phone model:
OnePlus 5t

Home Assistant version:
0.103

Description of problem:
Missing possibilities to add custom notification icon and pictures in notifications.

Like this service call, which I used to use in Ariela

{
    "title": "Doorbell",
    "message": "Someone at the door!",
    "data": {
        "tag": "866050",
        "image": "https://MY_URL/local/frontdoor.jpg",
        "color": "#FFFF00",
        "icon": "https://MY_URL/local/notification-icons/doorbell.png"
    }
}
enhancement notifications

Most helpful comment

@MTrab the app only supports basic notifications at this point. Extended notifications will come later on 馃檹

See https://github.com/home-assistant/home-assistant-android/issues/7 and https://companion.home-assistant.io/en/notifications/basic#enhancing-basic-notifications

All 10 comments

@MTrab the app only supports basic notifications at this point. Extended notifications will come later on 馃檹

See https://github.com/home-assistant/home-assistant-android/issues/7 and https://companion.home-assistant.io/en/notifications/basic#enhancing-basic-notifications

Could be added as other parameters in #356

I tried the latest (updated today) app, to test images - but it doesn't work.
The image is not displayed, message is.

Service call:

message: "Something happened at home!"
data:
  image: "https://my.domain/local/frontdoor.jpg"

Appversion: 1.7.0(116)

I thought the image option was released with 1.7?!

Image option has been around for a while. Can you check that the URL is accessible in a browser?

It is - have used the excact same URL for a long while (Ariela was used prior to this app).

Can you check that the other notification options are working like tag or color? If they don't you may need to start fresh with the app.

The image option has been around since notifications were first added.

https://companion.home-assistant.io/docs/troubleshooting/faqs#starting-fresh-with-the-android-app

As I read https://github.com/home-assistant/home-assistant-android/pull/356, it was first introduced to the Android version 3 days ago, and when I initially made this issue (back in december) image wasn't an option in the Android app yet.

But no - tag and color doesn't seem to work either.

@MTrab the image option was there before that PR however it was not documented so it was hard to find. The PR you mentioned just simplified the image option as it used to be nested under data > android > notification > image.

https://discordapp.com/channels/330944238910963714/562408603345092636/654818598698876931

Edit: definitely follow the steps to start fresh to fix your notification issue

Okay - a fresh start seems to have fixed it :) Thank you.

Closing as icon support has been added a few releases back and pictures have been available for quite some time. This icon is not to be confused with #793 if you intended for that icon then lets keep the discussion in that issue since more has been discussed about that specifically there.

Was this page helpful?
0 / 5 - 0 ratings