Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): iOS app gets compressed websocket frames #24931

Closedonly21mil(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/24931/headopened View on GitHub

Showing 7 changed files with 221 additions and 0 deletions (loading 4).

x
0 of 7 viewed, 7 left
21 additions and 0 deletionsapps/mobile/modules/t3-websocket/ios/T3WebSocket.podspecAdded
View file
@@ -0,0 +1,21 @@
+Pod::Spec.new do |s|
+ s.name = 'T3WebSocket'
+ s.version = '1.0.0'
+ s.summary = 'URLSession-backed WebSocket for T3 Code mobile.'
+ s.description = 'WebSocket client backed by URLSessionWebSocketTask, which offers permessage-deflate.'
+ s.author = 'T3 Tools'
+ s.homepage = 'https://t3tools.com'
+ s.platforms = {
+ :ios => '18.0',
+ }
+ s.source = { :path => '.' }
+ s.static_framework = true
+​
+ s.dependency 'ExpoModulesCore'
+ # Swift/Objective-C compatibility
+ s.pod_target_xcconfig = {
+ 'DEFINES_MODULE' => 'YES',
+ }
+​
+ s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
+end
194 additions and 0 deletionsapps/mobile/modules/t3-websocket/ios/T3WebSocketModule.swiftAdded
View file
@@ -0,0 +1,194 @@
+import ExpoModulesCore
+import Foundation
+​
+// URLSessionWebSocketTask offers permessage-deflate in its handshake, which
+// React Native's SocketRocket socket never does. Exposes only what Effect's
+// Socket.fromWebSocket drives, with events routed by a JS-assigned id.