MBS Restore Purchase

This is the code in the MBS Store module for Restoring an IAP. Does there need to be something more, as I have 2 customers saying it crashes with a Nil Exception (which I can’t reproduce) and then the have to do the Buy again process before it recognises they have already purchased.

Thanks

// Finish the transaction for a restored purchase.

System.DebugLog CurrentMethodName

recordTransaction transaction
provideContent transaction.originalTransaction.payment.productIdentifier

AppStoreModule.PaymentQueue.finishTransaction Transaction

Some more info about the steps:

1 Like

The quoted code looks strange.
Did you check if things like originalTransaction or payment are nil?

It’s from the RestoreTransaction method in the MacCloud/Store Kit Test

I guess what I am asking is, is there more needed than what is in the example file to make the MBS Store Kit example work?

Not sure. Did you add code to check if something in this chain is nil?

provideContent transaction.originalTransaction.payment.productIdentifier

transaction is not nil?
transaction.originalTransaction is not nil?
transaction.originalTransaction.payment is not nil?

I wonder where exactly the nil check fails.

1 Like

Will continue to check, thanks for the direction.