Skip to content

Commit 41ef55c

Browse files
committed
Encrypted channels support (by default) with SPM integration
- Changes the target name from 'PusherSwift' to 'PusherSwiftWithEncryption' - Adds swift-sodium 0.9.0 as a dependency of the target - Udpates the README
1 parent 525dc2f commit 41ef55c

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,29 @@ let package = Package(
66
name: "PusherSwift",
77
platforms: [.iOS("13.0"), .macOS("10.15"), .tvOS("13.0")],
88
products: [
9-
.library(name: "PusherSwift", targets: ["PusherSwift"])
9+
.library(name: "PusherSwift", targets: ["PusherSwiftWithEncryption"])
1010
],
1111
dependencies: [
1212
.package(url: "https://github.com/ashleymills/Reachability.swift.git", .upToNextMajor(from: "5.0.0")),
1313
.package(url: "https://github.com/pusher/NWWebSocket.git", .upToNextMajor(from: "0.3.0")),
14+
.package(url: "https://github.com/jedisct1/swift-sodium", .upToNextMajor(from: "0.9.0")),
1415
],
1516
targets: [
1617
.target(
17-
name: "PusherSwift",
18+
name: "PusherSwiftWithEncryption",
1819
dependencies: [
1920
"Reachability",
2021
"NWWebSocket",
22+
"Sodium",
2123
],
2224
path: "Sources",
23-
exclude: ["PusherSwiftWithEncryption-Only"]
25+
exclude: ["PusherSwift-Only"]
2426
),
2527
.testTarget(
26-
name: "PusherSwiftTests",
27-
dependencies: ["PusherSwift"],
28+
name: "PusherSwiftWithEncryptionTests",
29+
dependencies: ["PusherSwiftWithEncryption"],
2830
path: "Tests",
29-
exclude: ["Unit/PusherSwiftWithEncryption-Only"]
31+
exclude: ["Unit/PusherSwift-Only"]
3032
)
3133
],
3234
swiftLanguageVersions: [.v5]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ Using Carthage under Xcode 12.0 and above currently requires [a workaround](http
132132

133133
### Swift Package Manager
134134

135-
> Please note that if you are looking to use encrypted channels, this is not currently possible with Swift Package Manager.
136-
137135
To integrate PusherSwift into your project using [Swift Package Manager](https://swift.org/package-manager/), you can add the library as a dependency in Xcode (11 and above) – see the [docs](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). The package repository URL is:
138136

139137
```bash
@@ -164,6 +162,8 @@ let package = Package(
164162
)
165163
```
166164

165+
You will then need to include an `import PusherSwiftWithEncryption` statement in any source files where you wish to use the SDK. (**N.B. When integrating using Swift Package Manager, encrypted channels are supported by default and there is no 'PusherSwift' module**).
166+
167167
## Configuration
168168

169169
There are a number of configuration parameters which can be set for the Pusher client. For Swift usage they are:
@@ -650,7 +650,7 @@ Update your Podfile to include `PusherSwiftWithEncryption` instead of `PusherSwi
650650
You do not need to change your Cartfile. However, you will need to import the `PusherSwiftWithEncryption` framework into your project, instead of `PusherSwift`. You will also need to import the `Sodium` framework into your project (in addition to `Reachability`).
651651
652652
#### Swift Package Manager
653-
PusherSwiftWithEncryption is not yet compatible with the Swift Package Manager.
653+
Encrypted channels are supported by default when integrating using Swift Package Manager. No code or configuration changes are required.
654654
655655
#### Limitations
656656

0 commit comments

Comments
 (0)