FirebaseFunctions blocks request to localhost

Viewed 9

I try to use the FunctionsEmulator and I'm getting the error:

flutter: [firebase_functions/-1022] The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

Sourcecode:

var myInstance = FirebaseFunctions.instance;
myInstance.useFunctionsEmulator(
      "localhost",
      5001,
    );
    var result = myInstance
        .httpsCallable("checkVoucherCode", options: HttpsCallableOptions())
        .call({"voucher_id": id}).then((value) {
      inspect(value);
})

How can I fix this problem? I guess I have to disable SSL but how?

1 Answers

Fixxed. Just include into info.plist:

<dict>
            <!--Include to allow all connections (DANGER)-->
            <key>NSAllowsArbitraryLoads</key>
            <true/>
        </dict>
Related