Unity Moralis v1.2.7 Unauthorized Problem

I am using Unity 2021.3.9f1 (latest stable) and i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. How can i fix?

This happens when you try first time to authenticate?

Yes. I’ve been trying since today. Also i opened a new server and I opened a new moralis account and tried it. But nothing changes. Few months ago I was connecting with old version moralis without any problem.

Can you check the request that is made to see if the application id is included?

Is there anything wrong?


I mean in the request that is made. I remember of a similar issue that was related to missing the application id from the sent request. There is an issue created on GitHub for that.

I scan it with a qr code from my phone and approve all permissions. Warning messages coming to my phone are “Connected to Moralis SDK Application” and “Signed”. Everything looks fine in the metamask on my phone. Already a few months ago, I was able to connect with the old version moralis without any problems.

It could be a bug in latest version

I tried with v1.2.5 but same error:

I am referring to this issue:

maybe you can add comments there if it is a similar case

I tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).

Would you recommend me to use 1.1.0?

I don’t know what to recommend, we should find out why you get that error.

I tested Unity 2021.3.3f1, 2021.3.4f1, 2021.3.8f1, 2021.3.9f1, 2020.3.0f1. Also, i used moralis sdk 1.2.5 and 1.2.7. Same error on all of them. But , i have tested with moralis old sdk (v1.1.0) and unity 2021.3.9f1, there is no problem. Wallet connection is working. I don’t understand :frowning:

You are testing with new projects each time (e.g. to make sure it’s not related to something like caching)? Is your server updated?

You can create an issue.

Yes, i created new empty projects and i installed v1.2.7 game kit each time. But everytime same error. Server updated. Also, I tried different servers as well. But not working. I think 1.2.7 game kit have problem because 1.1.0 is working perfectly.
I created new issue:

Today, i tried on Mac OS. I created new empty project and installed 1.2.7 game kit. Wallet connection is working perfectly on Unity Editor with metamask scanning.
Unity version: 2021.3.9f1 apple silicon
Game kit version: 1.2.7
After that, I switched target to WebGL. But, i do not have moraliswebgl template in player settings.

So i build webgl and open with chrome. Now, i have this errors:

That error looks like some variable is undefined. The variable that is used as variable.connect

Webgl build errors solved:

  • Copy the WebGLTemplates folder from Packages/io.moralis.web3-unity-sdk/Resources/ to the Assets folder

  • In Player Settings change the WebGL template to the Moralis WebGL Template.

But when i press connect button, connected my metamask wallet. But after connect wallet, there is only black screen. Is this normal?

Do you get another error there? Is there meant to be something showing e.g. another scene?