Firebase functions how to send a notification in Android

后端 未结 1 1616
北恋
北恋 2021-01-26 12:31

I want that every time that chat is modified from the firebase database this function is activated \"sendNotification\" but this error appears:

sendNotification
         


        
相关标签:
1条回答
  • 2021-01-26 13:22

    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.

    0 讨论(0)
提交回复
热议问题