import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';

class FirebaseService {
  Future<void> initializeApp() async {
    if (kIsWeb) {
      await Firebase.initializeApp(
        options: const FirebaseOptions(
          apiKey: 'AIzaSyCTjdsk2jE34IfnvSKP1JMTIf_Abd7tbt0',
          authDomain: 'opplens-270d1.firebaseapp.com',
          projectId: 'opplens-270d1',
          storageBucket: 'opplens-270d1.firebasestorage.app',
          messagingSenderId: '6923326255',
          appId: '1:6923326255:web:c71763ece06aaaf3ed87da',
          measurementId: 'G-M5HQR4YZVS',
        ),
      );
      final FirebaseMessaging firebaseMessaging = FirebaseMessaging.instance;
      await firebaseMessaging.requestPermission();
    } else {
      await Firebase.initializeApp();
      final FirebaseMessaging firebaseMessaging = FirebaseMessaging.instance;
      await firebaseMessaging.requestPermission();
    }
  }
}
