Skip to content

Commit affb32a

Browse files
Fix/il2cpp pc exception (#127)
* Catch exception and give explanation that IL2CPP not currently supported for social sign in on PC * Increment package version
1 parent 6b321c1 commit affb32a

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

Assets/Sequence/SequenceSDK/Authentication/OpenIdAuthenticator.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public void PlatformSpecificSetup()
244244
$"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open /f",
245245
$"add HKEY_CURRENT_USER\\Software\\Classes\\{_urlScheme}\\shell\\open\\command /t REG_SZ /d \"\\\"{appPath}\\\" \\\"%1\\\"\" /f",
246246
};
247+
#if ENABLE_MONO
247248
foreach(var args in commands) {
248249
var command = new System.Diagnostics.ProcessStartInfo();
249250
command.FileName = "C:\\Windows\\System32\\reg.exe";
@@ -252,6 +253,25 @@ public void PlatformSpecificSetup()
252253
command.CreateNoWindow = true;
253254
System.Diagnostics.Process.Start(command);
254255
}
256+
#elif ENABLE_IL2CPP
257+
try
258+
{
259+
foreach(var args in commands) {
260+
var command = new System.Diagnostics.ProcessStartInfo();
261+
command.FileName = "C:\\Windows\\System32\\reg.exe";
262+
command.Arguments = args;
263+
command.UseShellExecute = false;
264+
command.CreateNoWindow = true;
265+
System.Diagnostics.Process.Start(command);
266+
}
267+
}
268+
catch (Exception ex)
269+
{
270+
string message = $"Failed to register URL scheme '{_urlScheme}': {ex.Message}" + "\nSocial sign in is not currently supported on IL2CPP";
271+
Debug.LogWarning(message);
272+
throw new Exception(message);
273+
}
274+
#endif
255275

256276
StartWindowsServer();
257277
#elif UNITY_STANDALONE_OSX

Assets/Sequence/SequenceSDK/WaaS/WaaSLogin.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ public WaaSLogin(IValidator validator = null)
6363

6464
string nonce = SequenceCoder.KeccakHashASCII(_sessionId).EnsureHexPrefix();
6565
_authenticator = new OpenIdAuthenticator(nonce);
66-
_authenticator.PlatformSpecificSetup();
66+
try {
67+
_authenticator.PlatformSpecificSetup();
68+
}
69+
catch (Exception e) {
70+
Debug.LogError($"Error encountered during PlatformSpecificSetup: {e.Message}\nSocial sign in will not work.");
71+
}
6772
Application.deepLinkActivated += _authenticator.HandleDeepLink;
6873
_authenticator.SignedIn += OnSocialLogin;
6974
_authenticator.OnSignInFailed += OnSocialSignInFailed;

Assets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "2.8.2",
3+
"version": "2.8.3",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for the Sequence WaaS API",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)