Native calls: get LiveKit 2.15.3 via git-tag pin (stay on CocoaPods) + audio fix

The LiveKitClient CocoaPod on trunk caps at 2.0.18 (2.1+ is SPM-only), so the
2.15 CallKit audio API was unreachable. BUT the repo still ships a valid podspec
at tag 2.15.3, and its deps (LiveKitWebRTC 144.7559.11, LiveKitUniFFI 0.0.6,
SwiftProtobuf) ARE on trunk. So instead of a risky SPM migration:
- ios-patch.sh injects `pod 'LiveKitClient', :git => <repo>, :tag => '2.15.3'`
  into the generated Podfile (after cap sync, before pod install). The NativeCall
  podspec's '~> 2.0' is satisfied by 2.15.3. Idempotent; hard-fails if it can't
  find the App target so we never silently fall back to 2.0.18.
- Plugin re-adds the CallKit<->LiveKit audio-session coordination, now compilable:
  auto-config OFF + engine OFF at load; configure session + enable engine in
  didActivate; disable in didDeactivate; request mic permission on connect.

Core Room APIs (connect/disconnect/setMicrophone) verified compatible between
2.0.18 and 2.15.3 against the real source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 19:46:48 +05:30
parent c3de5ac8e3
commit a92cdd69f8
5 changed files with 133 additions and 10 deletions
+28
View File
@@ -123,6 +123,34 @@ if [ -f "$AD" ]; then
node "$(dirname "$0")/inject-push.js" "$AD" || echo " (push forwarding patch skipped — non-fatal)"
fi
# ── Pin LiveKit to 2.15.3 via its Git tag (stay on CocoaPods; no SPM migration) ─────────────────────
# The CallKit audio-session coordination API (AudioManager.audioSession / setEngineAvailability) exists only
# in LiveKit 2.1+, but the LiveKitClient CocoaPod PUBLISHED to trunk caps at 2.0.18 (2.1+ is SPM-only). The
# repo still ships a VALID podspec at tag 2.15.3, and its deps (LiveKitWebRTC 144.7559.11 / LiveKitUniFFI
# 0.0.6 / SwiftProtobuf) ARE on trunk — so we point the Podfile straight at the git tag. The NativeCall
# podspec's `LiveKitClient ~> 2.0` is satisfied by 2.15.3 (2.15.3 ∈ [2.0, 3.0)). Idempotent (grep guard).
PODFILE="mobile/ios/App/Podfile"
if [ -f "$PODFILE" ]; then
if grep -q "client-sdk-swift.git" "$PODFILE"; then
echo "Podfile: LiveKitClient git pin already present"
else
ruby -e '
p = "mobile/ios/App/Podfile"
s = File.read(p)
pin = " pod \x27LiveKitClient\x27, :git => \x27https://github.com/livekit/client-sdk-swift.git\x27, :tag => \x272.15.3\x27\n"
if s =~ /target ["\x27]App["\x27] do\n/
s = s.sub(/target ["\x27]App["\x27] do\n/) { |m| m + pin }
File.write(p, s)
puts "Podfile: pinned LiveKitClient -> git tag 2.15.3"
else
STDERR.puts "WARN: could not find \"target App do\" in Podfile — LiveKit pin NOT applied"
exit 1
end
'
fi
grep -n "LiveKitClient" "$PODFILE" || true
fi
echo "Info.plist patched:"
"$PB" -c "Print :NSCameraUsageDescription" "$PLIST"
"$PB" -c "Print :NSMicrophoneUsageDescription" "$PLIST"