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

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

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 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