Registering an application for push notification

This post will describe about “Registering the application for push notification”.
You may also consider it as “enabling push notification in an iPhone/iPad application.”

1) Open your application project.

2) Select & Open “YourApplicationDelegate.m” ( Application delegate implementation file )

3) Jump to didFinishLaunchingWithOptions method. Paste following code for enabling push notification.

4) Paste/Add following method in your applicationDelegate implementation file.

5) Also add following method to handle “if user don’t allow push notification”

6) Sign in to Developer Portal ( http://www.developer.apple.com/iphone ) & Open “iOS Provisioning Portal. Create a new application ID as follows & Download the certificate.

Push notification Step 7

7) Now create a new Provisioning profile as follows & download the provisioning profile.

8) Add certificate to your keychain access.

9) Add provisioning profile using XCode – Organizer as follows.

10) Associate your provisioning profile with your project as follows.

 

Run the project on device to perform test of Actual push notification. You will receive following error on console if you try to run project on Simulator.

Leave a Reply

Your email address will not be published. Required fields are marked *


*