Skip to content

[🐛] Android push notifications in background with images containing exif metadata sometimes rotated incorrectly #8423

@markoboras0712

Description

@markoboras0712

I have rn mobile app developed using https://expo.dev/ and for push notifications I'm using @react-native-firebase/messaging (background and terminated states).
Push notifications are sent through FCM via our backend.

Everything works as intended but I have issue on android devices.
Our push notifications contain images that are stored on amazon s3 buckets (example https://s3.us-east-1......./files/public/..../w700/1....jpg)

If you inspect exif metadata for this image you can see that it has orientation rotate 90 CW https://jimpl.com/results/Lz1h8ohTfFbK7o1QzvWHcrXQ?target=exif

Image

For background and terminated states I have in my app registered listeners setBackgroundMessageHandler and getInitialNotification where my push notifications are auto displayed correctly.

My issue is following:

  • If image stored on amazon s3 bucket has inside of it EXIF metadata, image in background and terminated states on android is rotated by 90 degrees.

NOTE:

  • I've recreated issue locally where I've created node js server to test this and if I strip from image exif metadata, reupload it, get image url and pass it in send of push notification, image is displayed correctly. Issue is that our system hundreds and hundreds of assets and they're coming from different sources.
  • If I send data-only push notifications auto display is ignored and I can display push notifications using https://notifee.app/ for background, foreground and terminated states, but I don't want to do that because I'm losing auto display feature and I need to handle a lot of more things inside of my mobile app.

Question

  • Can I somehow control to ignore EXIF metadata when image is auto displayed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions