Registers a listener invoked after a native purchase completes. This fires when the native SDK handles the purchase directly (i.e., no onPurchaseRequest handler is set on the native side).
Signature
Parameters
PurchaseCompleteEvent
Returns
An unsubscribe function. Call it to remove the listener.
When It Fires
onPurchaseComplete fires only when:
- No
onPurchaseRequest handler is registered on the native side
- The native SDK successfully completes a purchase
- The transaction is verified and finished
It does not fire when:
- An
onPurchaseRequest handler is set (the handler takes full responsibility)
- The user cancels the purchase
- The purchase fails or is pending
Usage
Clean up the listener when your component unmounts by calling the returned unsubscribe function.