Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

paymentQueue: updatedTransactions: not called [duplicate]

I have recently released my first app after 2.5 years of development (a roguelike) and I am now having difficulty restoring a nonconsumable purchase:

I have a "restore purchases" button that calls this method just fine:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

Then a prompt pops up requesting my user name and password, so I enter my test account information.

However, that is all that happens. The app doesn't crash as xcode shows it still running fine, but this method never gets called:

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

I am able to make consumable purchases and even the non-consumable purchase can be made normally, but when I delete the app from my device, reinstall and try to restore, the paymentQueue: updatedTransactions: function above never gets called while everything else seems to be called normally.

Can anyone identify my error?

like image 316
Naseiva Khan Avatar asked Apr 08 '14 13:04

Naseiva Khan


2 Answers

Are you calling [[SKPaymentQueue defaultQueue] addTransactionObserver:myObject] to tell the defaultQueue that you are to be notified of transaction updates/events? I just recently had a similar problem occur to me, and it took a couple of days and multiple tutorials to find the error. Hope this helps!

like image 90
Adam Evans Avatar answered Oct 23 '22 13:10

Adam Evans


Note that Store Kit testing does not work in the Simulator. You don't say whether this is happening in the Simulator or on a device, but my experience is that testing in the Simulator won't cut it. (It's unclear to me whether this is a deliberate policy on Apple's part or a Simulator bug.)

like image 2
matt Avatar answered Oct 23 '22 14:10

matt