Reputation: 1452
FCM service isn't delivering messages to my iOS app.
App CAN successfully receive both APNs token and Instance ID token
App CAN successfully receive pushes in background from APNs using Push Notification utility utilizing .p8 token
Same APNs key used in #2 is uploaded in Firebase console
App CAN'T receive messages sent from Notification Composer in Firebase Console, as well as it CAN'T receive messages using CURL requests.
App simply not showing any messages when sending through FCM
Tried creating new Firebase account and reassigning project to it - nothing changed. However when I created new project and new firebase account from scratch - worked fine.
According to this debug helper article I'm stuck on step 5. While sending CURL using FCM response is successfull, but message isn't shown.
https://firebase.googleblog.com/2017/01/debugging-firebase-cloud-messaging-on.html
curl --header "Content-Type: application/json" \
--header "Authorization: key=AAAA long server key" \
https://fcm.googleapis.com/fcm/send \
-d '{"notification": {"body": "Hello from curl via FCM!", "sound": "default"},
"priority": "high",
"to": "valid instance ID token"}'
{"multicast_id":6968188796954352053,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1546017076321077%73b1f8ed73b1f8ed"}]}
Upvotes: 1
Views: 1149
Reputation: 1452
Problem was in line: >> FirebaseApp.configure()
It was in AppDelegate init() method. For all other Firebase related functionality it was fine to have it there. However for pushes it is critical to put this code in application(_:didFinishLaunchingWithOptions)
Upvotes: 1