0👍
✅
If this.getDefaultCountry()
is synchronous (i.e. doesn’t require any database lookups, promises, etc), you should be able to use the following code, where defaultCountry
is swapped out for a getter instead of a static value:
signInOptions: [
firebase.auth.EmailAuthProvider.PROVIDER_ID,
{
provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
recaptchaParameters: {
type: 'image',
size: 'invisible',
badge: 'bottomleft'
},
get defaultCountry() {
// contents of getDefaultCountry here
}
}
]
If your this.getDefaultCountry()
is asynchronous, you will instead have to show some form of loading screen while you get the value, build signInOptions
, give it to your FirebaseUI config and then finally render it.
Source:stackexchange.com