I have tried out the example found in the link http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 , for my iPhone push notification message. I could successfully run all steps except the steps for registering the app for push notification for the first time.
I have followed different variations of the code:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
But none worked for me. I am testing it in my iPhone 4 and my Xode version is 4.2 , OS is Lion. Please advice.
You can try the following:
Also look at the error object in the UIApplicationDelegate method
application:didFailToRegisterForRemoteNotificationsWithError:
EDIT 1
Open your provisioning profile in a text editor and look for the string
<key>aps-environment</key>
If your profile does not contain this, it is not correctly set up for push.