Reward mailbox
The reward mailbox holds rewards for a player to claim later. For how it works, see Reward Mailbox. For a team’s shared mailbox, see Teams.
Initializing the reward mailbox system #
The reward mailbox system relies on the Nakama System and an ILogger. Pass both to the constructor:
| |
The Nakama System must be initialized first. Otherwise, initializing the reward mailbox system throws an InvalidOperationException.
Listing mailbox entries #
List the rewards in the player’s mailbox. Results are paginated: pass the returned Cursor to get the next page.
| |
Claiming a reward #
Claim a reward by its entry ID. Set delete to true to remove the entry from the mailbox after it’s claimed:
| |
Deleting mailbox entries #
Delete one or more entries without claiming them:
| |
The mailbox entry object #
| Attribute | Type | Definition |
|---|---|---|
Id | string | Unique identifier for this mailbox entry |
Reward | Reward | Reward object containing currencies, items, and other assets |
CreateTimeSec | long | Unix timestamp when this entry was created |
UpdateTimeSec | long | Unix timestamp when this entry was last modified |
ExpiryTimeSec | long | Unix timestamp when this entry expires and becomes invalid |
ClaimTimeSec | long | Unix timestamp when this entry was claimed, 0 if unclaimed |
CanClaim | bool | Whether this entry’s reward can currently be claimed |
