I have created a Google Cloud Function through functions.https.onRequest
, which is working nicely when I paste its URL in a browser and integ
Since version 12.0.0 you can call cloud function in more simple way
Add following line in your build.gradle
implementation 'com.google.firebase:firebase-functions:19.0.2'
And use following code
FirebaseFunctions.getInstance() // Optional region: .getInstance("europe-west1")
.getHttpsCallable("myCoolFunction")
.call(optionalObject)
.addOnFailureListener {
Log.wtf("FF", it)
}
.addOnSuccessListener {
toast(it.data.toString())
}
You can use it on main thread safely. Callbacks is triggered on main thread as well.
You can read more in official docs: https://firebase.google.com/docs/functions/callable