sendNotificationToTopic method

Future<bool> sendNotificationToTopic({
  1. required String topic,
  2. required String title,
  3. required String body,
  4. required Map<String, String> data,
})

Send notification to FCM topic

Implementation

Future<bool> sendNotificationToTopic({
  required String topic,
  required String title,
  required String body,
  required Map<String, String> data,
}) async {
  try {
    // This would normally be done from backend
    // For now, just log
    if (kDebugMode) {
      print('Would send notification to topic: $topic');
      print('Title: $title, Body: $body');
      print('Data: $data');
    }
    return true;
  } catch (e) {
    if (kDebugMode) {
      print('Error sending notification: $e');
    }
    return false;
  }
}