checkEntitlements() method.
Entitlement is access to the premium features of your application. → Read more about creating and using entitlements here.
You need to call the checkEntitlements() method at the start of your app to check if a user has the required entitlement. This method will check the user’s receipt and return current entitlements.
In addition, Qonversion can manage cross-platform entitlements with the user Identity concept (e.g. after your users subscribe using the IOS app, you can use Qonversion to check their entitlements in your Android or Web applications)
Qonversion SDK caches all required data on products, offerings, and entitlements. The data is still immediately available when the internet connection is lost, or there are server-side delays.
The Entitlement Object
| Var Name | Description |
|---|---|
id | Qonversion entitlements ID. For example, premium |
isActive | Boolean. true means a user has active entitlement. Please note that isActive = true does not mean a subscription will be renewed. A user can have active entitlement while auto-renewal for the subscription is switched off. |
source | Source of the purchase via which the entitlement was activated. Values: – appstore: App Store – playstore: Play Store – stripe: Stripe – unknown: unable to detect the source – manual: the entitlement was activated manually |
startedDate | Initial transaction date. For a subscription with a trial period, the date will be when the trial starts. |
trialStartDate | The trial start date for current entitlement. Null for entitlement that was unlocked by consumable/non-consumable/lifetime purchase or subscription without a trial period. |
firstPurchaseDate | The date of the first purchase. |
lastPurchaseDate | The date of the last purchase. |
autoRenewDisableDate | The date when auto-renew for the subscription was disabled. |
expirationDate | The expiration date for a subscription. Null for a consumable/non-consumable in-app purchase or a lifetime subscription |
productId | Identifier of the product from the Qonversion Dashboard |
renewState | A renewal state of the subscription. It can have the following values: nonRenewable - consumable or non-consumable in-app purchase, willRenew – subscription is active, and auto-renew status is on, billingIssue – there was some billing issue, canceled – the subscription was cancelled, unknown - if we don’t have information about the renewal state. |
renewsCount | Subscription renews count for the entitlement. Renews count starts from the second paid transaction. For example, we have 20 transactions:- The first one is the trial started transaction |
- The second one is the first paid transaction, trial converted.
- All the other - subscription renew transactions, thus renewsCount is equal to 18. |
|
grantType| Grant type of entitlement-purchase: User bought a subscription -familySharing: User got entitlement via family sharing offerCode: User got entitlement using offer codemanual: User got entitlement via Qonversion dashboard feature | |lastActivatedOfferCode| The last activated offer code that unlocks the current entitlement. | |transactions| An array of Transaction objects that contains information about transactions that unlocked current entitlement. |
The Transaction object
| Var Name | Description |
|---|---|
originalTransactionId | The original transaction identifier. |
transactionId | The transaction identifier. |
offerCode | The offer code that was used to get the transactions. |
transactionDate | The date of the transaction. |
expirationDate | The expiration date for the transaction. Null for a consumable/non-consumable in-app purchase or a lifetime subscription |
transactionRevocationDate | The date when the transaction was revoked. This field represents the time and date the App Store refunded a transaction or revoked it from family sharing. |
environment | The environment of the transaction:- sandbox |
production| |ownershipType| Type of the ownership for the transaction:-owner- User owns the transactionfamilySharing- User got transaction via family sharing | |type| Type of the transaction:-subscriptionStartedsubscriptionRenewedtrialStartedintroStartedintroRenewednonConsumablePurchase|
Making Purchases Offline SDK mode