I am adding this answer as a supplement to the accepted answer. If you receive this error, it is due to your applications bundle identifier not matching what you supplied to firebase when creating your firebase application.
To find your firebase bundle identifier:
Go to Firebase > Project Overview > Find your iOS application and press the 3 vertical dots on the right hand side and press Settings. You should be able to scroll down and find your Bundle ID listed
To find your apple bundle identifier:
Open Xcode, click on your top level project file and click on the General tab. Under signing, locate the Provisioning Profile and click on the 'i' icon on the right of the provided profile to view more information. Your bundle ID should be listed for both your application and for your developer account.
Your Firebase Bundle ID and Apple Bundle ID must match. If they do not, the easiest thing to do is just create a new application in Firebase. Do not forget this will require you to download the Google-Info.plist file again. Everything else should be straightforward.
Uploading the APNS certificate was not so straightforward on Firebase's documentation so I will write up how to do that also.
- Assuming you have generated the certificate and added it to the keychain, open Keychain Access app and right click on your APNS certificate (listed as Apple Development Push Services or similar).
- Right click and select export.
- On Firebase, go to Project Overview, find your iOS application and again press the 3 vertical dots and select Settings.
- At the top of this page, switch to the Cloud Messaging tab. You should see a section to upload your APNS certificate. You need to provide the password you created when exporting the Certificate in step 1&2.