kishan kishan - 1 month ago 34
Objective-C Question

how to implement in app purchase ios 10 in objective c

I am developing an app with some chargeable subscription, I want to add in-app purchase for that, so can anyone help me find a helping tutorial or example for it, in ios-10 (objective-c). I have been searching example for it , all I get is for swift. Thank you in advance !

Answer

Have a deep look here: https://www.raywenderlich.com/127423/in-app-purchases-tutorial and https://www.appcoda.com/in-app-purchase-tutorial/

Objc version: https://www.tutorialspoint.com/ios/ios_in_app_purchase.htm , http://www.techotopia.com/index.php/An_iOS_7_In-App_Purchase_Tutorial and https://www1.in.tum.de/lehrstuhl_1/teaching/tutorials/511-sgd-ws13-tutorial-store-kit

And from iOS 9.0, in app purchase restore has an issue. Try to use this for restore purchase.

-(IBAction)restorePurchase:(id)sender
{
   [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
   [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}