npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ns-pubnub

v1.0.5

Published

PubNub SDK for NativeScript

Downloads

4

Readme

NativeScript PubNub apple

THIS IS NOT READY FOR PRODUCTION, JUST FOR DEVELOPING/TESTING

This plugin is allows you to use the PubNub Objective-C SDK in your NativeScript app.

Installation

tns plugin add ns-pubnub

Usage

// import
import { Pubnub, PubnubConfig, PubnubOptions } from 'ns-pubnub';

// configure
const pubnubConfig: PubnubConfig = {
  publishKey: 'demo',
  subscribeKey: 'demo'
}

const pubnubOptions: PubnubOptions = {
  cipherKey: 'a12345',
  suppressLeaveEvents: false
}

let pubnub = new Pubnub(pubnubConfig, pubnubOptions);

// subscribe
pubnub.subscribe(channels: string[], withPresence: boolean)

pubnub.subscribeToChannelGroups(groups: string[], shouldObservePresence: boolean)

// publish message
pubnub.publish('my_channel', "message", (status) => {
  conosle.log(status.information)
})

// listen to receive events
pubnub.on('receiveMessage', (data) => {
  console.log(data)
})
pubnub.on('receivePresenceEvent', (data) => {
  console.log(data)
})
pubnub.on('receiveStatus', (data) => {
  console.log(data)
})

// unsubscribe
pubnub.unsubscribe(channels: string[], withPresence: boolean)

pubnub.unsubscribeFromChannelGroups(groups: string[], withPresence: boolean)

pubnub.unsubscribeFromAll()

Options (PubnubOptions)

| Property | Type | Default | Description | | --- | --- | --- | --- | | cipherKey | string | _ | Key which is used to encrypt messages pushed to PubNub service and decrypt messages received from live feeds on which client subscribed at this moment. | | stripMobilePayload | boolean | _ | Stores whether client should strip out received messages (real-time and history) from data which has been appended by client (like mobile payload for push notifications). | | subscribeMaximumIdleTime | number | 310 | Maximum number of seconds which client should wait for events from live feed. | | nonSubscribeRequestTimeout | number | 10 | Number of seconds which is used by client during non-subscription operations to check whether response potentially failed with timeout or not. | | presenceHeartbeatValue | number | _ | Number of seconds which is used by server to track whether client still subscribed on remote data objects live feed or not. | | presenceHeartbeatInterval | number | _ | Number of seconds which is used by client to issue heartbeat requests to PubNub service. | | keepTimeTokenOnListChange | boolean | true | Whether client should keep previous time token when subscribe on new set of remote data objects live feeds. | | catchUpOnSubscriptionRestore | boolean | true | Whether client should try to catch up for events which occurred on previously subscribed remote data objects feed while client was off-line. | | applicationExtensionSharedGroupIdentifier | string | _ | Reference on group identifier which is used to share request cache between application extension and it's containing application. This property should be set to valid registered group only if PubNub client is used inside of application's extension (iOS 8.0+, macOS 10.10+). | | requestMessageCountThreshold | number | | Number of maximum expected messages from PubNub service in single response. | | maximumMessagesCacheSize | number | 100 | Messages de-duplication cache size | | completeRequestsBeforeSuspension | boolean | true | Whether client should try complete all API call which is done before application will be completely suspended. | | suppressLeaveEvents | boolean | _ | Whether client shouldn't send presence leave events during unsubscription process. |

License

Apache License Version 2.0, January 2004