相关疑难解决方法(0)

Firebase云功能:onRequest和onCall之间的区别

通过文档,我遇到了:

...您可以直接使用HTTP请求或来自客户端调用来调用函数.

来源

那里(引用中的链接)是一个提及functions.https.onCall.

但是在这里的教程中,使用了另一个函数functions.https.onRequest,我应该使用哪个函数?为什么?它们之间有什么区别/相似之处?

文档functions.https在这里.

firebase google-cloud-functions

26
推荐指数
2
解决办法
7869
查看次数

Flutter Firebase Cloud 函数无法调用

当我尝试从 Flutter 调用可调用函数时,在使用 Firebase Cloud Functions 时遇到错误。

flutter: caught generic exception
flutter: PlatformException(functionsError, Firebase function failed with exception., {message: NOT FOUND, code: NOT_FOUND})
Run Code Online (Sandbox Code Playgroud)

这是我尝试使用 cloud_functions 调用云函数的方法:^0.4.2+3

import 'package:cloud_functions/cloud_functions.dart';
      _check(String id) async {
        HttpsCallable callable = CloudFunctions.instance
            .getHttpsCallable(functionName: 'checkUserFavorites');
        try {
          final HttpsCallableResult result = await callable.call(
            <String, dynamic>{
              'id': id,
            },
          );
          print(result.data);
        } on CloudFunctionsException catch (e) {
          print('caught firebase functions exception');
          print(e.code);
          print(e.message);
          print(e.details);
        } catch (e) {
          print('caught generic exception');
          print(e);
        }
      }
Run Code Online (Sandbox Code Playgroud)

flutter google-cloud-functions

4
推荐指数
1
解决办法
3290
查看次数

标签 统计

google-cloud-functions ×2

firebase ×1

flutter ×1