title: didRegisterForRemoteNotificationsWithDeviceToken: doesn't invoke on calling registerForRemoteNotificationTypes:?
body: <p>I am working with push notifications in a navBased app. in AppDelegate.m didRegisterForRemoteNotificationsWithDeviceToken: doesn't invoke on calling registerForRemoteNotificationTypes: code looks like this:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
  
      [self.window addSubview:navigationController.view];
      [self.window makeKeyAndVisible];
  
      return YES;
  }
  
  
  
  - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
      // Get a hex string from the device token with no spaces or &lt; &gt;
      NSLog(@"applicationDidFinishLaunchingWithOptions dev token test");
  
      NSString *deviceTokenStr = [[[[deviceToken description]
                            stringByReplacingOccurrencesOfString: @"&lt;" withString: @""] 
                           stringByReplacingOccurrencesOfString: @"&gt;" withString: @""] 
                          stringByReplacingOccurrencesOfString: @" " withString: @""];
  
      NSLog(@"Device Token: %@", deviceTokenStr);
  }
  </code></pre>
  
  <p>I am quite sure that provisioning profile is not the problem. and i found error:</p>
  
  <p>Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x115490 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}</p>
  
  <p>can anyone tell me whats going on in this code and y its not working? thanx </p>