Skip to content
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

CustomerIOPushNotificationCallback isn’t called if the app is in the background and the notification doesn’t have a deep link #243

Open
tfcporciuncula opened this issue Jul 31, 2023 · 2 comments

Comments

@tfcporciuncula
Copy link

tfcporciuncula commented Jul 31, 2023

SDK version: 3.6.4

Environment: Development and Production

Are logs available?

There’s something interesting in the logs: while the app is in the background (open or closed), when I send a notification with deep link, I see this:

Received message with empty deliveryId
Handling push message. Bundle: …

But when the notification doesn’t have a deep link, I only see the first message, even though the notification shows up as usual:

Received message with empty deliveryId

So it’s like this is never being called for some reason?

Describe the bug

CustomerIOPushNotificationCallback isn’t being called if we send a notification without a deep link while the app is in the background (open or closed). It works fine if the app is in the foreground, or if the notification has a deep link.

To Reproduce

  • Make sure the app is not in the foreground (either kill it or keep it open but not in the foreground)
  • Send a notification message without a deep link
  • Observe CustomerIOPushNotificationCallback won’t be called

Expected behavior

CustomerIOPushNotificationCallback should always be called.

Additional context

I’ve reproduced this on a Pixel 4a running Android 13 so far.

@tfcporciuncula tfcporciuncula changed the title CustomerIOPushNotificationCallback isn’t called if the app is closed and the notification doesn’t have a deep link CustomerIOPushNotificationCallback isn’t called if the app is in the background and the notification doesn’t have a deep link Jul 31, 2023
@Shahroz16
Copy link
Contributor

Shahroz16 commented Jul 31, 2023

Hey @tfcporciuncula, thank you for reaching out and raising this.

I think I understand what might be happening here, I think you could verify it on your end as well.

So, when you add the deep link, and try previewing the payload from the dashboard, you would notice its a custom data payload object wrapped in data. That means our SDK gets to handle it,

But when you just have an image in there without the deep link, and if you preview from the dashboard, you would notice the data is under notification payload. That means FCM handles is different for foreground vs background.

I have raised this with the team, and we are looking into how we can update the flow if you send a push via rich push editor it should always be wrapped under the data payload.

A workaround for this work for the time being would be to just custom data payload, where you wrap your payload of title, body, and image under data and SDK should work properly or send a rich push with an empty or dummy deep link. Apologies for the inconvenience.

@tfcporciuncula
Copy link
Author

Yup, I’ve verified what you described on my end, thanks! And I agree the SDK should always work with data messages to keep the behavior consistent — I don’t see any good reason to have notification messages (where Firebase is responsible for the rendering) in the mix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants