title: Apple Push Notifications: Not receiving device token?
body: <p>In an app which involves push notifications, I am receiving device tokens just fine but the my client's device doesn't receive device token (hence causing failure to receive push notifications). I am using Parse for push notifications. This is what I have in my <code>AppDelegate</code>:</p>
  
  <pre><code>-(void)application:(UIApplication *)application
  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken {
      // Store the deviceToken in the current installation and save it to Parse.
      PFInstallation *currentInstallation = [PFInstallation currentInstallation];
      [currentInstallation setDeviceTokenFromData:newDeviceToken];
      PFACL *objectACL = [[PFACL alloc] init];
      [objectACL setPublicReadAccess:YES];
      [objectACL setPublicWriteAccess:YES];
  
      [currentInstallation saveInBackground];
  }
  
  -(void) application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
  {
  
      NSString *errorString = [NSString stringWithFormat:@"%@", error];
      UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:errorString delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  
      [errorAlertView show];
  }
  - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
      [application registerForRemoteNotifications];
  }
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      // Override point for customization after application launch.
      [Parse setApplicationId:PARSE_APPLICATION_ID
                    clientKey:PARSE_CUSTOMER_KEY];
      [PFFacebookUtils initializeFacebook];
  
      [self.window makeKeyAndVisible];
  
      // create the Login controller instance:
  
      [application registerForRemoteNotificationTypes:
       UIRemoteNotificationTypeBadge |
       UIRemoteNotificationTypeAlert |
       UIRemoteNotificationTypeSound];
  }
  </code></pre>
  
  <p>Client doesn't receive any UIAlert representing failure of registration with APN so that means <code>didFailToRegisterForRemoteNotificationsWithError</code> is not being called. I have tried removing all installations from my parse server, removing the app &amp; reinstalling again as per guidelines of Apple technical note TN2265. The application doesn't prompt the client for authorization of push notifications on first launch &amp; doesn't appear in notification center either (Which is baffling because <code>didRegisterUserNotificationSettings:</code> is there too). But all this is working fine on my iPad, iPhone 5S, iPod 5, iPhone 4s. Any ideas what Might be causing this device to device variable behavior in the app?!This is the sc client sent me.<a href="http://i.stack.imgur.com/lwAtx.png" rel="nofollow">notificationCenterScreenShot</a></p>