Flutter Flitter iOS和Android中的FCM定制声音

Flutter Flitter iOS和Android中的FCM定制声音,flutter,push-notification,firebase-cloud-messaging,apple-push-notifications,Flutter,Push Notification,Firebase Cloud Messaging,Apple Push Notifications,目前我正在使用 firebase_消息:^6.0.1 用于FCM通知。已经收到通知,但没有任何声音(android和iOS)。虽然我想要定制声音,并且我知道android中的通知频道(如何在android中使用Flitter播放通知频道?),但目前即使在从服务器拍摄通知时也没有默认声音 任何帮助都将不胜感激。您已经有了fireBaseMessaging的实例,如果没有创建: FirebaseMessaging _fireBaseMessaging = FirebaseMessaging();

目前我正在使用

firebase_消息:^6.0.1

用于FCM通知。已经收到通知,但没有任何声音(android和iOS)。虽然我想要定制声音,并且我知道android中的通知频道(如何在android中使用Flitter播放通知频道?),但目前即使在从服务器拍摄通知时也没有默认声音


任何帮助都将不胜感激。

您已经有了
fireBaseMessaging
的实例,如果没有创建:

FirebaseMessaging _fireBaseMessaging = FirebaseMessaging();
并在iOS中使用以下命令:

if (Platform.isIOS) {
      _fireBaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true));
      _fireBaseMessaging.onIosSettingsRegistered.listen((IosNotificationSettings settings) {
        print("Settings registered: $settings");
      });
}

并确保您已在info.plist中添加了
FirebaseMessagingAutoInitEnabled=NO
,如果没有创建实例,您已经有了
fireBaseMessaging

FirebaseMessaging _fireBaseMessaging = FirebaseMessaging();
并在iOS中使用以下命令:

if (Platform.isIOS) {
      _fireBaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true));
      _fireBaseMessaging.onIosSettingsRegistered.listen((IosNotificationSettings settings) {
        print("Settings registered: $settings");
      });
}

并确保您已在info.plist

中为iOS声音工作添加了
FirebaseMessagingAutoInitEnabled=NO
?我正在使用
firebase\u消息:^5.1.2
no用于iOS即使从控制台发送也没有声音,但在安卓系统中从控制台发送默认声音工作,但不从服务器检查我的设备是否工作。对于iOS声音工作?我使用的是
firebase\u消息:^5.1.2
no用于iOS即使从控制台发送也没有声音,但在android中从控制台发送默认声音有效,但不从服务器检查我的设备是否正常。设备未处于静默或振动模式,对吗?如果是通知托盘,则设置
声音:true
。此外,当在
onMessage
@RavinderKumar上接收推送时,您也可以使用并播放声音,但如果应用程序处于后台或关闭状态,则不会播放。设备未处于静音或振动模式,对吗?如果是通知托盘,则设置
声音:true
。此外,当您在
onMessage
@RavinderKumar上收到推送时,您也可以使用并播放声音,但若应用程序处于后台或关闭状态,则不会播放