@umituz/react-native-firebase 1.13.7 → 1.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-firebase",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.8",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -38,8 +38,6 @@ declare const __DEV__: boolean;
|
|
|
38
38
|
export interface ServiceInitializationResult {
|
|
39
39
|
app: FirebaseApp | null;
|
|
40
40
|
auth: unknown;
|
|
41
|
-
analytics: unknown;
|
|
42
|
-
crashlytics: unknown;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
/**
|
|
@@ -111,7 +109,7 @@ export function autoInitializeFirebase(): FirebaseApp | null {
|
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
/**
|
|
114
|
-
* Initialize all Firebase services (App
|
|
112
|
+
* Initialize all Firebase services (App and Auth)
|
|
115
113
|
* This is the main entry point for applications - call this once at app startup
|
|
116
114
|
*
|
|
117
115
|
* IMPORTANT: Auth initialization is handled via callback to avoid require() issues.
|
|
@@ -141,36 +139,21 @@ export async function initializeAllFirebaseServices(
|
|
|
141
139
|
return {
|
|
142
140
|
app: null,
|
|
143
141
|
auth: null,
|
|
144
|
-
analytics: null,
|
|
145
|
-
crashlytics: null,
|
|
146
142
|
};
|
|
147
143
|
}
|
|
148
144
|
|
|
149
|
-
const { auth
|
|
150
|
-
await FirebaseServiceInitializer.initializeServices(options);
|
|
151
|
-
|
|
152
|
-
if (analytics && typeof (analytics as { init?: () => Promise<void> }).init === 'function') {
|
|
153
|
-
await (analytics as { init: () => Promise<void> }).init();
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (crashlytics && typeof (crashlytics as { init?: () => Promise<void> }).init === 'function') {
|
|
157
|
-
await (crashlytics as { init: () => Promise<void> }).init();
|
|
158
|
-
}
|
|
145
|
+
const { auth } = await FirebaseServiceInitializer.initializeServices(options);
|
|
159
146
|
|
|
160
147
|
if (__DEV__) {
|
|
161
148
|
console.log('[Firebase] All services initialized:', {
|
|
162
149
|
app: !!app,
|
|
163
150
|
auth: !!auth,
|
|
164
|
-
analytics: !!analytics,
|
|
165
|
-
crashlytics: !!crashlytics,
|
|
166
151
|
});
|
|
167
152
|
}
|
|
168
153
|
|
|
169
154
|
return {
|
|
170
155
|
app,
|
|
171
156
|
auth,
|
|
172
|
-
analytics,
|
|
173
|
-
crashlytics,
|
|
174
157
|
};
|
|
175
158
|
}
|
|
176
159
|
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Firebase Service Initializer
|
|
3
|
-
* Handles initialization of Firebase
|
|
3
|
+
* Handles initialization of Firebase Auth service
|
|
4
4
|
*
|
|
5
5
|
* NOTE: Auth initialization is handled by the main app via callback.
|
|
6
6
|
* This removes the need for dynamic require() which causes issues in production.
|
|
7
7
|
*
|
|
8
|
-
* Single Responsibility: Only initializes Firebase
|
|
8
|
+
* Single Responsibility: Only initializes Firebase Auth service
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { firebaseAnalyticsService } from '../../../analytics';
|
|
12
|
-
import { firebaseCrashlyticsService } from '../../../crashlytics';
|
|
13
|
-
|
|
14
11
|
declare const __DEV__: boolean;
|
|
15
12
|
|
|
16
13
|
export type AuthInitializer = () => unknown;
|
|
@@ -21,8 +18,6 @@ export interface ServiceInitializationOptions {
|
|
|
21
18
|
|
|
22
19
|
export interface ServiceInitializationResult {
|
|
23
20
|
auth: unknown;
|
|
24
|
-
analytics: typeof firebaseAnalyticsService;
|
|
25
|
-
crashlytics: typeof firebaseCrashlyticsService;
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
export class FirebaseServiceInitializer {
|
|
@@ -30,7 +25,7 @@ export class FirebaseServiceInitializer {
|
|
|
30
25
|
options?: ServiceInitializationOptions
|
|
31
26
|
): Promise<ServiceInitializationResult> {
|
|
32
27
|
if (__DEV__) {
|
|
33
|
-
console.log('[Firebase] Initializing
|
|
28
|
+
console.log('[Firebase] Initializing auth service...');
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
let auth: unknown = null;
|
|
@@ -50,20 +45,10 @@ export class FirebaseServiceInitializer {
|
|
|
50
45
|
}
|
|
51
46
|
}
|
|
52
47
|
|
|
53
|
-
const analytics = firebaseAnalyticsService;
|
|
54
|
-
const crashlytics = firebaseCrashlyticsService;
|
|
55
|
-
|
|
56
48
|
if (__DEV__) {
|
|
57
|
-
console.log(
|
|
58
|
-
'[Firebase] Services initialized - Auth:',
|
|
59
|
-
!!auth,
|
|
60
|
-
'Analytics:',
|
|
61
|
-
!!analytics,
|
|
62
|
-
'Crashlytics:',
|
|
63
|
-
!!crashlytics
|
|
64
|
-
);
|
|
49
|
+
console.log('[Firebase] Auth service initialized:', !!auth);
|
|
65
50
|
}
|
|
66
51
|
|
|
67
|
-
return { auth
|
|
52
|
+
return { auth };
|
|
68
53
|
}
|
|
69
54
|
}
|