Мое приложение обрабатывает sh когда оно получает облачное уведомление от FCM, я только печатал данные сообщения firebase на консоли для дебюта, но оно создает sh приложение, когда получает уведомление без ошибок в консоли журнала
Зависимости:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+3
url_launcher: ^5.4.1
line_icons: ^0.2.0
photo_view: ^0.9.1
cached_network_image: ^2.0.0
connectivity: ^0.4.6+2
firebase_messaging: ^6.0.9
#firebase_core: ^0.4.0
flutter_full_pdf_viewer: ^1.0.6
#firebase_auth: ^0.11.1+6
#cloud_firestore: ^0.12.5
мой код в main.dart
import 'package:flutter/material.dart';
import 'home.dart';
import 'Components/connection.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
FirebaseMessaging firebaseMessaging = new FirebaseMessaging();
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
},
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
},
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Raleway',
),
home: Home(),
);
}
}
флаттер доктор:
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.10586], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[√] VS Code (version 1.42.0)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
Зависимость в build.gradle
classpath 'com.google.gms:google-services:4.3.3'
В android / app / build.gradle apply plugin: 'com.google.gms.google-services'
Я также добавил intent filter
в androidManifest.xml
попробовал flutter clean
и Удаление приложения.
Я сделал все правильно, не знаю, почему его сбой. пожалуйста помогите