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

303
Views
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 answers
Answer question

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