WebGL app returns POST error while wallet connect

Greetings. I’m trying to build Unity WebGL app. I’m successfully deploy parse server and other stuff.
But while wallet connection I’m get some errors related with POST query. I’m sure what server is alive, bc I’m retrieve {"error":"unauthorized"} response.
Here is what I retrieve, when I deploy WebGL app on localhost. With what it can be related? Because the server was setup correctly.

  • Moralis Game Kit version: 1.2.11
  • Unity editor version: 2021.2.16 (silicon)

Have you made the changes outlined here for the SDK to work with self-hosted servers?

Yeah. Actually in two different version sdk’s.

There is /server/server being used in your errors, can you doublecheck your server / dapp URL in your Unity SDK setup as well as the steps outlined in that topic to make sure everything seems correct.

Here is my .env file on server. Also, I have checked both variants in setup file in Unity (like http://my-ip/server and without /server). Anyway I just retrieve that error.

That seems fine. In your Unity project, the dapp URL needs to have /server at the end e.g. http://127.0.0.1:1337/server.

Should I insert port into dapp URL like http://90.21.32.15:1337/server?
(thats not my actual ip)

Btw, right now I have dapp URL like that http://127.0.0.1/server .

You mentioned you had already tested the server URL in your browser so this is what you use. Test with your self-hosted server locally first to make sure it works.

Hm, I will test now locally with port number in the moralis setup

Unfortunately, url with port number isn’t work for me. I just retrieve that error and black screen

GET http://localhost:3000/53119848 404 (Not Found)

My setup resource file
(thats not my actual ip)

Can you screenshot your Unity setup window (Tools > Unity SDK > Web3 Setup). Can you test with your self-hosted locally e.g. http://localhost:1337/server to start with also, just like as instructed with these steps.

It’s the same as in resource files.

I need to setup it again. I will be back later.

Oh, nvm, locally thats works perfectly (probably db bugs). Also, the last question. How could I change wallet connection to for example Trust Wallet (with qr code). Bc, I just choose Trust Wallet as default wallet in Wallet Connect script (in the Demo scene), but anyway when I try to connect - metamask connect window opened. How could I choose any other wallet provider?

I will look at this over the next week.

1 Like

Are you saying this is for WebGL or WalletConnect (you said qr code)? Because with WalletConnect, you just scan the code with the wallet you want to connect.

I want to implement multiply wallet connection with wallet selection in WebGL. For example:

  1. User select to connect metamask wallet and app connected with metamask (with browser extension).
  2. User select to connect via Trust wallet - app shows to user QR code for mobile auth (with Trust Wallet app).
    Also the question is How to generate wallet connect QR and shows him for connect. Like that:

Greetings, alex. Any updates?