Implementing WebSockets plugin for NativeScript using React Native

JS empowerment with native platform APIs

WebSocket plugin for NativeScript

Implementation

  1. Created a public workspace for NativeScript plugins based on the NativeScript plugin workspace docs and generated the plugin through Nx.
  2. Created a native-src with the Xcode project and built scripts, using the React Native approach.
  3. Ran `ns typings ios` from within the “apps/demo” folder to generate the typings for the RCTSRWebSocket class.
  4. Started writing the WebSocket polyfill straight from JavaScript, which involved creating the Native delegate and calling a callback when these events happened.
  1. Made small adjustments related to data types and converted them to JavaScript types when needed.

Not to compete, but evolve and excel

Useful links

--

--

--

Useful articles from experienced Valor specialists in various spheres of digital development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Explore the hidden power of JavaScript Generators

Array methods in javascript

The very basic of JavaScript…#30daysofJavaScript =>Day 1

How to build a calculator with JavaScript

Tale of React -What, Why and How

ReactJS Best Practices

How Do I Convert a Decimal to a String with Thousands Separators?

12 Apps Using React Native: Learn About Their Value and Popularity

12 Apps Using React Native: Learn About Their Value and Popularity

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Valor Software

Valor Software

Useful articles from experienced Valor specialists in various spheres of digital development.

More from Medium

Beginning with KoaJS and Creating Server using Koa

To gain a clear understanding of NoSQL and MongoDB.

Firebase user count per provider

How to Handle Objection.Js