Running a macOS App as a Firebase Server in lieu of a Swift Admin SDK #8893
-
As the title states, I'm looking for alternatives to the Node JS Admin SDK. I currently use Firestore and implemented Firebase Functions to bridge the gap for things like running tasks and sending messages to users. However, I'm getting tired of battling with the terribly worded errors and GCP IAM permission nonsense, among many other issues, of Firebase Functions. Before abandoning Firebase for my project entirely, I'm considering attempting to build a macOS process (or app, if necessary) that can run on a server and handle the functionality I'm currently using the Admin SDK for the following, and I believe I can replicate the behaviors I need with minimal risk/impact.
Given the above, I believe this is a workable solution if I'm willing to run the risk of the server being tied to a common user auth key and add additional Cloud Firestore reads that would have been free from Firebase Functions Firestore Triggers. Nothing the server does is critical, meaning if it dies during the day, nothing bad happens. I can re-enable and it will continue on like nothing happened. I'm posting in the hopes others might have suggestions / additional thoughts. Does my plan seem reasonable? Whatever I come up with, I'll document and share so others can replicate. I know the Firebase team talked about the potential for a Swift Admin SDK in the past, preferably that could tie into Vapor. I can't imagine it's worth Firebase adding the maintenance cost for a Swift Admin SDK, but I'd love more info if anyone has any there as well. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
@bdrelling It will be interesting to learn a bit more about your use case. Would you mind sharing more details? From your description it looks like you have a backend implemented with in Swift with Vapor (running on a macOS server?) and you would like to use Firestore, Firebase Could Functions and Cloud Messaging from it. Does it look accurate? If yes, here are my initial thoughts on using Firebase SDKs for Apple platforms for this:
As an alternative solution, you can use Firebase HTTP API to access Firestore, Functions and Cloud Messaging directly form your backend. In this case you will be able to use any backend stack, optimize implementation for your use cases, but it will be a bit more tedious to implement: |
Beta Was this translation helpful? Give feedback.
-
@maksymmalyhin Thank you for the reply, this is incredibly helpful. I will 100% share anything I do here publicly for others to learn from / expand upon, and I'll try to signal to the Firebase team as well when I've made any headway. Re: "integrating Firebase SDKs with your Swift based backend running in macOS environment using SPM" -- The issue is that Vapor is typically going to run on Linux, which doesn't have access to I'll report back this week when I give it a shot! Thanks again. Really appreciate your comments. |
Beta Was this translation helpful? Give feedback.
-
Hi @bdrelling, Thank you for creating this issue! We understand that there is an interest to use Firebase Admin APIs/Firebase Cloud Functions with server-side Swift. We have been discussing this topic with our teams lately, however this is not something the Firebase Admin SDK team currently have plans to work in the near future. We will use this issue to track any progress. As you have mentioned in your initial post, using the Firebase REST APIs in a Swift server environment is one of the main workarounds for now... Additionally, you might be able to use a script written in Node.js or Python (or other officially supported language of the Admin SDK) as a way to bridge the space, though I understand that it might not be sustainable given the complexity and requirements of your projects. If you are comfortable sharing we would love to hear more use cases and examples where you would prefer server-side Swift + Firebase services (Admin SDK). Thanks again for your feedback. These are very valuable inputs for us to further improve our SDKs. b/205177095 |
Beta Was this translation helpful? Give feedback.
@bdrelling It will be interesting to learn a bit more about your use case. Would you mind sharing more details? From your description it looks like you have a backend implemented with in Swift with Vapor (running on a macOS server?) and you would like to use Firestore, Firebase Could Functions and Cloud Messaging from it. Does it look accurate? If yes, here are my initial thoughts on using Firebase SDKs for Apple platforms for this: