title: while running app from xcode push notification is working but when install ipa it is not working
body: <p>I am developing a iOS app with push notification and it is working fine while running via xcode with device.But i try to generate ipa and install it is not working.(Notification sent from backend server,there device token not generated for ipa).The code I used to register push notification.</p>
  
  <pre><code>if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
  {
      // iOS 8 Notifications
      [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
  
      [application registerForRemoteNotifications];
  }
  else
  {
      // iOS &lt; 8 Notifications
      [application registerForRemoteNotificationTypes:
       (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
  }
     - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  {
  
  
  NSString *tokenStr = [[[[deviceToken description]
                          stringByReplacingOccurrencesOfString:@"&lt;" withString:@""]
                         stringByReplacingOccurrencesOfString:@"&gt;" withString:@""]
                        stringByReplacingOccurrencesOfString:@" " withString:@""];
  
  NSLog(@"Device Token (raw): %@", deviceToken);
  NSLog(@"Device Token (string): %@", tokenStr);
  
  NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  
  [userDefaults setObject:tokenStr forKey:@"deviceToken"];
  [userDefaults synchronize];
  </code></pre>
  
  <p>}</p>
  
  <pre><code>- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
   {
    [MSTLog printdebug:@"Failed to get token, error: %@", error];
  
   }
  </code></pre>
  
  <p>I'm using xcode 6.1.</p>