Fail to upload iOS APNs Certificate on Firebase - ios

I can't upload my production APNs Certicate on Firebase. There was an error reading your certificate.
I can't find out the cause of this error.

You should select only the certificate and don't select the private key . See this screenshot

I experienced the same issue before due to not proper "Certificate Signing Request". You may miss the Common name when you create a "Certificate Signing Request" or you may mentioned any other mails that didn't include in your xcode as developer Account.
Please try to put a common name and do the process again to create a new APN Certificate.

I think you make some mistake's to create the certificate. Follow this link to create certificate correctly and try.

In my case I have faced this issue because I was exported 2 items Apple Development Push Services along with private key, and uploaded .p12 file to firebase. Then it said there was an error reading your certificate.
So the solution is don't export private key along with Apple Development Push Services item. Now generated .p12 file uploaded in Firebase. And the upload was successful.
Hope it will help to someone.

Related

The APNs certificate provided does not match the current environment

It's my first time to update one app in app store after implementing the Firebase push notifications in the project. I'm trying to upload the "Production Certificate" in Firebase Console, but it gives me this:
The APNs certificate provided does not match the current environment
I want to make sure that after updating the app users will receive notifications.
Any link with tutorial to update one app in appstore is welcome.
The mistake I was making was that I was exporting the "private key" part of the certificate in Keychain Access instead of the "certificate" part. As soon as I re exported the .p12 using the correct item - it worked.
Please refer to the answer given here
The other possibility is:
You are confusing the development certificate with Production one in the certificate list of Key Chain Access.
Try to "Export" from the correct one.
This is what brought me here :)

Firebase: Cannot upload production APNs certificate

I am currently testing an app in TestFlight and need a production APNs certificate in order to test Notifications in Firebase.
I have followed all of the steps in this video and successfully configured the development APNs certificate:
https://www.youtube.com/watch?v=LBw5tuTvKd4
I've also checked that my steps following the Firebase support guide. Although I note that the Apple Developer site has changed slightly since this guide was written:
https://firebase.google.com/docs/cloud-messaging/ios/certs#configure_an_app_id_for_push_notifications
I have generated a production APNs certificate at developer.apple.com using the same method as the development certificate but when I try to upload the .p12 file to Firebase, it gives me the following error:
"The certificate environment did not match. Ensure that you got the right development or production APNS certificate."
I'm definitely uploading a .p12 generated from a production APNS certificate, is there something else I need to do for a production certificate?
Solved. The mistake I was making was that I was exporting the "private key" part of the certificate in Keychain Access instead of the "certificate" part. As soon as I re exported the .p12 using the correct row in the list - it worked.
Images to illustrate below credit iOS
Correct method:
try this
make .csr file and download cert from developer.apple.com
while exporting select private key and certificate both at a same time and export to .p12 with any passphase.
upload tht .p12 file on firebase console.
Thanks
Don't select private ket in key chain, directly select certificate and create production certificate.
1) Don't select private ket in key chain.
2) Directly select certificate and create production certificate
I am facing the same problem and i have tried all above mentioned solution but nothing works for me than i delete certificate from keychain access and again download certificate and install it than export and try to upload it. It works for me.
When I tried the solution suggested here, nothing works (This probably means I am doing right). I solved this issue by replacing Chrome (The application is running for a very long time) with Safari (I invoke the application just for this purpose) for the upload.
That means, if restart Chrome might also work.
FYI.
In my case I wanted to upload a production certificate to Firebase, and after trying everything I finally realized that I had created a development certificate on iOS Developer...
There might be an inssue of semantics in some cases, so pay attention to meaning.
When you have to upload the certificates in firebase console there are 2 boxes with placeholder text which read:
1. No development APNs certificate
2. No production APNs certificate
In my case, I had understood that I must not upload a development APNs certificate in box 1. Actually, firebase meant that no development Apns certificate has been uploaded yet and that I could upload my certificate.
I was having this problem after my previous p12 had expired, I was trying to upload as a new certificate and was getting the “does not match the current environment” error but it uploaded fine once I updated the expired p12 with the new p12 instead of trying to upload the new one alongside the expired one.

ios pushwoosh implementation error

i have download the sample of ios pushwoosh-phonegap on my mac and i want to run on the device, but it gave me this error that pushwoosh/pushnotificationmanager.h is not found. What is the problem?
and ther is another problem, when i configure the ios on pushwoosh site, it said that can't generate the certificate. i have the apn certificate on the key, i exported .cer file. also i try to upload the download version of the certificate. same error. should i upload the dev certificate. i use free account , so i canot make auto configuration. any help, and Thx.
That's strange, I've just tried the sample and it worked well.
Do you see Pushwoosh.framework added to your project?
Also the other way is to use Phonegap/Cordova CLI to add the plugin using this guide:
http://www.pushwoosh.com/programming-push-notification/ios/ios-additional-platforms/push-notification-sdk-integration-for-phonegap/
When uploading the certificate make sure you upload APN certificate not your developers certificate. It should come as .p12 (that's export from your keychain) and .cer file.
This guide might help:
http://www.pushwoosh.com/programming-push-notification/ios/ios-configuration-guide/

Certificate stuff in iOS MDM operation

Now I'm trying to make an MDM server which manages iOS devices using APNS push notifications.
So far I went over number of Apple official documents about configuration profile, mdm protocol, APNS push and etc.
But some of the steps necessary for the MDM full flow, I can't figure out clearly.
APNS certificate which MDM server has to use for push notification
Who(Vendor? or customer?) creates CSR and who(Vendor? or customer?) generates APNS certificate by uploading the CSR in Apple Push Portal?
(What the Apple document says and what Google says are not matching each other..)
Identity certificate which has to be contained in Configuration Profile
How to create the identity certificate and in where?
How to include it in the Configuration Profile using iPCU?
Searching on web I could see pretty lots of information about these but not all of them says consistent answer, so I got to feel more dizzy. :-(
Any piece of help/information will be appreciated.
Thanks.. :-)
I have some basic points in order to generate a MDM certificate.
MDM certificate is use to manage the enrolled device.
The policies will work over the air(APNS).
The Server-Clint communication will happened through APNS.
I am going to answer your questions below.
Q: APNS certificate which MDM server has to use for push notification:
A: In order to manage the iOS device you need to install the profile in server.
First of all you need to create the CSR in your server using IIS manager.
After generate the CSR file you need to sign by any third party vendor,then you will get the .SCSR file. Hear the vendor will sign your CSR using a private key.
Once have the .SCSR you need to upload the file to apple push cert site.
After upload the SCSR file you will get the .PEM file.
Once have the .PEM file need to complete the request using IIS manager.
Your certificate will visible in the certificate list.Right click on the certificate and export with password.
Hear the customer means whoever creating the CSR.Vendor means the certificate whoever signing.
Feel free to ask the questions if you are not clear.
I have prepared some basic steps for you to configure Push notification as follows :
Go to Developer.apple.com
Check with Member centre
Navigate to iOS provisioning portal
check if app id exists
Create new app id
select created app (configure)
Enable push notification and in app
CSR from apple MAC user with keychain app(give account creds)
Enter CSR and generate
Download production certificate
Give this to MAC user again to generate p12 file
Provisioning go to distribution
Create New Distribution profile
Profile name is “APP name (space) Dist”
Hope this will help you.. Please feel free to ask if anything is not clear to you.
You can't much info regarding this. But I will tell you, use iPCU for creating config profiles. Use a server for sending these config profiles as a response.
Use a separate server for CA and issuing the authority.
You(Vendor/Customer) have to create a APNS certificate and you have to use it in the server, for sending push notification.
Let me know whether you have found a breakthrough or still you struck somewhere

Apple MDM Vendor genenrated plist file is invalidate when upload to apple push certificate port

I create the plist file step by http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning, but when i post this plist file to apple push certificate port, it failed and reported as invalide servicetype, service type invalidate null, can anyone help me? Thanks very much!!!
Do you get the vendor's certificate and private key? You should upload the plist_encoded file but not the plist.xml file.
I was dealing exactly the same error a few days ago, it's surprisingly true that "ServiceType null" is the only logging statement for this problem, good job Apple...
So you need to check a few things to get it working:
make sure the account you are using is an enterprise one WITH the mdm option checked when first purchased.
when choosing the type of certificate when creating mdm certificate, make sure you use the MDM CSR one under Production, not "Apple Push Notification service SSL (sandbox)" under Development or any other one.
also as Kun said, use the encoded_plist, but if you do use the plist.xml, I think you will get another type of error saying "Invalid signing request"
Hope this helps, good luck.

Resources