2

I used postman to make a HTTP request for sending push notification to a topic, I used this body information:

{
  "to" : "/topics/mahdi",
  "priority" : "high",
  "notification" : {
    "body" : "This is a Firebase Cloud Messaging Topic Message!",
    "title" : "FCM Message2"
  }
}

Of course I put the authorization key in the header and the request succeeded and get:

{"message_id":5081280333669625878}

But I did not receive the notification on my iOS device, where is the error please?

David
  • 3,392
  • 3
  • 36
  • 47

1 Answers1

1

Be sure you have

Edit: According to https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html, to make it work on background, you also have to set the following in the message:

"content-available":"1"
Community
  • 1
  • 1
J Manuel
  • 3,010
  • 22
  • 39
  • I did every suggestion but still not receive any notification – mahdi alajwadi Feb 15 '17 at 15:39
  • Even if you have the application open? Using the Firebase AppDelegate methods, you should be able to see the notifications in the Console Log. – J Manuel Feb 15 '17 at 15:43
  • Finally, i got the notification , but still can not see it when the app in foreground , i see it just in background – mahdi alajwadi Feb 15 '17 at 17:11
  • That's because you have to add to the JSON returned in the notification the tag "content-available":"1". Source: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html – J Manuel Feb 15 '17 at 17:34