How to clear appStoreReceiptURL in-app array

After a lot of testing I end up with a broken appStoreReceiptUR file.


On the appdelegate I read the appStoreReceiptURL and then I validate the receipt as explained here https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/ValidateAppStoreReceipt.pdf


and I get a lot of pending in_app transactions to finish (just showing two below)

{

environment = Sandbox;

receipt = {

"in_app" = (

{

"is_trial_period" = false;

"original_purchase_date" = "2015-06-28 18:07:10 Etc/GMT";

"original_purchase_date_ms" = 1435514830000;

"original_purchase_date_pst" = "2015-06-28 11:07:10 America/Los_Angeles";

"original_transaction_id" = 1000000161134923;

"purchase_date" = "2015-06-28 18:07:10 Etc/GMT";

"purchase_date_ms" = 1435514830000;

"purchase_date_pst" = "2015-06-28 11:07:10 America/Los_Angeles";

quantity = 1;

"transaction_id" = 1000000161134923;

},

{

"is_trial_period" = false;

"original_purchase_date" = "2015-06-29 17:16:29 Etc/GMT";

"original_purchase_date_ms" = 1435598189000;

"original_purchase_date_pst" = "2015-06-29 10:16:29 America/Los_Angeles";

"original_transaction_id" = 1000000161282043;

"purchase_date" = "2015-06-29 17:16:29 Etc/GMT";

"purchase_date_ms" = 1435598189000;

"purchase_date_pst" = "2015-06-29 10:16:29 America/Los_Angeles";

quantity = 1;

"transaction_id" = 1000000161282043;

}


);

};

status = 0;

}

How can I retrieve those SKPaymentTransaction objects to then call.

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
Answered by in 22373022

This is very strange - Is this issue happening in the sandbox or production environments. In either case, this is an iTunesConnect issue to be investigated. If you do report this to iTC, they are likely to point you to DTS. On my part, I can only help you collect additional information which I can then present to iTC for them to investigate. Looking at this differently - is this in the sandbox. If so, try creating a new testuser and see if the problem persists with the new test user. I'm going to assume that it doesn't. However, if this issue is with the production environment, this would best be handled as a DTS incident.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

I met the same issue,two pending to be finished after I validate the receipt.And I don't receive the older transaction in delegate bellow from the apple server.

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions,

when I test iap on another device,I get the message the producti you have been bought, and I get the older pending transaction,and finished it correctly,the problem is solved.

So i guess the situation is :

you buy a product on Devcie-A and don't finish the transaction,then you buy a product on Device-B using same appId,then you validate the receipt ,you will get it.

Apple Document:

Make sure that the observer is ready to handle a transaction at any time, not just after you add a transaction to the queue. For example, consider the case of a user buying something in your app right before going into a tunnel. Your app isn’t able to deliver the purchased content because there’s no network connection. The next time your app is launched, Store Kit calls your transaction queue observer again and delivers the purchased content at that time. Similarly, if your app fails to mark a transaction as finished, Store Kit calls the observer every time your app is launched until the transaction is properly finished.

your app point the same app on the same device.

Some users who installed my app reported an incident that he/she can not make in-app purchase of a consumable item.

The document here( https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html ) describes In-App Purchase Receipt as

============

The in-app purchase receipt for a consumable product or non-renewing subscription is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated—for example, when the user makes another purchase or if your app explicitly refreshes the receipt.



The in-app purchase receipt for a non-consumable product, auto-renewable subscription, or free subscription remains in the receipt indefinitely.

============

My application is implemented to execute ”[queue finishTransaction:transaction]” then despite of the execution completed successfully, I found that old/previous in-app purchase receipts are not automatically removed from the receipt.



Is this a possible bug on iOS?

Is there any way to clear the in-app purchase receipt from the receipt

I have almost same problem.

In my case I have no problem for consumable product receipt.

but non-renewing subscription recipt is continously appeared despite I called finishtransaction for them.


I am using sandbox environment.

The receipts for all non-renewing subscription purchases are now retained in the receipt. Only consumable IAP's disappear after a refresh.

Yes:


https://developer.apple.com/library/ios/technotes/tn2413/_index.html


Important: Information about auto-renewable subscriptions, non-consumable products, and non-renewing subscriptions is added to the receipt when they are paid for and remains in the receipt indefinitely.

Thanks a lot!

We have a similar problem. We got a lot of timeout problems when validating receipts for out testflight users. Their receipt sizes are bigger than 200kb. How can we delete contents of Sandbox Receipts for out testflight users. They are using testflight version more than 3 year. With every unconsumable product purchase sandbox receipt size gets bigger.

How to clear appStoreReceiptURL in-app array
 
 
Q