Good reference
http://maniacdev.com/2011/05/tutorial-ios-push-notification-services-for-beginners/
Some notes
1. If get some error like “no valid ‘aps-environment’ entitlement string", remove all Provision Profile, on both Apple’s portal and local, re-create them, and refresh in Organizer. Remember to do all these AFTER THE PUSH HAS BEEN ENABLED.
2. If using Urban Airship for testing purpose, and get any error like “Certificate does not contain the private key": import the key downloaded from Apple’s Portal, and then re-export the same key from your Keychain Access. Save the format as .p12 extension, proved work.