Table of Contents
CocoaPods is a dependency manager for Cocoa projects and is our recommended method of installing PusherPlatform and its dependencies.
If you don't already have the Cocoapods gem installed, run the following command:
$ gem install cocoapods
pod init to create your
Podfile (if you don't already have one).
Next, add the following lines to it:
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' # change this if you're not making an iOS app! use_frameworks! # Replace `<Your Target Name>` with your app's target name. target '<Your Target Name>' do pod 'PusherPlatform' end
Then, run the following command:
$ pod install
If you find that you're not having the most recent version installed when you run
pod install then try running:
$ pod repo update $ pod install
Also you'll need to make sure that you've not got the version of PusherPlatform locked to an old version in your
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
$ brew update $ brew install carthage
To integrate PusherPlatform into your Xcode project using Carthage, specify it in your
Swift Package Manager
Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
Manual Xcode integration
To integrate PusherPlatform into your Xcode project using Swift Package Manager, in your Xcode choose
Swift Packages >
Add Package Dependency... and provide the following URL:
Swift Package Manager dependency
To add PusherPlatform as a dependency of your own package use the follwing code:
dependencies: [ .package(url: "https://github.com/pusher/pusher-platform-swift.git", from: "0.7.3") ]
First we need to have an instance of an
Instance. To create an
Instance we need to pass in a
serviceVersion. You can get your instance locator from the dashboard.
let instance = Instance(locator: "instanceLocator", serviceName: "service-name", serviceVersion: "service-version")
Instance instance allows you to interact with the service using the Elements protocol. The high level methods it exposes are:
requestWithRetryfor standard HTTP requests
subscribeWithResumefor subscriptions that you can resume from the last received event ID
There are a set of tests for the library that can be run using the standard method (Command-U in Xcode).
The tests also get run on Bitrise.
- Found a bug? Please open an issue.
- Have a feature request. Please open an issue.
- If you want to contribute, please submit a pull request (preferrably with some tests
PusherPlatform is released under the MIT license. See LICENSE for details.
PusherPlatform uses code from the following repositories:
The individual licenses for these libraries are included in the relevant source files.