Skip to content

Commit 53520cd

Browse files
fix: add UnityPostMessage alias for macOS WebView compatibility
The game-bridge JavaScript checks for UnityPostMessage before window.Unity.call. This commit adds UnityPostMessage as an alias to ensure proper callback communication on macOS, allowing the 'ready' signal to be received correctly.
1 parent c684b19 commit 53520cd

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Plugins/Mac/Sources/ImmutableWebView.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ - (id)initWithUa:(const char *)ua
118118
window.webkit.messageHandlers.saveDataURL.postMessage(fileName + '\t' + dataURL); \
119119
} \
120120
}; \
121+
window.UnityPostMessage = window.Unity.call; \
121122
function captureLog(msg) { window.webkit.messageHandlers.logHandler.postMessage(msg); } window.console.log = captureLog; \
122123
";
123124

0 commit comments

Comments
 (0)