Proje: Okul B2B App · Hub: Okul B2B App — Conventions

Firebase Native Modül Kuralı

KRITIK UYARI

@react-native-firebase/* modülleri Expo Go’da çalışmaz ve crash’e neden olur!

Bu modüller production build gerektirir:

  • @react-native-firebase/app
  • @react-native-firebase/analytics
  • @react-native-firebase/crashlytics
  • @react-native-firebase/remote-config

Doğru Kullanım Patternleri

1. Lazy Import

// Doğru: Dynamic import ile
const RemoteConfigService = await import('@/services/RemoteConfigService');

2. Expo Go Kontrolü

import Constants, { ExecutionEnvironment } from 'expo-constants';
 
const isExpoGo = Constants.executionEnvironment === ExecutionEnvironment.StoreClient;
 
if (!isExpoGo) {
  // Firebase native modüllerini kullan
  const firebase = await import('@react-native-firebase/analytics');
}

3. Config.IS_EXPO_GO

if (Config.IS_EXPO_GO) {
  logger.logWarning('Firebase: Skipped in Expo Go');
  return;
}

Servis Bazlı Uygulama

ServisKorunma Yöntemi
RemoteConfigService`if (isExpoGo
CrashlyticsServiceLazy import + Config.IS_EXPO_GO
AnalyticsServiceConfig.IS_EXPO_GO kontrolü
CustomerIOServicetry/catch + Config.IS_EXPO_GO
OneSignalServiceConfig.IS_EXPO_GO kontrolü

Firebase Konfigürasyonu

  • Firebase Project: b2b-kurumsal
  • Project ID: 323903876653
  • Android App ID: 1:323903876653:android:a3fe996c86c97ffeebd2a4
  • Android: android/app/google-services.json
  • iOS: ios/Okulcomtr/GoogleService-Info.plist