Quick update to this:
I looks like MobileIAP.Restore purchases causes "On product owned" to trigger.
So the issue I have now is how to detect when the user clicks on "Restore purchases" but doesn't have the IAP (I only have one IAP)?
Current flow:
- User clicks "Restore purchases"
- MobileIAP.Restore Purchases called
- If "Has product xxx" = true, then set global variable "IAPPurchased" = TRUE & alert user "Restore successful"
- If "Has product xxx" = false, alert user "Nothing to restore"
- "On product xxx owned", then set global variable "IAPPurchased" = TRUE & alert user "Purchase successful"
The problem is that steps 1 to 4 all happen BEFORE "On product xxx owned" so that step 3 is never TRUE and "Nothing to restore" is always displayed.
("On product xxx owned" triggers either after a purchase or restore.)
Another minor issue is distinguishing in step 4 whether the user has just purchased or restored the IAP. I can either change "Purchase successful" to just "Success" or store in a variable whether the last button pressed was "Purchase IAP" or "Restore Purchases" then set the message to be either "Purchase successful" or "Restore successful" accordingly.