├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── RCTWebSocket.podspec ├── RCTWebSocket.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── RCTWebSocket.xcworkspace └── contents.xcworkspacedata ├── RCTWebSocket ├── RCTWebSocket.h └── RCTWebSocket.m ├── RCTWebSocketTests └── Info.plist └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | Pods/ 27 | 28 | # Carthage 29 | # 30 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 31 | # Carthage/Checkouts 32 | 33 | Carthage/Build 34 | 35 | DerivedData/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tyler Paul Thompson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '8.0' 3 | # use_frameworks! 4 | 5 | link_with 'RCTWebSocket', 'RCTWebSocketTests' 6 | 7 | pod 'jetfire', '0.1.2' 8 | pod 'React', '0.4.0' 9 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - jetfire (0.1.2) 3 | - React (0.4.0): 4 | - React/Core (= 0.4.0) 5 | - React/Core (0.4.0) 6 | 7 | DEPENDENCIES: 8 | - jetfire (= 0.1.2) 9 | - React (= 0.4.0) 10 | 11 | SPEC CHECKSUMS: 12 | jetfire: 5e823aa9248d3de1fac2b7b6d9c6e31ab7d90f0c 13 | React: fd7c744a4445caf86b6e6df247845d12a7182c1a 14 | 15 | COCOAPODS: 0.36.3 16 | -------------------------------------------------------------------------------- /RCTWebSocket.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "RCTWebSocket" 3 | s.version = "0.1.0" 4 | s.summary = "A React Native WebSocket client extension." 5 | s.homepage = "https://github.com/tptee/RCTWebSocket" 6 | s.license = 'MIT' 7 | s.author = { "Tyler Thompson" => "tyler@tylerpaulthompson.com" } 8 | s.source = { :git => "https://github.com/tptee/RCTWebSocket.git", :tag => s.version.to_s } 9 | 10 | s.platform = :ios, '8.0' 11 | s.requires_arc = true 12 | 13 | s.source_files = 'RCTWebSocket/**/*' 14 | s.resource_bundles = { 15 | 'RCTWebSocket' => ['Pod/Assets/*.png'] 16 | } 17 | 18 | s.dependency 'React', '~> 0.4.0' 19 | s.dependency 'jetfire', '~> 0.1.2' 20 | end 21 | -------------------------------------------------------------------------------- /RCTWebSocket.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5CF30C1E0A3CEE08BEEF453F /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5ED999FF3A2790DFA7ED805F /* libPods.a */; }; 11 | 84E711961AD9A06E00D207E9 /* RCTWebSocket.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84E711951AD9A06E00D207E9 /* RCTWebSocket.h */; }; 12 | 84E711981AD9A06E00D207E9 /* RCTWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E711971AD9A06E00D207E9 /* RCTWebSocket.m */; }; 13 | 84E7119E1AD9A06E00D207E9 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E711921AD9A06E00D207E9 /* libRCTWebSocket.a */; }; 14 | F70FFFE662C5B2236F60966F /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5ED999FF3A2790DFA7ED805F /* libPods.a */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | 84E7119F1AD9A06E00D207E9 /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = 84E7118A1AD9A06E00D207E9 /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = 84E711911AD9A06E00D207E9; 23 | remoteInfo = RCTWebSocket; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXCopyFilesBuildPhase section */ 28 | 84E711901AD9A06E00D207E9 /* CopyFiles */ = { 29 | isa = PBXCopyFilesBuildPhase; 30 | buildActionMask = 2147483647; 31 | dstPath = "include/$(PRODUCT_NAME)"; 32 | dstSubfolderSpec = 16; 33 | files = ( 34 | 84E711961AD9A06E00D207E9 /* RCTWebSocket.h in CopyFiles */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 00BB85919C4CD5C3F3557C51 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 42 | 5ED999FF3A2790DFA7ED805F /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 84E711921AD9A06E00D207E9 /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 84E711951AD9A06E00D207E9 /* RCTWebSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTWebSocket.h; sourceTree = ""; }; 45 | 84E711971AD9A06E00D207E9 /* RCTWebSocket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocket.m; sourceTree = ""; }; 46 | 84E7119D1AD9A06E00D207E9 /* RCTWebSocketTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTWebSocketTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 84E711A31AD9A06E00D207E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | A1D37602E108EC7736C95014 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 84E7118F1AD9A06E00D207E9 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | 5CF30C1E0A3CEE08BEEF453F /* libPods.a in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | 84E7119A1AD9A06E00D207E9 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | 84E7119E1AD9A06E00D207E9 /* libRCTWebSocket.a in Frameworks */, 65 | F70FFFE662C5B2236F60966F /* libPods.a in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 26E9E8FC07F3D0B2B591D0D5 /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 00BB85919C4CD5C3F3557C51 /* Pods.debug.xcconfig */, 76 | A1D37602E108EC7736C95014 /* Pods.release.xcconfig */, 77 | ); 78 | name = Pods; 79 | sourceTree = ""; 80 | }; 81 | 84E711891AD9A06E00D207E9 = { 82 | isa = PBXGroup; 83 | children = ( 84 | 84E711941AD9A06E00D207E9 /* RCTWebSocket */, 85 | 84E711A11AD9A06E00D207E9 /* RCTWebSocketTests */, 86 | 84E711931AD9A06E00D207E9 /* Products */, 87 | 26E9E8FC07F3D0B2B591D0D5 /* Pods */, 88 | E230316AFFED6B3BD46787E8 /* Frameworks */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 84E711931AD9A06E00D207E9 /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 84E711921AD9A06E00D207E9 /* libRCTWebSocket.a */, 96 | 84E7119D1AD9A06E00D207E9 /* RCTWebSocketTests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 84E711941AD9A06E00D207E9 /* RCTWebSocket */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 84E711951AD9A06E00D207E9 /* RCTWebSocket.h */, 105 | 84E711971AD9A06E00D207E9 /* RCTWebSocket.m */, 106 | ); 107 | path = RCTWebSocket; 108 | sourceTree = ""; 109 | }; 110 | 84E711A11AD9A06E00D207E9 /* RCTWebSocketTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 84E711A21AD9A06E00D207E9 /* Supporting Files */, 114 | ); 115 | path = RCTWebSocketTests; 116 | sourceTree = ""; 117 | }; 118 | 84E711A21AD9A06E00D207E9 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 84E711A31AD9A06E00D207E9 /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | E230316AFFED6B3BD46787E8 /* Frameworks */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 5ED999FF3A2790DFA7ED805F /* libPods.a */, 130 | ); 131 | name = Frameworks; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 84E711911AD9A06E00D207E9 /* RCTWebSocket */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 84E711A61AD9A06E00D207E9 /* Build configuration list for PBXNativeTarget "RCTWebSocket" */; 140 | buildPhases = ( 141 | 72853123B5B3CC19B4DDFA0D /* Check Pods Manifest.lock */, 142 | 84E7118E1AD9A06E00D207E9 /* Sources */, 143 | 84E7118F1AD9A06E00D207E9 /* Frameworks */, 144 | 84E711901AD9A06E00D207E9 /* CopyFiles */, 145 | 54386C3C7388BE42326F9065 /* Copy Pods Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = RCTWebSocket; 152 | productName = RCTWebSocket; 153 | productReference = 84E711921AD9A06E00D207E9 /* libRCTWebSocket.a */; 154 | productType = "com.apple.product-type.library.static"; 155 | }; 156 | 84E7119C1AD9A06E00D207E9 /* RCTWebSocketTests */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 84E711A91AD9A06E00D207E9 /* Build configuration list for PBXNativeTarget "RCTWebSocketTests" */; 159 | buildPhases = ( 160 | 91B17CD4E2E4800206B0BA25 /* Check Pods Manifest.lock */, 161 | 84E711991AD9A06E00D207E9 /* Sources */, 162 | 84E7119A1AD9A06E00D207E9 /* Frameworks */, 163 | 84E7119B1AD9A06E00D207E9 /* Resources */, 164 | 2897309422A62A763B556C33 /* Copy Pods Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | 84E711A01AD9A06E00D207E9 /* PBXTargetDependency */, 170 | ); 171 | name = RCTWebSocketTests; 172 | productName = RCTWebSocketTests; 173 | productReference = 84E7119D1AD9A06E00D207E9 /* RCTWebSocketTests.xctest */; 174 | productType = "com.apple.product-type.bundle.unit-test"; 175 | }; 176 | /* End PBXNativeTarget section */ 177 | 178 | /* Begin PBXProject section */ 179 | 84E7118A1AD9A06E00D207E9 /* Project object */ = { 180 | isa = PBXProject; 181 | attributes = { 182 | LastUpgradeCheck = 0630; 183 | ORGANIZATIONNAME = tptee; 184 | TargetAttributes = { 185 | 84E711911AD9A06E00D207E9 = { 186 | CreatedOnToolsVersion = 6.3; 187 | }; 188 | 84E7119C1AD9A06E00D207E9 = { 189 | CreatedOnToolsVersion = 6.3; 190 | }; 191 | }; 192 | }; 193 | buildConfigurationList = 84E7118D1AD9A06E00D207E9 /* Build configuration list for PBXProject "RCTWebSocket" */; 194 | compatibilityVersion = "Xcode 3.2"; 195 | developmentRegion = English; 196 | hasScannedForEncodings = 0; 197 | knownRegions = ( 198 | en, 199 | ); 200 | mainGroup = 84E711891AD9A06E00D207E9; 201 | productRefGroup = 84E711931AD9A06E00D207E9 /* Products */; 202 | projectDirPath = ""; 203 | projectRoot = ""; 204 | targets = ( 205 | 84E711911AD9A06E00D207E9 /* RCTWebSocket */, 206 | 84E7119C1AD9A06E00D207E9 /* RCTWebSocketTests */, 207 | ); 208 | }; 209 | /* End PBXProject section */ 210 | 211 | /* Begin PBXResourcesBuildPhase section */ 212 | 84E7119B1AD9A06E00D207E9 /* Resources */ = { 213 | isa = PBXResourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXResourcesBuildPhase section */ 220 | 221 | /* Begin PBXShellScriptBuildPhase section */ 222 | 2897309422A62A763B556C33 /* Copy Pods Resources */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "Copy Pods Resources"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 235 | showEnvVarsInLog = 0; 236 | }; 237 | 54386C3C7388BE42326F9065 /* Copy Pods Resources */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputPaths = ( 243 | ); 244 | name = "Copy Pods Resources"; 245 | outputPaths = ( 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | shellPath = /bin/sh; 249 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 250 | showEnvVarsInLog = 0; 251 | }; 252 | 72853123B5B3CC19B4DDFA0D /* Check Pods Manifest.lock */ = { 253 | isa = PBXShellScriptBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | inputPaths = ( 258 | ); 259 | name = "Check Pods Manifest.lock"; 260 | outputPaths = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 265 | showEnvVarsInLog = 0; 266 | }; 267 | 91B17CD4E2E4800206B0BA25 /* Check Pods Manifest.lock */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputPaths = ( 273 | ); 274 | name = "Check Pods Manifest.lock"; 275 | outputPaths = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | shellPath = /bin/sh; 279 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 280 | showEnvVarsInLog = 0; 281 | }; 282 | /* End PBXShellScriptBuildPhase section */ 283 | 284 | /* Begin PBXSourcesBuildPhase section */ 285 | 84E7118E1AD9A06E00D207E9 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 84E711981AD9A06E00D207E9 /* RCTWebSocket.m in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | 84E711991AD9A06E00D207E9 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | /* End PBXSourcesBuildPhase section */ 301 | 302 | /* Begin PBXTargetDependency section */ 303 | 84E711A01AD9A06E00D207E9 /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = 84E711911AD9A06E00D207E9 /* RCTWebSocket */; 306 | targetProxy = 84E7119F1AD9A06E00D207E9 /* PBXContainerItemProxy */; 307 | }; 308 | /* End PBXTargetDependency section */ 309 | 310 | /* Begin XCBuildConfiguration section */ 311 | 84E711A41AD9A06E00D207E9 /* Debug */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_CONSTANT_CONVERSION = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | COPY_PHASE_STRIP = NO; 329 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_DYNAMIC_NO_PIC = NO; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_OPTIMIZATION_LEVEL = 0; 335 | GCC_PREPROCESSOR_DEFINITIONS = ( 336 | "DEBUG=1", 337 | "$(inherited)", 338 | ); 339 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 347 | MTL_ENABLE_DEBUG_INFO = YES; 348 | ONLY_ACTIVE_ARCH = YES; 349 | SDKROOT = iphoneos; 350 | }; 351 | name = Debug; 352 | }; 353 | 84E711A51AD9A06E00D207E9 /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | ALWAYS_SEARCH_USER_PATHS = NO; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 358 | CLANG_CXX_LIBRARY = "libc++"; 359 | CLANG_ENABLE_MODULES = YES; 360 | CLANG_ENABLE_OBJC_ARC = YES; 361 | CLANG_WARN_BOOL_CONVERSION = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 364 | CLANG_WARN_EMPTY_BODY = YES; 365 | CLANG_WARN_ENUM_CONVERSION = YES; 366 | CLANG_WARN_INT_CONVERSION = YES; 367 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 368 | CLANG_WARN_UNREACHABLE_CODE = YES; 369 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 370 | COPY_PHASE_STRIP = NO; 371 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 372 | ENABLE_NS_ASSERTIONS = NO; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | GCC_C_LANGUAGE_STANDARD = gnu99; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 383 | MTL_ENABLE_DEBUG_INFO = NO; 384 | SDKROOT = iphoneos; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | 84E711A71AD9A06E00D207E9 /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | baseConfigurationReference = 00BB85919C4CD5C3F3557C51 /* Pods.debug.xcconfig */; 392 | buildSettings = { 393 | OTHER_LDFLAGS = "-ObjC"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | SKIP_INSTALL = YES; 396 | }; 397 | name = Debug; 398 | }; 399 | 84E711A81AD9A06E00D207E9 /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | baseConfigurationReference = A1D37602E108EC7736C95014 /* Pods.release.xcconfig */; 402 | buildSettings = { 403 | OTHER_LDFLAGS = "-ObjC"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | SKIP_INSTALL = YES; 406 | }; 407 | name = Release; 408 | }; 409 | 84E711AA1AD9A06E00D207E9 /* Debug */ = { 410 | isa = XCBuildConfiguration; 411 | baseConfigurationReference = 00BB85919C4CD5C3F3557C51 /* Pods.debug.xcconfig */; 412 | buildSettings = { 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | FRAMEWORK_SEARCH_PATHS = ( 415 | "$(SDKROOT)/Developer/Library/Frameworks", 416 | "$(inherited)", 417 | ); 418 | GCC_PREPROCESSOR_DEFINITIONS = ( 419 | "DEBUG=1", 420 | "$(inherited)", 421 | ); 422 | INFOPLIST_FILE = RCTWebSocketTests/Info.plist; 423 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 424 | PRODUCT_NAME = "$(TARGET_NAME)"; 425 | }; 426 | name = Debug; 427 | }; 428 | 84E711AB1AD9A06E00D207E9 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | baseConfigurationReference = A1D37602E108EC7736C95014 /* Pods.release.xcconfig */; 431 | buildSettings = { 432 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 433 | FRAMEWORK_SEARCH_PATHS = ( 434 | "$(SDKROOT)/Developer/Library/Frameworks", 435 | "$(inherited)", 436 | ); 437 | INFOPLIST_FILE = RCTWebSocketTests/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | }; 441 | name = Release; 442 | }; 443 | /* End XCBuildConfiguration section */ 444 | 445 | /* Begin XCConfigurationList section */ 446 | 84E7118D1AD9A06E00D207E9 /* Build configuration list for PBXProject "RCTWebSocket" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 84E711A41AD9A06E00D207E9 /* Debug */, 450 | 84E711A51AD9A06E00D207E9 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | 84E711A61AD9A06E00D207E9 /* Build configuration list for PBXNativeTarget "RCTWebSocket" */ = { 456 | isa = XCConfigurationList; 457 | buildConfigurations = ( 458 | 84E711A71AD9A06E00D207E9 /* Debug */, 459 | 84E711A81AD9A06E00D207E9 /* Release */, 460 | ); 461 | defaultConfigurationIsVisible = 0; 462 | defaultConfigurationName = Release; 463 | }; 464 | 84E711A91AD9A06E00D207E9 /* Build configuration list for PBXNativeTarget "RCTWebSocketTests" */ = { 465 | isa = XCConfigurationList; 466 | buildConfigurations = ( 467 | 84E711AA1AD9A06E00D207E9 /* Debug */, 468 | 84E711AB1AD9A06E00D207E9 /* Release */, 469 | ); 470 | defaultConfigurationIsVisible = 0; 471 | defaultConfigurationName = Release; 472 | }; 473 | /* End XCConfigurationList section */ 474 | }; 475 | rootObject = 84E7118A1AD9A06E00D207E9 /* Project object */; 476 | } 477 | -------------------------------------------------------------------------------- /RCTWebSocket.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RCTWebSocket.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RCTWebSocket/RCTWebSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | 6 | @interface RCTWebSocket : NSObject 7 | 8 | @property (strong, nonatomic) JFRWebSocket *ws; 9 | @property (weak, nonatomic) RCTResponseSenderBlock callback; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /RCTWebSocket/RCTWebSocket.m: -------------------------------------------------------------------------------- 1 | #import "RCTWebSocket.h" 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | 9 | @implementation RCTWebSocket 10 | 11 | RCT_EXPORT_MODULE(); 12 | 13 | @synthesize bridge = _bridge; 14 | 15 | RCT_EXPORT_METHOD(connect:(NSString *)host callback:(RCTResponseSenderBlock)callback) { 16 | self.callback = callback; 17 | self.ws = [[JFRWebSocket alloc] initWithURL:[NSURL URLWithString:host] protocols:nil]; 18 | } 19 | 20 | - (void)websocketDidConnect:(JFRWebSocket *)socket { 21 | self.callback(@[[NSNull null], @"Connected to WebSocket."]); 22 | } 23 | 24 | - (void)websocket:(JFRWebSocket *)socket didReceiveMessage:(NSString *)string { 25 | [self.bridge.eventDispatcher 26 | sendDeviceEventWithName:@"WebSocketMessage" 27 | body:string]; 28 | } 29 | 30 | - (void)websocketDidDisconnect:(JFRWebSocket *)socket error:(NSError *)error { 31 | if (error) { 32 | NSLog(@"%@", [error localizedDescription]); 33 | } 34 | 35 | [self.bridge.eventDispatcher 36 | sendDeviceEventWithName:@"WebSocketDisconnect" 37 | body:@"Disconnected from WebSocket."]; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /RCTWebSocketTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.tptee.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | Use the official polyfill here: https://github.com/facebook/react-native/tree/master/Libraries/WebSocket 3 | 4 | ## RCTWebSocket 5 | A React Native WebSocket client extension. 6 | --------------------------------------------------------------------------------