【问题标题】:Getting access to parameter in lcoud function when cloud function is called from android app从android应用调用云函数时获取云函数中的参数
【发布时间】:2018-04-05 06:59:50
【问题描述】:
FirebaseFunctions.getInstance().getHttpsCallable("onCommentMentionCreated")
                            .call(data);

上面的代码是我用来从 android 应用程序调用 firebase 云函数的代码。在call 函数中用作参数的data 变量是一个Hashmap。我想知道如何在服务器端访问它。

【问题讨论】:

标签: android firebase google-cloud-functions


【解决方案1】:

你应该有一个对应的Callable Cloud Function,类似这样:

exports. onCommentMentionCreated = functions.https.onCall((data, context) => {
  // ...
});

您从 Android 应用程序传递的数据在 data 参数中可用。

如需比documentation 中的sn-ps 更完整的示例,请查看full corresponding Cloud Functions code

【讨论】:

    猜你喜欢
    • 2019-01-18
    • 1970-01-01
    • 2021-01-21
    • 2017-08-04
    • 2020-01-04
    • 2017-08-09
    • 1970-01-01
    • 2020-07-27
    相关资源
    最近更新 更多