Hey, we are using the Unity SDK in multiple Unity projects, our implementation seems to be solid in general, but since we started internal testing, in some devices Web3Auth & OpenLogin started to give some errors that we cannot replicate.
Both errors happen right after calling the login method and before any provider screen shows up.
The first one was OpenLogin giving “Invalid constructor params, network or sdk url”. On some devices it kept on giving the same error, and other devices never did. Removing app data or reinstalling the app didn’t help. Clean devices kept working, they never replicated it. Both iOS and Android builds had this. We have WebGL builds, also, but it seems to be working fine. We did some digging, couldn’t find anything. We saw that our Web3Auth Unity SDK version was fairly old(1.8.0) decided to update it. Screenshot:
We updated to 2.1.0. Now the problematic devices are stuck at another error: “Invalid environment settings” And this time the issue it seems to be happening before we’re redirected from Web3Auth to OpenLogin. Screenshot:
And this is the URL from that page, if that helps: Web3Auth
Details as requested:
- SDK Version: 1.8.0 & 2.1.0
- Platform: Unity (Android and iOS) (We also have WebGL builds but haven’t run into these errors in them)
- Browser Console Screenshots: N/A because it happens on some mobile devices and not on web, it is considerably harder to get meaningful logs
Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.
Initialization code:
_web3Auth.setOptions(new Web3AuthOptions()
{
clientId = clientId,
redirectUrl = uri,
network = network switch
{
"mainnet" => Web3Auth.Network.MAINNET,
"cyan" => Web3Auth.Network.CYAN,
"testnet" => Web3Auth.Network.TESTNET,
"aqua" => Web3Auth.Network.AQUA,
_ => Web3Auth.Network.TESTNET,
},
buildEnv = network switch
{
"mainnet" => Web3Auth.BuildEnv.PRODUCTION,
_ => Web3Auth.BuildEnv.TESTING
},
});
_web3Auth.onLogin += OnLogin;
_web3Auth.onLogout += OnLogout;
}
Our login code:
var loginParams = new LoginParams()
{
loginProvider = loginProvider,
mfaLevel = MFALevel.NONE,
};
if (options?.ContainsKey("email") ?? false)
{
loginParams.extraLoginOptions = new ExtraLoginOptions() { login_hint = options["email"] };
}
_web3Auth.login(loginParams);