Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
HttpsCallable Return from python

I have an Xcode Application (written in Swift) that calls an HTTP python function that's deployed in Firebase. It should be getting a Response in return but for some reason, it always just returns when data is nil.

// swift function in xcode 

Functions.functions().httpsCallable("python_callable").call(["ID": ID, "time": String(currentTime)]) { (result, error) in
                        if error != nil {
                            //does not enter this
                            return
                        }
                        else {
                            guard let data = result?.data as? Data else {return}
                            print(data)
            }
    }

The following is a google cloud function that is written in python. According to the Google Cloud documentation, Firebase function use Flask to work with HTTP Requests.

#deployed python Firestore function 
    import Flask
    def python_callable(request):
        ** processes firestore data ** 
        result = {"text":"example", "score": 100}
        return jsonify(data=result)

I know that the python_callable function is being invoked and that it is receiving the request however it seems that no matter what I do, I can't get the Swift function to get the response. It always receives null. Is there a specific Response format that httpsCallable expects/is jsonify used incorrectly?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Callable functions are only supported in Cloud Functions via the Firebase SDK for node. They won't work for Python, unless you implement the callable protocol in the function itself. If you want to call a regular HTTP function that you wrote in python, you won't be able to call it using the Firebase SDK on the client.

If you want to try implementing the protocol on the server side, the documentation on how callables work is here: https://firebase.google.com/docs/functions/callable-reference

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!