Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real time database support #156

Closed
sleever opened this issue Feb 1, 2017 · 19 comments
Closed

Real time database support #156

sleever opened this issue Feb 1, 2017 · 19 comments

Comments

@sleever
Copy link

sleever commented Feb 1, 2017

Hello everybody,

I was wondering when support for the real time database is being added to this plugin to make it more complete. Of course there are several other plugins like AngularFire and cordova-plugin-firebase-realtime-database but it would be more convenient to have everything in one place.

Thanks in advance for your response.

@prantikv
Copy link

prantikv commented Feb 8, 2017

👍
Adding to this the **AngularFire ** is not a plugin for cordova but more of a library for firebase+angluar.
And the **cordova-plugin-firebase-realtime-database ** is not added to Ionic Native.

As this plugin is added to Ionic 2 Native, would love to see the real-time database added here as well.

@thedmeyer
Copy link

Bumping for visibility.

Also, would there be any conflicts if I were to use cordova-plugin-firebase in conjunction with cordova-plugin-firebase-realtime-database?

@Sampath-Lokuge
Copy link

Any feedback for this from the creator of the plugin? Will we have real time database support on this plugin? Thanks.

@Sampath-Lokuge
Copy link

Can I have an URL of "cordova-plugin-firebase-realtime-database plugin"? Thanks. @sleever

@thedmeyer
Copy link

@Sampath-Lokuge I have since switched to https://github.com/firebase/angularfire/ for realtime database support.

I still use cordova-plugin-firebase for direct interactions with remote config, push notifications, and analytics.

@Sampath-Lokuge
Copy link

Yes.But still, you cannot use it for offline use case no? I think that is the key issue of this plugin. We can do almost all the other things plus more without this plugin if we use firebase JS API. But that API doesn't support offline use case.That is the huge issue right now when we're dealing with the firebase and Ionic app development. Thank you so much for your feedback @thedmeyer

@thedmeyer
Copy link

@Sampath-Lokuge Take a look at this card. FirebaseExtended/angularfire#31

Angularfire can support offline use cases to some extent, but not fully. Best practice for implementation would be to load data when available and only write data using isolated set and push calls. (NOT using $firebaseArray $add and $save calls).

This would prevent data from being overwritten in the case that the offline user tries to push out-of-date data when they regain connectivity (since the array loaded offline could have been modified during this period).

See: https://github.com/firebase/angularfire/blob/master/docs/reference.md

Isolated calls:
https://firebase.google.com/docs/reference/js/firebase.database.Reference#push

@prantikv
Copy link

I agree with @thedmeyer I pulled up this issue with ionic native. As you can see from the reply they won't be adding the other two plugins to the Ionic Native repo, the reason being that they are not popular. Also, taking a look at the repo of cordova-plugin-firebase-realtime-database the plugin does not seem to be under active maintenance.

As a result, I have shifted to AngularFire 2 for my needs and haven't looked back. Best part about using AngularFire2 are observable.

Still would love to see a all-in-one plugin for firebase. Hope this plugin evolves into one.

@yyzhou1994
Copy link

I tried implement both cordova-firebase-plugin and cordova-firebase-plugin-realtime-database into my cordova project but it returns "google-services.json/GoogleService-Info.plist already exists" error once I start the build.

I guess it's because both plugins are installing same source files so I commented out <source-file src="src/android/google-services.json" target-dir="." /> and <resource-file src="src/ios/GoogleService-Info.plist" target="Resources/GoogleService-Info.plist" /> from the plugin.xml file. However this time when I do a build action, it returns an error saying
'Failed to apply plugin [id 'com.google.gms.google-services'] For input string: "+"'.

So anyone got idea what to do with the error and how to implement the 2 plugins together elegantly?

@sleever
Copy link
Author

sleever commented May 8, 2017

@yyzhou1994, I've currently integrated my app with AngularFire2 which, up till now, works fine.

It doesn't seem to conflict with the cordova-plugin-firebase plugin and the realtime database works as expected.

@yyzhou1994
Copy link

@sleever, How about cordova-firebase-plugin-realtime-database plugin? Have you tried that plugin with cordova-plugin-firebase before?

@DavidFrahm
Copy link

Using multiple Cordova plugins for Firebase sounds very problematic.

Just for starters:

  • Contention over GoogleService-Info.plist
  • Dependency management conflicts with required Google libraries for Play Services and Firebase

Seems like using this cordova-plugin-firebase plugin with AngularFire2 is the only reliable thing, so we need database support added here to get great offline capability.

@DavidFrahm
Copy link

Does the recent (May 17th, 2017) announcement of open-sourcing the Firebase SDKs have any impact or opportunity here?

Maybe this repo should be moved under Firebase and maintained there, with realtime support added?

@Tobbyte
Copy link

Tobbyte commented Jul 7, 2017

@DavidFrahm about the real time plugin: why don't you use firebase' web api? Every query/write etc works when offline and automatically syncs to the server when back online again. All you have to do is save the states to a local db which gets updated on server updates, or miss I something?

@DavidFrahm
Copy link

@apptum Well this is exactly the functionality I don't want to hand roll, and feel would help all the cordova firebase developers to have built-in to this plugin

All you have to do is save the states to a local db which gets updated on server updates, or miss I something?

@zakton5
Copy link

zakton5 commented Jul 21, 2017

@DavidFrahm @apptum I would greatly prefer to use the one liner of Firebase.getDefaultConfig().setPersistenceEnabled(true); as opposed to using a local db. If no one is currently working on this issue, I will gladly fork the repo and attempt it myself.

@zakton5
Copy link

zakton5 commented Jul 25, 2017

I would like some input? Should I attempt to model the API after the native iOS/Android calls or more like AngularFire?

@explofish
Copy link

AngularFire now Supports Offline Functionality due to the release of FireStore (which has Offline Support even for the WEB).

Though, i have a bad feeling with having two instances of Firebase (one Native, one Web SDK), using AngularFire with cordova-plugin-firebase now seems like a good solution.

@soumak77
Copy link
Contributor

closing as resolved. AngularFire should support your needs.

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

No branches or pull requests

10 participants