プレイヤー受信箱

プレイヤー受信箱

通知と件数制限のある個人メッセージを届けます。

無料で始める

プレイヤー受信箱

通知と件数制限のある個人メッセージを届けます。

SDK と REST

Unity、Godot、Unreal と統合するか、REST インターフェースを使えます。

プロジェクトのダッシュボード

プロジェクトで各機能を設定し、現在のデータを管理できます。

クイック統合

クイック統合

プレイヤー受信箱
動画は近日公開

一斉配信を作成し、保護報酬を確認して、プレイヤー操作なしで受信箱を閲覧します。

クイック統合
Unity (C#)
using UnityEngine;
using PM.horizOn.Cloud.Manager;
using PM.horizOn.Cloud.Objects.Network.Responses;

var userId = UserManager.Instance.CurrentUser.UserId;
var manager = InboxManager.Instance;
var loaded = await manager.GetInbox(userId, since: null);
if (!loaded.IsSuccess) { Debug.LogWarning(loaded.ErrorCode); return; }
foreach (var entry in loaded.Data.entries) Debug.Log(entry.textKey);
// The manager retains full cached entries when the wire response is unchanged.
// Poll again only after loaded.Data.pollAfterSeconds, and stop with the game lifecycle.

bool claimInFlight = false;
async System.Threading.Tasks.Task ClaimSelectedReward(string entryId)
{
    if (claimInFlight) return;
    const string projectId = "YOUR_PROJECT_ID";
    string pendingKey = "horizOn_inbox_claim_" + projectId + "_" + userId;
    string pending = PlayerPrefs.GetString(pendingKey, "");
    if (pending.Length > 0 && pending != entryId) return; // Resolve the original claim first.
    if (pending.Length == 0)
    {
        var current = manager.CurrentInbox; // Authorized for the current project/session.
        if (current == null || current.userId != userId) return;
        var selected = System.Array.Find(current.entries, entry => entry.id == entryId);
        if (selected == null || selected.claimed || selected.attachment?.values == null ||
            selected.attachment.values.Length == 0) return;
    }
    // Previously saved IDs remain replayable even after their visible state changes.
    PlayerPrefs.SetString(pendingKey, entryId);
    PlayerPrefs.Save();
    if (PlayerPrefs.GetString(pendingKey) != entryId) return;
    claimInFlight = true;
    try
    {
        var claimed = await manager.Claim(userId, entryId);
        if (!claimed.IsSuccess) { Debug.LogWarning(claimed.ErrorCode); return; }
        // Display claimed.Data.inbox and replace values with claimed.Data.playerValues.
        // The SDK refreshes its cache. Never add reward deltas yourself.
        if (PlayerPrefs.GetString(pendingKey, "") == entryId)
        {
            PlayerPrefs.DeleteKey(pendingKey);
            PlayerPrefs.Save();
        }
    }
    finally { claimInFlight = false; }
}
// Invoke ClaimSelectedReward only from an explicit player action.
// Retry the saved entryId after a lost response; no replacement grant or new action ID.
// Other deliberate actions: await manager.MarkRead(userId, entryId);
// await manager.Remove(userId, entryId); // Protects unclaimed rewards.

これらの例では、Unity SDK(C#)とREST APIを使っています。GodotとUnrealでも、それぞれのSDKで同じ呼び出しができます: クイックスタートを参照

よくある質問

よくある質問

統合の準備はできましたか?

horizOn で今日からゲームバックエンドを構築しましょう。無料プラン付き。