nativescript-pusher
by triniwiz | v1.0.1
Pusher client for NativeScript
npm i --save nativescript-pusher

NativeScript Pusher

npm npm Build Status

Installation

tns plugin add nativescript-pusher

Usage

const pusher = new Pusher(apiKey,options?);

pusher.subscribeToChannelEvent('activities','running',(error,data)=>{});

pusher.connect();

Api key follow ➡ link to get your api key

Api

Method Default Type Description
connect(callback?:Function) void Connects to Pusher.
disconnect() void Disconnect from Pusher.
subscribeToChannel(channelName: string, callback?: Function) void Subscribes to a public Channel with optional callback
subscribeToChannelEvent(channelName: string,event: string,callback: Function) void Subscribes to a public channel event.
subscribePresence(channelName: string, callback?: Function) void Subscribes to a PresenceChannel which requires authentication.
subscribeToPrivateChannel(channelName: string, callback?: Function) void Subscribes to a PrivateChannel which requires authentication.
subscribeToPrivateChannelEvent(channelName: string,event: string,callback: Function) void Subscribes to a private channel event.
unsubscribe(channelName: string) void Unsubscribes from a public channel using via the name of the channel.
unsubscribePrivate(channelName: string) void Unsubscribes from a private channel using via the name of the channel.
unsubscribeAll() void Unsubscribes from all channels.
unsubscribeEvent(channelName: string, event: string) void Unsubscribes a previously subscribed event on a public channel.
unsubscribePrivateEvent(channelName: string, event: string) void Unsubscribes a previously subscribed event on a private channel.

Example Image

IOS Android
IOS Android

TODO

  • [ ] Push Notifications