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

Commit c6bb8a7

Browse files
#564 Firebase Auth + WebPack crashing iOS application (when createUser is triggered)
1 parent c278144 commit c6bb8a7

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)
55

66

7+
## 5.0.3 (2017, December 7)
8+
9+
### New
10+
- [#564](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/564) Firebase Auth + WebPack crashing iOS application (when createUser is triggered)
11+
12+
713
## 5.0.2 (2017, December 1)
814

915
### New

src/firebase.ios.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ firebase._receivedPushTokenCallback = null;
1313
firebase._gIDAuthentication = null;
1414
firebase._cachedInvitation = null;
1515
firebase._cachedDynamicLink = null;
16-
firebase._configured = null;
16+
17+
// Note that this must be done only once
18+
FIRApp.configure();
1719

1820
/**
1921
* Workaround function to call the `dispatch_get_main_queue(...)` for iOS
@@ -28,13 +30,6 @@ const invokeOnRunLoop = (() => {
2830
};
2931
})();
3032

31-
firebase._configure = () => {
32-
if (!firebase._configured) {
33-
FIRApp.configure();
34-
firebase._configured = true;
35-
}
36-
};
37-
3833
firebase._addObserver = (eventName, callback) => {
3934
const queue = utils.ios.getter(NSOperationQueue, NSOperationQueue.mainQueue);
4035
return utils.ios.getter(NSNotificationCenter, NSNotificationCenter.defaultCenter).addObserverForNameObjectQueueUsingBlock(eventName, null, queue, callback);
@@ -67,8 +62,6 @@ const addBackgroundRemoteNotificationHandler = appDelegate => {
6762
if (typeof(FIRMessaging) !== "undefined") {
6863
appDelegate.prototype.applicationDidReceiveRemoteNotificationFetchCompletionHandler = (app, notification, completionHandler) => {
6964

70-
firebase._configure();
71-
7265
// Pass notification to auth and check if they can handle it (in case phone auth is being used), see https://firebase.google.com/docs/auth/ios/phone-auth
7366
if (FIRAuth.auth().canHandleNotification(notification)) {
7467
completionHandler(UIBackgroundFetchResult.NoData);
@@ -630,8 +623,6 @@ firebase.init = arg => {
630623
FIROptions.defaultOptions().deepLinkURLScheme = utils.ios.getter(NSBundle, NSBundle.mainBundle).bundleIdentifier;
631624
}
632625

633-
firebase._configure();
634-
635626
if (typeof(FIRDatabase) !== "undefined") {
636627
if (arg.persist) {
637628
FIRDatabase.database().persistenceEnabled = true;
@@ -1513,7 +1504,7 @@ firebase.changePassword = arg => {
15131504
firebase.createUser = arg => {
15141505
return new Promise((resolve, reject) => {
15151506
try {
1516-
const onCompletion = (user, error) => {
1507+
const onCompletion = (user: FIRUser, error: NSError) => {
15171508
if (error) {
15181509
reject(error.localizedDescription);
15191510
} else {

0 commit comments

Comments
 (0)