Giter Club home page Giter Club logo

stompclient's Introduction

Stomp Client

Swift Version CocoaPods Compatible Carthage compatible Platform

This project is a simple STOMP client in Swift, and we use Starscream as a websocket dependency.

Usage

First thing is to import the Starscream and StompClient frameworks. Once imported, you're able to connect to the server. Note that client is probably best as a property, so it doesn't get deallocated right after being setup.

let url = server_url
client = StompClient(url: url)
client.delegate = self
client.connect()

After you are connected, there are some delegate methods that you need to implement.

Delegate Methods

stompClientDidConnected(client: StompClient) is called when the client connects to the server.

stompClient(client: StompClient, didErrorOccurred error: NSError) is called when error occurs.

stompClient(client: StompClient, didReceivedData data: NSData, fromDestination destination: String) is called when the client receive a message from a subscription destination.

Subscription

You can use subscribe(destination: String, parameters: [String : String]?) method to subscribe a topic, and this method will return a destination id string. Please pass this string to the second argument when invoking unsubscribe(destination: String, destinationId: String)

Installation

Carthage

Add the following line into your Cartfile,

github "ShengHuaWu/StompClient"

, and then run carthage update --platform ios in your terminal.

CocoaPods

Create a Podfile as following,

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'MyApp' do
  pod 'StompClient', '~> 0.2.6'
end

, and then run pod install in your terminal.

stompclient's People

Contributors

shenghuawu avatar vetikett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stompclient's Issues

Errors in starscream

When i install (by cocoapods) stompClient i get hundred errors in starscream (on swift 3.0, xcode 8).
StompClient require starscream 1.1.3, but this version dont support swift 3.0.

StompClient not working

Hello,

I do not know when you test it last time but it is not even working at all. I might make something wrong, can you please put an example :)

Thank you

This API doesn't work at all

Honestly, ur StompClient API doesn't work at all, There is no response when I make the connection. Try it by urself

No delegate method is working

Hello, since there is no sample code to test the connection and subscription to channel, the user cannot know whether the connection is established. No delegate method is called. Please provide a sample project or fix the delegate call issue

Subscribe response

Hi I have been trying to subscribe a particular endpoint which was given from the server side but i can't get the respective response from server or error in my side. So what would be the issue i am facing??

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.