Sfoglia il codice sorgente

[fix]添加录音通知插件平台限制,解决报错

Destiny 1 anno fa
parent
commit
04c7ebafbf
4 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. 1 1
      ios/Podfile.lock
  2. 1 1
      lib/data/consts/constants.dart
  3. 6 3
      lib/utils/notification_util.dart
  4. 1 1
      pubspec.yaml

+ 1 - 1
ios/Podfile.lock

@@ -208,7 +208,7 @@ SPEC CHECKSUMS:
   Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
   flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
   flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
-  flutter_umeng: 9005e3f776ff69868f0d75fbb2f11b33fbafc850
+  flutter_umeng: e2a65e6196eb52a0a4fe2147ac7cb322f7848465
   gravity_engine: 750c5f2424a042f334f1154ece41d916eb148d6a
   in_app_purchase_storekit: 8c3b0b3eb1b0f04efbff401c3de6266d4258d433
   just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa

+ 1 - 1
lib/data/consts/constants.dart

@@ -6,7 +6,7 @@ import '../../utils/common_utils.dart';
 class Constants {
   Constants._();
 
-  static const String env = envTest;
+  static const String env = envProd;
 
   static const String envDev = 'dev';
 

+ 6 - 3
lib/utils/notification_util.dart

@@ -1,6 +1,7 @@
 import 'package:custom_notification/custom_notification.dart';
 import 'package:electronic_assistant/module/talk/view.dart';
 import 'package:flutter_local_notifications/flutter_local_notifications.dart';
+import 'package:get/get.dart';
 
 class NotificationUtil {
   NotificationUtil._();
@@ -16,9 +17,11 @@ class NotificationUtil {
   static void showRecordNotification(
       int notificationId, bool isRecording, double recordDuration,
       {required String channelId, required String channelName}) {
-    CustomNotification.showRecordNotification(
-        notificationId, isRecording, formatDuration(recordDuration),
-        channelId: channelId, channelName: channelName);
+    if (GetPlatform.isAndroid) {
+      CustomNotification.showRecordNotification(
+          notificationId, isRecording, formatDuration(recordDuration),
+          channelId: channelId, channelName: channelName);
+    }
   }
 
   static int _analyseNotificationId = 2000;

+ 1 - 1
pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.0.4+1
+version: 1.0.4+20
 
 
 environment: