humhub / fcm-push

Enables your users to receive push notifications from your network.
5 stars 7 forks source link

Only attach `image` if related #18

Closed luke- closed 1 year ago

luke- commented 1 year ago

Currently, an image is added with each notification. If none is available from the context, the logo/space image is added.

We should only attach an image if one is available from the context (e.g. first image in the post, attachment file).

luke- commented 1 year ago

See also: https://github.com/humhub/app/issues/57

serh-mosk commented 1 year ago

@luke- Can you explain in more detail in which cases, where exactly to add which images? Can you add screenshots for better understanding? Where can I see the app to test it? Also, based on the context, you need to have access to the Cloud Messaging options at https://console.firebase.google.com. Can you provide all of these? Locally, I was not able to configure the process of receiving the appropriate push notifications, although I figured out how it works in the code. I also want to note that, having experience from previous projects, the push message should have a project icon and, if necessary, you can add an image to the content of the message itself.

luke- commented 1 year ago

@yuriimaz Thanks for your investigation. Seems the issue was not quite true. It seems that we currently always the SiteIcon is added to the notification as image.

https://github.com/humhub/fcm-push/blob/master/services/MessagingService.php#L33

The intention should be to attach an image to the notification only if there is an image attached to the notification source. (e.g. the notification is about a Post with an attached image).

Currently it would be ok not to add any image at all to the notification for now.

I'll do this, because it's too much overheat to spin up a Firebase test project for this.

luke- commented 1 year ago

I've created a new issue https://github.com/humhub/fcm-push/issues/21 for possible future developments about this.