0.5.0 • Published 5 years ago

nativescript-stomp-client v0.5.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

nativescript-stomp-client

A stomp client for Nativescript. iOS only for now.

See nativescript-stomp-client demo for example code.

Installation

tns plugin add nativescript-stomp-client

Usage

Describe any usage specifics for your plugin. Give examples for Android, iOS, Angular if needed. See nativescript-drop-down for example.

	// Create the instance
	let aDelegate: StompClientCallback = <your delegate>;
    let stompClient = new StompClient(aDelegate);
    
	// connect
	stompClient.openSocketWithURL('ws://<hostname>/<path>'); 
    ```)
    
	// subscribe to a topic
	let topic = "/topic/<my-topic>";
    stompClient.subscribe(topic);
    
	// disconnect
	stompClient.disconnect();

API

export interface StompClientCallback {
    stompClientDidDisconnect(client: StompClientCommon)

    stompClientDidConnect(client: StompClientCommon)

    stompClientDidReceiveMessage(client: StompClientCommon, destination: string, jsonBody: string)

    serverDidSendReceipt(client: StompClientCommon, receiptId: string)

    serverDidSendError(client: StompClientCommon, description: string, message: string)

    serverDidSendPing();
}

Android limitations

  1. event serverDidSendPing is not yet implemented
  2. sendMessage: parameters withHeaders and withReceipt are ignored
  3. event serverDidSendReceipt doesn't contain the receiptId (it's always undefined)
  4. stompClientDidReceiveMessage: parameter destination is not sent (it's always undefined)

TODO

  • Test with more servers
  • Remove Android limitations

License

Apache License Version 2.0, January 2004

0.5.0

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago