MBS macCloud StoreKit, IAP restore, macOS

I use the MBS plugins for In-App Purchases. Generally it seems to work. But when I tried a restore from a promo code it doesn’t seem to work. I implemented the restore procedure like it is demonstrated in the example from MBS:

AppStoreModule.PaymentQueue.restoreCompletedTransactions

But this cannot be the correct way to restore a payment because it just calls the corresponding event. Can someone please direct me?

Well, long time since I wrote that.

So restoreCompletedTransactions starts an asynchronous process.
Later it calls paymentQueueRestoreCompletedTransactionsFinished on success or restoreCompletedTransactionsFailedWithError on failure.
You may need to inspect the transactions array to see what’s there.

Thank you for your quick answer, Christian,
That’s exactly what I did. It always enters paymentQueueRestoreCompletedTransactionsFinished, but never the receipt shows any restore neither there is an entry in the array available. Could it be that it doesn’t work with promo codes and not inside the sandbox, too?

Sorry, no idea about this. Maybe others can help who use this?

You may wanna read this:

I believe you receive new purchase(s) after restore which have a property and type set to indicate it’s a restored payment.

After the event check the transactions array and for each item you see the transactionState property the indicated if it was restored or not.

Thank you for these hints!

Unfortunately I never get an transactionState “transaction.StateRestored” for any transaction. In the paymentQueueRestoreCompletedTransactionsFinished event there is no transaction in the transactions array.

Again my question:
Could it be that it doesn’t work with promo codes and not inside the sandbox, too?

Perhaps someone has some experience with this?

Did you check the receipt once ?

Yes, I did, doesn’t show any restore. I checked containsInAppPurchaseOfProductIdentifier and inAppPurchases.