React-native-fcm: [iOS] Not showing notification banner when app running in Background

Created on 17 Jun 2016  路  9Comments  路  Source: evollu/react-native-fcm

@evollu I have created a React Native Project and added the "react-native-fcm" for the Push Notification Support. In android i am able to run the app as expected.

But in iOS, if the app is in foreground, I am getting the notification(I have added some console.log in the "notification" event). But when I push the app background then I am not able to see the notification Banner.

Is I am missing anything?

Most helpful comment

post to https://fcm.googleapis.com/fcm/send

{
"to":"some_device_token",
  "content_available": true,
  "notification": {
      "title": "hello",
      "body": "yo",
      "click_action": "fcm.ACTION.HELLO"
  },
  "data": {
      "extra":"juice"
  },
  "priority": "high"
}

you also need to pass an authorization header

All 9 comments

APN sometimes delay the notification to save battery. Try add priority: 'high' into payload

@evollu May be I am sending the Payload in the wrong format. Can you share me the sample format of the message.
I am using FCM console to send the message.

post to https://fcm.googleapis.com/fcm/send

{
"to":"some_device_token",
  "content_available": true,
  "notification": {
      "title": "hello",
      "body": "yo",
      "click_action": "fcm.ACTION.HELLO"
  },
  "data": {
      "extra":"juice"
  },
  "priority": "high"
}

you also need to pass an authorization header

I am trying from Firebase console to send message. Following is the format I am using for sending the message. Is I am missing anything.

screen shot 2016-06-19 at 1 03 30 am

firebase console is limiting and I experienced some delay sometime too. Try to send with postman?
Also does app receive notification when it is killed?

Thanks @evollu. Issue is resolved now.

I was not using the proper certificate.

@ashwinpreet I am currently facing the same issue, can you describe your situation in more detail ?
I double checked my certificate but the banner still not showing. Any help will be appreciated.
Payload is exactly the same as suggested, Xcode capacity is opened too

Thanks @evollu and @ashwinpreet. Issue is resolved now.
I miss this code .
"notification": {
"title": "hello",
"body": "yo",
"click_action": "fcm.ACTION.HELLO"
},`

I am geting a callback in my code when I recieve a push notification, but when in background i cant see the banner or any any kind or notification that push notification has beeen recieved.

Was this page helpful?
0 / 5 - 0 ratings