Код: Выделить всё
E/flutter (23959): [ERROR:flutter/lib/ui/dart_runtime_hooks.cc(38)] Dart Error: Dart_LookupLibrary: library 'package:mobile_app_v2/services/firebase_helper.dart' not found.
E/flutter (23959): [ERROR:flutter/shell/common/shell.cc(117)] Dart Error: Dart_LookupLibrary: library 'package:mobile_app_v2/services/firebase_helper.dart' not found.
E/flutter (23959): [ERROR:flutter/shell/common/shell.cc(117)] Dart Error: Dart_LookupLibrary: library 'package:mobile_app_v2/services/firebase_helper.dart' not found.
firebase_helper.dart:
Код: Выделить всё
static void initializeFCMHandler() async {
FirebaseMessaging.onBackgroundMessage(handleBackgroundMessage);
FirebaseMessaging.onMessage.listen(handleMessage);
}
static Future handleBackgroundMessage(RemoteMessage? message) async {
NotificationService().pushNotification(
id: 200,
body: "Message From Background",
title: "Conversations",
category: NotificationCategory.Message,
payload: {
"screen": "chat",
},
);
handleDataMessage(message, isBackground: true);
}
static void handleMessage(RemoteMessage? message) async {
// check if message is notification
print(message?.data);
if (message?.notification != null) {
handleNotification(message);
} else {
handleDataMessage(message);
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... inated-app
Мобильная версия