proposals icon indicating copy to clipboard operation
proposals copied to clipboard

Support all firebase products

Open xzilja opened this issue 3 years ago • 11 comments

Plugin Request

Name: firebase-core, firebase-auth, firebase-crashlytics, firebase-firestore .... Package: @capacitor-community/firebase-core ...

Platform(s)

iOS, Android, Web (partial)

Existing Solutions

Firebase plugin ecosystem for capacitor is very fragmented, with different implementations and API's I was able to find https://github.com/baumblatt/capacitor-firebase-auth https://github.com/capacitor-community/firebase-analytics (already in community)

However it would be ideal to have all packages under capacitor community with unified implementation and apis, something like https://github.com/invertase/react-native-firebase did for react-native

Description

As mentioned above, I'd look at something like https://github.com/invertase/react-native-firebase for reference. Create a single "core" package for firebase and supporting packages like auth, analytics etc... that can be used alongside. Try to adhere to similar api and implementation where possible. In theory all that is needed are capacitor interfaces for ios and android sdk's

Related proposal issues I was able to find https://github.com/capacitor-community/proposals/issues/91 https://github.com/capacitor-community/proposals/issues/66

xzilja avatar Apr 18 '21 13:04 xzilja

This would be a great plugin addition! Even if there was a desire to keep each component separate, having a consistent API and options for more Firebase services would be a huge plus.

A huge addition would be Firebase Cloud Storage - we need the ability to start and manage long-running uploads and downloads in the background! To my knowledge, there is no great way to do this with Ionic + Capacitor. The mobile OS tends to kill/suspend things as soon as they are made inactive, and forcing the main activity to stay active (like some plugins do) can lead to its own issues. A Cloud Storage plugin with true background support (sticky notification with progress bar maybe?) would be amazing.

I'd also love a plugin for Cloud Firestore - something that can leverage the full power of the offline capabilities with the native SDKs. Maybe I did something wrong, but offline support with the Javascript SDK (eg. firebase.firestore().enablePersistence()) was not acting reliably in my Ionic app. I think offline mode gets more first-class treatment with the native Android/iOS SDKs, plus then you're not worrying about the WebView storage layers, which aren't generally the most reliable to begin with.

5hee75 avatar Nov 15 '21 03:11 5hee75

@5hee75 There is already a plugin request for true background task support, so be sure to vote that up to show your support.

ptmkenny avatar Nov 15 '21 03:11 ptmkenny

@ptmkenny I have already upvoted that request and actually commented in the thread several months ago with a related StackOverflow question that I had submitted. Sorry for the duplication, but I can't pass up a chance to advocate for it! Any chance that one has made it on the short list yet??

5hee75 avatar Nov 15 '21 04:11 5hee75

Great idea. Could even be a mono repo with all the plugins for each firebase product. I would be happy to help if needed. I started something similar for App Center.

johnborges avatar Nov 15 '21 13:11 johnborges

Great proposal. I'm already working on such a mono repo. ETA is this year. I'll let you know when I'm done.

robingenz avatar Nov 23 '21 22:11 robingenz

@robingenz any update on this?

5hee75 avatar Feb 16 '22 02:02 5hee75

@5hee75 I'm sorry. There was a lot of stuff going on in the last few months. The topic is still up to date and I hope to be able to publish it soon.

robingenz avatar Feb 16 '22 20:02 robingenz

@robingenz apology not necessary! I understand you guys must be extremely busy, so no rush. Let me/us know if you need any assistance.

5hee75 avatar Feb 17 '22 04:02 5hee75

Quick update: I will be publishing the Capacitor Firebase Monorepo next week. If anyone would like to have access in advance to help me test it, feel free to send me a message.

robingenz avatar Mar 15 '22 21:03 robingenz

Quick update: I will be publishing the Capacitor Firebase Monorepo next week. If anyone would like to have access in advance to help me test it, feel free to send me a message.

@robingenz I'd be happy to test out the early version!

5hee75 avatar Mar 16 '22 00:03 5hee75

The plugins are now published! 🎉 This is the link to the repo: https://github.com/robingenz/capacitor-firebase The following Firebase products are supported initially:

  • 📊 Analytics
  • ⚙️ App
  • 🔒 Authentication
  • 🐛 Crashlytics
  • 💯 Performance Monitoring

More coming soon! If you find bugs or have feature requests, just create an issue. If you have questions you can create a discussion. I would be happy about feedback!

robingenz avatar Mar 21 '22 10:03 robingenz