title: In APP Purchase BOOL Values are Not Saving in iPhone
body: <p>I am doing In App Purchases using NSUser Defaults in My application.. It all working fine... But when I delete the application in Background The Bool Values of isPurchased and isFailed are not storing... After buying once.. and deleting the app in background.. My application is again asking to buy the new level.. If i click on buy it is showing that "You Have Already Purchased" and the lock is opening... But I want, If user buy the level once it should not ask  to buy next time after deleting the app in background... If don't delete the app in background it is working fine... What i Have to do to store the isPurchased and isFailed Values After deleting the app in background.. When delete the app in background autorelease pool in main.m is calling..</p>
  
  <pre><code>enter code here
  </code></pre>
  
  <p>AppDelegate.m</p>
  
  <pre><code> MyStoreAbserver *observer = [[MyStoreAbserver alloc] init];
  [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
  
  if([[[NSUserDefaults standardUserDefaults] objectForKey:@"isPurchased"] isEqualToString:@"true"])
      isPurchased = YES;
  else
      isPurchased = NO;
  isFailed = NO;
  </code></pre>
  
  <p>ViewController.m </p>
  
  <pre><code>-(void)callInAppPurchase
  {
  if ([SKPaymentQueue canMakePayments])
  {
      // Display a store to the user.
      [self requestProductData];
      waitLabel.text = @"Please Wait...";
      //[self showLoadingState];
  
      SKPayment *payment = [SKPayment paymentWithProductIdentifier:kPaper1Identifier];
      [[SKPaymentQueue defaultQueue] addPayment:payment];
  
  else 
  {
      // Warn the user that purchases are disabled.
  
      UIAlertView *alertMsg = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"In App Purchases are disabled in your Apple account, to buy the coupon please enable In App Purchases for your Apple account." delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK",nil];
      [alertMsg show];
      [alertMsg release];
  }
  }
  - (void) requestProductData
  {
  
      SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:kPaper1Identifier]];
      request.delegate = self;
      [request start];
  
  
  }
  
  - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
  
  {
  waitLabel.text = @"";
  [request release];
  NSLog(@"the details of the product are %@",response.products);
  }
  </code></pre>