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

class FirebaseApi {
  final _firebasemessaging = FirebaseMessaging.instance;

  Future<void> initNotifications() async {
    await _firebasemessaging.requestPermission();
    final fcmToken = await _firebasemessaging.getToken();
    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}');
  }
}
