Skip to content

Fix iOS WebRTC SDP processing, dual-path token refresh, and polish queue UI#273

Merged
Kief5555 merged 1 commit intokief5555/iosfrom
capy/fix-ios-webrtc-sdp
Apr 12, 2026
Merged

Fix iOS WebRTC SDP processing, dual-path token refresh, and polish queue UI#273
Kief5555 merged 1 commit intokief5555/iosfrom
capy/fix-ios-webrtc-sdp

Conversation

@Kief5555
Copy link
Copy Markdown
Collaborator

@Kief5555 Kief5555 commented Apr 12, 2026

This PR ports full desktop WebRTC SDP manipulation (fixServerIp, preferCodec, mungeAnswerSdp, buildNvstSdp) into the iOS streaming WebView to fix "internal error" handshakes, implements dual-path token refresh (client_token preferred, OAuth fallback) to keep sessions alive, skips the PrintedWaste zone picker for Alliance/BPC providers, and polishes the queue/streaming UI with Liquid Glass aesthetics.

OpenNOWStore.swift:

  • Added mediaIp and mediaPort to ActiveSession and extracted them from usage == 1 in connectionInfo
  • Rewrote refreshSession to try client_token grant first (preferred), then refresh_token OAuth, renewing client tokens after each refresh
  • Removed dead GFNSignalingClient class, connectSignalingIfNeeded, disconnectSignaling, and all signaling client state properties
  • Exposed authProviderCode for BPC bypass checks

StreamerView.swift:

  • Added settings: AppSettings parameter and resolved stream profile (width/height/bitrate) from native screen bounds and FPS
  • Expanded bridge JSON to include serverIp, mediaIp, mediaPort, preferredCodec, fps, maxBitrateKbps, width, height
  • Implemented fixServerIp to replace 0.0.0.0 in offer SDP with actual server IP (extracts dash-encoded hostnames)
  • Implemented preferCodec to filter/reorder m=video payload types for H265/H264/AV1 preference with "Auto" logic
  • Implemented mungeAnswerSdp to inject b=AS for video/audio and stereo=1 on Opus fmtp
  • Implemented buildNvstSdp to construct the proprietary nvstSdp payload from answer credentials and stream params
  • Implemented injectManualIce to add the media endpoint as a host candidate using mediaIp/mediaPort after answer send
  • Integrated waitForIceGathering and extracted ICE credentials for nvstSdp construction

PrintedWasteQueueView.swift:

  • Bypassed zone picker for provider.code == "BPC" by calling scheduleLaunch(game, zoneUrl: nil) directly and dismissing the sheet
  • Wrapped zone list appearance in .animation(.spring(response: 0.35), value: isLoading) for smooth spinner-to-content transition
  • Added .interactiveDismissDisabled(isLoading) to prevent accidental dismissal during fetch
  • Added "Launch Anyway" button in empty zones view to allow forcing launch
  • Changed List style to .plain with Color(.secondarySystemGroupedBackground).opacity(0.7) row backgrounds
  • Added .presentationCornerRadius(32) and .presentationBackground(.regularMaterial) for premium modal feel

ContentView.swift:

  • Passed store.settings to StreamerView(session:settings:) for appSettings access
  • Added .transaction { $0.animation = $0.animation?.delay(0.15) } to queueOverlayVisible full screen cover to wait for launch sheet dismiss
  • Added .shadow(color: brandAccent.opacity(0.12), radius: 8, y: 2) to QueueStatusPill for subtle glass glow

StreamLoadingView.swift:

  • Replaced dark gradient with Color(.systemBackground).ignoresSafeArea() for system-adaptive appearance
  • Wrapped .active step circles in glassEffect(in: Circle()) on iOS 26+ with brandAccent stroke
  • Wrapped game header icon circle in glassEffect(in: Circle()) on iOS 26+
  • Implemented connectorGradient using LinearGradient from completed/pending colors
  • Updated text foregrounds to .primary/.secondary for adaptive coloring

SettingsView.swift:

  • Changed codec options from ["Auto", "H264", "HEVC", "AV1"] to ["Auto", "H264", "H265", "AV1"]
  • Added .scrollContentBackground(.hidden) and .background(appBackground) to NavigationStack
  • Added .listRowBackground(Color(.secondarySystemGroupedBackground).opacity(0.75)) to settings picker rows

Open in Capy OPEN-7 · 5.4

@Kief5555 Kief5555 added the capy Generated by capy.ai label Apr 12, 2026 — with Capy AI
@Kief5555 Kief5555 merged commit a11261a into kief5555/ios Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant