Try this.
In your method.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
use this code
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeNewsstandContentAvailability| UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
And then Put log or breakpoints that your
didRegisterForRemoteNotificationsWithDeviceToken
get called or not.
And if your app is properly registered for remote-notification settings and yet you are not getting device token then
check
didFailToRegisterForRemoteNotificationsWithError
method that will tell you which error you have.
NOTE : device-token will return only when you run on device. OS Simulator doesn't support push notifications
And then also if you are not able to get this method called, then check out this tutorial
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
And follow the steps for creating provisioning profile and certificates. I tried with my existing certificate. After you run your app with valid profile as explained in this tutorial series, you will able to get that method called.