waseefakhtar
waseefakhtar

Reputation: 1423

The Bundle ID in the certificate does not match the Bundle ID you entered

My Bundle ID of the certificate does not match the Bundle ID entered in the Firebase console and when I try to upload the certificate for Cloud Messaging. I get the error:

The Bundle ID in the certificate does not match the Bundle ID you entered.

My question is, what’d be the best way to match the Bundle IDs of my project in Xcode, Apple Developer Portal, and Firebase Console? Do I create a new app in iTunes Connect and then generate new certificates? Can I change Bundle IDs in Firebase Console or Apple Developer Portal? Or Can I simply create new certificates with the matching bundle IDs as it is in my Firebase Console without having to create a new app in iTunes Connect?

Upvotes: 34

Views: 30076

Answers (7)

Shihabudheen kp
Shihabudheen kp

Reputation: 1

How I had solved this issue : In Apple Developer > Keys : Removed old key, and regenerate new and able to download the p8 file and upload to APNs Authentication Key and works fine

Upvotes: 0

user1623521
user1623521

Reputation: 338

As for me, I was not uploading the correct .p12 file.

I had to go here first and create APN certificate: https://developer.apple.com/account/resources/certificates/list , then download it as .cer file, double-click it to be installed in KeyRing app, and then export it from KeyRing app into a .p12 file.

Upvotes: 0

sanjay singh Bisht
sanjay singh Bisht

Reputation: 171

Just additional in case which happened to me.

Make sure you are generating the .p2 file from Apple Push Notification service SSL Certificates.

If you try .p12 with other certificate you will get the bundledid mismatch issue.

Upvotes: 1

saurabh rathod
saurabh rathod

Reputation: 1278

Please remove all certificates related apns from keychain.And once again install it works.

Upvotes: 0

quirky purple
quirky purple

Reputation: 2219

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.

  1. 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).
  2. Right click and select export.
  3. On Firebase, go to Project Overview, find your iOS application and again press the 3 vertical dots and select Settings.
  4. 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.

Upvotes: 4

bobtune
bobtune

Reputation: 1386

The Firebase documentation regarding certificates is misleading. In the section Configure an App ID for Push Notifications under step 8 it tells you to expand the arrow and export the private key. Don't do this, just export the certificate itself (i.e. on the line above the private key) as a .p12 and it will work.

Upvotes: 125

Hemant Solanki
Hemant Solanki

Reputation: 912

Follow the instructions below.

Create new app in firebase console and add same bundle id for the app as you added in apple's developer account. this will fix your problem.

Or

Go to firebase console and update your project bundle id same as in apple's developer account.

Upvotes: 2

Related Questions