Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-firebase

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-firebase

A react-native module that wraps the native firebase iOS SDK

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-28.17%
Maintainers
1
Weekly downloads
 
Created
Source

RNFirebase

wip - use cautiously

Why?

Because the native iOS Firebase SDK rocks - it's got great offline capabilities & caching, and SimpleLogin works much better on native devices than in the JS SDK.

Goal

Provide an API that mirrors Firebase's JS SDK, but map the important bits to the native SDK.

I'd like to continue to use Firebase references on the JS side (to avoid re-implementing methods like .root(), .key(), etc, and override only methods like .on() and .off().

How it works

Subclass Firebase in JS, and in the constructor have the native SDK create a "mirror" reference. Anytime you call a method on the JS reference, RNFirebase will call the appropriate method on the "mirror" reference.

Similarly, when data is available on the native side, an event is emitted over the bridge with the (always serializable) data. This event is caught by the JS SDK, which then fires the callback you registered with "on". This callback is provided with an object that conforms to the DataSnapshot API, though I'm planning only to implement the basic DataSnapshot methods at first. .val() is the important one, of course.

When you call .off(), the corresponding reference is destroyed using the native SDK.

JS -> iOS mappings

JS methodiOS method
.on()observeEventType:withBlock:

When you call new Firebase() in javascript-land, a normal Firebase reference is created. Nothing happens, though, until you call a method to set or fetch data from firebase: .on(), .update(), .set(), .remove(), (add the rest).

At that point, a mirror reference is created on the objective-c side (if it doesn't already exist) and

Progress

None to speak of. I made an xcode project though!

Good first tasks

(link to issues here)

  • Add unit tests to ensure parity with the official react JS lib

Keywords

FAQs

Package last updated on 17 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc