I want that every time that chat is modified from the firebase database this function is activated \"sendNotification\" but this error appears:
sendNotification
Apparently you are using an old version of the Firebase SDK for Cloud Functions, which is < to version 1.0, but your syntax (onWrite((change, context))
) corresponds to version >= 1.0.
The image shows an error on onWrite.event which corresponds to the old syntax (.onWrite((event))
) .
You should update the SDK in your project, as follows:
npm install firebase-functions@latest --save npm install firebase-admin@latest --save-exact
You should also update Firebase CLI to the latest version:
npm install -g firebase-tools
See this documentation item for all the details.