我正在使用fcm_push库向特定用户发送通知,但我有一个我不明白的问题
https://pub.dartlang.org/packages/fcm_push
sendNotif(message, title, userId, userFcmToken) async{
final FCM fcm = new FCM(fcm_server_key);
final Message fcmMessage = new Message()
..to = userFcmToken
..title = title
..body = message
;
final String messageID = await fcm.send(fcmMessage);
}
问题出在这里
[错误:flutter / shell / common / shell.cc(181)] Dart错误:未处理的异常: E / flutter(19171):“ FCMException”的实例 E / flutter(19171):#0 FCM.send(file:///home/noob/development/flutter/.pub-cache/hosted/pub.dartlang.org/fcm_push-1.3.1/lib/fcm_push/fcm .dart:81:17) E /颤振(19171): E / flutter(19171):#1 Network.sendNotif(package:vadom / Core / Network.dart:267:41) E /颤振(19171): E / flutter(19171):#2 HomeState.getUser ...(file:///home/noob/AndroidStudioProjects/vadom/lib/ui/Home.dart:74:27) E /颤振(19171): E / flutter(19171):#3 _RootZone.runUnary(dart:async / zone.dart:1379:54) E / flutter(19171):#4 _FutureListener.handleValue(dart:async / future_impl.dart:129:18) E / flutter(19171):#5 Future._propagateToListeners.handleValueCallback(dart:async / future_impl.dart:642:45) E / flutter(19171):#6 Future._propagateToListeners(dart:async / future_impl.dart:671:32) E / flutter(19171):#7 Future._complete(dart:async / future_impl.dart:476:7) E / flutter(19171):#8 _SyncCompleter.complete(dart:async / future_impl.dart:51:12) E / flutter(19171):#9 _AsyncAwaitCompleter.complete(dart:async / runtime / libasync_patch.dart:28:18)