Skip to content

Commit 0ee8478

Browse files
committed
Add new EndSession method with no input parameters
1 parent 3f29528 commit 0ee8478

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,31 @@ public static void StartAppleSession(string token, Action<LootLockerSessionRespo
403403
LootLockerAPIManager.AppleSession(sessionRequest, onComplete);
404404
}
405405

406+
public static void EndSession(Action<LootLockerSessionResponse> onComplete)
407+
{
408+
if (!CheckInitialized())
409+
{
410+
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerSessionResponse>());
411+
return;
412+
}
413+
414+
// Clear White Label Login credentials
415+
if (CurrentPlatform == "white_label")
416+
{
417+
PlayerPrefs.DeleteKey("LootLockerWhiteLabelSessionToken");
418+
PlayerPrefs.DeleteKey("LootLockerWhiteLabelSessionEmail");
419+
}
420+
421+
CurrentPlatform = "";
422+
LootLockerSessionRequest sessionRequest = new LootLockerSessionRequest();
423+
LootLockerAPIManager.EndSession(sessionRequest, onComplete);
424+
}
425+
426+
/// <summary>
427+
/// Calling this method with devideId is deprecated
428+
/// </summary>
429+
/// <param name="deviceId"></param>
430+
/// <param name="onComplete"></param>
406431
public static void EndSession(string deviceId, Action<LootLockerSessionResponse> onComplete)
407432
{
408433
if (!CheckInitialized())

0 commit comments

Comments
 (0)