I'm having a problem with getting FCM APNs to work in distribution (Ad Hoc). Everything works perfectly in development, but when I tried to build an Ad Hoc for testing, it doesn't work. Here is what I did:
1- I implemented FCM into my app following this guide: https://firebase.google.com/docs/cloud-messaging/ios/client. I confirmed it's working with development in all three states (background, foreground, killed).
2- I created a p8 key for APN and uploaded it successfully to Firebase.
3- I created an Apple Distribution certificate with a provisioning profile for Ad Hoc.
4- I added "Push Notifications" capability in Xcode
5- I built the Ad Hoc distribution.
6- I'm getting the notification token every time the app launches, so I'm sending my notifications to the right tokens.
What I tried:
1- Re-created all my certificates and provisioning files and rebuilt the app.
2- I tried sending test messages from my Firebase console, and nothing was delivered
3- I tried to make the app print a label whenever it gets a notification, but nothing is happening.
Here is my JSON payload:
{"aps" : {
"alert" : {
"title" : "Hello",
"body" : "World"
},
"content-available" : 1,
"sound" : "default",
"badge": 1
},
"person" : "John"}
As I said, everything works fine during development. Am I missing something? Is there an extra step I need to do for distribution?
Both development and distribution devices run on iOS 13, and I'm using Xcode 11.5
UPDATE:
After going through my Apple Developer account, I noticed this:
It doesn't list Ad Hoc under distribution support, does that mean APNs don't work with Ad Hoc?