Skip to content

Commit c16efdb

Browse files
fix: resolve Windows build error and macOS JavaScript execution
WINDOWS FIX: - Fixed compilation error in UwbWebView.cs line 143 - UniTask.WhenAny returns a tuple (int winIndex, T result), not just int - Corrected to use tuple deconstruction: var (winIndex, _) = await UniTask.WhenAny(...) MACOS FIX: - WKWebView requires being in view hierarchy to execute JavaScript - Set webView.hidden = NO and positioned offscreen (-10000, -10000) - Added WebView to main window's content view - This allows JavaScript (game-bridge) to execute and send callbacks Both fixes address the 'App stuck in Initialisation' issue by ensuring JavaScript can execute and callbacks can reach Unity on both platforms.
1 parent 4f2c6e8 commit c16efdb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Packages/Passport/Runtime/Scripts/Private/Uwb/UwbWebView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ private async UniTask WaitForClientConnected(WebBrowserClient webBrowserClient)
138138
Debug.Log($"[UwbWebView] Waiting up to {timeoutSeconds} seconds for OnLoadFinish event...");
139139

140140
// Race between completion and timeout
141-
var completedTask = await UniTask.WhenAny(completionTask, timeoutTask);
141+
var (winIndex, _) = await UniTask.WhenAny(completionTask, timeoutTask);
142142

143-
if (completedTask == 1) // Timeout won
143+
if (winIndex == 1) // Timeout won
144144
{
145145
webBrowserClient.OnLoadFinish -= OnLoadFinish;
146146
var errorMsg = $"[UwbWebView] Timeout after {timeoutSeconds} seconds waiting for browser OnLoadFinish event. " +

0 commit comments

Comments
 (0)