EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

iOS auth().settings cannot be accessed #1759

Closed danielorihuela closed 3 years ago

danielorihuela commented 3 years ago

Good morning,

I am trying to make an e2e test with nativescript-dev-appium for the login of an app. This login uses the sms verification of firebase, and a captcha verification appears sometimes on an iOS simulator. I want to get rid of it, and in the official documentation says that it can be done with the following line of code.

firebase.auth().settings.appVerificationDisabledForTesting = true;

This option appears on the repository.

Screenshot 2021-01-12 at 16 27 18

I tried to access it through the native and the web API, but I was not lucky.

Any ideas on how to enable that setting or if its even possible at the moment?

Thanks

danielorihuela commented 3 years ago

I was finally able to disable the app verification for testing on iOS by accessing the native API. As I was using typescript, I needed to generate the typings of the cocoapods.

TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios [--for-device] [--release]

Then, it was a matter of accessing the data to modify it.

const auth = FIRAuth.auth();
if (auth != null) {
    auth.settings.appVerificationDisabledForTesting = true;
}