Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the product identifier from a restored transaction?

Tags:

I have managed to restore in-app transactions and get the transaction identifier from the original transaction, but how do I identify the product which were bought in the transaction? Is it possible to get the product identifier for a previously purchased in-app product?

like image 908
ThomasCle Avatar asked Feb 20 '12 10:02

ThomasCle


People also ask

What is product ID in app purchase?

A: A product identifier is a string used to uniquely identify every product you wish to sell from your application. The App Store uses it to retrieve information about a product. It is a string identifier that can only contain alphanumeric (A-Z, a-z, 0-9), underscore (_), and period (.) characters.

How restore purchases work?

Restoring purchases prevents you from losing all the things that have been purchased on the old devices. All you need to do is sign in with your old Apple ID or Google Account credentials and you would have restored your purchases. Pretty simple, correct? This menu is available on the side menu of your app.


1 Answers

if you mean you want to check the purchased items that already user buy it .. yes you can do like this

- (void) checkPurchasedItems {     [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; } //You Call This Function  //Then this delegate Function Will be fired - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {     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];     } } 
like image 197
Malek_Jundi Avatar answered Oct 26 '22 06:10

Malek_Jundi