11. Daily rewards
There are three kinds of reward the client may claim. The client only asks to claim. MultiConnectCloud decides whether the claim is allowed and what it pays, from your dashboard settings.
Daily bonus
Set it up: on the app page, open Daily rewards, go to Daily bonus, and choose a Mode:
| Mode | How it works |
|---|---|
| Calendar | A window of N days from the first claim, then a new one. Turn on Missed days in the window can still be claimed (catch-up) to let players claim days they missed |
| Streak | Consecutive days. A missed day starts again at day 1 |
Add a gift for each day.
Script 11.1: Show and claim the daily bonus
using MultiConnect.App;
using UnityEngine;
public class DailyBonusPopup : MonoBehaviour
{
private async void OnEnable()
{
var bonus = await McAppDailyBonus.GetAsync();
if (!bonus.Ok || bonus.Value == null || bonus.Value.mode == "off") return;
foreach (var day in bonus.Value.days)
Debug.Log($"Day {day.day}: {day.state}"); // claimed, claimable, catch_up, locked, missed
if (!bonus.Value.claimedToday)
{
var claim = await McAppDailyBonus.ClaimAsync();
if (claim.Ok && claim.Value != null)
Debug.Log("Claimed. Coins now " + claim.Value.Balance("coins"));
}
}
}
Claiming a past day: ClaimAsync(dayNumber) claims a day marked catch_up. That works only in calendar mode with catch-up on.
Daily tasks
What a task is: a goal for the day, such as "win 3 games", with a reward.
Set it up: on Daily rewards, go to Daily tasks and add tasks. Each has:
- a Key;
- a Name;
- a Counter: the name of what your server counts, e.g.
wins; - a Target;
- what Finishing it gives.
Tasks per day says how many of the active tasks each player gets each day.
Progress comes only from your server, which saw the game happen. The client can then claim a task once it is complete.
Script 11.2: Server: count a win toward today's tasks
using System.Threading.Tasks;
using MultiConnect.App;
public static class TaskProgress
{
public static Task CountWin(string matchId, string winnerPlayerId) =>
McAppServer.AddTaskProgressAsync(winnerPlayerId, "wins", 1, requestId: matchId + ":wins");
}
Script 11.3: Client: list tasks and claim the finished ones
using MultiConnect.App;
using UnityEngine;
public class DailyTasksScreen : MonoBehaviour
{
private async void OnEnable()
{
var tasks = await McAppTasks.GetAsync();
if (!tasks.Ok || tasks.Value == null) return;
foreach (var task in tasks.Value.tasks)
{
Debug.Log($"{task.name}: {task.progress}/{task.target}");
if (task.completed && !task.claimed)
{
var claim = await McAppTasks.ClaimAsync(task.taskKey);
Debug.Log(claim.Ok ? "Claimed " + task.name : claim.Message);
}
}
}
}
Ad reward
Set it up: on the Economy page, under Ad reward and the game's day, set what One ad gives and the Ads per day limit.
Claim it: after your ad plugin reports that the player earned the reward, call McAppAds.ClaimRewardAsync(). The answer has the new wallet, plus claimedToday and dailyCap, so you can hide the button when the limit is reached.
Ad rewards can't be verified with the ad network, so a modified client could claim without watching. The daily limit is what keeps that small.
Pay an unfinished task with an ad
Some games let a player watch a rewarded ad to collect a task they haven't finished. To allow it, turn on A rewarded ad may pay a task that is not finished yet under Level multipliers and ads on Daily rewards.
In the game: after the ad's "earned reward" callback, call McAppTasks.ClaimWithAdAsync(taskKey).
- It pays the task's reward and marks the task as claimed, so it can't be paid again, by another ad or by finishing it later.
- It uses one of the day's ad rewards, so Ads per day limits both kinds of ad together. The answer has
claimedTodayanddailyCap, as forClaimRewardAsync.
Level multipliers
What they do. A higher-level player can earn more from the same reward. The daily bonus, task rewards and the ad reward pay their currencies times the multiplier for the player's level, rounded down. Items are never multiplied.
Set them up: on Daily rewards, under Level multipliers and ads, add level ranges with From level, To level and a Multiplier (for example 1.5). A level outside every range pays ×1.
Set each player's level from your server, with McAppServer.SetPlayerLevelAsync(playerId, level). The client can't set it.
What players see: the amounts McAppDailyBonus.GetAsync and McAppTasks.GetAsync return are already multiplied, so your screens show what the player will actually get. McApp.Player.level holds the player's level.

