@umituz/react-native-firebase 3.0.7 → 3.0.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": "3.0.
|
|
3
|
+
"version": "3.0.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",
|
|
@@ -51,23 +51,37 @@ export function createFirebaseInitModule(
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
if (!result.app) {
|
|
54
|
+
const errorMsg = 'Firebase configuration not found. Please set EXPO_PUBLIC_FIREBASE_* environment variables.';
|
|
54
55
|
if (__DEV__) {
|
|
55
|
-
console.
|
|
56
|
+
console.error(`[Firebase] ${errorMsg}`);
|
|
57
|
+
}
|
|
58
|
+
// In production, this is a critical error
|
|
59
|
+
if (critical) {
|
|
60
|
+
throw new Error(errorMsg);
|
|
56
61
|
}
|
|
57
62
|
return false;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
if (result.auth === false && result.authError) {
|
|
66
|
+
const errorMsg = `Auth initialization failed: ${result.authError}`;
|
|
61
67
|
if (__DEV__) {
|
|
62
|
-
console.
|
|
68
|
+
console.error(`[Firebase] ${errorMsg}`);
|
|
69
|
+
}
|
|
70
|
+
// Auth failure is critical for apps that require authentication
|
|
71
|
+
if (critical && authInitializer) {
|
|
72
|
+
throw new Error(errorMsg);
|
|
63
73
|
}
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
return true;
|
|
67
77
|
} catch (error) {
|
|
68
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
78
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown Firebase initialization error';
|
|
69
79
|
if (__DEV__) {
|
|
70
|
-
console.
|
|
80
|
+
console.error(`[Firebase] Initialization failed: ${errorMessage}`);
|
|
81
|
+
}
|
|
82
|
+
// Re-throw in production if this is a critical module
|
|
83
|
+
if (critical) {
|
|
84
|
+
throw error;
|
|
71
85
|
}
|
|
72
86
|
return false;
|
|
73
87
|
}
|