Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with transactionreceipt deprecated in iOS 7 warning
    primarykey
    data
    text
    <p>I am going to update my application for iOS 7 and I am using IAP , but xcode 5 give me this this error :</p> <blockquote> <p>transactionreceipt is deprecated : first deprecated in iOS 7</p> </blockquote> <p>here is my code :</p> <pre><code>// saves a record of the transaction by storing the receipt to disk - (void)recordTransaction:(SKPaymentTransaction *)transaction { if ([transaction.payment.productIdentifier isEqualToString:kProductIdentifier]) { // save the transaction receipt to disk [[NSUserDefaults standardUserDefaults] setValue:transaction.transactionReceipt forKey:@"proUpgradeTransactionReceipt"]; [[NSUserDefaults standardUserDefaults] synchronize]; } } </code></pre> <p>how can I fix this issue ?</p> <p>//EDITED :</p> <p>I used my AndreyMan's answer but nothing happened and compiler gave me APP:requestProductData END message </p> <pre><code>- (void)requestProductData { [NSThread sleepForTimeInterval:2]; NSLog(@"IN-APP:requestProductData"); SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject: @"com.compony.product"]]; request.delegate = self; [request start]; NSLog(@"IN-APP:requestProductData END"); } </code></pre> <p>and then gives me these messages :</p> <blockquote> <pre><code>2013-10-08 14:26:21.400 Arta[1138:60b] Purchasing... 2013-10-08 14:26:28.380 Arta[1138:60b] Unknown Reason. 2013-10-08 14:26:28.383 </code></pre> <p>Arta[1138:60b] Purchase faild...</p> </blockquote> <pre><code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: [self completeTransaction:transaction]; NSLog(@"Purchase compelete..."); break; case SKPaymentTransactionStateFailed: [self failedTransaction:transaction]; NSLog(@"Purchase faild..."); break; case SKPaymentTransactionStateRestored: [self restoreTransaction:transaction]; NSLog(@"Restore compelete..."); break; case SKPaymentTransactionStatePurchasing: NSLog(@"Purchasing..."); break; default: break; } } } - (void)failedTransaction:(SKPaymentTransaction *)transaction { if (transaction.error.code != SKErrorPaymentCancelled) { // error! [self finishTransaction:transaction wasSuccessful:NO]; if (transaction.error.code == SKErrorClientInvalid) { } else if (transaction.error.code == SKErrorPaymentInvalid) { } else if (transaction.error.code == SKErrorPaymentNotAllowed) { } else if (transaction.error.code == SKErrorPaymentCancelled) { // [self showAlert:@"In-App Purchase" withMessage:@"This device is not allowed to make the payment."]; NSLog(@"User Cancellation."); } else { // SKErrorUnknown NSLog(@"Unknown Reason."); } } else { // this is fine, the user just cancelled, so don’t notify [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload