[Cloud Functions] Apply the same function to different firebase projects
Overview
If you are using firebase in your smartphone app, you may use different firebase projects for development and production.
If you use cloud functions, here's how to apply the same functions to each project.
Method
※Proceed on the assumption that each project has already been created
You can apply the same function to multiple different projects by using aliases(reference)
1 Add aliases
You can add an alias with the following command.
firebase use --add
Assign your production / development project to a suitable alias (such as prod / dev).
The alias of the project selected when starting cloud functions is "default".
2 Switch aliases
Switch the alias with the following command. (For prod alias)
firebase use prod
If you deploy firebase in this state, the function will be deployed to the project to which the prod alias is assigned.
Recent Posts
See AllOverview In many cases, you'll send a message with Firebase Messaging and take some action when the notification is tapped (eg to go to a...
Overview A title error has occurred at FirebaseMessaging.onBackgroundMessage(). Cause and Solution The delegate passed to the argument of...
Comments