Implementing Apple push notifications into your iPhone/iPod Touch or iPad app can be quite the challenging task. You really have to pay close attention to the official docs when setting it up and even then it might not work right out of the box.

If you’re new to APNS, you might want to check out the tutorials, I mentioned in one of my previous posts:

http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/
and
http://mobiforge.com/developing/story/programming-apple-push-notification-services

I can only repeat myself by saying, that these tutorials really rock and should definitely get you started.

If you don’t plan on running your own server, check out Urban Airship. They currently offer two different plans, which should perfectly fit your needs.

However, implementing APNS on your own server is most fun, as you’re likely going to face some issues :)

Rule #1, if nothing you tried so far works: Get some open source package and learn from the professionals: EasyAPNS is exactly what you might want to check out in this kinda situation.

Don’t forget to watch the video tutorial, which can be found right on the landing page.

Some additional hints and suggestions:

If your iPhone/iPod Touch/iPad app communicates with your server (maybe via php scripts), check out ASIHTTPRequest. This is some awsome package, that you can easily integrate into your existing XCode project. It’s perfect for contacting your server via POST requests. However, ASIHTTPRequest can do much more – just check out the official docs, which can be found on the developer’s website.

If you’re testing push notifications with your beta testers, make sure that you’re using the correct APNS certificate on your server. By correct I mean: Development certificate or Production certificate. In case you followed the tutorials above, you probably created both. In order to clear things up, check out the steps below:

  • If your iPhone/iPod Touch/iPad app communicates with your server (maybe via php scripts), check out ASIHTTPRequest. This is some awsome package, that you can easily integrate into your existing XCode project. It’s perfect for contacting your server via POST requests. However, ASIHTTPRequest can do much more – just check out the official docs, which can be found on the developer’s website.
  • If you’re testing push notifications with your beta testers, make sure that you’re using the correct APNS certificate on your server. By correct I mean: Development certificate or Production certificate. In case you followed the tutorials above, you probably created both. In order to clear things up, check out the steps below:
  1. Find your Provisioning certificate and the AdHoc one, you are using for your beta testers: Open up XCode and go to “Window”->”Organizer”. Now click on your Provisioning certificate, then right click -> “Reveal in Finder”. Do the same for your AdHoc certificate.
  2. Open up both files with TextEdit (DON’T EVER CHANGE ANYTHING IN THERE!!!) and look for the following string: “Environment”.
  3. Right below you should see either “Development” or “Production”.
  4. If you want your beta testers to receive push notifications and their AdHoc certificate says “Production”, you now know that you will have to use the APNS Production certificate on your server. Otherwise push messages won’t get delivered.

Happy pushing :)

Leave a Reply

An App, you might like:
We recommend…
You might also like…
Get Adobe Flash playerPlugin by wpburn.com wordpress themes