I have questions regarding Firebase functions for iOS app and web admin.
So.. Here's a circumstance.
My concern is... If I do "firebase deploy --only functions" on admin page and forget to mention "not to wipe out" functions from functions used in iOS app, that could cause problem to the live app.
So, someone suggested me to write codes in iOS app's index.js for firebase functions for the admin's backend.
And, I want to know what's the best practice in this case TT
Firebase deploy will only delete functions if you (a) use the functions:delete
CLI command or (b) if you remove the function from you index.js
before deploying. When you firebase deploy --only functions
, it will deploy any new ones and redeploy any existing ones.
If what you're saying is that you have your functions in two different repos, then you have two options:
firebase deploy --only functions
. Instead, set up your deploy workflow or process to deploy the specific functions in that repo so it doesn't affect any other functions. Something like this:firebase deploy --only functions:iosFunc1,functions:iosFunc2
firebase deploy --only functions:adminFuncA,functions:adminFuncB
When you explicitly define which functions to deploy, it won't affect any other functions.
But I'd seriously consider separating the functions back-end code from your iOS client side code if for no other reason than removing the possibility of potentially leaking admin credentials to the client.