ios – How to implement an Apple APNS push notification services?

Question:

I have a web service , and I would like to create a Push Notification service for an app using Apple's APNS, without using the third-party service, how could I do that?

Answer:

Basically you have to implement this system on your server. The notifications process consists of the following steps:

  • At the beginning of the application you ask the "Apple servers" to register the device to accept notifications.
  • From that request you receive a token referring to your device.
  • You send that token to your server, which will store it.
  • Whenever your server thinks it needs to send notifications to devices, it makes a request to Apple's server with the device token.
  • Apple's server tries to send the notification to the device.

There are external services that facilitate and help in this process to avoid implementing a server for this process. See this example that explains the whole process and how to implement a server.

Scroll to Top