0

So when I open functions in my firebase console. I open the function's link which is https://us-central1-geochatterthing.cloudfunctions.net/getWall . And this link gets opened into a browser with below error

{"error":{"status":"INVALID_ARGUMENT","message":"Bad Request"}}

Also, my scenario is that there is an app already on Google Play on which images are being fetched using the function getWall. And now I'm supposed to redesign the app using the same original code.

But now the getWallfunction doesn't seems to work.

const wallFunc = firebase.functions().httpsCallable('getWall');

result = await wallFunc({size: 15});

Can someone please tell me what could be the issue here? Thanks in advance! :)

UPDATE:

Below is the code for the getWall function I accessed from Google Cloud Console.

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _messages = require("./messages");

Object.keys(_messages).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _messages[key];
    }
  });
});

var _conversations = require("./conversations");

Object.keys(_conversations).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _conversations[key];
    }
  });
});

var _profiles = require("./profiles");

Object.keys(_profiles).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _profiles[key];
    }
  });
});

var _auth = require("./auth");

Object.keys(_auth).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _auth[key];
    }
  });
});

var _apiHttp = require("./api-http");

Object.keys(_apiHttp).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _apiHttp[key];
    }
  });
});

var _friends = require("./friends");

Object.keys(_friends).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _friends[key];
    }
  });
});

var _wall = require("./wall");

Object.keys(_wall).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _wall[key];
    }
  });
});
Shubham Bisht
  • 577
  • 2
  • 26
  • 51
  • What is the code of your `getWall` Cloud Function ? You may be mixing up HTTP Cloud Functions and Callable Cloud Functions but it is not 100% clear... You should give more details on how is coded the Cloud Function and how do you call it (through an URL or via `firebase.functions().httpsCallable('getWall');`? – Renaud Tarnec Apr 25 '19 at 08:51
  • Can you please tell me how can I access the code for `getWall` cloud function? – Shubham Bisht Apr 25 '19 at 09:41
  • See https://stackoverflow.com/questions/52534966/cloud-functions-for-firebase-retrieving-already-deployed-code/52535292#52535292 – Renaud Tarnec Apr 25 '19 at 09:42
  • maybe that is because of registrationToken , see this [answer](https://stackoverflow.com/a/49141865/7858922) – amirhosein Apr 25 '19 at 09:52
  • @RenaudTarnec please check my updated question. I've now added the code of `getWall` cloud function. – Shubham Bisht Apr 29 '19 at 07:29
  • @ShubhamBisht Actually, this code does not seem to be Cloud Functions for Firebase code. – Renaud Tarnec Apr 29 '19 at 07:39
  • @RenaudTarnec So where can I access the right code? – Shubham Bisht Apr 29 '19 at 07:40
  • @RenaudTarnec I use this `firebase.functions().httpsCallable('getWall')` – Shubham Bisht Apr 29 '19 at 07:41
  • I have no idea! If this is the code you got by exactly following the instructions in https://stackoverflow.com/questions/52534966/cloud-functions-for-firebase-retrieving-already-deployed-code/52535292#52535292, I am sorry but I cannot help you further as this is not Cloud Functions for Firebase code IMO and I don't know what is this code doing. – Renaud Tarnec Apr 29 '19 at 07:42
  • Using firebase.functions().httpsCallable('getWall') means that you call a Callable Cloud Function https://firebase.google.com/docs/functions/callable and the code you shown is not corresponding to a Callable Cloud Function... What else can I say?! :) – Renaud Tarnec Apr 29 '19 at 07:44
  • @ShubhamBisht i understand, and i am explaining that "this is not Cloud Functions for Firebase code IMO and I don't know what is this code doing". You should contact the persons who wrote this code. – Renaud Tarnec Apr 29 '19 at 07:49
  • @RenaudTarnec should I need to deploy the callable function in my App? I'm not sure if it has already been deployed or not. – Shubham Bisht Apr 30 '19 at 10:38
  • The Callable Cloud Function shall be deployed on the Firebase platform (Google Cloud Platform), not on your app. See https://firebase.google.com/docs/functions – Renaud Tarnec Apr 30 '19 at 11:30
  • @RenaudTarnec https://stackoverflow.com/questions/56001098/how-to-search-documents-from-a-collection-based-on-a-field-in-firestore-databa can you please check this question? – Shubham Bisht May 06 '19 at 08:18

0 Answers0