fix: iOS Kotlin/Native + Now Playing + WebRTC embed fixes #100
Open
hayupadhyaya wants to merge 2 commits intomusic-assistant:mainfrom
Open
fix: iOS Kotlin/Native + Now Playing + WebRTC embed fixes #100hayupadhyaya wants to merge 2 commits intomusic-assistant:mainfrom
hayupadhyaya wants to merge 2 commits intomusic-assistant:mainfrom
Conversation
- Replace synchronized() with Mutex.withLock{} in AudioStreamManager.kt
(synchronized is JVM-only; suspend functions use withLock, close() uses runBlocking)
- Wire updateNowPlaying() in MainDataSource to push track metadata, artwork,
elapsed time and playback rate to the iOS Now Playing center on every
local player state change (~500 ms cadence via position tracker loop)
- Embed WebRTC.framework into the app bundle in the Xcode build phase script
and sign it with $EXPANDED_CODE_SIGN_IDENTITY so dyld can find it at
runtime (without this the app crashes immediately on launch)
ec2ea95 to
532cbeb
Compare
- Fix no-audio bug: MessageDispatcher and AudioStreamManager each had independent TimeSource.Monotonic.markNow() epochs; ClockSynchronizer now owns the shared startMark and exposes getCurrentTimeMicros() so serverLoopOriginLocal and currentLocalTime are always in the same domain - Add AVAudioSession interruption + route-change handlers to NativeAudioController; auto-resumes playback after phone calls/Siri - Add writeRawPcmNSData(NSData) for efficient Kotlin→Swift PCM transfer via usePinned bulk copy (avoids per-byte Swift interop loop) - Fix DataChannelWrapper binary fast path: first-byte check instead of full decodeToString() on every audio chunk at 50-100/sec - Fix OAuthHandler: open OAuth URLs in Safari instead of throwing UnsupportedOperationException - Fix SystemAppearance: apply overrideUserInterfaceStyle to all windows - Fix Config.xcconfig: rename BUNDLE_ID to PRODUCT_BUNDLE_IDENTIFIER - Fix project.pbxproj: copy compose-resources into app bundle so Compose Multiplatform assets (images, fonts) resolve at runtime - Update README: iOS features section + building from source - Update .claude docs: mark iOS volume, background playback, and no-audio bug as resolved (pending end-to-end tests) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
formatBCE
reviewed
Feb 20, 2026
Contributor
There was a problem hiding this comment.
Could you please merge main into your branch? ServiceClient got changed a bit. I apologize for inconvenience!
formatBCE
requested changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three issues that prevent the iOS app from building and running correctly.
AudioStreamManager.kt—synchronized()removedsynchronized(lock) {}is JVM-only and not available in Kotlin/Native. Replaced withMutex.withLock {}on suspend functions andrunBlocking { mutex.withLock {} }on the non-suspendclose().MainDataSource.kt— Now Playing never populatedupdateNowPlaying()was fully implemented in Swift (NowPlayingManager) and wired throughPlatformAudioPlayerto Kotlin, but was never called. Added a collector onlocalPlayerthat pushestrack title, artist, album, artwork URL, duration, elapsed time and playback rate to the iOS Now Playing center on every player state update (~500 ms cadence).
project.pbxproj—WebRTC.frameworknot embeddedThe build phase script copied
WebRTC.frameworkto the linker search path but never placed it inside the.appbundle. At launch, dyld looked for it at@executable_path/Frameworks/WebRTC.framework, didn't find it, and aborted. Fixed by embedding the correct slice into the bundle and signing with$EXPANDED_CODE_SIGN_IDENTITY(developer certfor device builds, ad-hoc for simulator).