1

I'm using Appery platform to develop hybrid Apps. For one of the Apps that is already published to Apple Store, I want to enable Push Notifications. The devices are being registered correctly with DeviceID and Token. However, when I try to send push notifications, they do not go through, and platform only returns this error which does not reveal much to me:

Description: Unrecoverable error occurred while trying to communicate with Apple servers: null Devices count: 100

I tried all possible attempst to solve this problem in futile. Most of the tutorials and questions are about creating new App with Push Notification enabled, and not about enabling Push notification to already published App. Therefore, it created a fair amount of confusion as where should I start from and what should I update and what should I leave (e.g., I cannot start from the scratch, my App already registered with an App ID)

Here I describe the steps I've taken to enable PN for my App

  1. In Apple developer account, I chose App IDs from Identifiers menu, and I chose my targeted App ID, clicked Edit , ticked Push Notification option and it became configurable with yellow bulb.
  2. Then, in the same page, I clicked Create Certificate under Production SSL Certificate.
  3. I uploaded the CSR file that I created long time ago when I published the App. I downloaded the aps_production.cer file
  4. As pointed out here, I double clicked on aps_production.cer file to install it in the Keychain Access application, and I can see `Apple Production IOS Push Service certificate and the private key below it in Keychain.
  5. Right clicked on the certificate in Keychain and exported .p12 file
  6. Back to Apple developer: under provisioning profiles menu, I chose distribution and created new provisioning profile: Distribution -> App Store option -> Continue -> my App ID continue -> The certificate my App used when I published first time (The certificate here is not SSL push notification certificate I generated just now. It is the certificate that was created when I published the App first time).
  7. I downloaded the provisioning profile.
  8. I add all certificates to my platform (basically, .p12 file and provisioning profile. Bundle ID is the same). Then, I generated xcode project which I open in xCode
  9. In xCode, under code Signing I chose the certificate that I created the App with (it is the only option displayed), and I double clicked on my provisioning profile so it appears provisioning profile options (I'm very skeptical about this step though). I built and validated the project successfully, submitted it to App store, it appeared under prerelease section, and Test Flight invitation is received.
  10. I downloaded the App on iPhone and iPad, once I launched the App, I could see it being registered correctly at the backend.
  11. When I send push notification (from Appery Platform) I get the error above
  12. Appery support informed me that is something has to do with the certifications mismatch

Now my question is, what is in my steps causing the error? What is missing or not being done properly?

These are other references I used trying to solve the problem

Community
  • 1
  • 1
Hawk
  • 5,060
  • 12
  • 49
  • 74

3 Answers3

0

I can't remember clearly but you need to convert p12 (like in the link above) and have the converted file and will run on the server. Something like this.

Shklyar
  • 140
  • 1
  • 12
0

I'm not sure but I think problem maybe at step 4 & 5. Let try my steps:

  1. Expand this option then right click on “Apple Development Push Services” > Export “Apple Development Push Services ID123″. Save this as apns-dev-cert.p12 file somewhere you can acess it.

  2. Do the same again for the “Private Key” that was revealed when you expanded “Apple Development Push Services” ensuring you save it as apns-dev-key.p12 file.

  3. These files now need to be converted to the PEM format by executing this command from the terminal:

openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

If you wish to remove the passphrase, either do not set one when exporting/converting or execute:

openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem

Finally, you need to combine the key and cert files into a apns-dev.pem file we will use when connecting to APNS:

cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem

Hope it help.

Mục Đồng
  • 216
  • 1
  • 12
0
Step1 :

enter image description here

Go to Apple development account and in the Certificate press the PLUS button and follow the steps.

Under Production, select the

“Apple Push Notification service SSL (Sandbox & Production)”

checkbox, then click Continue.

enter image description here

Upload CSR certificate and continue...

enter image description here Launch Keychain Access.

In the Category section, select My Certificates.

Find the certificate you want to export and disclose its contents.

You’ll see both a certificate and a private key.

Select both the certificate and the key, and choose File > Export Items.

From the File Format pop-up menu, choose a file format that your server accepts.

Enter a filename in the Save As field, and click Save.

The certificate and key are saved to the location you specified as a text file in the Personal Information Exchange format (a file with a .p12 file extension).

Follow the Link

Niraj Paul
  • 1,498
  • 14
  • 22