From d7e953eb00f26ca26830ae832c3992b28a223d7f Mon Sep 17 00:00:00 2001 From: Hamilton Chapman Date: Mon, 14 Mar 2016 11:58:31 +0000 Subject: [PATCH] Bump to 0.2.4 --- CHANGELOG.md | 9 +++ Podfile.lock | 6 +- PusherSwift.podspec | 2 +- PusherSwift.xcodeproj/project.pbxproj | 90 +++++++++++++-------------- Source/PusherSwift.swift | 16 ++--- Tests/PusherSwiftTests.swift | 6 +- 6 files changed, 69 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4815b8f7..caa03448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.2.4 + +* Use cocoapods version 1.0.0.beta.5 to make builds work on Travis +* Update CryptoSwift to 0.2.3 +* Update Starscream to 0.1.2 +* Add `cluster` option to client initialiser options dictionary +* Fix autoreconnect bugs (@bdolman) +* Make `pusher:subscription_succeeded` event accessible (@bdolman) + ## 0.2.3 * Make `unsentEvents` an array instead of a dictionary (fixes #29) diff --git a/Podfile.lock b/Podfile.lock index 23f976d6..8c69c8b9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,7 +1,7 @@ PODS: - CryptoSwift (0.2.3) - Nimble (3.0.0) - - PusherSwift (0.2.3): + - PusherSwift (0.2.4): - CryptoSwift (~> 0.2.3) - ReachabilitySwift (~> 2.3.3) - Starscream (~> 1.1.2) @@ -24,11 +24,11 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CryptoSwift: b2bf37b8e7cc6d682ef3365cb966bc5ae5174aa5 Nimble: 4c353d43735b38b545cbb4cb91504588eb5de926 - PusherSwift: d1b4206cbda4b4ad13f377189984a2fc917f8f71 + PusherSwift: b84c870b3ad6021278f44b8893ed6ecce6a39584 Quick: 563d0f6ec5f72e394645adb377708639b7dd38ab ReachabilitySwift: e0f6b6f280effb47731acfaaa2d5ffe223703793 Starscream: 58a12fd35a3cb6aaa105716c2d42765f7c1c732f PODFILE CHECKSUM: f573834fd6ab3b029d84eda5e04be4ad773b3ddc -COCOAPODS: 1.0.0.beta.4 +COCOAPODS: 1.0.0.beta.5 diff --git a/PusherSwift.podspec b/PusherSwift.podspec index 896bdd94..07e731c0 100644 --- a/PusherSwift.podspec +++ b/PusherSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PusherSwift' - s.version = '0.2.3' + s.version = '0.2.4' s.summary = 'A Pusher client library in Swift' s.homepage = 'https://github.com/pusher/pusher-websocket-swift' s.license = 'MIT' diff --git a/PusherSwift.xcodeproj/project.pbxproj b/PusherSwift.xcodeproj/project.pbxproj index b38689f0..c7c0c7a9 100644 --- a/PusherSwift.xcodeproj/project.pbxproj +++ b/PusherSwift.xcodeproj/project.pbxproj @@ -335,13 +335,13 @@ isa = PBXNativeTarget; buildConfigurationList = 337C9F0A1C38BE2E006CC757 /* Build configuration list for PBXNativeTarget "PusherSwift-tvOS" */; buildPhases = ( - 67B6B8A283B0BFBA3B0712B7 /* Check Pods Manifest.lock */, + 67B6B8A283B0BFBA3B0712B7 /* 📦 Check Pods Manifest.lock */, 337C9F011C38BE2E006CC757 /* Sources */, 337C9F031C38BE2E006CC757 /* Frameworks */, 337C9F051C38BE2E006CC757 /* Headers */, 337C9F071C38BE2E006CC757 /* Resources */, 337C9F091C38BE2E006CC757 /* ShellScript */, - 561C5B78328F81B868092155 /* Copy Pods Resources */, + 561C5B78328F81B868092155 /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -356,13 +356,13 @@ isa = PBXNativeTarget; buildConfigurationList = 337C9F1E1C394197006CC757 /* Build configuration list for PBXNativeTarget "PusherSwift-OSX" */; buildPhases = ( - 3356470C392E478FD3EA2CEC /* Check Pods Manifest.lock */, + 3356470C392E478FD3EA2CEC /* 📦 Check Pods Manifest.lock */, 337C9F151C394197006CC757 /* Sources */, 337C9F171C394197006CC757 /* Frameworks */, 337C9F191C394197006CC757 /* Headers */, 337C9F1B1C394197006CC757 /* Resources */, 337C9F1D1C394197006CC757 /* ShellScript */, - 977F09EDA01A32BD84344D2A /* Copy Pods Resources */, + 977F09EDA01A32BD84344D2A /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -377,13 +377,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33831C9D1A9CF61600B124F1 /* Build configuration list for PBXNativeTarget "PusherSwift-iOS" */; buildPhases = ( - DEA75CAD787F952D9666DB0F /* Check Pods Manifest.lock */, + DEA75CAD787F952D9666DB0F /* 📦 Check Pods Manifest.lock */, 33831C841A9CF61600B124F1 /* Sources */, 33831C851A9CF61600B124F1 /* Frameworks */, 33831C861A9CF61600B124F1 /* Headers */, 33831C871A9CF61600B124F1 /* Resources */, 3358FA6E1B4FD8C000AB0670 /* ShellScript */, - C27B992B717AD38ACE5D6540 /* Copy Pods Resources */, + C27B992B717AD38ACE5D6540 /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -398,13 +398,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33831CA01A9CF61600B124F1 /* Build configuration list for PBXNativeTarget "PusherSwiftTests-iOS" */; buildPhases = ( - 0327B7C4DDB2E4C2CF2C269C /* Check Pods Manifest.lock */, + 0327B7C4DDB2E4C2CF2C269C /* 📦 Check Pods Manifest.lock */, 33831C911A9CF61600B124F1 /* Frameworks */, 33831C901A9CF61600B124F1 /* Sources */, 33C40CB81C1DFC91008A54E3 /* Headers */, 33831C921A9CF61600B124F1 /* Resources */, - 119607B9FB438DFC3E0BDD2A /* Embed Pods Frameworks */, - 4ED84449C57D3C392A4E5617 /* Copy Pods Resources */, + 119607B9FB438DFC3E0BDD2A /* 📦 Embed Pods Frameworks */, + 4ED84449C57D3C392A4E5617 /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -420,13 +420,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33999D2A1C401F9600AFED30 /* Build configuration list for PBXNativeTarget "PusherSwiftTests-tvOS" */; buildPhases = ( - D9BF8BA3396091A2F109F62C /* Check Pods Manifest.lock */, + D9BF8BA3396091A2F109F62C /* 📦 Check Pods Manifest.lock */, 33999D211C401F9600AFED30 /* Frameworks */, 33999D231C401F9600AFED30 /* Sources */, 33999D251C401F9600AFED30 /* Headers */, 33999D271C401F9600AFED30 /* Resources */, - 3B138E849CCFB96A517D4280 /* Embed Pods Frameworks */, - BC40E3C73E693376F95A7518 /* Copy Pods Resources */, + 3B138E849CCFB96A517D4280 /* 📦 Embed Pods Frameworks */, + BC40E3C73E693376F95A7518 /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -442,13 +442,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33999D3C1C4020A300AFED30 /* Build configuration list for PBXNativeTarget "PusherSwiftTests-OSX" */; buildPhases = ( - F3DF5C2C9983A171B70B942A /* Check Pods Manifest.lock */, + F3DF5C2C9983A171B70B942A /* 📦 Check Pods Manifest.lock */, 33999D331C4020A300AFED30 /* Frameworks */, 33999D351C4020A300AFED30 /* Sources */, 33999D371C4020A300AFED30 /* Headers */, 33999D391C4020A300AFED30 /* Resources */, - C41AD32A2236CDF49D84FEA5 /* Embed Pods Frameworks */, - 8B1C3BE8C26C3ADE46059E2B /* Copy Pods Resources */, + C41AD32A2236CDF49D84FEA5 /* 📦 Embed Pods Frameworks */, + 8B1C3BE8C26C3ADE46059E2B /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -548,14 +548,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0327B7C4DDB2E4C2CF2C269C /* Check Pods Manifest.lock */ = { + 0327B7C4DDB2E4C2CF2C269C /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -563,14 +563,14 @@ 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"; showEnvVarsInLog = 0; }; - 119607B9FB438DFC3E0BDD2A /* Embed Pods Frameworks */ = { + 119607B9FB438DFC3E0BDD2A /* 📦 Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -578,14 +578,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-iOS/Pods-PusherSwiftTests-iOS-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 3356470C392E478FD3EA2CEC /* Check Pods Manifest.lock */ = { + 3356470C392E478FD3EA2CEC /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -632,14 +632,14 @@ shellPath = /bin/sh; shellScript = ""; }; - 3B138E849CCFB96A517D4280 /* Embed Pods Frameworks */ = { + 3B138E849CCFB96A517D4280 /* 📦 Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -647,14 +647,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-tvOS/Pods-PusherSwiftTests-tvOS-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 4ED84449C57D3C392A4E5617 /* Copy Pods Resources */ = { + 4ED84449C57D3C392A4E5617 /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -662,14 +662,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-iOS/Pods-PusherSwiftTests-iOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 561C5B78328F81B868092155 /* Copy Pods Resources */ = { + 561C5B78328F81B868092155 /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -677,14 +677,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwift-tvOS/Pods-PusherSwift-tvOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 67B6B8A283B0BFBA3B0712B7 /* Check Pods Manifest.lock */ = { + 67B6B8A283B0BFBA3B0712B7 /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -692,14 +692,14 @@ 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"; showEnvVarsInLog = 0; }; - 8B1C3BE8C26C3ADE46059E2B /* Copy Pods Resources */ = { + 8B1C3BE8C26C3ADE46059E2B /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -707,14 +707,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-OSX/Pods-PusherSwiftTests-OSX-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 977F09EDA01A32BD84344D2A /* Copy Pods Resources */ = { + 977F09EDA01A32BD84344D2A /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -722,14 +722,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwift-OSX/Pods-PusherSwift-OSX-resources.sh\"\n"; showEnvVarsInLog = 0; }; - BC40E3C73E693376F95A7518 /* Copy Pods Resources */ = { + BC40E3C73E693376F95A7518 /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -737,14 +737,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-tvOS/Pods-PusherSwiftTests-tvOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C27B992B717AD38ACE5D6540 /* Copy Pods Resources */ = { + C27B992B717AD38ACE5D6540 /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "📦 Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -752,14 +752,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwift-iOS/Pods-PusherSwift-iOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C41AD32A2236CDF49D84FEA5 /* Embed Pods Frameworks */ = { + C41AD32A2236CDF49D84FEA5 /* 📦 Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -767,14 +767,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PusherSwiftTests-OSX/Pods-PusherSwiftTests-OSX-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - D9BF8BA3396091A2F109F62C /* Check Pods Manifest.lock */ = { + D9BF8BA3396091A2F109F62C /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -782,14 +782,14 @@ 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"; showEnvVarsInLog = 0; }; - DEA75CAD787F952D9666DB0F /* Check Pods Manifest.lock */ = { + DEA75CAD787F952D9666DB0F /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -797,14 +797,14 @@ 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"; showEnvVarsInLog = 0; }; - F3DF5C2C9983A171B70B942A /* Check Pods Manifest.lock */ = { + F3DF5C2C9983A171B70B942A /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "📦 Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Source/PusherSwift.swift b/Source/PusherSwift.swift index fe23d55a..c661238a 100644 --- a/Source/PusherSwift.swift +++ b/Source/PusherSwift.swift @@ -15,7 +15,7 @@ public typealias PusherUserInfoObject = Dictionary public typealias PusherUserData = PresenceChannelMember let PROTOCOL = 7 -let VERSION = "0.2.3" +let VERSION = "0.2.4" let CLIENT_NAME = "pusher-websocket-swift" public class Pusher { @@ -102,16 +102,16 @@ public struct PusherClientOptions { "host": "ws.pusherapp.com", "port": nil ] - + var mutableOptions = options - + if let options = options { for (key, _) in options { if !validKeys.contains(key) { print("Invalid key in options: \(key)") } } - + if let cluster = options["cluster"] { if let host = options["host"] { print("Both host (\(host)) and cluster (\(cluster)) passed as options - host takes precedence") @@ -120,7 +120,7 @@ public struct PusherClientOptions { } } } - + var optionsMergedWithDefaults: [String:Any?] = [:] for (key, value) in defaults { @@ -161,7 +161,7 @@ public class PusherConnection: WebSocketDelegate { public var channels = PusherChannels() public var socket: WebSocket! public var URLSession: NSURLSession - + public lazy var reachability: Reachability? = { let reachability = try? Reachability.reachabilityForInternetConnection() reachability?.whenReachable = { [unowned self] reachability in @@ -242,7 +242,7 @@ public class PusherConnection: WebSocketDelegate { self.socket.disconnect() } } - + public func connect() { if self.connected { return @@ -550,7 +550,7 @@ public class PusherConnection: WebSocketDelegate { if let error = error { print("Websocket is disconnected: \(error.localizedDescription)") } - + self.connected = false for (_, channel) in self.channels.channels { channel.subscribed = false diff --git a/Tests/PusherSwiftTests.swift b/Tests/PusherSwiftTests.swift index e0ecb57d..aab376b8 100644 --- a/Tests/PusherSwiftTests.swift +++ b/Tests/PusherSwiftTests.swift @@ -12,7 +12,7 @@ import Nimble import Starscream import PusherSwift -let VERSION = "0.2.3" +let VERSION = "0.2.4" // Setup mock objects that we will need public class MockWebSocket: WebSocket { @@ -424,7 +424,7 @@ class PusherTopLevelApiSpec: QuickSpec { let testChannel = pusher.connection.channels.channels["test-channel"] expect(testChannel?.subscribed).to(beTruthy()) } - + it("subscription succeeded event sent to global channel") { let callback = { (data: AnyObject?) -> Void in if let eName = data?["event"] where eName == "pusher:subscription_succeeded" { @@ -436,7 +436,7 @@ class PusherTopLevelApiSpec: QuickSpec { pusher.subscribe("test-channel") expect(socket.callbackCheckString).to(equal("globalCallbackCalled")) } - + it("subscription succeeded event sent to private channel") { let callback = { (data: AnyObject?) -> Void in if let eName = data?["event"] where eName == "pusher:subscription_succeeded" {