On Firebase:
Goto Settings > Project Settings > General
Scroll down to find the iOS app
Add Team ID & App Store ID
GoTo Cloud Messaging Tab & make sure you've uploaded the authentication keys (p8 file). The same is generated from Developer Console > Keys.
Also, make sure you have added the Team ID & App Store ID as well.
On Xcode:
I had faced the same issue on iOS and the authentication key(p8) file was missing & also the team IDs and App Store Ids were missing, adding which solved the problem for me.