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

Method constructor

packages/firebase-core/index.android.ts:205–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 return Firebase._inForeground;
204 }
205 constructor() {
206 if (firebaseInstance) {
207 return firebaseInstance;
208 }
209 firebaseInstance = this;
210 Application.android.on('activityResumed', (args) => {
211 Firebase._inForeground = true;
212 Firebase._appDidLaunch = true;
213 Firebase._onResumeQueue.forEach((callback) => {
214 callback();
215 });
216 });
217
218 Application.android.on('activityPaused', (args) => {
219 Firebase._inForeground = false;
220 });
221
222 Application.android.once('activityCreated', (args: any) => {
223 if (!lastActivity) {
224 lastActivity = new WeakRef(args.activity);
225 Firebase._activityResultContractsQueue.notify({
226 eventName: 'register',
227 activity: args.activity,
228 dispose: false,
229 });
230 }
231 });
232
233 Application.android.on('activityDestroyed', (args) => {
234 const activity = lastActivity?.get?.();
235 if (activity && args.activity === activity) {
236 Firebase._activityResultContractsQueue.notify({
237 eventName: 'register',
238 activity: args.activity,
239 dispose: true,
240 });
241
242 lastActivity = undefined;
243 Application.android.once('activityCreated', (args: any) => {
244 if (!lastActivity) {
245 lastActivity = new WeakRef(args.activity);
246 Firebase._activityResultContractsQueue.notify({
247 eventName: 'register',
248 activity: args.activity,
249 dispose: false,
250 });
251 }
252 });
253 }
254 });
255 return firebaseInstance;
256 }
257
258 app(name?: string) {
259 if (name) {

Callers

nothing calls this directly

Calls 5

callbackFunction · 0.85
onMethod · 0.65
forEachMethod · 0.65
onceMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected