【发布时间】:2020-12-22 10:02:03
【问题描述】:
我想问如果文本已经溢出,是否可以在flutter FCM通知中扩展通知?
这是我用于通知的示例代码:
void initFirebase() {
_firebaseMessaging = FirebaseMessaging();
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(
sound: true, badge: true, alert: true, provisional: false));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
debugPrint('Settings registered: $settings');
});
}
void configFirebase() {
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print(message);
final FirebaseModel dataModel = FirebaseModel.fromJson(message);
await notifHandler.showNotif(dataModel);
notifHandler.onNotifRefresh(dataModel.data?.action);
if (dataModel?.data?.action == AppString.CONFIRM_REDEEM_POINT) {
notifHandler.onSelectNotification(dataModel?.data?.action ?? '');
}
},
// onBackgroundMessage: _onBackgroundMessage,
onResume: _showFirebaseNotif,
onLaunch: _showFirebaseNotif,
);
}
【问题讨论】:
标签: flutter push-notification notifications firebase-cloud-messaging