Since Firebase does not provide separate databases for debug and production, I decided to create a separate database for testing purposes for my app. I have a firebase function which listens to changes in the database but I'm unable to create a new function which listens to the new database url.
How can I change the url for the database?
I tried this :
export const sendNotificationTest = functions.database
.instance("https://appname-1234.firebaseio.com/")
.ref('/conversations/{conversationID}/{messageID}')
.onCreate(async (change, context) => {}
On trying to deploy, it says
HTTP Error: 400, The request has errors
Both the databases exist in the same project as shown here -
According to the guides it seems like you're supposed to put the name of the instance, not the URL. So, in the above example, it would be appname-1234
.