GithubHelp home page GithubHelp logo

guoyu07 / pusher-platform-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pusher/pusher-platform-swift

0.0 0.0 0.0 8.71 MB

Swift SDK for Pusher platform products

Home Page: https://pusher.com

License: MIT License

Ruby 3.92% Swift 95.20% Objective-C 0.34% Shell 0.54%

pusher-platform-swift's Introduction

PusherPlatform (pusher-platform-swift)

BuddyBuild 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"

Directly using a framework

TODO

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 buddybuild. See buddybuild_postbuild.sh for details on how the tests are run.

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.

pusher-platform-swift's People

Contributors

hamchapman avatar jameshfisher avatar lukabratos avatar zmarkan avatar

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.