デジタルサービス法通知
Understand Digital Services Act compliance requirements for publishing games with Unity Authentication in the European Union.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前
最小 SDK バージョン: 3.3.0
デジタルサービス法 が 2024 年 2 月 17 日に完全施行されたことに伴い、新しい通知 API との統合が義務化されています。詳細については、DSA コンプライアンスの取り組みに関するページ を参照してください。 この記事では、通知 API を統合して以下を行う方法について説明します。- サインイン済みのプレイヤーに対する新しい通知を確認する。
- バンされたプレイヤーに対する新しい通知を確認する。
サインイン済みのプレイヤーに対する通知
プレイヤーがサインインに成功するたびに、Authentication SDK はそのプレイヤーに表示できる通知があるかどうかを検証し、通知がある場合は、LastNotificationDate- サインイン成功後に、フィールドが null でないことを確認する。これは、そのプレイヤーに通知があることを意味します。通知の例: "あなたのアカウントまたはコンテンツが DSA アクションの影響を受けました。詳細を確認し、こちらから異議を申し立ててください: [リンク] (ケース ID [挿入] とプレイヤー ID [挿入] が必要です)。"
LastNotificationDate- 開発者は、このテキストをプレイヤーに表示する義務を負います。
- プレイヤーが最後に読んだ通知の日付として保存した値よりも、の方が大きいかどうかを確認する。
LastNotificationDate - メソッドを呼び出してプレイヤーの通知を取得する。
GetNotificationsAsync - 通知をプレイヤーに表示する。(通知は メソッドの戻り値として取得でき、
GetNotificationsAsyncフィールドにもキャッシュされます)。Notifications - プレイヤーが通知を読んだ際に、通知の 値とプレイヤーが最後に読んだ通知の日付の保存値を比較し、大きい方の値を保存する。
CreatedAt
バンされたプレイヤーに対する通知
プレイヤーがサインインを試みた際、そのプレイヤーに制限が課せられている (例えば、バンされていたり、無効化されていたりする) ためにサインインが失敗した場合は、AuthenticationExceptionNotifications- サインインが失敗するたびに、例外が かどうかを確認する。
AuthenticationException - Notifications フィールドが null でないかどうかを確認する。
- 通知をプレイヤーに表示する。
- : プレイヤーが通知の詳細をリクエストできるようにするためのケース識別子。
CaseId - : プレイヤーが通知の詳細をリクエストできるようにするためのクラウドプロジェクト識別子。
ProjectId - : プレイヤーに表示する通知の内容。例: "あなたのアカウントまたはコンテンツが DSA アクションの影響を受けました。詳細を確認し、こちらから異議を申し立ててください: [リンク] (ケース ID [挿入] とプレイヤー ID [挿入] が必要です)。"
Message - : 通知が作成された日時のタイムスタンプ。この値を使用して、プレイヤー向けの新しい通知が利用可能かどうかが判断されます。
CreatedAt
async Task SignInWithNotifications(){ List<Notification> notifications = null; try { // Sign the Player In, Anonymously in this example await AuthenticationService.Instance.SignInAnonymouslyAsync(); // Verify the LastNotificationDate var lastNotificationDate = AuthenticationService.Instance.LastNotificationDate; long storedNotificationDate = // Retrieve the last notification read createdAt date from storage using GetLastNotificationReadDate(); // Verify if the LastNotification date is available and greater than the last read notifications if (lastNotificationDate != null && long.Parse(lastNotificationDate) > storedNotificationDate) { // Retrieve the notifications from the backend notifications = await AuthenticationService.Instance.GetNotificationsAsync(); } } catch (AuthenticationException e) { // Read notifications from the banned player exception notifications = e.Notifications; // Notify the player with the proper error message Debug.LogException(e); } catch (Exception e) { // Notify the player with the proper error message Debug.LogException(e); } if (notifications != null) { // Display notifications }}void OnNotificationRead(Notification notification){ long storedNotificationDate = // Retrieve the last notification read createdAt date from storage GetLastNotificationReadDate(); var notificationDate = long.Parse(notification.CreatedAt); if (notificationDate > storedNotificationDate) { SaveNotificationReadDate(notificationDate); }}void SaveNotificationReadDate(notificationReadDate) { // Store the notificationReadDate, e.g.: PlayerPrefs}long GetLastNotificationReadDate() { // Retrieve the notificationReadDate that was stored in SaveNotificationReadDate, e.g.: PlayerPrefs ...}