-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: image not shown when image url in notification payload #172
Conversation
image when in notification payload, doesn't show in foreground
Codecov Report
@@ Coverage Diff @@
## beta #172 +/- ##
=========================================
Coverage 62.12% 62.12%
Complexity 210 210
=========================================
Files 91 91
Lines 2041 2041
Branches 257 258 +1
=========================================
Hits 1268 1268
Misses 676 676
Partials 97 97
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Pull request title looks good 👍! If this pull request gets merged, it will cause a new release of the software. Example: If this project's latest release version is All merged pull requests will eventually get deployed. But some types of pull requests will trigger a deployment (such as features and bug fixes) while some pull requests will wait to get deployed until a later time. This project uses a special format for pull requests titles. Expand this section to learn more (expand by clicking the ᐅ symbol on the left side of this sentence)...This project uses a special format for pull requests titles. Don't worry, it's easy! This pull request title should be in this format:
If your pull request introduces breaking changes to the code, use this format:
where
Examples:
Need more examples? Want to learn more about this format? Check out the official docs. Note: If your pull request does multiple things such as adding a feature and makes changes to the CI server and fixes some bugs then you might want to consider splitting this pull request up into multiple smaller pull requests. |
Build available to test |
// This is custom logic to add images to a push notification. Some image URLs have not | ||
// been able to display an image in a push. https://github.com/customerio/issues/issues/7293 | ||
// Instead, we recommend customers use `notification.image` in the FCM payload to bypass | ||
// our logic and use the logic from FCM's SDK for image handling instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was added to help out customers in the past where they would not see an image for some image URLs (the ticket has some example URLs that failed).
That ticket was made a while ago so there is a chance that the customer issue has been resolved and our SDK is able to show images with all URLs now. If that is true, I am OK with removing this comment.
If our SDK still encounters problems with some image URLs, I am still OK with removing this comment as long as we create a new ticket for us to address this problem of increasing image URL compatibility in the SDK in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your concern is very valid Levi,
From LJ's response in the ticket
It ended up not being an issue with the link, but instead an issue with the payload they were using to test. @levibostian any reason to keep this image open?
and my testing, I tested the very same URL you mentioned in the ticket that didn't work,
And for the reasons, that we want to push people to use Rich Push
which is data only
, hence I decided to remove the comment.
we create a new ticket for us to address this problem of increasing image URL compatibility in the SDK in the future.
Would you advise creating it now or when an issue occurs? because I noticed the PR that adds it just got merged and we didn't get this issue reported for months after we reworked the image handling in SDK and sorted all the edge cases. Happy to create a ticket, if its serves a purpose.
try { | ||
// check for image | ||
val notificationImage = bundle.getString(IMAGE_KEY) | ||
// check for image in data and notification payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining why we are checking for an image in data and in notification payload? So future readers of this code understand the decision behind doing this.
Changed PR title to be more descriptive. I thought this would be helpful for when this commit gets added to the changelog. Anyone else can change the title if they have a better suggestion 👍 |
## [3.3.0-beta.4](3.3.0-beta.3...3.3.0-beta.4) (2023-02-17) ### Bug Fixes * image not shown when image url in notification payload ([#172](#172)) ([0abdc85](0abdc85))
🎉 This PR is included in version 3.3.0-beta.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [3.3.0](3.2.0...3.3.0) (2023-02-22) ### Features * add setting a in-app event listener ([#147](#147)) ([5fd9559](5fd9559)) * in-app feature no longer requires orgId ([#163](#163)) ([fc2a08e](fc2a08e)) ### Bug Fixes * image not shown when image url in notification payload ([#172](#172)) ([0abdc85](0abdc85)) * moved shared wrapper code ([#158](#158)) ([51af98f](51af98f)) * remove currentRoute parameter in in-app event listener ([#159](#159)) ([688e4a5](688e4a5)) * rename in app listener keys ([#164](#164)) ([f540eaf](f540eaf)) * set gist dependency to use latest 3.X.Y version ([#170](#170)) ([a019c36](a019c36)) * set gist user token incase identifier exists ([#162](#162)) ([44cc4d1](44cc4d1)) * update CustomerIOFirebaseMessagingService to open ([#174](#174)) ([edce7f5](edce7f5)) * upgrade dependencies ([#146](#146)) ([6da8b8d](6da8b8d)) * use maven style dependency range syntax ([#171](#171)) ([ba83214](ba83214))
🎉 This PR is included in version 3.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
In the case of custom payload,
If the app is in the foreground,
Service
would receive payload, and we need to check fornotification.image
.More information : https://customerio.slack.com/archives/C02580R06/p1676625992450419
Complete each step to get your pull request merged in. Learn more about the workflow this project uses.