Skip to content

Commit bdcdddf

Browse files
authored
Merge pull request #1309 from socketio/socket.io-3
Support socket.io 3 + starscream 4
2 parents 6992ea5 + 2a0e0f5 commit bdcdddf

File tree

79 files changed

+5412
-2254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5412
-2254
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
22
xcode_project: Socket.IO-Client-Swift.xcodeproj # path to your xcodeproj folder
33
xcode_scheme: SocketIO-Mac
4-
osx_image: xcode11.2
4+
osx_image: xcode12.2
55
branches:
66
only:
77
- master

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v16.0.0
2+
3+
- Removed Objective-C support. It's time for you to embrace Swift.
4+
- Socket.io 3 support.
5+
16
# v15.3.0
27

38
- Add `==` operators for `SocketAckStatus` and `String`

Diff for: Cartfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "daltoniam/Starscream" ~> 3.1
1+
github "daltoniam/Starscream" ~> 4.0

Diff for: Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "daltoniam/Starscream" "3.1.0"
1+
github "daltoniam/Starscream" "4.0.4"

Diff for: Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/daltoniam/Starscream",
77
"state": {
88
"branch": null,
9-
"revision": "9c03ef715d1bc9334b446c90df53586dd38cf849",
10-
"version": "3.1.0"
9+
"revision": "df8d82047f6654d8e4b655d1b1525c64e1059d21",
10+
"version": "4.0.4"
1111
}
1212
}
1313
]

Diff for: Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.3
22

33
import PackageDescription
44

@@ -8,7 +8,7 @@ let package = Package(
88
.library(name: "SocketIO", targets: ["SocketIO"])
99
],
1010
dependencies: [
11-
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "3.1.0")),
11+
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "4.0.0")),
1212
],
1313
targets: [
1414
.target(name: "SocketIO", dependencies: ["Starscream"]),

Diff for: README.md

+4-37
Original file line numberDiff line numberDiff line change
@@ -31,56 +31,23 @@ socket.on("currentAmount") {data, ack in
3131
socket.connect()
3232
```
3333

34-
## Objective-C Example
35-
```objective-c
36-
@import SocketIO;
37-
38-
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost:8080"];
39-
SocketManager* manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @YES, @"compress": @YES}];
40-
SocketIOClient* socket = manager.defaultSocket;
41-
42-
[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
43-
NSLog(@"socket connected");
44-
}];
45-
46-
[socket on:@"currentAmount" callback:^(NSArray* data, SocketAckEmitter* ack) {
47-
double cur = [[data objectAtIndex:0] floatValue];
48-
49-
[[socket emitWithAck:@"canUpdate" with:@[@(cur)]] timingOutAfter:0 callback:^(NSArray* data) {
50-
if ([[data[0] description] isEqualToString:@"NO ACK"]) {
51-
// Handle ack timeout
52-
}
53-
54-
[socket emit:@"update" with:@[@{@"amount": @(cur + 2.50)}]];
55-
}];
56-
57-
[ack with:@[@"Got your currentAmount, ", @"dude"]];
58-
}];
59-
60-
[socket connect];
61-
62-
```
63-
6434
## Features
65-
- Supports socket.io 2.0+ (For socket.io 1.0 use v9.x)
66-
- Supports binary
35+
- Supports socket.io 2.0+/3.0+.
36+
- Supports Binary
6737
- Supports Polling and WebSockets
6838
- Supports TLS/SSL
69-
- Can be used from Objective-C
7039

7140
## FAQS
7241
Checkout the [FAQs](https://nuclearace.github.io/Socket.IO-Client-Swift/faq.html) for commonly asked questions.
7342

43+
7444
Checkout the [12to13](https://nuclearace.github.io/Socket.IO-Client-Swift/12to13.html) guide for migrating to v13+ from v12 below.
7545

46+
Checkout the [15to16](https://nuclearace.github.io/Socket.IO-Client-Swift/15to16.html) guide for migrating to v16+ from v15.
7647

7748
## Installation
7849
Requires Swift 4/5 and Xcode 10.x
7950

80-
If you need Swift 2.3 use the [swift2.3 tag](https://github.com/socketio/socket.io-client-swift/releases/tag/swift2.3) (Pre-Swift 4 support is no longer maintained)
81-
82-
If you need Swift 3.x use v11.1.3.
83-
8451
### Swift Package Manager
8552
Add the project as a dependency to your Package.swift:
8653
```swift

Diff for: Socket.IO-Client-Swift.podspec

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
Pod::Spec.new do |s|
22
s.name = "Socket.IO-Client-Swift"
33
s.module_name = "SocketIO"
4-
s.version = "15.2.0"
4+
s.version = "16.0.0"
55
s.summary = "Socket.IO-client for iOS and OS X"
66
s.description = <<-DESC
77
Socket.IO-client for iOS and OS X.
88
Supports ws/wss/polling connections and binary.
9-
For socket.io 2.0+ and Swift.
9+
For socket.io 3.0+ and Swift.
1010
DESC
1111
s.homepage = "https://github.com/socketio/socket.io-client-swift"
1212
s.license = { :type => 'MIT' }
1313
s.author = { "Erik" => "[email protected]" }
14-
s.ios.deployment_target = '8.0'
15-
s.osx.deployment_target = '10.10'
16-
s.tvos.deployment_target = '9.0'
17-
s.watchos.deployment_target = '2.0'
14+
s.ios.deployment_target = '10.0'
15+
s.osx.deployment_target = '10.13'
16+
s.tvos.deployment_target = '10.0'
17+
s.watchos.deployment_target = '5.0'
1818
s.requires_arc = true
1919
s.source = {
2020
:git => "https://github.com/socketio/socket.io-client-swift.git",
21-
:tag => 'v15.2.0',
21+
:tag => 'v16.0.0',
2222
:submodules => true
2323
}
2424

@@ -27,5 +27,5 @@ Pod::Spec.new do |s|
2727
'SWIFT_VERSION' => '5.0'
2828
}
2929
s.source_files = "Source/SocketIO/**/*.swift", "Source/SocketIO/*.swift"
30-
s.dependency "Starscream", "~> 3.1"
30+
s.dependency "Starscream", "~> 4.0"
3131
end

Diff for: Socket.IO-Client-Swift.xcodeproj/project.pbxproj

+8-14
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818
1C686BE61F869AFD007D8627 /* SocketAckManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C686BD61F869AF1007D8627 /* SocketAckManagerTest.swift */; };
1919
1C686BE71F869AFD007D8627 /* SocketParserTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C686BD71F869AF1007D8627 /* SocketParserTest.swift */; };
2020
1C686BE81F869AFD007D8627 /* SocketNamespacePacketTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C686BD81F869AF1007D8627 /* SocketNamespacePacketTest.swift */; };
21-
1C686C001F869EAE007D8627 /* SocketObjectiveCTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C686BFE1F869E9D007D8627 /* SocketObjectiveCTest.m */; };
2221
572EF2431B51F18A00EEBB58 /* SocketIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 572EF2381B51F18A00EEBB58 /* SocketIO.framework */; };
2322
6CA08A981D615C0B0061FD2A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CA08A971D615C0B0061FD2A /* Security.framework */; };
2423
74BF53581F894326004972D8 /* SocketIO.h in Headers */ = {isa = PBXBuildFile; fileRef = 572EF23C1B51F18A00EEBB58 /* SocketIO.h */; settings = {ATTRIBUTES = (Public, ); }; };
2524
74D0F5961F8053950037C4DC /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9432E00B1F77F883006AF628 /* Starscream.framework */; };
2625
74DA21741F09440F009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21731F09440F009C19EE /* libz.tbd */; };
2726
74DA217C1F09457B009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21731F09440F009C19EE /* libz.tbd */; };
28-
9432E00F1F77F8C4006AF628 /* SSLSecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */; };
2927
DD52B048C71D724ABBD18C71 /* SocketTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BDC9E66AADA2CC5E8246 /* SocketTypes.swift */; };
3028
DD52B11AF936352BAE30B2C8 /* SocketStringReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BA240D139F72633D4159 /* SocketStringReader.swift */; };
3129
DD52B1F8BA0455EBE7C1B93E /* SocketAckEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BFF2E3216CDC364BB8AF /* SocketAckEmitter.swift */; };
@@ -34,7 +32,6 @@
3432
DD52B3A6C1E082841C35C85D /* SocketEngineClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BE5FDCE1D684132E897C /* SocketEngineClient.swift */; };
3533
DD52B44AE56F2E07F3F3F991 /* SocketAckManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B09F7984E730513AB7E5 /* SocketAckManager.swift */; };
3634
DD52B4DFA12F2599410205D9 /* SocketEngineWebsocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BE9AD8B2BD7F841CD1D4 /* SocketEngineWebsocket.swift */; };
37-
DD52B53F2609D91A683DFCDD /* ManagerObjectiveCTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52BB5E907D283ACC31E17F /* ManagerObjectiveCTest.m */; };
3835
DD52B56DE03CDB4F40BD1A23 /* SocketExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B471D780013E18DF9335 /* SocketExtensions.swift */; };
3936
DD52B57E7ABC61B57EE2A4B8 /* SocketPacket.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B59C11D3D2BC63612E50 /* SocketPacket.swift */; };
4037
DD52B883F942CD5A9D29892B /* SocketEnginePollable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B2D110F55723F82B108E /* SocketEnginePollable.swift */; };
@@ -474,7 +471,6 @@
474471
DD52BB69B6D260035B652CA4 /* SocketAnyEvent.swift in Sources */,
475472
DD52BF924BEF05E1235CFD29 /* SocketIOClient.swift in Sources */,
476473
DD52BFEB4DBD3BF8D93DAEFF /* SocketEventHandler.swift in Sources */,
477-
9432E00F1F77F8C4006AF628 /* SSLSecurity.swift in Sources */,
478474
DD52BB9A3E42FF2DD6BE7C2F /* SocketIOClientSpec.swift in Sources */,
479475
DD52B2AFE7D46039C7AE4D19 /* SocketIOClientOption.swift in Sources */,
480476
DD52BE4D1E6BB752CD9614A6 /* SocketIOStatus.swift in Sources */,
@@ -495,7 +491,6 @@
495491
isa = PBXSourcesBuildPhase;
496492
buildActionMask = 2147483647;
497493
files = (
498-
1C686C001F869EAE007D8627 /* SocketObjectiveCTest.m in Sources */,
499494
1C686BE21F869AFD007D8627 /* SocketIOClientConfigurationTest.swift in Sources */,
500495
1C686BE31F869AFD007D8627 /* SocketEngineTest.swift in Sources */,
501496
1C686BE41F869AFD007D8627 /* SocketSideEffectTest.swift in Sources */,
@@ -504,7 +499,6 @@
504499
1C686BE71F869AFD007D8627 /* SocketParserTest.swift in Sources */,
505500
1C686BE81F869AFD007D8627 /* SocketNamespacePacketTest.swift in Sources */,
506501
DD52BCCD25EFA76E0F9B313C /* SocketMangerTest.swift in Sources */,
507-
DD52B53F2609D91A683DFCDD /* ManagerObjectiveCTest.m in Sources */,
508502
1C657CDE5D510E8E2E573E39 /* utils.swift in Sources */,
509503
);
510504
runOnlyForDeploymentPostprocessing = 0;
@@ -583,16 +577,16 @@
583577
GCC_WARN_UNINITIALIZED_AUTOS = YES;
584578
GCC_WARN_UNUSED_FUNCTION = YES;
585579
GCC_WARN_UNUSED_VARIABLE = YES;
586-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
587-
MACOSX_DEPLOYMENT_TARGET = 10.10;
580+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
581+
MACOSX_DEPLOYMENT_TARGET = 10.14;
588582
ONLY_ACTIVE_ARCH = YES;
589583
PRODUCT_NAME = SocketIO;
590584
SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos iphonesimulator iphoneos watchos watchsimulator";
591585
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
592586
SWIFT_VERSION = 5.0;
593-
TVOS_DEPLOYMENT_TARGET = 9.0;
587+
TVOS_DEPLOYMENT_TARGET = 10.0;
594588
VALID_ARCHS = "i386 x86_64 armv7 armv7s arm64 armv7k";
595-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
589+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
596590
};
597591
name = Debug;
598592
};
@@ -657,15 +651,15 @@
657651
GCC_WARN_UNINITIALIZED_AUTOS = YES;
658652
GCC_WARN_UNUSED_FUNCTION = YES;
659653
GCC_WARN_UNUSED_VARIABLE = YES;
660-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
661-
MACOSX_DEPLOYMENT_TARGET = 10.10;
654+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
655+
MACOSX_DEPLOYMENT_TARGET = 10.14;
662656
PRODUCT_NAME = SocketIO;
663657
SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos iphonesimulator iphoneos watchos watchsimulator";
664658
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
665659
SWIFT_VERSION = 5.0;
666-
TVOS_DEPLOYMENT_TARGET = 9.0;
660+
TVOS_DEPLOYMENT_TARGET = 10.0;
667661
VALID_ARCHS = "i386 x86_64 armv7 armv7s arm64 armv7k";
668-
WATCHOS_DEPLOYMENT_TARGET = 2.0;
662+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
669663
};
670664
name = Release;
671665
};

0 commit comments

Comments
 (0)