# Entitlements

***

{% hint style="info" %} <mark style="color:blue;">Appflow\.ai only links your entitlements with your SKU, you should know the id of your entitlements yourself</mark>
{% endhint %}

To create entitlement, go to Appflow\.ai Settings => Entitlements => Add new

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FPsltlFDpX0rsnrP3ZLeD%2Fimage.png?alt=media&#x26;token=c2df0675-d78f-4815-a8df-0dc37b412827" alt=""><figcaption></figcaption></figure>

That's it! Your entitlements will be related to your new SKU choice right away!

{% hint style="info" %} <mark style="color:blue;">You can create same entitlements with the same ids but</mark>&#x20;

<mark style="color:blue;">You can't assign same ids to the same apps'SKUs</mark>
{% endhint %}

**Example of how to make entitlements work through Appflow\.ai:**

If you make an entitlement call 'Remove Ads'

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FCkG5Rmmx5SNbEPFqOch3%2Fimage.png?alt=media&#x26;token=6989ac02-0093-4bc8-99ce-d96955e3f489" alt=""><figcaption></figcaption></figure>

And then you link it to SKU

The value in 'Name / Identifier', will be returned if a user purchases one of the SKU in the 'Linked to SKU' and doesn't expire.

Then you ask your developer/or do yourself: to put to the SDK:

Android:

```kotlin
Appflow.getSubscriberInfo(object : ReceivePurchaserInfoListener {
    override fun onReceived(subscriber: IapIap.Subscriber) {
        var canRemoveAds = false
        for (info in subscriber.entitlementsList) {
            if (info.id == "Remove Ads" && info.isActive) {
                canRemoveAds = true
                break
            }
        }
    }

    override fun onError(error: PurchasesError) {}
})
```

iOS

```swift
Appflow.shared.restorePurchases {[weak self] subscriber, error in  
   var canRemoveAds = false  
   for imEntitlement in subscriber.imEntitlements where (imEntitlement.id == "Remove Ads" && imEntitlement.isActive == true) {  
      canRemoveAds = true  
      break  
   }  
}
```
