Open brian-kryptomon opened 2 weeks ago
And obviously this is the error I get when I try to open the modal:
Exception: Web3Modal not initialized
at WalletConnect.Web3Modal.Web3Modal.OpenModal (WalletConnect.Web3Modal.ViewType viewType) [0x00000] in <00000000000000000000000000000000>:0
at PinkMoon.World.Blockchain.WalletConnectWalletProviderService.Connect () [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
at PinkMoon.World.Blockchain.WalletConnectWalletProviderService.Connect () [0x00000] in <00000000000000000000000000000000>:0
at PinkMoon.World.Blockchain.BlockchainClientService.Connect (PinkMoon.World.Accounts.WalletType walletType, System.String emailAddress) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
at PinkMoon.World.Blockchain.BlockchainClientService.Connect (PinkMoon.World.Accounts.WalletType walletType, System.String emailAddress) [0x00000] in <00000000000000000000000000000000>:0
at PinkMoon.World.Login.LoginCreateAccountView.ExternalWalletToggleChanged (System.Boolean isOn) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 ```
Hello!
Have you set Managed Code Stripping to Minimal in the Player settings?
Hello!
Have you set Managed Code Stripping to Minimal in the Player settings?
@skibitsky Thanks this did solve the issue on the start on both android and iOS so now the modal comes up but I am getting this error now:
[websocket-connection-197952ff-48fa-417b-b31a-8b1bf22a9a60] Error: Unable to connect to the remote server
NativeWebSocket.<Connect>d__32:MoveNext()
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Runtime.CompilerServices.MoveNextRunner:Run()
UnityEngine.WorkRequest:Invoke()
UnityEngine.UnitySynchronizationContext:Exec()
I have attached the larger log file with the relevant WalletConnect lines.
Also I have metamask already installed on the device and its up to date on the latest patch and it doesn't open the wallet and just shows this - not sure if its related:
Error: Unable to connect to the remote server
Could you please try changing the relay url in the WalletConnectProjectConfig
scriptable asset from wss://relay.walletconnect.com
to wss://relay.walletconnect.org
?
Also I have metamask already installed on the device and its up to date on the latest patch and it doesn't open the wallet and just shows this
The SDK needs to connect to the WalletConnect relay before establishing a connection with any wallet. So, it's probably related to the first issue.
Also, based on the screenshot, it seems you're running the game in the Editor with iOS/Android as the target platform. In this case, the Web3Modal UI and user flow will be the same as on mobile. However, since there’s no desktop MetaMask app, you’ll need to use another desktop wallet (e.g. Ledger Live or Zerion) or scan QR code with your phone. In the mobile Web3Modal UI, the QR code button can be found next to the search input field on the "All wallets" screen.
@skibitsky I tried updating it to the URL but still no luck? any ideas on how I can get you more info to help troubleshoot? That error is pretty vague.
@skibitsky a little more info - i am getting this in the Unity editor as well when I'm on android or iOS platforms but not on Windows.
Also interestingly enough - our other library that is using web sockets is also failing on android / ios. I'm trying to see if there's something specific that needs to be done on Android/iOS for web sockets.
UPDATE: I fixed the other library and its working but WalletConnect still wont connect. I saw some stuff about headers being missing or even this link that talks about wss not working on some android versions:
https://github.com/sta/websocket-sharp/issues/312#issuecomment-286339095
Let me know if I can get you more info somehow.
This is very strange, especially that it doesn't work in the Editor with some platforms. Have you tried exiting Unity, deleting Library folder, and opening Unity again?
This is very strange, especially that it doesn't work in the Editor with some platforms. Have you tried exiting Unity, deleting Library folder, and opening Unity again?
@skibitsky is there something more targeted? If I delete the library folder i'll be here for 3 days waiting for Unity to import everything.
The only platform it seems to work on consistently is PC other than that I can't get it to work on any mobile platforms - as builds or in editor.
is there something more targeted?
Library/Bee
? We only use WebGL preprocessor directive in the WebSocketConnection and WebSocket scripts, so I think there's a high chance that it's a Unity bug, or there's another tool in your project that causes this behaviour. Moreover, we haven't received similar reports from other developers.
I saw some stuff about headers being missing
We use query parameters instead of headers for higher compatibility.
Describe the bug Our WalletConnect integration isn't working on iOS builds and I see an error in the logs:
To Reproduce I just added the modal to the build and then ran the build like I normally would.
Expected behavior No errors and WalletConnect modal should show up.
Screenshots If applicable, add screenshots to help explain your problem.
Environment
Is this happening in Unity Editor or on a player like Android, iOS, Windows? Only happens on iOS - prompt works on windows and android.
Wallets used for testing N/A - can't even get to that point.
Additional context Add any other context about the problem here.