Cloud Functions for Firebase HTTP Request

后端 未结 1 2007
失恋的感觉
失恋的感觉 2021-01-15 17:39

I want to send an HTTP Request from Android to a cloud function, post some values, then input these values into real time database.

index.js
const functions         


        
相关标签:
1条回答
  • 2021-01-15 18:12

    I see three steps in here:

    1. Calling a Cloud Function from Android.

      This is the same as calling any other HTTP URL from Android. See Calling a Cloud Function from Android through Firebase

    2. Parsing parameters from the call in your Cloud Function

      A HTTP triggered Cloud Function is really just an Express handler. So parsing the post works the same as for other Express handlers. The Firebase documentation for HTTP functions has some examples and links to other documentation.

    3. Posting to the database from a Cloud Functions

      All the samples in the functions-samples repo include the Firebase Admin SDK. This SDK allows you to access many Firebase features, such as the database, from within your function. But there's also an example in this repo.

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