You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iOS exported methods use global unity instead of resolved view — postMessage/pauseUnity/unloadUnity resolve view from viewRegistry, validate it, then call methods on a file-global variable. Stale instance risk. File: RNUnityViewManager.mm:16,37-78
Static singleton view refs on both platforms — ReactNativeUnityViewManager.view (Android) and unity (iOS) are static/global. Multiple createViewInstance overwrites, callbacks close over stale reference.
onPlayerUnload called with nil — RCTBubblingEventBlock expects a dictionary. File: RNUnityView.mm:126
Audit Findings — 2026-04-11
Code quality and correctness audit of iOS native layer, Expo config plugin, and CI. This complements the Android fixes in PR #5.
High Priority
pauseUnity:takesBOOL *instead ofBOOL— same bug as Android (PR fix(android): resolve black screen and improve reliability #5). Method always pauses, never unpauses.resumeUnitycasts literalfalsetoBOOL *(null pointer violation that accidentally works). Files:RNUnityView.h:34,RNUnityView.mm:93,RNUnityViewManager.mm:66initUnityModule—malloc/strdupallocations never freed afterrunEmbeddedWithArgc:argv:appLaunchOpts:. File:RNUnityView.mm:55-62.circleci/config.yml:5Medium Priority
unityinstead of resolved view —postMessage/pauseUnity/unloadUnityresolve view from viewRegistry, validate it, then call methods on a file-global variable. Stale instance risk. File:RNUnityViewManager.mm:16,37-78ReactNativeUnityViewManager.view(Android) andunity(iOS) are static/global. MultiplecreateViewInstanceoverwrites, callbacks close over stale reference.onPlayerUnloadcalled with nil —RCTBubblingEventBlockexpects a dictionary. File:RNUnityView.mm:126componentWillUnmountalways unloads Unity — ignoresandroidKeepPlayerMounted, forces expensive reinit. File:UnityView.tsx:68-72withSettingsGradleModappends unconditionally — duplicate entries on multiple prebuilds. File:app.plugin.js:43app.plugin.js:22it.todo('write a test')existsLow Priority
sharedInstancedeclared never used (RNUnityView.mm:39)appLaunchOptsalways nil (RNUnityView.mm:37)actions/checkout@v3/actions/cache@v3Notes
🤖 Created by Kōan from audit session