无法执行Google Cloud Functions Android客户端调用。
我从云控制台创建Cloud Function,并在云控制台上测试工作。
但在Android客户端应用程序上,它不起作用。
因此,我的确在Android Studio上导入了Google Cloud Service快速入门项目,也出现了同样的错误。
这是快速启动项目的URL。
https://cloud.google.com/functions/docs/quickstart-console
这是我的代码。
public class TestClass {
private FirebaseFunctions mFunctions;
public TestClass(){
mFunctions=new FirebaseFunctions();
}
..
public Task<String> myFunc(String text) {
// Create the arguments to the callable function, which is just one string
Map<String, Object> data = new HashMap<>();
data.put("message", text);
return mFunctions
.getHttpsCallable("myFunc")
.call(data)
.continueWith(new Continuation<HttpsCallableResult, String>() {
@Override
public String then(@NonNull Task<HttpsCallableResult> task) throws Exception {
// This continuation runs on either success …Run Code Online (Sandbox Code Playgroud)