Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Packages/Marketplace/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.immutable.marketplace",
"version": "1.36.4",
"version": "1.36.5",
"description": "Marketplace package for the Immutable SDK for Unity",
"displayName": "Immutable Marketplace",
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class SdkVersionInfoHelpers
{
public static string GetSdkVersionInfo()
{
return "1.36.4";
return "1.36.5";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,52 @@ void Start()
ShowOutput("Passport Instance is null");
}

// Set up button listeners if buttons are assigned
if (DefaultLoginButton != null) DefaultLoginButton.onClick.AddListener(() => Login(DirectLoginMethod.None));
if (GoogleLoginButton != null) GoogleLoginButton.onClick.AddListener(() => Login(DirectLoginMethod.Google));
if (AppleLoginButton != null) AppleLoginButton.onClick.AddListener(() => Login(DirectLoginMethod.Apple));
if (FacebookLoginButton != null) FacebookLoginButton.onClick.AddListener(() => Login(DirectLoginMethod.Facebook));
// Set up button listeners using DirectLoginOptions
if (DefaultLoginButton != null) DefaultLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions()));
if (GoogleLoginButton != null) GoogleLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions(DirectLoginMethod.Google)));
if (AppleLoginButton != null) AppleLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions(DirectLoginMethod.Apple)));
if (FacebookLoginButton != null) FacebookLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions(DirectLoginMethod.Facebook)));
}

/// <summary>
/// Logs into Passport using the default auth method.
/// </summary>
public async void Login()
{
await LoginAsync(DirectLoginMethod.None);
await LoginAsync(new DirectLoginOptions());
}

/// <summary>
/// Logs into Passport using the specified direct login method.
/// Logs into Passport using the specified direct login options.
/// </summary>
/// <param name="directLoginMethod">The direct login method to use (Google, Apple, Facebook, or None for default)</param>
public async void Login(DirectLoginMethod directLoginMethod)
/// <param name="directLoginOptions">The direct login options</param>
public async void Login(DirectLoginOptions directLoginOptions)
{
await LoginAsync(directLoginMethod);
await LoginAsync(directLoginOptions);
}

/// <summary>
/// Internal async method that performs the actual login logic.
/// </summary>
/// <param name="directLoginMethod">The direct login method to use</param>
private async System.Threading.Tasks.Task LoginAsync(DirectLoginMethod directLoginMethod)
/// <param name="directLoginOptions">The direct login options</param>
private async System.Threading.Tasks.Task LoginAsync(DirectLoginOptions directLoginOptions)
{
try
{
string methodName = directLoginMethod == DirectLoginMethod.None ? "default" : directLoginMethod.ToString();
ShowOutput($"Logging in with {methodName} method...");
string directLoginMethod = directLoginOptions.directLoginMethod.ToString().ToLower();

bool success = await Passport.Login(useCachedSession: false, directLoginMethod: directLoginMethod);
ShowOutput($"Logging in with {directLoginMethod} method...");

bool success = await Passport.Login(useCachedSession: false, directLoginOptions: directLoginOptions);

if (success)
{
ShowOutput($"Successfully logged in with {methodName}");
ShowOutput($"Successfully logged in with {directLoginMethod}");
SceneManager.LoadScene("AuthenticatedScene");
}
else
{
ShowOutput($"Failed to log in with {methodName}");
ShowOutput($"Failed to log in with {directLoginMethod}");
}
}
catch (OperationCanceledException ex)
Expand Down
2 changes: 1 addition & 1 deletion src/Packages/Passport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.immutable.passport",
"version": "1.36.4",
"version": "1.36.5",
"description": "The Immutable SDK for Unity helps you integrate your game with Immutable Passport.\n\nFor a complete working example, please visit https://github.com/immutable/unity-immutable-sdk/tree/main/sample.",
"displayName": "Immutable Passport",
"author": {
Expand Down