1.0.1 • Published 6 years ago

nativescript-pusher v1.0.1

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

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

MethodDefaultTypeDescription
connect(callback?:Function)voidConnects to Pusher.
disconnect()voidDisconnect from Pusher.
subscribeToChannel(channelName: string, callback?: Function)voidSubscribes to a public Channel with optional callback
subscribeToChannelEvent(channelName: string,event: string,callback: Function)voidSubscribes to a public channel event.
subscribePresence(channelName: string, callback?: Function)voidSubscribes to a PresenceChannel which requires authentication.
subscribeToPrivateChannel(channelName: string, callback?: Function)voidSubscribes to a PrivateChannel which requires authentication.
subscribeToPrivateChannelEvent(channelName: string,event: string,callback: Function)voidSubscribes to a private channel event.
unsubscribe(channelName: string)voidUnsubscribes from a public channel using via the name of the channel.
unsubscribePrivate(channelName: string)voidUnsubscribes from a private channel using via the name of the channel.
unsubscribeAll()voidUnsubscribes from all channels.
unsubscribeEvent(channelName: string, event: string)voidUnsubscribes a previously subscribed event on a public channel.
unsubscribePrivateEvent(channelName: string, event: string)voidUnsubscribes a previously subscribed event on a private channel.

Example Image

IOSAndroid
IOSAndroid

TODO

  • Push Notifications
1.0.1

6 years ago

1.0.0

6 years ago