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

308
Visualizações
Firebase HTTP cloud function giving 401 error when calling the function from the iOS app

I have written some cloud functions and deployed them. Initially, I was using a single function onUpdate, and it's working fine. Today I've created a simple onCall function that I'm willing to call from iOS Firebase SDK. this is the test function that I'm assuming to work but it is giving me Unauthenticated error in the response.

exports.test = functions.https.onCall((data, context) => {
  console.log('test call info', data, context);
  return 'hello, world!';
});

When I check the logs on firebase, it is showing me the below logs -

enter image description here

Can anybody help me in resolving this issue? Few key points -

  • I've not enabled App Check.
  • I'm able to access Firebase real-time DB and Firestore DB from the iOS app and from internal cloud functions (onUpdate), just facing this issue with HTTP callable functions.

Here is the iOS app code where I'm calling the cloud function -

   let functions = Functions.functions()
   functions.httpsCallable("test").call() { res, error in
        if let error = error {
            debugPrint(error)
        } else {
            debugPrint(res?.data)
        }
   }

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Regarding the docs about Protocol specification for https.onCall, I suggest taking a look to the paragraph Response format: status codes.

The issue seems to point to “If the auth token supplied in the request is invalid, the request is rejected with 401 Unauthorized, with an error code of UNAUTHENTICATED.”

You may find this question interesting too.

about 4 years ago · Juan Pablo Isaza 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