A stomp client for Nativescript. iOS only for now.
See nativescript-stomp-client demo for example code.
tns plugin add nativescript-stomp-client
// 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();
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();
}
- event
serverDidSendPing
is not yet implemented sendMessage
: parameterswithHeaders
andwithReceipt
are ignored- event
serverDidSendReceipt
doesn't contain thereceiptId
(it's alwaysundefined
) stompClientDidReceiveMessage
: parameterdestination
is not sent (it's alwaysundefined
)
- Test with more servers
- Remove Android limitations
Apache License Version 2.0, January 2004