Hi,
I'm surprised that the SKPaymentTransaction object doesn't include the productIdentifier of the product that was being purchased.
I need this information in my transaction observer so I can record which product was purchased and configure my app accordingly.
I guess I could keep track of this by recording the last product a user tried to purchase, but that seems error-prone; it doesn't account for restoring transactions on a new device, or the possibility that the transaction observer might be called at a time later than expected, or that two purchases might overlap.
Is there a way to obtain the productIdentifier from the transaction?
Thanks,
Frank
It does.
transaction.payment.productIdentifier
-(void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{
for(SKPaymentTransaction *transaction in transactions){
switch (transaction.transactionState){
case SKPaymentTransactionStatePurchased:
if([myArrayOfProductIdentifiers containsObject:transaction.payment.productIdentifier]){
////
}