Skip to content

Commit

Permalink
Merge pull request #124 from lukeredpath/release/1.5
Browse files Browse the repository at this point in the history
v1.5 Release
  • Loading branch information
lukeredpath committed Dec 6, 2013
2 parents 138d287 + d7c1417 commit ac87421
Show file tree
Hide file tree
Showing 881 changed files with 31,099 additions and 13,096 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ dist
.bundle
xcodebuild.log
Pods/Documentation
*.xccheckout
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
language: objective-c
before_install: sudo gem update --system && bundle install --without scripts
script: bundle exec rake debug:cleanbuild
install: true
env:
matrix:
- XCODE_SCHEME=libPusher SDK=iphonesimulator
- XCODE_SCHEME=libPusher-OSX SDK=macosx10.9
script: xctool -workspace libPusher.xcworkspace -scheme $XCODE_SCHEME -sdk $SDK build test
72 changes: 65 additions & 7 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,71 @@
# 1.5 - May 2013
# 1.5 - December 2013

This release contains some significant bug fixes and API changes. All deprecated API in this release will be removed in the next release after this one.

## Upgrade notes

This is a summary of the changes in this release and notes on how to upgrade. The recommended way of installing libPusher is to use CocoaPods.

As of this version, support for iOS < 5.0 and OSX < 10.8 has been dropped.

### Connection is no longer automatic

`PTPusher` will no longer connect automatically on initialisation and all methods that accept a connect `connectAutomatically` parameter (including the initialiser and all factory methods) are deprecated.

You should now explicitly call `connect` when you are ready to connect.

The method `reconnectAutomatically` has been removed completely (see below).

### Improvements to disconnection handling

`PTPusher` now goes to great lengths to ensure it remains connected whenever possible, including correctly handling error codes returned by the Pusher service (see http://pusher.com/docs/pusher_protocol#error-codes).

In most cases where the connection fails or disconnects, Pusher will attempt to reconnect either immediately or after a configured delay (which defaults to 5s and can still be customised using the `reconnectDelay` property.

In the case where Pusher returns a 4100 error code (over capacity), reconnection attempts will be attempted using a linear back-off delay. In all cases, Pusher will limit reconnection attempts to a maximum of three attempts before giving up.

There are two circumstances in which the client will not reconnect automatically:

* The client disconnects with an error code in the 4000-4099 range, which generally indicates a client misconfiguration.
* The client is not able to connect in the first place (i.e. it fails on it's first attempt), which normally indicates that there is no network connection or there is a server-side issue.

A new delegate method, `pusher:connection:didDisconnectWithError:willAttemptReconnect:` will be called when Pusher disconnects. The `willAttemptReconnect:` parameter will indicate to clients that `PTPusher` will automatically reconnect. If this is `NO`, clients should decide how they want to proceed (e.g. you may want to check network reachability and manually reconnect when reachability changes).

These changes should ensure that libPusher is much more reliable. You no longer need to explicitly disconnect and reconnect the client when going to the background or when the device is locked - in these situations the client will automatically reconnect when the app returns to the foreground or the device is unlocked.

The delegate methods `pusher:connection:didDisconnectWithError` and `pusher:connection:didDisconnect:` are now deprecated and will be removed in the next release.

Additionally, the `reconnectAutomatically` property of `PTPusher` has been deprecated. Setting this will not affect the automatic reconnection behaviour of `PTPusher`. If you need to take control of the auto-reconnect behaviour, a new delegate method is provided, `pusher:connectionWillAutomaticallyReconnect:afterDelay:`. Returning `NO` from this method will prevent the automatic reconnection attempt from happening. You will be responsible for manually reconnecting the client.

Pusher can be prevented from connecting *at any time* by returning `NO` from another new delegate method, `pusher:connectionWillConnect:`.

### Changes to presence channel members API

The API for accessing members of a channel has been brought in line with the JavaScript client.

Presence channels have a property `members`, which returns a instance of `PTPusherChannelMembers`, which is an unordered collection of members. Members can be retrieved by ID using the `memberWithID:` method. Members are represented by instances of the class `PTPusherChannelMember` rather than `NSDictionary` - see the headers for more information. There is also a property, `me`, which returns your own member object.

### Experimental ReactiveExtensions

This release contains some extensions that allow binding to events using ReactiveCocoa signals. These extensions are bundled as a separate library and if you're using CocoaPods, a sub-spec that is excluded from the default spec. These are still experimental so proceed with caution. You can add them to your project by adding `libPusher/ReactiveExtensions` to your `Podfile`.

### Bug Fixes

* There have been numerous bug fixes around connection handling and Pusher should generally be more stable and remain connected in most cases where you have network connectivity.
* libPusher now uses socket-native ping/pong and also sends client-side pings to keep the connection alive.
* Removed an assertion that would cause a crash if trying to send a client-send event when not connected.
* Calling `unsubscribe` on a channel while disconnected works as expected, with the channel being removed from the channels list and all bindings removed.

### Other enhancements and changes

* Deprecated `reconnectAutomatically`, which is now ignored. Pusher will now try and reconnect automatically whenever possible by default, based on the error code returned by Pusher as defined in the latest Pusher protocol.
* Generally improved reconnection strategy.
* Added a global Pusher.h header file to reduce the number of imports needed
* Added `pusher:connectionWillConnect:` delegate method.
* Deprecated `pusher:willAuthorizeChannelWithRequest:` delegate method, replaced with pusher:willAuthorizeChannel:withRequest:.
* Bumped Pusher protocol to version 6.
* Removed support for iOS4.
* Switched to latest SocketRocket backend, improved threading issues
* Removed private headers from CocoaPod specification
* Removed `PTPusher` property, `reconnectAutomatically`
* Moved fatal protocol errors that disallow reconnection into a new `PTPusherFatalErrorDomain` error domain.
* Fixed 64bit warnings.
* Removed JSONKit support.
* Log warnings when calling deprecated delegate methods.

# 1.4 - October 2012

Expand Down
Binary file added [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions Functional Specs/SpecHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
PTPusher *newTestClientWithMockConnection(void)
{
PTPusherMockConnection *mockConnection = [[PTPusherMockConnection alloc] init];
PTPusher *client = [[PTPusher alloc] initWithConnection:mockConnection connectAutomatically:NO];
PTPusher *client = [[PTPusher alloc] initWithConnection:mockConnection];
client.delegate = [PTPusherClientTestHelperDelegate sharedInstance];
return [client retain];
}

PTPusher *newTestClientDisconnected(void) {
PTPusher *client = [PTPusher pusherWithKey:PUSHER_API_KEY connectAutomatically:NO encrypted:kUSE_ENCRYPTED_CONNECTION];
client.delegate = [PTPusherClientTestHelperDelegate sharedInstance];
PTPusher *client = [PTPusher pusherWithKey:PUSHER_API_KEY delegate:[PTPusherClientTestHelperDelegate sharedInstance] encrypted:NO];
return [client retain];
}

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group :building do
gem "rest-client"
gem "xcodebuild-rb", :git => "git://github.com/lukeredpath/xcodebuild-rb.git"
gem "xcodeproj"
gem "cocoapods", '~> 0.22.0'
gem "cocoapods", '~> 0.28.0'
gem "github-downloads", :git => "git://github.com/lukeredpath/github-downloads.git"
gem "osx_keychain"
gem "ios-sim-test", :git => "git://github.com/alloy/ios-sim-test.git"
Expand Down
88 changes: 47 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,85 +20,91 @@ GIT

GIT
remote: git://github.com/lukeredpath/xcodebuild-rb.git
revision: eadcfbb4924b99f9f65775368e2ba5fc43a499fa
revision: 689feb53dc4f7f0132b70b33436dc13495e9fd4c
specs:
xcodebuild-rb (0.2.0)
state_machine (~> 1.1.2)

GEM
remote: https://rubygems.org/
specs:
RubyInline (3.11.4)
RubyInline (3.12.2)
ZenTest (~> 4.3)
ZenTest (4.8.4)
activesupport (3.2.13)
i18n (= 0.6.1)
ZenTest (4.9.5)
activesupport (3.2.15)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
claide (0.3.2)
cocoapods (0.22.2)
activesupport (~> 3.2.13)
claide (~> 0.3.2)
cocoapods-core (= 0.22.2)
cocoapods-downloader (~> 0.1.1)
claide (0.4.0)
cocoapods (0.28.0)
activesupport (>= 3.2.15, < 4)
claide (~> 0.4.0)
cocoapods-core (= 0.28.0)
cocoapods-downloader (~> 0.2.0)
colored (~> 1.2)
escape (~> 0.0.4)
json (~> 1.8.0)
open4 (~> 1.3.0)
xcodeproj (~> 0.8.1)
cocoapods-core (0.22.2)
activesupport (~> 3.2.13)
json (~> 1.8.0)
nap (~> 0.5.1)
cocoapods-downloader (0.1.1)
json_pure (~> 1.8)
open4 (~> 1.3)
xcodeproj (~> 0.14.1)
cocoapods-core (0.28.0)
activesupport (>= 3.2.15, < 4)
fuzzy_match (~> 2.0.4)
json (~> 1.8)
nap (~> 0.5)
cocoapods-downloader (0.2.0)
colored (1.2)
daemons (1.1.9)
escape (0.0.4)
eventmachine (1.0.0)
highline (1.6.15)
hirb (0.7.0)
i18n (0.6.1)
json (1.8.0)
eventmachine (1.0.3)
fuzzy_match (2.0.4)
highline (1.6.20)
hirb (0.7.1)
httpclient (2.3.4.1)
i18n (0.6.5)
json (1.8.1)
json_pure (1.8.1)
macaddr (1.6.1)
systemu (~> 2.5.0)
mime-types (1.19)
multi_json (1.7.7)
mime-types (2.0)
multi_json (1.8.2)
nap (0.5.1)
open4 (1.3.0)
osx_keychain (1.0.0)
RubyInline (~> 3)
pusher (0.11.1)
pusher (0.12.0)
httpclient (~> 2.3.0)
multi_json (~> 1.0)
signature (~> 0.1.6)
rack (1.4.1)
rack-protection (1.2.0)
rack (1.5.2)
rack-protection (1.5.1)
rack
rake (10.1.0)
rest-client (1.6.7)
mime-types (>= 1.16)
signature (0.1.6)
signature (0.1.7)
simpleconsole (0.1.1)
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
sinatra (1.4.4)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
state_machine (1.1.2)
systemu (2.5.2)
thin (1.5.0)
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
tilt (1.3.3)
uuid (2.3.6)
tilt (1.4.1)
uuid (2.3.7)
macaddr (~> 1.0)
xcodeproj (0.8.1)
activesupport (~> 3.2.13)
xcodeproj (0.14.1)
activesupport (~> 3.0)
colored (~> 1.2)
rake

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 0.22.0)
cocoapods (~> 0.28.0)
github-downloads!
ios-sim-test!
json
Expand Down
Loading

0 comments on commit ac87421

Please sign in to comment.