MCPcopy Index your code
hub / github.com/NativeScript/firebase / show

Method show

packages/firebase-ui/index.ios.ts:535–572  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

533 }
534
535 show(config: Config) {
536 return new Promise<IIdpResponse>((resolve, reject) => {
537 try {
538 if (config.providers.length > 0) {
539 const providers = config.providers
540 .map((provider) => {
541 return provider.getNative(this);
542 })
543 .filter((value) => !!value);
544 this.native.providers = providers as any;
545 }
546
547 if (config.anonymousUsersAutoUpgrade) {
548 this.native.autoUpgradeAnonymousUsers = true;
549 } else {
550 this.native.autoUpgradeAnonymousUsers = false;
551 }
552
553 if (config.tosAndPrivacyPolicy?.tos && config.tosAndPrivacyPolicy?.privacyPolicy) {
554 this.native.TOSURL = NSURL.URLWithString(config.tosAndPrivacyPolicy?.tos);
555 this.native.privacyPolicyURL = NSURL.URLWithString(config.tosAndPrivacyPolicy?.privacyPolicy);
556 }
557
558 this._resolve = resolve;
559 this._reject = reject;
560
561 const keyWindow = UIApplication.sharedApplication.keyWindow;
562 const vc = keyWindow != null ? keyWindow.rootViewController : undefined;
563 const controller = Utils.ios.getVisibleViewController(vc) as UIViewController;
564 this._controller = this.native.authViewController();
565 controller.presentViewControllerAnimatedCompletion(this._controller, true, () => {});
566 } catch (error) {
567 reject(new FirebaseError(error?.message || 'Failed to show UI'));
568 this._resolve = null;
569 this._reject = null;
570 }
571 });
572 }
573
574 delete() {
575 return new Promise<void>((resolve, reject) => {

Callers

nothing calls this directly

Calls 2

getNativeMethod · 0.65

Tested by

no test coverage detected