Solved

Android devices not receiving push notifications

  • 26 February 2024
  • 4 replies
  • 143 views

Hello!

 

I followed the react-native SDK integrations tutorials, in order to send rich push notifications to my react-native app.

 

However when I add a deep link or an image to my notification template in the campaign, the android devices stop to receive the notifications. On iOS devices the notifications are being received, this problem only occurs on Android.

 

If I remove the deep link/image from the push notification, then the Android devices start to receive the notifications again…

 

I'm looking for help to understand what could be causing this problem...

icon

Best answer by Penny 28 February 2024, 09:11

View original

4 replies

Userlevel 4

Hi @antonioribeiro ,

First, we would encourage that you update your React Native SDKs to the latest version 3.5.1: https://github.com/customerio/customerio-reactnative/releases/tag/3.5.1

 

At the same time, for your push notification where you’re sending, would you be able to check the payload format? Per our documentation: https://customer.io/docs/journeys/send-push/#standard-payload:

When you send a push notification containing an image or a link, we place the entire payload in the data object.

{
"message": {
//rich push
"data": {
"title": "string", //(optional) The title of the notification
"body": "string", //The message you want to send
"image": "string", //https URL to an image you want to include in the notification
"link": "string", //Deep link in the format remote-habits://deep?message=hello&message2=world

// other "custom keys" are sent inside this object
}
}
}

This has a different payload format from a simple notification—a notification without an image, link, or custom keys where your notification’s title and body will go in the message.notification object.

If you’ve integrated with our SDKs, you should use our Rich Push editor, which should do this for you so you don’t have to customise your own payload.

Hopefully, this will help to move you along in the right direction and unblock you!

First, we would encourage that you update your React Native SDKs to the latest version 3.5.1: https://github.com/customerio/customerio-reactnative/releases/tag/3.5.1

[...]

If you’ve integrated with our SDKs, you should use our Rich Push editor, which should do this for you so you don’t have to customise your own payload.

 

Hi @Penny! thank you for the reply.

I am already using the latest version of the React-Native SDK (3.5.1) and also am using the Rich Push editor on the message template in my campaign.

Whenever I fill the Rich Push editor's link field or attach an image to the push notification, my android devices stops to receive them.

Userlevel 4

Thanks for clarifying this @antonioribeiro ! The next thing to check would be whether you’re using multiple push providers like expo-notificationsreact-native-push-notification, or rnfirebase, as these modules may take over push handling by default and prevent your app from receiving push notifications from Customer.io.

 

In the event that you are, using one of the solutions documented here should help to resolve the problem: https://customer.io/docs/sdk/react-native/push-notifications/multiple-push-providers/ 😊

Thanks for clarifying this @antonioribeiro ! The next thing to check would be whether you’re using multiple push providers like expo-notificationsreact-native-push-notification, or rnfirebase, as these modules may take over push handling by default and prevent your app from receiving push notifications from Customer.io.

 

In the event that you are, using one of the solutions documented here should help to resolve the problem: https://customer.io/docs/sdk/react-native/push-notifications/multiple-push-providers/ 😊

 

 

Turns out I missed the background listener suggestion on the first option in the link you provided. After adding those changes to my index.js it started to work!!!

 

Thank you very much, @Penny ! I really appreciate your help 😁

Reply