Fix: IOS Push Notifications Not Showing Profile Pictures
Hey guys! So, we've got a situation where profile pictures aren't showing up in iOS push notifications in the Expensify app. Let's dive into the details and see what's going on.
Before we get started, if you're looking to contribute, make sure to check out the contributing guidelines for onboarding. Also, feel free to email contributors@expensify.com to request to join our Slack channel. We're always happy to have more hands on deck!
Version Number: 9.2.28-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: Stack Overflow Expensify/Expensify Issue URL: Issue reported by: @AndrewGable Slack conversation: #Expensify Bugs
Steps to Reproduce
Let's walk through the exact steps to reproduce this issue. This will help anyone trying to fix it to see the problem firsthand.
- Set Profile Picture: First, as User A, go into your settings and set a profile picture. Make sure it's something easily recognizable.
- Send a Message: Next, send a message from User A to User B. Just a simple "Hey!" will do.
- Observe Push Notification: Now, as User B, check the push notification you receive. The expectation is to see User A's profile picture alongside the notification.
Expected vs. Actual Results
Expected Result: The push notification should display the profile avatar of the user who sent the message (User A in this case).
Actual Result: The push notification doesn't display the profile avatar. Instead, it shows a generic icon or nothing at all where the avatar should be. This is definitely not ideal, as profile pictures help users quickly identify who sent the message.
Impact
The impact of this issue is primarily on user experience. Seeing the profile picture in the push notification allows users to quickly glance and know who sent the message without even opening the app. This small visual cue can significantly improve the user's perception of the app's responsiveness and ease of use.
Without the profile picture, users have to rely on the sender's name, which requires a bit more cognitive effort. It might seem minor, but these little details add up to create a smoother, more enjoyable user experience. For a fast-paced app like Expensify, where users are constantly managing expenses and communicating, every second counts!
Potential Causes
Let's brainstorm some potential reasons why this might be happening. Understanding the underlying cause is crucial for fixing the bug efficiently.
- Image Loading Issues: The app might be failing to load the profile picture URL correctly when generating the push notification. This could be due to network issues, incorrect URL formatting, or problems with the image server.
- Caching Problems: The push notification service might be caching older versions of the user's profile, or failing to update when a new profile picture is set. This could lead to inconsistencies between the user's current profile picture and what's displayed in the notification.
- Data Serialization Errors: When the app prepares the data for the push notification, the profile picture URL might not be serialized correctly, leading to the URL being lost or corrupted during transmission.
- Platform-Specific Issues: There might be specific issues with how iOS handles images in push notifications. Different platforms have different requirements and limitations, so it's possible that the code needs to be adjusted specifically for iOS.
Possible Solutions
Based on the potential causes, here are some possible solutions we could try.
- Verify Image URL: Double-check that the image URL being used in the push notification is correct and accessible. Try loading the URL directly in a browser to ensure that the image is actually there.
- Implement Caching Mechanisms: If caching is the issue, implement a more robust caching mechanism that ensures the push notification service always has the latest version of the user's profile picture. This might involve using cache invalidation techniques or setting appropriate cache expiration times.
- Review Data Serialization: Carefully review the code that serializes the data for the push notification. Make sure that the profile picture URL is being handled correctly and that there are no errors during serialization.
- Test on Multiple Devices: Test the push notifications on different iOS devices and versions. This will help identify any platform-specific issues and ensure that the fix works consistently across all devices.
Workaround
Unfortunately, there is currently no known workaround for this issue. Users will simply have to rely on the sender's name in the push notification to identify who sent the message.
Platforms Affected
The issue has been reproduced on the following platforms:
- [x] iOS: App
Here's a breakdown of the platforms tested:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Unfortunately, no screenshots or videos were provided in the original report. If anyone has any visual evidence of this issue, please add it to the report!
Conclusion
So, there you have it! iOS push notifications aren't displaying profile pictures in the Expensify app. This is a known issue that affects user experience, and we're working on finding a solution. Stay tuned for updates!
If you're interested in contributing to Expensify, check out the open jobs on GitHub: View all open jobs on GitHub
Thanks for reading, and happy coding! 🚀