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

# Models

> The AlmediaLink API — releases before SDK 1.3.0. Synced from the source repository.

## `AlmediaStatus`

Namespace: `AlmediaLink.Models` · enum

Mirrors the SDK's runtime state. Delivered to `OnStatusChanged` on every transition and always available as a snapshot via `CurrentStatus`.

| Value | Meaning |
| - | - |
| `NotInitialized` | Default value before init finishes. Never persists. |
| `Eligible` | Service is available and the player has not linked yet. Linking UI should be visible. |
| `Linked` | Player has linked their Freecash account. Reward notifications can flow. |
| `NotAvailable` | Service is not available for this user (region, eligibility, holdout). Linking UI should hide. [`NotAvailableReason`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almedianotavailablereason) says why. |
| `Blocked` | User is blocked by the backend (abuse, fraud). Linking UI should hide. |
| `Disabled` | Integration is killswitched at the backend level. SDK runs in a no-op mode until the backend re-enables it. |

Terminal values: `Eligible`, `Linked`, `NotAvailable`, `Blocked`, `Disabled`. `NotInitialized` is the pre-init default and is never re-entered after the first terminal transition.

The status says whether the service is available; it does not say whether a given screen can be opened. A `Linked` player may still have no reward hub - see [`AlmediaScreenAvailability`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediascreenavailability).

***

## `AlmediaNotAvailableReason`

Namespace: `AlmediaLink.Models` · enum

Why the SDK is `NotAvailable` for this player. Read it from `AlmediaLinkSDK.NotAvailableReason`, which is non-null exactly while `CurrentStatus` is `NotAvailable`.

| Value | Meaning |
| - | - |
| `Unknown` | The backend sent no reason, or one this SDK version does not recognize. Not an error - read it as "not available, cause unspecified". |
| `Holdout` | The player is in the holdout (control) group and is deliberately excluded from the Link experience. |
| `Disabled` | The game declared `Linking` in its [disabled features](https://docs.almedia.dev/technical/api-reference/almedialink/models.md#almediafeature). |

The mapping from the backend's value happens inside the SDK, so a reason added by the backend later lands on `Unknown` in an existing build rather than surfacing a value your code cannot name. Handle `Unknown` as a real case; do not `switch` exhaustively without a default.

The reason never changes what the SDK does - the entry point hides on `NotAvailable` whatever the reason. Use it for analytics, support diagnostics, and messaging.

***

## `AlmediaScreenAvailability`

Namespace: `AlmediaLink.Models` · readonly struct

Which SDK screens native can present right now. Read it from `AlmediaLinkSDK.ScreenAvailability`; changes fire [`OnScreenAvailabilityChanged`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediascreenavailability%3E-onscreenavailabilitychanged).

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public readonly struct AlmediaScreenAvailability : IEquatable<AlmediaScreenAvailability>
{
    public bool CanShowRewardHub { get; }
    public bool CanShowOffer { get; }
}
```

| Member | Meaning |
| - | - |
| `CanShowRewardHub` | `ShowRewardHub()` would present a screen right now. |
| `CanShowOffer` | `ShowOffer()` would present a screen right now. |

Value type with `Equals`, `==`, and `!=`, so two snapshots can be compared directly.

**These are not derived from the status.** Both read `false` for a player who is not linked, but a `Linked` player can also have either flag `false` - a reward hub the backend has withdrawn, or an offer that has not appeared yet - and the flags can flip between syncs without the status moving. Availability is a live signal, not a property of the status.

Both flags read `false` until the SDK reaches its first terminal status.

***

## `AlmediaError`

Namespace: `AlmediaLink.Models` · class

Immutable error payload passed to `OnErrorOccurred`.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public AlmediaErrorCode Code    { get; }
public string           Message { get; }
```

| Property | Notes |
| - | - |
| `Code` | See [`AlmediaErrorCode`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediaerrorcode). Unrecognized native codes map to `Unknown`. |
| `Message` | Human-readable string. May contain native-side detail; safe to log, but do not rely on its format for branching. |

***

## `AlmediaErrorCode`

Namespace: `AlmediaLink.Models` · enum

| Value | Source | Typical cause |
| - | - | - |
| `Unknown` | Native | Unrecognized native code (version mismatch). |
| `InvalidConfiguration` | Local or native | Missing integration key, malformed config. Local errors fire synchronously from `Initialize`. |
| `NetworkFailure` | Native | Native HTTP request did not complete (offline, DNS, timeout). |
| `ServerError` | Native | Backend returned 5xx. |
| `RateLimited` | Native | Backend returned 429. |
| `Disabled` | Native | Integration is killswitched. SDK will not function until re-enabled. |
| `LinkingFailed` | Native | The linking flow ended without success (user closed, backend rejected). |
| `InvalidState` | Native | Method called in a state it does not support. |
| `Unexpected` | Native | Catch-all for uncaught native exceptions. |

***

## `AlmediaNotification`

Namespace: `AlmediaLink.Models` · class

Immutable reward-notification payload delivered via `OnNotificationsReceived`.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string           Id         { get; }
public string           Title      { get; }
public string           Message    { get; }
public string           Timestamp  { get; }
public DateTimeOffset?  ReceivedAt { get; }
public string           Display    { get; }
public string           IconUrl    { get; }

[Obsolete] public string Type      { get; }   // alias of Display
```

| Property | Notes |
| - | - |
| `Id` | Stable, unique per notification. Use for dedup and tracking. |
| `Title` | Short headline. |
| `Message` | Body. May be multi-line; render in a wrapping text element. |
| `Timestamp` | Raw ISO 8601 string as delivered by the backend (e.g. `"2025-03-15T10:30:00Z"`). Preserved for logging / re-serialization; prefer `ReceivedAt` for display logic. |
| `ReceivedAt` | Parsed UTC `DateTimeOffset?`, or `null` when `Timestamp` is empty or unparseable. Always normalized to UTC (offset 0), so `DateTimeOffset.UtcNow - notification.ReceivedAt.Value` gives the elapsed time directly. |
| `Display` | Presentation hint: `"popup"` or `"tray"`. Open set - treat values you do not recognize as `"popup"`. Never null or empty. |
| `IconUrl` | Absolute URL of the notification's icon, or `null`. The bundled UI does not render it; the notification prefab supplies the row icon. In custom UI, load it yourself and fall back to your own art when null or unreachable. |
| `Type` | **Obsolete.** Alias of `Display`. Until 1.2.0 this carried a free-form category (`"reward"`, `"status"`); those values no longer exist on the wire, so comparisons against them never match. |

***

## `AlmediaInGameRewardGrant`

Namespace: `AlmediaLink.Models` · class

An in-game-reward grant delivered via [`OnInGameRewardGrantRequested`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediaingamerewardgrant%3E-oningamerewardgrantrequested). Every reward in `Rewards` was granted together and belongs to one celebration.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string                             Id         { get; }
public string                             Timestamp  { get; }
public DateTimeOffset?                    ReceivedAt { get; }
public IReadOnlyList<AlmediaInGameReward> Rewards    { get; }
```

| Property | Notes |
| - | - |
| `Id` | Server-issued and unique per grant; a redelivery repeats it. The dedup key for hosts that want exactly-once crediting. |
| `Timestamp` | Raw ISO 8601 string of when the backend issued the grant. |
| `ReceivedAt` | Parsed UTC `DateTimeOffset?`, or `null` when `Timestamp` is empty or unparseable. |
| `Rewards` | The reward line items. At least one entry. |

***

## `AlmediaInGameReward`

Namespace: `AlmediaLink.Models` · class

One reward line item of an [`AlmediaInGameRewardGrant`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediaingamerewardgrant).

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public double Amount { get; }
public string Code   { get; }
```

| Property | Notes |
| - | - |
| `Amount` | Amount to credit. Whole today, but the contract permits fractions - do not truncate to an integer. |
| `Code` | Reward code agreed with Almedia (e.g. `"gems"`, `"spins"`). Treat unrecognized codes as a no-op rather than an error. |

***

## `AlmediaProgress`

Namespace: `AlmediaLink.Models` · class

A snapshot of the player's progress in this game. [`Progress`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-properties#static-almediaprogress-progress--get-) exposes it and [`OnProgressUpdated`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediaprogress%3E-onprogressupdated) delivers it. A snapshot is never partial. A newer snapshot replaces the previous one. The SDK does not merge snapshots.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string                              Id        { get; }
public string                              Timestamp { get; }
public DateTimeOffset?                     BuiltAt   { get; }
public string                              Username  { get; }
public AlmediaRewardPoints                 Balance   { get; }
public AlmediaRewardPoints                 Earned    { get; }
public IReadOnlyList<AlmediaTask>          Pending   { get; }
public IReadOnlyList<AlmediaCompletedTask> Completed { get; }
public IReadOnlyList<AlmediaTask>          Expired   { get; }
```

| Property | Notes |
| - | - |
| `Id` | Opaque and unique for each snapshot. It has no order. Compare `BuiltAt` instead. |
| `Timestamp` | Raw ISO 8601 string. The time when the server built the snapshot. |
| `BuiltAt` | Parsed UTC `DateTimeOffset?`. `null` when `Timestamp` is empty or not valid. |
| `Username` | The player's username. `null` when the server sent none. A newer snapshot without a username clears the previous value. |
| `Balance` | The player's total balance. |
| `Earned` | The total the player earned in this game. |
| `Pending` | Tasks the player can still do in this game. Not more than one entry for each task. |
| `Completed` | One entry for each completion, newest first. The server limits the number of entries. |
| `Expired` | Tasks the player can no longer complete. The server can limit the number of entries. |

***

## `AlmediaTask`

Namespace: `AlmediaLink.Models` · class

A task the player can do in this game to earn a reward.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string              Id                     { get; }
public string              Kind                   { get; }
public string              Title                  { get; }
public AlmediaRewardPoints Reward                 { get; }
public AlmediaTaskProgress Progress               { get; }
public string              RewardDropsAtTimestamp { get; }
public DateTimeOffset?     RewardDropsAt          { get; }
```

| Property | Notes |
| - | - |
| `Id` | Opaque and stable across snapshots and reward decreases. It identifies the task, not one completion. |
| `Kind` | Groups similar tasks. One of [`AlmediaTaskKind`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediataskkind). The set is open. Treat an unknown value as `AlmediaTaskKind.Main`. |
| `Title` | The title to show the player. |
| `Reward` | The reward for one completion. |
| `Progress` | The player's progress, or `null` for a yes-or-no task. |
| `RewardDropsAtTimestamp` | Raw ISO 8601 string. The time of the next `Reward` decrease, or `null` when none is scheduled. |
| `RewardDropsAt` | Parsed UTC `DateTimeOffset?`. `null` when `RewardDropsAtTimestamp` is `null` or not valid. |

***

## `AlmediaTaskKind`

Namespace: `AlmediaLink.Models` · static class

The known values of [`AlmediaTask.Kind`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediatask), as `const string` members. The server can add more.

| Member | Value | Notes |
| - | - | - |
| `Main` | `"main"` | A regular task. |
| `PurchaseBonus` | `"purchaseBonus"` | Pays when the player makes a purchase. |
| `Burning` | `"burning"` | Its reward decreases on a schedule. See `AlmediaTask.RewardDropsAt`. |
| `BurningPurchaseBonus` | `"burningPurchaseBonus"` | A purchase bonus whose reward decreases on a schedule. |
| `TimeLimited` | `"timeLimited"` | Must be completed before a deadline. |
| `Daily` | `"daily"` | Can be completed once a day. |
| `Play` | `"play"` | Pays for time played. |
| `Unlimited` | `"unlimited"` | Can be completed any number of times. |

***

## `AlmediaTaskProgress`

Namespace: `AlmediaLink.Models` · class

The progress of an [`AlmediaTask`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediatask).

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public long Value  { get; }
public long Target { get; }
```

| Property | Notes |
| - | - |
| `Value` | The value reached so far. |
| `Target` | The value needed to complete the task. |

***

## `AlmediaCompletedTask`

Namespace: `AlmediaLink.Models` · class

One completion of an [`AlmediaTask`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almediatask). A player can complete the same task more than once.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public AlmediaTask         Task         { get; }
public string              Timestamp    { get; }
public DateTimeOffset?     CompletedAt  { get; }
public AlmediaRewardPoints ActualReward { get; }
```

| Property | Notes |
| - | - |
| `Task` | The completed task. |
| `Timestamp` | Raw ISO 8601 string. The time of the completion. |
| `CompletedAt` | Parsed UTC `DateTimeOffset?`. `null` when `Timestamp` is empty or not valid. |
| `ActualReward` | The reward this completion paid. It differs from `Task.Reward` when the reward decreased before completion, or when Freecash adjusted the credit. |

***

## `AlmediaRewardPoints`

Namespace: `AlmediaLink.Models` · class

A balance or a reward in coins, with the display values the server supplied.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public long         Coins            { get; }
public AlmediaMoney InPlayerCurrency { get; }
public AlmediaMoney InUsd            { get; }
```

| Property | Notes |
| - | - |
| `Coins` | The canonical amount. The money values are for display only. The value is signed. A reversal is negative. |
| `InPlayerCurrency` | The amount in the currency the server selected for the player. If this SDK version does not support that currency, the SDK substitutes the `InUsd` value and the `"USD"` code. |
| `InUsd` | The amount in USD. |

Each SDK version supports a closed set of player currencies. You can write your formatting against this list. This release supports `USD`, `EUR`, `GBP`, `CAD`, `AUD`, `PLN`, `CHF`, `KRW`, `JPY` and `SEK`. A new market needs a new SDK release.

***

## `AlmediaMoney`

Namespace: `AlmediaLink.Models` · class

A coin amount in real money, for display only.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public decimal Amount   { get; }
public string  Currency { get; }
```

| Property | Notes |
| - | - |
| `Amount` | An exact `decimal`. The SDK parses it from the wire string, independent of the device locale. The SDK never uses a `float` or a `double`. The scale from the server stays: `12.50` stays `12.50`. |
| `Currency` | The ISO 4217 code, in upper case. |

Every progress type compares by value, so `progress.Completed.Contains(completion.Task)` works and two snapshots with the same content are equal. `AlmediaMoney` compares numerically: `12.50` equals `12.5`.

The SDK does not format money. Format `Amount` with your own symbols, decimals and fonts:

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
var eur = new CultureInfo("de-DE");
label.text = money.Amount.ToString("N2", eur) + " " + money.Currency;   // "12,50 EUR"
```

***

## `AlmediaTaskCompletion`

Namespace: `AlmediaLink.Models` · class

A task the server reports as completed. [`OnTaskCompleted`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediataskcompletion%3E-ontaskcompleted) delivers it.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string               Id   { get; }
public AlmediaCompletedTask Task { get; }
```

| Property | Notes |
| - | - |
| `Id` | The server-generated message id. A replay carries the same id. Deduplicate on it. |
| `Task` | The completion, with `ActualReward`. The task is not always in the current snapshot. |

***

## `AlmediaBalanceChange`

Namespace: `AlmediaLink.Models` · class

A balance change the server reports. [`OnBalanceChanged`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediabalancechange%3E-onbalancechanged) delivers it.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public string              Id      { get; }
public AlmediaRewardPoints Balance { get; }
public AlmediaRewardPoints Change  { get; }
```

| Property | Notes |
| - | - |
| `Id` | The server-generated message id. A replay carries the same id. Deduplicate on it. |
| `Balance` | The balance after the change. It can differ from the current snapshot. |
| `Change` | The signed change. A reversal is negative. |

***

## `PlacementType`

Namespace: `AlmediaLink.Models` · enum

Analytics tag passed to `AlmediaLinkSDK.StartLinking(placement)`.

| Value | Native string | Suggested context |
| - | - | - |
| `Popup` | `"popup"` | Default. Linking initiated from a modal popup. |
| `RewardHub` | `"reward_hub"` | Linking initiated from a rewards / store UI. |
| `Banner` | `"banner"` | Linking initiated from an in-game banner ad slot. |

Behaviorally identical - the difference is reflected only in analytics.

***

## `AlmediaScreen`

Namespace: `AlmediaLink.Models` · enum

Identifies which SDK screen a lifecycle event is about. Delivered to [`OnScreenPresented`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediascreen%3E-onscreenpresented) and [`OnScreenDismissed`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediascreen-inappscreenresult%3E-onscreendismissed).

| Value | Native string | Meaning |
| - | - | - |
| `Linking` | `"linking"` | The account-linking flow shown in an in-app webview. System-browser linking is not reported. |
| `RewardHub` | `"reward_hub"` | The reward progression screen ([`ShowRewardHub()`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-methods#static-void-showrewardhub) or `Engage()` routing). |
| `Offer` | `"offer"` | The offer screen ([`ShowOffer()`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-methods#static-void-showoffer)). |

An unrecognized screen string from native is logged as a warning and the callback is dropped - the events never fire with a garbage value.

***

## `AlmediaFeature`

Namespace: `AlmediaLink.Models` · sealed class

A part of the Link experience a game can declare it hides from its players, through [`AlmediaLinkConfig.DisabledFeatures`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinkconfig) or the settings asset. The backend enforces the declaration; the SDK only reports it and reacts to the status that comes back. Only the static members below exist; there is no constructor and no cast, so an undeclared value cannot be built. A `null` entry in `DisabledFeatures` is ignored.

| Member | Wire name | Disabled means |
| - | - | - |
| `Linking` | `"linking"` | A not-linked player reads `NotAvailable` with reason [`Disabled`](https://docs.almedia.dev/technical/api-reference/almedialink/models#almedianotavailablereason); `StartLinking()` fails through the existing status check. A linked player is untouched. |
| `RewardHub` | `"reward_hub"` | `ScreenAvailability.CanShowRewardHub` is false; `ShowRewardHub()` is a no-op; the bundled button hides. |
| `Offer` | `"offer"` | `ScreenAvailability.CanShowOffer` is false; `ShowOffer()` is a no-op. |
| `Notifications` | `"notifications"` | No Almedia notification reaches the game, in the SDK's UI or through `OnNotificationsReceived`. Reward grants are unaffected. |

Linking and the two screens are independent: hiding the entry point does not un-link anyone or close the hub to a player who linked earlier.

***

## `InAppScreenResult`

Namespace: `AlmediaLink.Models` · class

How an in-app screen was dismissed. Delivered to [`OnScreenDismissed`](https://docs.almedia.dev/technical/api-reference/almedialink/almedialinksdk-events#static-event-action%3Calmediascreen-inappscreenresult%3E-onscreendismissed).

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public InAppScreenResultType Type  { get; }
public AlmediaError          Error { get; }
```

| Property | Notes |
| - | - |
| `Type` | See [`InAppScreenResultType`](https://docs.almedia.dev/technical/api-reference/almedialink/models#inappscreenresulttype). |
| `Error` | Populated only when `Type` is `Failed`; `null` for every other outcome. |

***

## `InAppScreenResultType`

Namespace: `AlmediaLink.Models` · enum

| Value | Native string | Meaning |
| - | - | - |
| `Completed` | `"completed"` | The web client closed the screen through its JS bridge. |
| `Cancelled` | `"cancelled"` | The player closed the screen with the close/back button. |
| `Failed` | `"failed"` | The screen could not load. `InAppScreenResult.Error` carries the detail. |

An unrecognized value from native is treated as `Cancelled` and logged.

***

## `AlmediaLogLevel`

Namespace: `AlmediaLink` · enum

Severity levels for `OnLog`, ordered low → high.

```csharp theme={"theme":{"light":"github-light","dark":"night-owl"}}
public enum AlmediaLogLevel
{
    Verbose = 0,
    Debug   = 1,
    Info    = 2,
    Warning = 3,
    Error   = 4
}
```

***


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