【发布时间】:2021-10-25 09:58:13
【问题描述】:
我在 kotlin 中编写了一个 http 函数。从 GCP 测试时它工作正常。相同的几行是:
class WinnerDeclaration : HttpFunction {
override fun service(request: HttpRequest?, response: HttpResponse?) {
//code ...
}
}
参考https://firebase.google.com/docs/functions/callable#call_the_function后,我写了这段代码:
private val cloudFunctions = FirebaseFunctions.getInstance()
val data = hashMapOf("uid" to uid)
cloudFunctions
.getHttpsCallable("WinnerDeclaration")
.call(data)
.addOnSuccessListener {
//code ...
}.addOnFailureListener {
it.printStackTrace()
}
但我总是遇到这个异常: com.google.firebase.functions.FirebaseFunctionsException: NOT_FOUND
【问题讨论】:
-
如果你熟悉 HTTP 请求,你可以使用 volley 或 retrofit
标签: java android firebase kotlin google-cloud-functions