0
votes

I've searched hours to find a solution for my problem. I added the Firebase Cloud Messaging to my app like in this tutorial:

https://firebase.google.com/docs/cloud-messaging/ios/client?authuser=0

  1. I've created an profile for the app inside the apple developer console
  2. created an APN Key inside the apple developer console (Key is valid for all team apps)
  3. created an new ios app entry inside the firebase console to the existing android app
  4. Added in the firebase console under project settings -> Cloud Messaging the APNs-Authenticationkey
  5. Installed all necessary pods via cocoapods
  6. Added the GoogleService-Info.plist to my project
  7. enabled the push notification in xcode/capabilities

Now in the Field:

I receive the messages when I sending from within the Firebase Console Website. On this way, there is no problem. The message arrive inside the iOS app function "didReceiveRemoteNotification".

But when I sending data from my remote server, the messages doesnt arrive inside my iOS app. Inside my Android-App all works perfectly with the remote server. iOS and Android app are using the same FCM Server Key, so normally it have to work.

I dont know how to solve this problem, have anybody an idea ?

1

1 Answers

0
votes

After some researches I've found the solution for my problem. All configurations was fine, the only think I've added was in the message body that I send from the remote server.

I`ve added "content_available" and "mutable_content" as true in the following way:

{
   "to":"device_token",
   "content_available":true,
   "mutable_content":true,
   "data": 
        {
           ...data...
        }
}

Now it works under iOS and I receive all messages from the remote server (implemented in Delphi on the legacy way).