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

Class UI

packages/firebase-ui/index.android.ts:620–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620export class UI implements IUI {
621 _native: com.firebase.ui.auth.AuthUI;
622 _auth: Auth;
623 _app: FirebaseApp;
624
625 constructor(auth?: Auth) {
626 if (auth?.app) {
627 this._native = com.firebase.ui.auth.AuthUI.getInstance(auth.app.native);
628 this._auth = auth;
629 } else {
630 if (defaultUI) {
631 return defaultUI;
632 }
633 defaultUI = this;
634 this._native = com.firebase.ui.auth.AuthUI.getInstance();
635 }
636 }
637
638 static fromNative(ui: com.firebase.ui.auth.AuthUI) {
639 if (ui instanceof com.firebase.ui.auth.AuthUI) {
640 const ret = new UI();
641 ret._native = ui;
642 return ret;
643 }
644 return null;
645 }
646
647 get native() {
648 return this._native;
649 }
650
651 get android() {
652 return this.native;
653 }
654
655 get app(): FirebaseApp {
656 if (this._auth) {
657 return this._auth.app;
658 }
659 if (!this._app) {
660 // @ts-ignore
661 this._app = FirebaseApp.fromNative(this.native.getApp());
662 }
663 return this._app;
664 }
665
666 useEmulator(host: string, port: number) {
667 this.native.useEmulator(host === 'localhost' || host === '127.0.0.1' ? '10.0.2.2' : host, port);
668 }
669
670 show(config: Config) {
671 return new Promise<IIdpResponse>((resolve, reject) => {
672 try {
673 const builder = this.native.createSignInIntentBuilder();
674 if (config.providers.length > 0) {
675 const providers = new java.util.ArrayList();
676 config.providers.forEach((provider) => {
677 providers.add(provider.getNative(this));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected