We’ve published many posts about pusher-js recently, but we haven’t forgotten about those of you building native apps! Recently we’ve been polishing some of the rough edges, and fixing some edge cases which were causing issues on unreliable networks. There is more work to do, but we’re getting there; if you’re using these libraries we definitely recommend upgrading.
Updated iOS library
Our recommended iOS (and Mac) client library, libPusher was updated to version 1.5 in December [changelog].
The handling of disconnections has been radically improved: the library now does the Right Thing by default (for example in the presence of unreliable networks, when your app is backgrounded, or the device is locked), while delegate methods allow advanced customisations to the behaviour if desired. Client initiated ping on inactivity allows the client to detect silently dropped connections, allowing automatic reconnection in these cases.
Updated Android library
The supported Android (and core Java) library pusher-java-client has likewise seen a significant improvement in reliability, also adding client initiated ping [changelog]. In addition to detecting silently dropped connections, pings considerably reduce the likelihood of connections being dropped in the first place by preventing them from idling past timeouts on network infrastructure between the client and Pusher. This is particularly true when the client is on a mobile or cellular network connection.
The library has also joined the global Java ecosystem; releases are now published to Maven Central, where they are available to all without additional repositories in your builds.
Open Source Test apps
Our native test apps expose connection and library related debug information, allowing you to experiment independently of any complexity introduced by your app. They aim to demonstrate best practice for a simple Pusher integration, while following the default behaviour of the underlying library as much as is possible. If you’re having any trouble understanding the behaviour of the Pusher connection in your apps, they’re a great place to start.
Both libraries are available on the respective app stores and are now also open source, joining the pusher-js test app.