首页 > 解决方案 > 无法调用函数 cloud_functions

问题描述

我不断得到:

颤振:捕获通用异常

颤振:异常:无法调用函数 helloWorld。

我一直在使用 cloud_functions 0.4.1

CloudFunctions cf = CloudFunctions(region: 'us-central1');
  try {
    HttpsCallable callable = cf.getHttpsCallable(
      functionName: 'helloWorld',
    );

    dynamic resp = await callable.call();

    print(resp);
  } 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);
  }

标签: flutter

解决方案


非易失性!我发现当我在 firebase 上部署我的云功能时,我为 https 请求而不是为调用部署了一个。对于未来的其他人,在制定部署方法时使用 functions.https.onCall。


推荐阅读