Skip to content

Calling Cloud Functions locally from iOS gives an "Insecure fetch request" error #7537

Closed
@ir-fuel

Description

@ir-fuel

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.4
  • Firebase SDK version: 7.6.0
  • Installation method: Swift Package Manager
  • Firebase Component: Functions

[REQUIRED] Step 2: Describe the problem

When running the emulator locally and calling a HTTPS function, the console outputs the following message:

 Insecure fetch request has a scheme (localhost) not found in fetcher allowedInsecureSchemes (( http )): localhost:5001/****/us-central1/testFunction 

Steps to reproduce:

Create a cloud function:

Run the emulator locally

Setup the iOS app to call your function and call it

Relevant Code:

exports.testFunction = functions.https.onCall(async (data, context) => { } 
firebase emulators:start 

on iOS:

 let functions = Functions.functions() functions.useEmulator(withHost: "localhost", port: 5001) functions.httpsCallable("testFunction").call([ ... 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close