Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Compatibility with the Firebase Web API #548

Closed
15 tasks done
EddyVerbruggen opened this issue Nov 21, 2017 · 4 comments
Closed
15 tasks done

Compatibility with the Firebase Web API #548

EddyVerbruggen opened this issue Nov 21, 2017 · 4 comments

Comments

@EddyVerbruggen
Copy link
Owner

EddyVerbruggen commented Nov 21, 2017

As y'all may know, this plugin is built on top of the native iOS and Android SDK's which are very different from the web API. For instance, the web API uses a method like on to attach an event listener to a db path, whereas the native (iOS) API uses observeEventType:WithBlock:WithCancelBlock.

Adding Web API compatibility will have the following benefits:

  • Easily switch back and forth between web and native Firebase usage (for instance, to upgrade from webview-based usage scenario's).
  • Allow for easier code sharing between web and native in 1 project.
  • It will be easier to add AngularFire compatibility (Feature/Question #260) later, because that works on top of the Web API.

Tasks:

These are the WebAPI function names I'd like to wire to their native equivalents (checked = completed):

firebase

  • .initializeApp

firebase.auth()

  • .signInAnonymously
  • .signInWithEmailAndPassword
  • .createUserWithEmailAndPassword
  • .signOut
  • .fetchProvidersForEmail

firebase.database().ref(path: string)

  • .set
  • .remove
  • .on
  • .off
  • .once
  • .orderByChild
  • .orderByKey
  • .orderByPriority
  • .orderByValue

firebase.firestore()

see #507

Other web API functions

Let's cut the 5.0.0 release and add other functions (based on demand by the community) later.

@EddyVerbruggen
Copy link
Owner Author

Note that I still need to document these, but that can wait until after the release.

@RaphaelJenni
Copy link
Contributor

@EddyVerbruggen for the authentication, how do I authenticate with a provider?

Can I run the web API and the "old" version in parallel? How? One uses ns-pl-fb/app and one doesn't require the /app. Do I need to have two different imports and how does it work with the initialization?

@EddyVerbruggen
Copy link
Owner Author

Hi @RaphaelJenni!

You can use them in parallel. Internally they call the same (native SDK) code. So you can mix & match them.

As an example look at the usages of these imports in the demo app.

@RaphaelJenni
Copy link
Contributor

Ah perfect. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants