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

class FirebaseApi {
  final _firebasemessaging = FirebaseMessaging.instance;

  Future<void> initNotifications() async {
    await _firebasemessaging.requestPermission();
    final fcmToken = await _firebasemessaging.getToken();
    if (kDebugMode) {
      print(fcmToken);
    }
  }

  Future<void> handleBackgroundMessage(RemoteMessage message) async {
    await Firebase.initializeApp();
    //print('Title :${message.notification?.title}');
    //print('Title :${message.notification?.body}');
    //print('Title :${message.data}');
  }
}
