gpt4 book ai didi

android - Firebase onCall 函数将结果保存到 android 中的变量

转载 作者:行者123 更新时间:2023-12-04 23:56:13 25 4
gpt4 key购买 nike

<分区>

我尝试保存从 Android 应用程序调用 firebase 函数的结果。我的函数运行良好,因为我在日志中看到了结果。但我无法将其保存到变量中以供进一步使用。有什么想法吗?

public void getUserRankFromFirebase(){
mFunctions = FirebaseFunctions.getInstance();
Map<String, Object> data = new HashMap<>();
String resultFBFunctions = "";

mFunctions
.getHttpsCallable("getUserOnCall")
.call(data)
.addOnSuccessListener(getActivity(), new OnSuccessListener<HttpsCallableResult>() {
@Override
public void onSuccess(HttpsCallableResult httpsCallableResult) {

resultFBFunctions = httpsCallableResult.getData().toString();
Log.d("result1", httpsCallableResult.getData().toString()); //I see result here
}
});
Log.d("result2", resultFBFunctions); // No result here
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com