Hi I need to implement the restore functionality in Inapp-Purchase, for this made a button "Restore" which is calling method
-(void)restorePurchasedProductsWithProductId:(NSString*)prodID
{
_productIdsArray = [[NSMutableArray alloc] init];
productID = [prodID retain];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}
It gives me a popup to enter the password of apple id.And after doing that nothing happens.
I read somewhere that it calls
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
So i did like this
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
NSLog(@"paymentQueue");
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchased:
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"restored");
[self restoreTransaction:transaction];
break;
default:
break;
}
}
}
But the problem is the above method is not calling neither this
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
nor
-(void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error
I have also included the required protocols,
Can some body help me why these delegate methods are not calling for restore process. I am trying it with test account.