проблема базы сообщений (push-уведомлений) в облачных сообщениях - PullRequest
0 голосов
/ 05 февраля 2019

Мои настройки:

  • Я мигрировал на Android X

версия: 1.0.0 + 1 среда: sdk: "> = 2.0.0-dev.68.0 <3.0.0 "</p>

зависимости: firebase_messaging: ^ 3.0.0

Мой код

import 'package:firebase_messaging/firebase_messaging.dart';

//...

class App extends StatefulWidget {
  @override
  _AppState createState() => _AppState();
}

class _AppState extends State<App> {
  final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();

  @override
  void initState() {
    super.initState();
//    _firebaseMessaging.configure(
//      onMessage: (Map<String, dynamic> message) {
//        print('on message $message');
//      },
//      onResume: (Map<String, dynamic> message) {
//        print('on resume $message');
//      },
//      onLaunch: (Map<String, dynamic> message) {
//        print('on launch $message');
//      },
//    );
    _firebaseMessaging
        .requestNotificationPermissions(const IosNotificationSettings(
      sound: true,
      badge: true,
      alert: true,
    ));
    _firebaseMessaging.getToken().then((token) {
      print('token ' + token);
    });
  }
//...
}

, когда я отправляю тестовое уведомление отконсоль firebase это то, что я получаю в моей консоли и ничего в моем реальном устройстве, даже onMessage не называется (я пробовал это на другом устройстве, я не получил никаких уведомлений , но onMessage называется )

D/ActivityThread( 7252): BDC-Calling onReceive: intent=Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000010 pkg=com.example.firstapp cmp=com.example.firstapp/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }, receiver=com.google.firebase.iid.FirebaseInstanceIdReceiver@c155cc5
V/ActivityThread( 7252): SVC-Creating service CreateServiceData{token=android.os.BinderProxy@cbab61a className=io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService packageName=com.example.firstapp intent=null}
D/ActivityThread( 7252): SVC-Calling onStartCommand: io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService@117a54b, flags=0, startId=1
V/ActivityThread( 7252): SVC-Destroying service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService@117a54b
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): beginTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): endTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): beginTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): endTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): beginTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): endTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): beginTransaction()
D/SQLiteConnectionPool( 7252): really get connection
D/SQLiteDatabase( 7252): endTransaction()
...