- Add PlayFabSDK as local package dependency - Add PlayFabTool.cs for PlayFab API integration - Implement LoginBySns method in TYSdkFacade - Add Android SNS login support in SDKManager and UnityBridgeFunc - Add Build Android With Debug menu option - Improve exception handling and timeout management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
68 lines
2.9 KiB
C#
68 lines
2.9 KiB
C#
#if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using PlayFab.EventsModels;
|
|
using PlayFab.Internal;
|
|
|
|
namespace PlayFab
|
|
{
|
|
/// <summary>
|
|
/// Write custom PlayStream and Telemetry events for any PlayFab entity. Telemetry events can be used for analytic,
|
|
/// reporting, or debugging. PlayStream events can do all of that and also trigger custom actions in near real-time.
|
|
/// </summary>
|
|
public static class PlayFabEventsAPI
|
|
{
|
|
static PlayFabEventsAPI() {}
|
|
|
|
|
|
/// <summary>
|
|
/// Verify entity login.
|
|
/// </summary>
|
|
public static bool IsEntityLoggedIn()
|
|
{
|
|
return PlayFabSettings.staticPlayer.IsEntityLoggedIn();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clear the Client SessionToken which allows this Client to call API calls requiring login.
|
|
/// A new/fresh login will be required after calling this.
|
|
/// </summary>
|
|
public static void ForgetAllCredentials()
|
|
{
|
|
PlayFabSettings.staticPlayer.ForgetAllCredentials();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Write batches of entity based events to PlayStream. The namespace of the Event must be 'custom' or start with 'custom.'.
|
|
/// </summary>
|
|
public static void WriteEvents(WriteEventsRequest request, Action<WriteEventsResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
|
{
|
|
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
|
var callSettings = PlayFabSettings.staticSettings;
|
|
if (!context.IsEntityLoggedIn()) throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn,"Must be logged in to call this method");
|
|
|
|
|
|
PlayFabHttp.MakeApiCall("/Event/WriteEvents", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Write batches of entity based events to as Telemetry events (bypass PlayStream). The namespace must be 'custom' or start
|
|
/// with 'custom.'
|
|
/// </summary>
|
|
public static void WriteTelemetryEvents(WriteEventsRequest request, Action<WriteEventsResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
|
|
{
|
|
var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
|
|
var callSettings = PlayFabSettings.staticSettings;
|
|
if (!context.IsEntityLoggedIn()) throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn,"Must be logged in to call this method");
|
|
|
|
|
|
PlayFabHttp.MakeApiCall("/Event/WriteTelemetryEvents", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif
|