diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6ac8ca0..664906e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -140,6 +140,8 @@ PODS: - FlutterMacOS - SwiftyGif (5.4.5) - TOCropViewController (2.6.1) + - url_launcher_ios (0.0.1): + - Flutter - video_player_avfoundation (0.0.1): - Flutter - FlutterMacOS @@ -167,6 +169,7 @@ DEPENDENCIES: - record_darwin (from `.symlinks/plugins/record_darwin/ios`) - rive_common (from `.symlinks/plugins/rive_common/ios`) - sqflite (from `.symlinks/plugins/sqflite/darwin`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) @@ -226,6 +229,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/rive_common/ios" sqflite: :path: ".symlinks/plugins/sqflite/darwin" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" video_player_avfoundation: :path: ".symlinks/plugins/video_player_avfoundation/darwin" wakelock_plus: @@ -267,6 +272,7 @@ SPEC CHECKSUMS: sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 + url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 diff --git a/lib/services/notification/firebase_api.dart b/lib/services/notification/firebase_api.dart index 21786e0..170497c 100644 --- a/lib/services/notification/firebase_api.dart +++ b/lib/services/notification/firebase_api.dart @@ -9,8 +9,6 @@ class FirebaseApi { static String? fcmToken; Future initNotification() async { - await _firebaseMessaging.requestPermission(); - try { fcmToken = await _firebaseMessaging.getToken(); if (kDebugMode) { diff --git a/lib/views/ai/ai_chat_page.dart b/lib/views/ai/ai_chat_page.dart index bdcb2d7..6dab66c 100644 --- a/lib/views/ai/ai_chat_page.dart +++ b/lib/views/ai/ai_chat_page.dart @@ -1,5 +1,7 @@ // ignore_for_file: library_private_types_in_public_api, deprecated_member_use, depend_on_referenced_packages +import 'dart:io'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:didvan/config/design_config.dart'; import 'package:didvan/config/theme_data.dart'; @@ -423,7 +425,7 @@ class _AiChatPageState extends State { children: [ if (message.role.toString().contains('user') && file != null) - file.isAudio() + (file.isAudio() && (!kIsWeb && !Platform.isIOS)) ? Padding( padding: const EdgeInsets.symmetric( horizontal: 16, vertical: 8), diff --git a/lib/views/ai/widgets/ai_message_bar.dart b/lib/views/ai/widgets/ai_message_bar.dart index 0df9f71..92c54e2 100644 --- a/lib/views/ai/widgets/ai_message_bar.dart +++ b/lib/views/ai/widgets/ai_message_bar.dart @@ -244,7 +244,7 @@ class _AiMessageBarState extends State { ); }, ), - if (!kIsWeb || !Platform.isIOS) + if (!kIsWeb && !Platform.isIOS) if (historyState.bot!.attachmentType! .contains('audio')) attachBtn( @@ -331,7 +331,7 @@ class _AiMessageBarState extends State { click: () async { path = await record .stop(); - + state.file = FilesModel( path.toString(), isRecorded: true, @@ -342,7 +342,9 @@ class _AiMessageBarState extends State { state.update(); }, ) - : (!kIsWeb || !Platform.isIOS) && + : (!kIsWeb && + !Platform + .isIOS) && widget.bot .attachmentType! .contains( @@ -382,7 +384,7 @@ class _AiMessageBarState extends State { } catch (e) { if (kDebugMode) { print( - 'Error starting recording: $e'); + 'Error starting recording: $e'); } } } @@ -441,6 +443,9 @@ class _AiMessageBarState extends State { fileName: state .file ?.basename, + fileLocal: + state + .file, finished: true, role: 'user',