magicblock-labs / magicblock-labs/Solana.Unity-SDK

[Bug] Inconsistent Behavior of "LoginWithWalletAdapter" Function on iOS vs Android (WebGL)

Open
#249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
199
Forks
128
PR merge metrics
No merged PRs in 30d

Description

I'm currently integrating the Solana.Unity-SDK into a WebGL game, and I've encountered an inconsistency in how the LoginWithWalletAdapter function behaves on different platforms.

Android: When I call LoginWithWalletAdapter from the web.cs script in the WebGL build, it redirects to the installed Phantom Wallet app. After connecting the wallet, it successfully returns to the WebGL game without issues.

iOS: On iOS, when I click LoginWithWalletAdapter, it redirects to the Phantom Browser. The game restarts from there, and upon calling LoginWithWalletAdapter again, it prompts me to connect the wallet again, even though the wallet was already connected.

Expected Behavior:
The behavior on iOS should mirror that of Android, where the app connects to the Phantom Wallet and returns directly to the WebGL game without requiring a second wallet connection.

Steps to Reproduce:

Launch the WebGL game.

On Android, call the LoginWithWalletAdapter function from the web.cs script.

The Phantom Wallet app opens, connects, and returns to the game.

On iOS, call the LoginWithWalletAdapter function.

The Phantom Browser opens, the game restarts, and when LoginWithWalletAdapter is called again, it connects to the wallet successfully.

Environment:

Unity version: [6000.31f1]

SDK version: [v1.2.8]

Platform: WebGL (iOS, Android)

Please advise on potential solutions or if additional configuration is needed for iOS to match the behavior on Android.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with web.cs and the LoginWithWalletAdapter call path in the WebGL integration, then compare the Android and iOS return flows described in the report. Reproduce on Unity 6000.31f1 with SDK v1.2.8; done means iOS returns to the game with the existing wallet connection without requiring a second connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev, mobile-dev, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.