Apple Push Notification Service
lastmod 2018-08-17created 2014-04-1618 edits
The Apple Push Notification Service is a service created by Apple Inc. that was launched together with iOS 3.0 on June 17, 2009. It uses push technology through a constantly open IP connection to forward notifications from the servers of third party applications to the Apple devices; such notifications may include badges, sounds or custom text alerts. In iOS 5, Notification Center enhanced the user experience of push and local notifications. APNs was also added as an API to Mac OS X v10.7 "Lion" for developers to take advantage of, and was greatly improved in OS X 10.8 "Mountain Lion" with the introduction of Notification Center.
Registering APNs
The procedure for registering APNs is as follows.
| | Go to "Identifiers" and select the registered App. |
| | Click the "Edit" button at the bottom. |
| | Under "Push Notifications", click the Development or Production |
| | Click the "Continue" button. |
| | Create and select the certificate request file (CertificateSigningRequest.certSigningRequest), then |
| | Download it. |
You can see the following files:
- CertificateSigningRequest.certSigningRequest: certificate request file.
- aps_development.cer or aps_production.cer: APNs certificate issued by Apple.
Generating P12
You need to generate a p12 file to register with APNs.
| | Open the downloaded cer file to add it to the keychain. |
| | "Export" the certificate file and the private key file. |
| | Select "Personal Information Exchange (.p12)" and enter a file name. |
| | Enter a password for the p12 file. |
You can see the following files:
- cert.p12: Personal Information Exchange file (certificate)
- key.p12: Personal Information Exchange file (private key)
Generating PEM files
cert.pem: generate the Base64 encrypted certificate:
key.pem: generate the Base64 encrypted private key:
key.unencrypted.pem: remove the password from the RSA private key:
apns.pem: merge the certificate and private key (password removed) files.
See also
Favorite site
- Wikipedia (en) description of APNs
- APNS step-by-step series
- [Recommended] APNS step-by-step series (creating certificates) 1
- [Recommended] APNS step-by-step series (configuring iOS) 2
- [Recommended] APNS step-by-step series (configuring the provider) 3
References
-
Use_APNs_01.pdf ↩
-
Use_APNs_02.pdf ↩
-
Use_APNs_03.pdf ↩
-
APNs_-_Register.pdf ↩
-
APNs_-_Get_DeviceToken.pdf ↩
-
In conclusion, you just need to register multiple certificates. ↩
-
How_to_use_APNs_01.pdf ↩
-
How_to_use_APNs_02.pdf ↩
-
How_to_use_APNs_03.pdf ↩
-
How_to_use_APNs_04.pdf ↩
-
How_to_use_APNs_05.pdf ↩
-
How_to_use_APNs_06.pdf ↩
-
JAVA_-_GCM_and_APNS.pdf ↩