Skip to content

Apple Push Notification Service

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.

APNs 등록하기

APNs등록을 위한 절차는 아래와 같다.

IOS_-_How_to_register_APNs_01.png

"Identifiers" 이동 후 등록된 App 선택.

IOS_-_How_to_register_APNs_02.png

하단의 "Edit"버튼 클릭.

IOS_-_How_to_register_APNs_03.png

"Push Notifications"에서 개발자(Development) 또는 배포(Production)
인증서 생성버튼(Create Certificate)을 클릭한다.

IOS_-_How_to_register_APNs_04.png

"Continue"버튼 클릭.

IOS_-_How_to_register_APNs_05.png

인증서 요청파일(CertificateSigningRequest.certSigningRequest)을 생성 및 선택한 후
"Generate"버튼 클릭.
인증서 요청파일 생성방법은 여기를 참조.

IOS_-_How_to_register_APNs_06.png

다운로드받는다.

아래와 같은 파일을 확인할 수 있다:

  • CertificateSigningRequest.certSigningRequest: 인증서 요청파일.
  • aps_development.cer 또는 aps_production.cer: Apple에서 발급한 APNs인증서.

P12 생성하기

APNs에 등록하기 위한 p12파일을 생성해야 한다.

IOS_-_How_to_generate_p12_01.png

다운받은 cer파일을 실행하여, 키체인에 등록 한다.

IOS_-_How_to_generate_p12_02.png

인증서 파일과 개인키 파일을 "보내기"한다.

IOS_-_How_to_generate_p12_03.png

"개인 정보 교환 (.p12)"을 선택한 후 파일이름을 입력한다.

IOS_-_How_to_generate_p12_04.png

p12파일의 암호를 입력한다.

아래와 같은 파일을 확인할 수 있다:

  • cert.p12: 개인정보 교환파일 (인증서)
  • key.p12: 개인정보 교환파일 (개인키)

PEM파일 생성

cert.pem: Base64 암호화 인증서 생성:

$ openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12

key.pem: Base64 암호화 개인키 생성:

$ openssl pkcs12 -nocerts -out key.pem -in key.p12

key.unencrypted.pem: RSA 개인키 암호제거:

$ openssl rsa -in key.pem -out key.unencrypted.pem

apns.pem: 병합된 인증서와 개인키(암호게거) 파일 병합.

$ cat cert.pem key.unencrypted.pem > ck.pem

See also

Favorite site

References


  1. Use_APNs_01.pdf 

  2. Use_APNs_02.pdf 

  3. Use_APNs_03.pdf 

  4. APNs_-_Register.pdf 

  5. APNs_-_Get_DeviceToken.pdf 

  6. 결론은, 인증서를 여러 개 등록하면 된다. 

  7. How_to_use_APNs_01.pdf 

  8. How_to_use_APNs_02.pdf 

  9. How_to_use_APNs_03.pdf 

  10. How_to_use_APNs_04.pdf 

  11. How_to_use_APNs_05.pdf 

  12. How_to_use_APNs_06.pdf 

  13. JAVA_-_GCM_and_APNS.pdf