Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 807e0b0

Browse files
Broken firebase API broken since 8/26 #475
1 parent 7b59855 commit 807e0b0

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

firebase.android.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ var frame = require("ui/frame");
44
var fs = require("file-system");
55
var firebase = require("./firebase-common");
66

7-
// this may fail if tns-core-modules doesn't include it (can be removed in about a year), see https://github.com/EddyVerbruggen/nativescript-plugin-firebase/pull/449
8-
var profile;
9-
try {
10-
profile = require("profiling").profile;
11-
} catch (ignore) {}
12-
13-
147
firebase._launchNotification = null;
158

169
// we need to cache and restore the context, otherwise the next invocation is broken
@@ -274,13 +267,12 @@ firebase.init = function (arg) {
274267
resolve(firebase.instance);
275268
}
276269

277-
var _resolve = profile === undefined ? runInit : profile("firebase.init resolve", runInit);
278270
try {
279271
if (appModule.android.foregroundActivity) {
280-
_resolve();
272+
runInit();
281273
} else {
282274
// if this is called before application.start() wait for the event to fire
283-
appModule.on(appModule.launchEvent, _resolve);
275+
appModule.on(appModule.launchEvent, runInit);
284276
}
285277
} catch (ex) {
286278
console.log("Error in firebase.init: " + ex);
@@ -739,14 +731,12 @@ firebase.getRemoteConfig = function (arg) {
739731
.addOnFailureListener(onFailureListener);
740732
}
741733

742-
var _resolve = profile === undefined ? runGetRemoteConfig : profile("firebase.getRemoteConfig resolve", runGetRemoteConfig);
743-
744734
try {
745735
if (appModule.android.foregroundActivity) {
746-
_resolve();
736+
runGetRemoteConfig();
747737
} else {
748738
// if this is called before application.start() wait for the event to fire
749-
appModule.on(appModule.launchEvent, _resolve);
739+
appModule.on(appModule.launchEvent, runGetRemoteConfig);
750740
}
751741
} catch (ex) {
752742
console.log("Error in firebase.getRemoteConfig: " + ex);

0 commit comments

Comments
 (0)