Skip to main content
Expires all entitlements for the currently identified user while preserving their user ID and attributes. This is a convenience method designed for testing and development environments to simulate entitlement expiry and test offer flows repeatedly for the same user.
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 an EncoreError 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 with revokeEntitlements() to run repeatable offer cycles for the same user from any location, and to watch the two-phase entitlement flow (provisional → verified → revoked).
1

Configure with your Test Key

The Test Key (pk_test_…) bypasses geo-filtering so location-restricted offers appear anywhere.
2

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 App Store Server Notifications for the full walkthrough.
3

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.
4

Revoke and repeat

Expire all entitlements while keeping the user identified, then run another cycle for the same test_user_456:
The combination of the Test Key (configure()) and revokeEntitlements() lets you replay the full offer lifecycle for one user from any location, with no geo-filtering.
  • configure() - Configure SDK with admin API key
  • isActive() - Check entitlement status after revoking
  • reset() - Clear user session and entitlements
  • identify() - Set user ID for testing specific users