Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

280
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda