@@ -13,7 +13,9 @@ firebase._receivedPushTokenCallback = null;
1313firebase . _gIDAuthentication = null ;
1414firebase . _cachedInvitation = null ;
1515firebase . _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-
3833firebase . _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 => {
15131504firebase . 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