#How to get user request that was sent to dart function and also import secret values from env var

58 messages · Page 1 of 1 (latest)

fast bloom
#

dynamic apiToken = context.res.send(Platform.environment['DAMMY_GONGOZ_API']);
I used this for fetching env var and it was returning - DAMMY_GONGOZ_API

Also, how to get user request that was sent to dart function?
I am able to send a response from cloud function😞 to user app, but cannot get app request yet.

soft hedge
fast bloom
#

this is the env var

soft hedge
fast bloom
fast bloom
soft hedge
fast bloom
#
functionId: 'all_sending_services', data: jsonEncode(data));```

this is the code
fast bloom
soft hedge
fast bloom
#

I inputed
'name':'p'

#

outcome

soft hedge
soft hedge
fast bloom
fast bloom
#

return context.res.json({"userReq": userReq});

userReq should have preceed it

#

currently using
appwrite: ^11.0.0

soft hedge
soft hedge
fast bloom
#
          await functions.createExecution(
        functionId: "all_sending_services",
        body: jsonEncode(data),
        xasync: false,
        path: '/',
        method: 'POST',
        headers: {
          'content-type': 'application/json',
        },
      );

this particular client code is given frontend error

fast bloom
#
Receiver: Instance of 'Functions'
Tried calling: createExecution(body: "{\"numberToProcess\":\"0903416500\",\"userMail\":\"[email protected]\",\"userID\":\"6538b01cc5e7399b65b9\",\"totalServiceCharge\":\"120\",\"serciceTypeAndService\":\"MTN SME\",\"serviceQuantity\":\"500MB\",\"walletBalanceDocumentID\":\"0903416500\",\"networkID\":\"1\",\"planID\":\"289\",\"serviceName\":\"Mobile Data\",\"customerAmount\":\"120\",\"currentUserBalance\":\"170\",\"previousWalletBalance\":\"50\",\"whatTypeOfTransaction\":\"Mobile Data\",\"supplierRate\":\"107.5\",\"transactionID\":\"unique()\"}", functionId: "all_sending_services", headers: _Map len:1, method: "POST", path: "/", xasync: false)
Found: createExecution({required String functionId, String? data, bool? xasync}) => Future<Execution>```
soft hedge
fast bloom
soft hedge
fast bloom
soft hedge
fast bloom
#

I have stressed you on this

Sighs

soft hedge
fast bloom
#
description: A new Flutter project.
environment:
  # sdk: '>=2.18.2 <3.0.0'
  sdk: ">=2.19.6 <3.0.0"

dependencies:
  flutter_svg:
  page_transition:
  flutter_html:
  flutter_widget_from_html:
  flutter_easyloading:
  # webview_flutter:
  # monnify_flutter_sdk_plus:
  # flutter_inappwebview:

  flutter_monnify:
  dio:
  connectivity_plus:
  http:
  get_storage:
  # animated_text_kit:p
  # screenshot:
  # appwrite_auth_kit:
  # dart_appwrite:
  # rflutter_alert:
  # flutter_easyloading:
  cupertino_icons:
  get: #^5.0.0-release-candidate-3
  shared_preferences:
  # awesome_snackbar_content:
  flutter_screenutil:
  url_launcher:
  carousel_slider:
  upgrader:
  # flutter_svg:
  # get_cli:
  # quickalert:
  local_auth:
  pinput:
  # flutter_secure_storage:
  # mailer for otp and notification
  mailer:
  # otp wait
  slide_countdown:
  material_design_icons_flutter:
  ionicons:

  flutter:
    sdk: flutter
  device_preview: ^1.1.0
  device_preview_screenshot: ^1.0.0
  isar: ^3.1.0+1
  isar_flutter_libs: ^3.1.0+1
  appwrite: ^11.0.0

dev_dependencies:
  build_runner: ^2.4.6
  flutter_lints: ^2.0.0
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.13.1
  flutter_native_splash:
  isar_generator: ^3.1.0+1
soft hedge
fast bloom
soft hedge
#

It was 8...

fast bloom
#

was thinking version 11 is the problem

fast bloom
soft hedge
#

Then share your pubspec.lock file

fast bloom
#

I just did that

soft hedge
# fast bloom

You should be on the right version...what's the function signature for create execution now?

soft hedge
fast bloom
fast bloom
#

so how do I update the corresponding cloud code without doing it mannually and having errror

soft hedge
fast bloom
#

but already showing error

soft hedge
fast bloom
soft hedge
fast bloom
#

I did, any need to update all cloud functions?

#

cause after uodating client code, error persist in older ones

#

I must be sincere @soft hedge
you mean alot to mee

I just hope all works, thanks Man