iOS Question Problem With Certificate

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hello,

I created an app using Firebase Notifications Service and published in App Store without any problem, with everything working. Now, I need to create another app using FCN and noticed that one of signing files for Firebase Service has the same name (app.cer). Then, I built a new keys directory and started the same process for the new app. (I followed exactly the same tutorial here: https://www.b4x.com/android/forum/t...h-messages-server-not-required.68645/#content)
But when I try to compile the new app I'm receiving this error from remote host:

error: Missing private key for signing certificate. Failed to locate the private key matching certificate "iPhone Distribution: MARCOS MOREIRA ALVES (624YJ22R62)" in the keychain. To sign with this signing certificate, install its private key in your keychain. If you don't have the private key, select a different signing certificate for CODE_SIGN_IDENTITY in the build settings editor. (in target 'B4iProject' from project 'B4iProject')

I reviewed many times and couldn't have success. The previous app (published in app store) is being compiled normally yet . Does anybody can help? What is this "private key" the server is requiring?

Thanks!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Best to always use the same keys folder. Just give the certificates and provision profiles a different name and set it in the project with #ProvisionFile and #CertificateFile attributes.

 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Best to always use the same keys folder. Just give the certificates and provision profiles a different name and set it in the project with #ProvisionFile and #CertificateFile attributes.

Thanks @Erel . I'll check and try again. I created a new directory because, like I told, it looks that is required one app.cer for each app (and the name must to be app.cer to create Firebase push Key).
I'll try to use the thread that u recommend.

Thanks .
 
Last edited:
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Best to always use the same keys folder. Just give the certificates and provision profiles a different name and set it in the project with #ProvisionFile and #CertificateFile attributes.

Ok... following step by step tutorial I think that there is a point that isn't very clear. Specifically: when creating a new certificate with a non wildcard app id it generates a new aps.cer file. In the tutorial you overwrites the old aps.cer file in the keys folder (see image). But the old app file is used by the other app (in my case, active in play store). Then, if I want to rebuild/recompile a new version of the old app I'll need to download again its specific app.cer file OR to reserve it in a separated folder before overwrite... that's it?
(I remember, that was the reason because I created a new keys folder...). Am I understanding something wrong?

1618404771494.png
 
Last edited:
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Have you tried using the new Authentication Certificates? It is much simpler and you no longer have to update the keys ona yearly basis.

 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Have you tried using the new Authentication Certificates? It is much simpler and you no longer have to update the keys ona yearly basis.

In the first app that uses FCN I followed the FCN B4i tutorial but also uploaded the firebase_push.p12 key to Firebase. It's working... I don't know if the keys files/authentication created using the tutorial and the configuration with Firebase is enough (the p12 key maybe is redundant...), but I can't test it now either (because it's a production app and it is working).
I'll test in this new app before to publish.
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
I agree it is better not to test on a live system.

However, as my current .p12 certificates expire, I have been converting to the new Authentication certificate without any problems.
(I have several customer apps which use Push notifications)
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
I agree it is better not to test on a live system.

However, as my current .p12 certificates expire, I have been converting to the new Authentication certificate without any problems.
(I have several customer apps which use Push notifications)
I noticed that if you follow the steps in @Erel FirebaseNotifications / Push Messages tutorial, it looks that your system is already using the new Authentication certificate (although you can generate and upload .p12 to Firebase yet).
Then, if I only remove the .p12 file that I uploaded to Firebase will FCN already be using the new method? Is there any other specific process to instruct the Firebase Structure to ignore .p12 file? It's not clear to me...

Thanks!

@Andrew (Digitwell) ... never mind... I didn't pay attention to this:?
[
 
Last edited:
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
I agree it is better not to test on a live system.

However, as my current .p12 certificates expire, I have been converting to the new Authentication certificate without any problems.
(I have several customer apps which use Push notifications)
Update . I tried the new Authentication certificate in a new app development, replacing the .p12 that was already working. At the first time I thought that didn't work but it looks that Firebase spends a couple minutes to really propagate the new configuration after certificates update (this is an important observation to developers when migrating from .p12 to APN key, specially if you are in a production environment - stress is high during this minutes ?, you know - advice: sit back, take a coffee and relax for a few minutes after updating)
After about 3 minutes the notifications are arriving again!
Thanks for your help @Andrew (Digitwell) and @Erel .

Regards!
 
Upvote 0
Top