Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

279
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda