@umituz/react-native-firebase 3.0.6 → 3.0.7

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.6",
3
+ "version": "3.0.7",
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",
@@ -47,7 +47,7 @@ class FirebaseAuthClientSingleton extends ServiceClientSingleton<Auth, FirebaseA
47
47
  }
48
48
 
49
49
  /**
50
- * Get Auth instance
50
+ * Get Auth instance with enhanced auto-initialization
51
51
  */
52
52
  getAuth(): Auth | null {
53
53
  // Attempt initialization if not already initialized
@@ -55,16 +55,26 @@ class FirebaseAuthClientSingleton extends ServiceClientSingleton<Auth, FirebaseA
55
55
  try {
56
56
  const app = getFirebaseApp();
57
57
  if (app) {
58
- this.initialize();
58
+ const auth = this.initialize();
59
+ if (__DEV__ && !auth) {
60
+ console.warn('[Firebase] Auto-initialization of Auth returned null');
61
+ }
62
+ } else {
63
+ if (__DEV__) {
64
+ console.warn('[Firebase] Firebase App not available for Auth auto-initialization');
65
+ }
59
66
  }
60
67
  } catch (error) {
61
68
  // Silently handle auto-initialization errors
62
69
  // The error will be stored in state for later retrieval
63
70
  const errorMessage = error instanceof Error ? error.message : 'Auto-initialization failed';
64
71
  this.setError(errorMessage);
72
+ if (__DEV__) {
73
+ console.error('[Firebase] Auth auto-initialization failed:', errorMessage);
74
+ }
65
75
  }
66
76
  }
67
- // Enable auto-initialization flag when getting instance
77
+ // Return instance (will attempt auto-init if needed)
68
78
  return this.getInstance(true);
69
79
  }
70
80
  }