GithubHelp home page GithubHelp logo

pusher / pusher-platform-swift Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 9.08 MB

Swift SDK for Pusher platform products

Home Page: https://pusher.com

License: MIT License

Swift 98.26% Ruby 1.55% Objective-C 0.19%
swift pusher

pusher-platform-swift's Introduction

PusherPlatform (pusher-platform-swift)

Build Status CocoaPods Carthage Twitter GitHub license

Table of Contents

Installation

CocoaPods

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

Then run 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 Podfile.lock file.

Carthage

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 Cartfile:

github "pusher/pusher-platform-swift"

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 File > Swift Packages > Add Package Dependency... and provide the following URL:

https://github.com/pusher/pusher-platform-swift

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")
]

Getting started

First we need to have an instance of an Instance. To create an Instance we need to pass in a locator, serviceName, and serviceVersion. You can get your instance locator from the dashboard.

let instance = Instance(locator: "instanceLocator", serviceName: "service-name", serviceVersion: "service-version")

The Instance instance allows you to interact with the service using the Elements protocol. The high level methods it exposes are:

  • request and requestWithRetry for standard HTTP requests
  • subscribe for subscriptions
  • subscribeWithResume for subscriptions that you can resume from the last received event ID

Testing

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.

Communication

  • 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 πŸ™‚ ).

License

PusherPlatform is released under the MIT license. See LICENSE for details.

Credits

PusherPlatform uses code from the following repositories:

The individual licenses for these libraries are included in the relevant source files.

pusher-platform-swift's People

Contributors

grzesiekko avatar hamchapman avatar jameshfisher avatar lukabratos avatar vivangkumar avatar zmarkan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

guoyu07 jjatie

pusher-platform-swift's Issues

Instance

What?

Environment

  • **PusherPlatform version:**0.7.1
  • **Xcode version:**10.1
  • **Swift version:**4.2
  • **Platform(s) running PusherPlatform:**iOS

TestLogger: URLSession generalRequestURLSession became invalid
TestLogger: URLSession subscriptionURLSession became invalid
TestLogger: URLSession uploadURLSession became invalid
TestLogger: URLSession downloadURLSession became invalid


CC @pusher/sigsdk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.