> For the complete documentation index, see [llms.txt](https://docs.namiml.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.namiml.com/sdk-reference/namientitlementmanager/registeractiveentitlementshandler.md).

# registerActiveEntitlementsHandler

Register a callback to react to a potential changes to the active entitlements for the user, whenever such state is fetched from the Nami service. This occurs during the course of the application lifecycle as well as when [refresh](https://docs.namiml.com/sdk-reference/namientitlementmanager/refresh.md) is called.

{% tabs %}
{% tab title="Swift" %}

```swift
NamiEntitlementManager.registerActiveEntitlementsHandler { (activeEntitlements: [NamiEntitlement]) in
  // respond to the current active entitlements for the user
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
NamiEntitlementManager.registerActiveEntitlementsHandler { activeEntitlements ->
  // respond to the current active entitlements for the user
}
```

{% endtab %}

{% tab title="Flutter" %}

```dart
NamiEntitlementManager.registerActiveEntitlementsHandler()
    .listen((activeEntitlementHandlerData) {
});
```

{% endtab %}

{% tab title="React Native" %}

```jsx
import {NamiEntitlementManager, NamiEntitlement} from 'react-native-nami-sdk';

const subscriptionRemover =
  NamiEntitlementManager.registerActiveEntitlementsHandler(
    (activeEntitlements) => {
      console.log('activeEntitlements', activeEntitlements);
      setEntitlements(activeEntitlements);
    },
  );
return () => {
  subscriptionRemover();
};
```

{% endtab %}

{% tab title="Unity" %}

```c
NamiEntitlementManager.RegisterActiveEntitlementsHandler(activeEntitlementsCallback);
```

{% endtab %}
{% endtabs %}

**Returns**

* `activeEntitlements` - a list of the current entitlements active for the user and device.
