title: Display In App Price BEFORE User Selects To Purchase Button
body: <p>I have an app with an in app purchase.  All works as designed... in app purchase works, but I am trying to display the local price <strong>BEFORE</strong> the user selects the Buy Now Button.</p>
  
  <p>Currently, somehow my code will only display the price once the process is initiated...</p>
  
  <p>Here is code</p>
  
  <pre><code>-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
  {
  
  NSLog(@"IAP: Received Response");
  
  // add wait text here
  iAPnote.text = @"Connecting With App Store...";
  
  SKProduct *validProduct = nil;
  int count = [response.products count];
  
  if (count&gt;0) {
  
      NSLog(@"IAP: Available, starting transaction");
  
      validProduct = [response.products objectAtIndex:0];
  
      SKPayment *payment = [SKPayment paymentWithProduct:validProduct];
      [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
      [[SKPaymentQueue defaultQueue] addPayment:payment];
  
      // shows the cost of the in-app-purchase in the local currency (Canada / United States etc) using SKProduct+LocalizedPrice .h and .m helper files
  
      [self.iAPprice setText:[NSString stringWithFormat:
                              @"Price: %@",validProduct.localizedPrice]];
  
  
  } else {
  
      NSLog(@"IAP: Item not found");
  
      UIAlertView *tmp = [[UIAlertView alloc]
                          initWithTitle:@"Internet Connection Required"
                          message:@"You must connect to a Wi-Fi  or cellular data network to perform an In-App Purchase."
                          delegate:self
                          cancelButtonTitle:nil
                          otherButtonTitles:@"Ok", nil];
          [tmp show];
  }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YMSiG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YMSiG.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/WC1Fp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WC1Fp.jpg" alt="enter image description here"></a></p>
  
  <p>You'll notice in the first screenshot that the price is NOT shown... This is the initial view... Once the user taps the Unlock Button, then the action is initiated to look for the price and then display it... How can I make this action happen without the user starting the process... How can I display the price BEFORE the user taps that button?</p>
  
  <p>Is there something in viewDidLoad I need to initiate?</p>