Unlike
reset() which clears everything, revokeEntitlements() only expires entitlements - the user remains identified with their attributes intact. This allows you to test multiple offer cycles for the same user.Signature
Returns
No return value. Completes normally on success and throws anEncoreError on failure.
Usage
Complete Testing Lifecycle for a User
Test the full entitlement lifecycle from offer presentation through expiry and re-testing for the same user:End-to-end sandbox test recipe
Use the Test Key together withrevokeEntitlements() to run repeatable offer cycles for the same user from any location, and to watch the two-phase entitlement flow (provisional → verified → revoked).
Configure with your Test Key
The Test Key (
pk_test_…) bypasses geo-filtering so location-restricted offers appear anywhere.Point App Store Connect at the sandbox webhook
In App Store Connect, set the Sandbox Server URL for App Store Server Notifications to Encore’s endpoint so sandbox transactions reach the backend and can be verified:See Configure Analytics for the full walkthrough.
Trigger an offer and observe provisional → verified
Present an offer and complete the sandbox purchase. With
unlock: .optimistic (the default), the entitlement is granted provisionally the moment the user returns, then flips to verified once the backend confirms the transaction.Related Methods
configure()- Configure SDK with admin API keyisActive()- Check entitlement status after revokingreset()- Clear user session and entitlementsidentify()- Set user ID for testing specific users