All Projects → dkhamsing → apns-guide

dkhamsing / apns-guide

Licence: MIT license
🔔 Guide to setup APNS

Labels

Projects that are alternatives of or similar to apns-guide

nasa-react-redux
Guide: Build a React + Redux app
Stars: ✭ 28 (-65.85%)
Mutual labels:  guide
belajar.machinelearning.id
Tempat belajar Machine Learning dari Nol
Stars: ✭ 32 (-60.98%)
Mutual labels:  guide
js-stack-from-scratch
🌺 Russian translation of "JavaScript Stack from Scratch" from the React-Theming developers https://github.com/sm-react/react-theming
Stars: ✭ 394 (+380.49%)
Mutual labels:  guide
SAP-ABAP-Development
SAP ABAP development, customization and enhancement guides
Stars: ✭ 51 (-37.8%)
Mutual labels:  guide
php-gcm-apns
A PHP Library for sending messages to devices (Android & IOS) through GCM and Apns respectively .
Stars: ✭ 13 (-84.15%)
Mutual labels:  apns
Scambaiting-Setup
A full setup guide for scam-baiting with Oracle's VirtualBox.
Stars: ✭ 232 (+182.93%)
Mutual labels:  guide
guide-to-becoming
แหล่งรวบรวมข้อมูลสำหรับคนที่อยากจะพัฒนาตัวเองในด้านต่างๆจากผู้เริ่มต้นสู่ระดับเทพ
Stars: ✭ 23 (-71.95%)
Mutual labels:  guide
FindMyDoc
Documentations, manuels et guides d'utilisation
Stars: ✭ 36 (-56.1%)
Mutual labels:  guide
api-guidelines
Squareboat's best practices for writing REST API's.
Stars: ✭ 76 (-7.32%)
Mutual labels:  guide
kubernetes-basico
Demonstração dos componentes do Kubernetes
Stars: ✭ 26 (-68.29%)
Mutual labels:  guide
Understanding-Analysis-Abbott-Solutions
Unofficial solutions to Understanding Analysis by Stephen Abbott (1st Edition)
Stars: ✭ 85 (+3.66%)
Mutual labels:  guide
PY-NOOB
A repository of very simple Python programs to edit, change and learn basics of Python programming language.
Stars: ✭ 37 (-54.88%)
Mutual labels:  guide
epns
📱 Erlang Push Notifications. APNS(Apple Push Notifications) and FCM(Firebase Cloud Messaging) Push Notifications
Stars: ✭ 13 (-84.15%)
Mutual labels:  apns
docker-dca
Docker DCA (Docker Certified Associate) exam preparation guide
Stars: ✭ 26 (-68.29%)
Mutual labels:  guide
apns
Helpful extensions and abstractions for using APNSwift
Stars: ✭ 75 (-8.54%)
Mutual labels:  apns
hackathons
A collection of tips and tricks for using Twilio at hackathons
Stars: ✭ 35 (-57.32%)
Mutual labels:  guide
bitcoin-development-with-go
[Work in Progress] A little book on Bitcoin Development with Go (golang)
Stars: ✭ 19 (-76.83%)
Mutual labels:  guide
Playbook
The Nodes iOS team Playbook 📖
Stars: ✭ 18 (-78.05%)
Mutual labels:  guide
beatoraja-english-guide
Detailed guide for how to get started with beatoraja or BMS in general. -- For example: What is BMS, How do I set it up, Where do I download songs, How does the community work, How does the difficulty system work
Stars: ✭ 62 (-24.39%)
Mutual labels:  guide
command-line-quick-reference
quick reference on command line tools and techniques for the people with limited time
Stars: ✭ 331 (+303.66%)
Mutual labels:  guide

Apple Push Notification (APNS) Setup Guide

⚠️ Note this guide is quite old, additional resources below:

Guide to setup APNS - 2016

Steps

Create Certificates, Identifiers and Profiles

Log into the Apple Developer Member Center.

Create the App Identifier

  • Go to "Identifiers" -> "App IDs" and create a new one
  • Enter the name of your app and an explicit bundle ID
  • Ensure "Push Notifications" is checked under "App Services"
  • Click continue and submit to save the app identifier

Note: It may make sense to use separate bundle identifiers for development and production to allow devices to run both versions simultaneously.

Certificates

This guide uses the openssl command rather than Keychain Access because it's easier to script and works cross-platform.

  • Open up a terminal and enter the following line to setup your app name. This is a variable that will be used by the other commands in this section to help generate consistent filenames so please adapt it to fit your needs:

    APP="YourApp-Development-Push-Sandbox"
    
  • Create the private key and associated certificate signing request (CSR):

    openssl req -new -newkey rsa:2048 -nodes -out "$APP.certSigningRequest" -keyout "$APP.key.pem"
    

    Fill out your location information, the OU, Email Address, Challenge Password, and CN may all be left blank. Skip entering the export password.

  • Create the APNS sandbox certificate for development use:

    • After you've created the identifier, go to "Certificates" and add a new one
    • Select "Apple Push Notification service SSL (Sandbox)" and click continue
      • Note: In addition to the push certificate, you'll also need to generate a separate key, csr, and cert for signing the app for development and distribution with if you haven't already done so
    • Now select the App ID that corresponds to the certificate you're creating and click continue
    • In the next step, choose the CSR file you created
    • The last step will allow you to download the generated certificate, named "aps_development.cer" for the sandbox and "aps_production.cer" for production
    • Rename the certificate to match your key and CSR (optional but recommended):
    mv ~/Downloads/aps_development.cer "$APP.cer"
    
    • Create the P12 and PEM files with the private key and signed certificate:
    openssl x509 -in "$APP.cer" -inform der -outform pem -out "$APP.cert.pem"
    cat "$APP.cert.pem" "$APP.key.pem" > "$APP.pem"
    openssl pkcs12 -export -in "$APP.pem" -out $APP.p12 -name "$APP"    
    

    You'll must specify an export password when generating the pkcs12 file.

Create the production APNS certificate

In the above steps you created a key and CSR for the sandbox APNS. To create an adhoc/production version:

  • Follow the above steps
  • When generating the certificate, select "Apple Push Notification service SSL (Production)" instead of the Sandbox option
  • You should replace "Sandbox" with "Production" to know what type of push service each certificate is for

Setup production push service for the App Identifier

  • After creating the identifier, you'll need to setup the APNS certificate for production push notifications, to do this click on the production/ad-hoc App ID you created and click "Edit"
  • Click "Create Certificate" under "Production SSL Certificate"
  • Use the certificate signing request that you generated in the previous section

Devices

Go to "Devices" and add the device ID (UDID) for any devices you'd like to test with

Provisioning Profiles

  • Go to "Provisioning Profiles" and add a new one
  • Select "Ad Hoc" for the profile type (you will also want to create a provisioning profile for development purposes)
  • Select the Ad Hoc App ID you created
  • Select your signing certificate for distribution
    • Note: This is a different type of certificate than the APS certificates generated in this guide, but the OpenSSL steps to generate it (above) are the same
  • Select the devies you want to allow
  • Enter the profile name: YourApp Ad Hoc
  • Download the provisioning profile file and open it, which will import the file into "~/Library/MobileDevice/Provisioning Profiles/UUID.mobileprovision"

Final Steps

After following the above steps, you should files that are something similar to the following:

Production push key/certs:

  • YourApp-Development-Push-Production.cer
  • YourApp-Development-Push-Production.cert.pem
  • YourApp-Development-Push-Production.certSigningRequest
  • YourApp-Development-Push-Production.key.pem
  • YourApp-Development-Push-Production.p12
  • YourApp-Development-Push-Production.pem

Development push key/certs:

  • YourApp-Development-Push-Sandbox.cer
  • YourApp-Development-Push-Sandbox.cert.pem
  • YourApp-Development-Push-Sandbox.certSigningRequest
  • YourApp-Development-Push-Sandbox.key.pem
  • YourApp-Development-Push-Sandbox.p12
  • YourApp-Development-Push-Sandbox.pem

Provisioning profiles:

  • YourApp-Development.mobileprovision
  • YourApp-AdHoc.mobileprovision

Signing

In addition to the above files, you'll want to keep track of your own iOS signing certificates which are split out into development and production versions. For development, you can generally re-use these certifiates across all of the apps in your account but it may be advisable to create separate production signing certificates for App Store releases.

You may generate your signing certificates using the same openssl-based steps above for creating the push certificates. Note: If you used the above commands, you'll need to import the .cer and .p12 files into your keychain in order for Xcode to be able to sign your apps.

Testing

To test connecting to the APNS gateway (the development sandbox in this case):

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert YourApp-Development-Push.cert.pem -key YourApp-Development-Push.key.pem

APNS with over-the-air (OTA) Deployments

To get push notifications working with over-the-air builds, you need to create and use a production certificate. (The development certificates are intended to be used when installing your app directly from Xcode/organizer and will provide extra debug information.)

Tools

Here are some tools to help you with APNS 👍

  • Knuff: The debug application for Apple Push Notification Service
  • PEM: Automatically generate and renew your push notification profiles

Contact

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].