简体   繁体   中英

How to call the restoreCompletedTransactions

i am doing one application.In that i am calling the restoreCompletedTransactions method like below.

-(void)restore
{
   [SKPaymentQueue defaultqueue] restoreCOmpletedTransactions];
 }

But it will not give any response from apple.If id like below then app is crashing when i call the restore method.

-(void)restore
  {
     [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
   [SKPaymentQueue defaultqueue] restoreCOmpletedTransactions];
 }

So how to call the restoreCompletedTransactions.And when we use this [[SKPaymentQueue defaultQueue] addTransactionObserver:self] in my code.

  1. You need to call [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; in your app delegate. It is recommended to call it in AppDidFinishLaunching .
  2. Then in your restore method (Usually connected to a button) you will call - [SKPaymentQueue defaultqueue] restoreCOmpletedTransactions];
  3. Do you implement the SKProductsRequestDelegate ?, what do you mean there is no response by apple ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM