Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip the alert "You've already purchased this but it hasn't been downloaded"

Tags:

I am testing my in app purchase application. While I purchase my consumable product second time with my user account in sandbox environment, it always show me a alert "You've already purchased this but it hasn't been downloaded. Tap OK to download it now.". Is there any way to skip the alert?

Thanks for any help.

like image 666
user297047 Avatar asked Mar 19 '10 02:03

user297047


2 Answers

You should not see this alert if you are purchasing a consumable after already having done so. If you are, then you have never removed the transaction from the queue. You need to remove it before the store will let you purchase it again.

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
like image 118
Brandon Avatar answered Sep 27 '22 21:09

Brandon


Well, my solution after searching the web for several hours! Don't forget to add transaction observer for your IAP manager!!

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];

Your application should add an observer to the payment queue during application initialization. If there are no observers attached to the queue, the payment queue does not synchronize its list of pending transactions with the Apple App Store, because there is no observer to respond to updated transactions.

If an application quits when transactions are still being processed, those transactions are not lost. The next time the application launches, the payment queue will resume processing the transactions. Your application should always expect to be notified of completed transactions.

like image 41
Kjuly Avatar answered Sep 27 '22 20:09

Kjuly