1

Today in the morning I tried to upload a new build with some bug fixes for my iOS Application to AppStore, Archiving the binary was successful but I couldn't upload it to itunesConnect for publishing. The error was related to some distribution certificate so I got a hint about the issue.

While going through the Keychain Access, I saw that my iOS Distribution certificate just expired in the morning.

I logged into my developer account and created a new distribution certificate and installed it to my keychain. But after this new certificate, my push notifications aren't working anymore.

I don't receive any kind of push notifications (with payload or simple notification) on my app. I can see the notification and data payload in logs.

I've read some other posts saying that this second method is deprecated and is no longer reliable but It was working fine before the certificate update. So I don't understand what happened here. Or am I missing some other things to configure after the certificate update like provisioning profiles or maybe my APNs certificates (but I just recently switched to APNS auth key.p8)

I logged notification and payload in didReceive remoteMessage method in Appdelegate. But didReceiveRemoteNotification is never called.

Other than this Distribution Certificate, my developer certificate was expiring as well so I revoked it through dev account and generated a new one and installed it in the Xcode.

Xcode Version 10.1 (10B61) - Swift 4.2 - TestDevice iPhone X with iOS 11.2.6

Joe
  • 173
  • 1
  • 15
  • 2
    You need to re-create the pem file from your new certificates. – Sarabjit Singh Feb 20 '19 at 06:44
  • @SarabjitSingh can you please go in a bit detail? – Joe Feb 20 '19 at 06:45
  • as @SarabjitSingh mentioned, create pem files for push notification using new certificate - https://stackoverflow.com/questions/21250510/generate-pem-file-used-to-setup-apple-push-notification – Akhilrajtr Feb 20 '19 at 06:49
  • @Joe please create p12 from your new certificates and then convert it into pem and then use this pem with your notification part. – Sarabjit Singh Feb 20 '19 at 06:53
  • And please follow @Akhilrajtr comment. – Sarabjit Singh Feb 20 '19 at 06:54
  • @Akhilrajtr correct me if I'm wrong. this process will generate a new certificate and after downloading I'll have to install, export the *.p12 file and then upload it to firebase project settings to make it work but I just switched from these different certificates for my different apps to one signle APNs auth key *.p8 file. – Joe Feb 20 '19 at 06:58

3 Answers3

0

You need to generate .pem file using new distributed certificate, then using this pem file to receive push notification.

Create .pem file (follow steps from this post)

https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/

Test online push notification using pem file

http://apns-gcm.bryantan.info/

OR

https://www.logisticinfotech.com/send-push-notification-online/

AtulParmar
  • 4,358
  • 1
  • 24
  • 45
0

You can follow this link for push certificate.

For testing the push notifications you can use Pusher

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
0

Okay i fixed the issue by deleting any of the existing instances of certificates related to my THIS App in keychain Access and from Certificates Page on developer account.

From App-IDs on Certificates page of dev account, reconfigured the push notifications SSL Certificates for my App by Generating one online, downloading, installing in keychains, exporting .p12 certificate and uploading to firebase project settings. Repeat the same for production SSL Certificates as well.

i'm using POSTMAN client to send Data Payload notifications to my app and its working now. I'm receiving all notifications without any issues now.

But strangely didReceiveRemoteNotification is still not invoked. I'll look into it and see whats the issue now because here i'm implementing saving notifications to local storage for later viewing.

Joe
  • 173
  • 1
  • 15
  • so I guess there were some certificates still pointing to old distribution and developer certificate. – Joe Feb 20 '19 at 09:59