> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IsActivePublisher()

> Follow whether the player has an active entitlement, with a callback on every change until you dispose the handle.

Calls `onChange` with the current state of an [`Entitlement`](https://docs.encorekit.com/publishers/unity/sdk-reference/entitlements), then again on each change, until you dispose the handle it returns. Follows changes on iOS only: on Android and WebGL it calls `onChange(false)` once.

## Signature

```csharp theme={null}
public static IDisposable IsActivePublisher(Entitlement entitlement, EntitlementScope scope, Action<bool> onChange)
public static IDisposable IsActivePublisher(Entitlement entitlement, Action<bool> onChange)   // EntitlementScope.All
```

## Parameters

| Name | Type | Default | Description |
| - | - | - | - |
| `entitlement` | [`Entitlement`](https://docs.encorekit.com/publishers/unity/sdk-reference/entitlements) | required | The entitlement to follow |
| `scope` | [`EntitlementScope`](https://docs.encorekit.com/publishers/unity/sdk-reference/entitlements) | `All` | Which grants count |
| `onChange` | `Action<bool>` | required | Called with the current state, then on each change |

## Example

```csharp theme={null}
using System;
using EncoreKit;
using UnityEngine;

public class PremiumBadge : MonoBehaviour
{
    [SerializeField] private GameObject badge;
    private IDisposable _subscription;

    private void OnEnable() =>
        _subscription = Encore.IsActivePublisher(Entitlement.FreeTrial(), active => badge.SetActive(active));

    private void OnDisable() => _subscription?.Dispose();
}
```

## Notes

* `onChange` runs on the Unity main thread, and never after you dispose the handle.
* Before [`Configure()`](https://docs.encorekit.com/publishers/unity/sdk-reference/configure), or when the native subscribe fails before any answer, it calls `onChange(false)` once.
* Throws `ArgumentNullException` when `entitlement` or `onChange` is null.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.