Players and purchases
Step 4. Players and purchases
- When the player is signed in to your app, call client.setGamePlayerId with your own player account ID.
- Before checkout, call client.purchaseBenefit(productId:) to see if the player gets a discount, then client.createPurchaseContext(productId:).
- Call client.appAccountToken() and put the UUID it returns into your normal StoreKit purchase options. The value is returned only once, on the call that issues it, so keep it for the player. If your app already sets its own appAccountToken, register it with client.adoptAppAccountToken(_:) instead. R3FTO never replaces it.
- Run your normal StoreKit checkout.
The SDK never starts StoreKit, never finishes a transaction and never grants an item. Apple returns the appAccountToken with the transaction, and R3FTO uses it to match the purchase to the player. A purchase without it cannot be matched.