Archive for APNS – Apple Push Notification Service

Apple Push Notification Services Tutorial: Part 3/3

Step 3: Build up your database to store user information

Now we need a MySQL database to store all user information so that we know where to send the Push Notifications!

  1. Build up database to receive user information

-> Create a database and a user for that database.
-> Update the apns.php file and sendMessage.php file with the database information (username, pwd, database name, host, etc.)

We need three tables: “apns_devices”, “apns_device_history” and “apns_messages”.

We will actually need only “apns_devices” and “apns_device_history”, but since this tutorial is based on Easy APNS, we must also include everyting and consider all dependencies…!

 

Apple Push Notification Services Tutorial: Part 2/3

Step 2: Do some stuff on your terminal

We now have to generate some files that are needed to communicate with Apple’s pushnotification servers:

  1. Generate cert & key files used by your php script to comm. with APNS

Remember the “aps_production.cer” file we downloaded? Now we need that one to make all the files we need for our php script to be able to create some nice messages and send them to all the devices that installed your awesome app…

 

Apple Push Notification Services Tutorial: Part 1/3

Step 1: Prepare the App to receive Push Notifications

In this tutorial I will explain all steps how to make an app for production that can receive Push Notifications. Basically there are 3 steps that must be explained:

  • Prepare the app to receive Push Notifications
    1. Login Developer Account & modify/enable app ID to receive PNs
    2. Use your new and PN enabled provisioning profile
    3. Modify AppDelegate to handle PNs
  • Do some sorcery on your terminal
    1. Generate cert & key files used by your php script to comm. with APNS
    2. Make some nice and easy PHP scripts to send messages right away
  • Build/modify provided Database-creation code to save device information
    1. Build up database to receive user information
    2. Take it all together – done!