Hi !
I’m on v1.0.5 and unity 2020.3.23
This is my WalletConnectHandler method (having changed anything):
public async void WalletConnectHandler(WCSessionData data)
{
Debug.Log("Wallet connection received");
// Extract wallet address from the Wallet Connect Session data object.
string address = data.accounts[0].ToLower();
string appId = MoralisInterface.GetClient().ApplicationId;
long serverTime = 0;
// Retrieve server time from Moralis Server for message signature
Dictionary<string, object> serverTimeResponse = await MoralisInterface.GetClient().Cloud.RunAsync<Dictionary<string, object>>("getServerTime", new Dictionary<string, object>());
if (serverTimeResponse == null || !serverTimeResponse.ContainsKey("dateTime") ||
!long.TryParse(serverTimeResponse["dateTime"].ToString(), out serverTime))
{
Debug.Log("Failed to retrieve server time from Moralis Server!");
}
Debug.Log($"Sending sign request for {address} ...");
string signMessage = $"Moralis Authentication\n\nId: {appId}:{serverTime}";
string response = await walletConnect.Session.EthPersonalSign(address, signMessage);
Debug.Log($"Signature {response} for {address} was returned.");
// Create moralis auth data from message signing response.
Dictionary<string, object> authData = new Dictionary<string, object> { { "id", address }, { "signature", response }, { "data", signMessage } };
Debug.Log("Logging in user.");
// Attempt to login user.
MoralisUser user = await MoralisInterface.LogInAsync(authData);
if (user != null)
{
Debug.Log($"User {user.username} logged in successfully. ");
}
else
{
Debug.Log("User login failed.");
}
HideWalletSelection();
}
here is the full log screenshot :