title: How to get iOS appStoreReceiptURL into Base 64 Encoded String?
body: <p>I want to use appStoreReceiptURL to see which version of the app someone purchased. How can I get this into a string?</p>
  
  <p>I'm testing this by downloading the app from the store, then running a new version of the app from Xcode. Here is what I've tried:</p>
  
  <pre><code>NSURL *receiptUrl = [[NSBundle mainBundle] appStoreReceiptURL];
  NSLog(@"receiptUrl %@",[receiptUrl path]);
  if ([[NSFileManager defaultManager] fileExistsAtPath:[receiptUrl path]]) {
          NSLog(@"exists");
           NSError *error;
           NSString *receiptString = [[NSString alloc] initWithContentsOfFile:[receiptUrl path] encoding:NSUTF8StringEncoding error:&amp;error];
           if (receiptString == nil) {
                NSLog(@"Error: %@", [error localizedDescription]);
           } else {
               NSLog(@"Receipt: %@",receiptString);
          }
  
  } else {
          NSLog(@"does not exist");
  }
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>receiptUrl /var/mobile/Applications/E612F261-2D30-416E-BF82-F24xxxx8860/StoreKit/receipt
  exists
  Error: The operation couldn’t be completed. (Cocoa error 261.)
  </code></pre>