diff --git a/Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime/WalletConnect.cs b/Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime/WalletConnect.cs index cea5ceac..bdcb5f7f 100644 --- a/Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime/WalletConnect.cs +++ b/Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime/WalletConnect.cs @@ -69,7 +69,8 @@ public async Task InitializeAsync() } var currentSyncContext = SynchronizationContext.Current; - if (currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext") + bool isSkipSyncCtxCheck = AppContext.TryGetSwitch("IsSkipWalletConnectSyncCtxCheck", out var isEnabled) && isEnabled; + if (!isSkipSyncCtxCheck && currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext") throw new Exception( $"[WalletConnectUnity] SynchronizationContext is not of type UnityEngine.UnitySynchronizationContext. Current type is {currentSyncContext.GetType().FullName}. Make sure to initialize WalletConnect from the main thread." );