diff --git a/Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs b/Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs index 45919843..fb0fdb7d 100644 --- a/Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs +++ b/Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs @@ -244,6 +244,7 @@ public void PlatformSpecificSetup() $"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open /f", $"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open\\command /t REG_SZ /d \"\\\"{appPath}\\\" \\\"%1\\\"\" /f", }; +#if ENABLE_MONO foreach(var args in commands) { var command = new System.Diagnostics.ProcessStartInfo(); command.FileName = "C:\\Windows\\System32\\reg.exe"; @@ -252,6 +253,25 @@ public void PlatformSpecificSetup() command.CreateNoWindow = true; System.Diagnostics.Process.Start(command); } +#elif ENABLE_IL2CPP + try + { + foreach(var args in commands) { + var command = new System.Diagnostics.ProcessStartInfo(); + command.FileName = "C:\\Windows\\System32\\reg.exe"; + command.Arguments = args; + command.UseShellExecute = false; + command.CreateNoWindow = true; + System.Diagnostics.Process.Start(command); + } + } + catch (Exception ex) + { + string message = $"Failed to register URL scheme '{_urlScheme}': {ex.Message}" + "\nSocial sign in is not currently supported on IL2CPP"; + Debug.LogWarning(message); + throw new Exception(message); + } +#endif StartWindowsServer(); #elif UNITY_STANDALONE_OSX diff --git a/Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs b/Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs index d1fce42c..185c6954 100644 --- a/Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs +++ b/Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs @@ -63,7 +63,12 @@ public WaaSLogin(IValidator validator = null) string nonce = SequenceCoder.KeccakHashASCII(_sessionId).EnsureHexPrefix(); _authenticator = new OpenIdAuthenticator(nonce); - _authenticator.PlatformSpecificSetup(); + try { + _authenticator.PlatformSpecificSetup(); + } + catch (Exception e) { + Debug.LogError($"Error encountered during PlatformSpecificSetup: {e.Message}\nSocial sign in will not work."); + } Application.deepLinkActivated += _authenticator.HandleDeepLink; _authenticator.SignedIn += OnSocialLogin; _authenticator.OnSignInFailed += OnSocialSignInFailed; diff --git a/Assets/package.json b/Assets/package.json index 0994401d..a6aa4621 100644 --- a/Assets/package.json +++ b/Assets/package.json @@ -1,6 +1,6 @@ { "name": "xyz.0xsequence.waas-unity", - "version": "2.8.2", + "version": "2.8.3", "displayName": "Sequence Embedded Wallet SDK", "description": "A Unity SDK for the Sequence WaaS API", "unity": "2021.3",