import 'package:firebase_messaging/firebase_messaging.dart';

class NotificationHandler {
  final FirebaseMessaging _fcm = FirebaseMessaging.instance;

  Future<void> init() async {
    // Request izin untuk menerima notifikasi (opsional)
    await _fcm.requestPermission();

    // Listen untuk menerima notifikasi ketika aplikasi berjalan
    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      print("Received message: ${message.notification?.title}");
      print("Received message body: ${message.notification?.body}");
    });
  }
}
