Parse In App Purchase Restore Feature

My app was rejected by Apple for not having a recovery feature for In-App-Purchasing.

I use the Parse implementation here , which allows you to restore purchases if the user made a previous purchase using the Alert controller with recovery when the user selects the purchase button.

I have 2 questions:

  • Is the Restore option through the ALert controller enough to match the Apple directive?
  • If not, is there a feature in the Parse In App Purchase API that allows you to restore a button click? Since I could not find it in the documents.

Thansk in advance

+4
source share
2 answers

Hidden in depth documentation:

 PFPurchase.restore();

, -

PFPurchase.addObserverForProduct("purchases.cases", block: { (transaction : SKPaymentTransaction!) -> Void in
            //set boolean to user defaults when in app p[urcahse is made, access agian in Tablevoew to relase cases

            let userDefaults = NSUserDefaults.standardUserDefaults();

            userDefaults.setBool(true, forKey: "inAppPurchaseMade");

            userDefaults.synchronize();

        })


        return true
    }
+2

, , UIAlertController, , .

//inside of an IBaction
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue]restoreCompletedTransactions];


// Then this is called
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
    NSLog(@"%@",queue );
    NSLog(@"Restored Transactions are once again in Queue for purchasing %@",[queue transactions]);  

    NSMutableArray *purchasedItemIDs = [[NSMutableArray alloc] init];
    NSLog(@"received restored transactions: %i", queue.transactions.count);

    for (SKPaymentTransaction *transaction in queue.transactions) {
        NSString *productID = transaction.payment.productIdentifier;
        [purchasedItemIDs addObject:productID];
        NSLog (@"product id is %@" , productID);
        // here put an if/then statement to write files based on previously purchased items
        // example if ([productID isEqualToString: @"youruniqueproductidentifier]){write files} else { nslog sorry}
    }  
}
+1

All Articles