1

I have a Firebase project with Cloud Messaging enabled. I'm using nodejs SDK with a service account to call admin.initializeApp() and so far I'm able to reach desktop Chrome, android Chrome, and the android example app as shown in firebase/quickstart-android.

However, I'm unable to reach a react-native built iOS app (running on testflight) from nodejs SDK. It is registered in the Firebase console The iOS app sends its notification/registration token to my nodejs backend, but when I try to interact with said token I keep getting

{
    "code": "messaging/registration-token-not-registered",
    "message": "Requested entity was not found."
}

The iOS app does receive messages built on the Firebase Console, so I guess that means it's configuration is fine.

The only explanation that comes to my mind is I should be using an APNS in my node sdk, but the documentation says that's only needed when manually building HTTP v1 requests, and that Node SDK should handle auth internally.

If I manually build an HTTP request using desktop, PWA, Android and iOS tokens

curl -X POST \
  https://fcm.googleapis.com/fcm/send \
  -H 'Authorization: key=AAAAxxxxfc:ASDFG' \
  -H 'Content-Type: application/json' \
  -d '{
    "registration_ids": [
        "crC4-mcUgl0:APA91b...", //<Chrome Desktop Token>"
        "dxye8zL0Ke4:APA91b...", //<Android Token>",
        "cgEuQzw7tzk:APA91b...", //<PWA Token>",
        "eIzMUZYYzEM:APA91b..." //<iOS Token>
    ],
    "notification": {
        "title": "Testing notification",
        "body": "Hey, does this message work?"
    }
}'

I get three success results and a failure for iOS saying "NotRegistered".

  • So... is it because I'm missing an APNS certificate in the request?
  • Is it because the iOS app is running on testflight?
  • Should the iOS app perform an additional request or provide an additional permission in its code?
  • Should the service account bear a special permission for iOS apps?
ffflabs
  • 17,166
  • 5
  • 51
  • 77
  • In case anybody cares, this problem went away by itself. According to the person in charge of the iOS app, he didn't made any changes. I guess it will remain a mistery. – ffflabs Jun 21 '19 at 15:02

0 Answers0