From ade52bb9e7f66e26aea063e572043fe5d4720142 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 1 May 2021 21:36:27 +0200 Subject: [PATCH] chore: Update macOS and iOS builds --- CHANGELOG.md | 2 - ios/Runner.xcodeproj/project.pbxproj | 18 +-- ios/Runner/Info.plist | 4 +- lib/views/recording_dialog.dart | 108 +++++++++--------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + macos/Podfile | 2 +- macos/Podfile.lock | 68 ++++++----- macos/Runner.xcodeproj/project.pbxproj | 12 +- 8 files changed, 117 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25d4c8f3..0bead36f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,3 @@ -# Change Log for fluffychat - ## v0.30.0 - 2021-05-01 In this release we have mostly focused on bugfixing and stability. We have switched to the new Flutter 2 framework and have done a lot of refactoring under the hood. The annoying freezing bug should now be fixed. Voice messages now have a new backend which should improve the sound quality and stability. There is now a more professional UI for editing aliases of a room. Users can now see a list of all aliases, add new aliases, delete them and mark one alias as the canonical (or main) alias. Some minor design changes and design fixes should improve the overall UX of the app exspecially on tablets. diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 7469b90c..c0ca1ebd 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -467,7 +467,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -606,7 +606,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -639,7 +639,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -674,7 +674,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "FluffyChat Share/FluffyChat Share.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "FluffyChat Share/Info.plist"; @@ -684,7 +684,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.29.0; + MARKETING_VERSION = 0.30.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share"; @@ -708,7 +708,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "FluffyChat Share/FluffyChat Share.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "FluffyChat Share/Info.plist"; @@ -718,7 +718,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.29.0; + MARKETING_VERSION = 0.30.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -739,7 +739,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "FluffyChat Share/FluffyChat Share.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4NXF6Z997G; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "FluffyChat Share/Info.plist"; @@ -749,7 +749,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 0.29.0; + MARKETING_VERSION = 0.30.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index e4ea89e7..6f32f7a0 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -37,11 +37,13 @@ CFBundleVersion - $(FLUTTER_BUILD_NUMBER) + $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS NSAppleMusicUsageDescription Play audio and voice messages in the app. + NSBluetoothPeripheralUsageDescription + Play audio and voice messages on bluetooth devices NSCalendarsUsageDescription Share calendar dates with your contacts in FluffyChat. NSCameraUsageDescription diff --git a/lib/views/recording_dialog.dart b/lib/views/recording_dialog.dart index e1cddf91..8cae2275 100644 --- a/lib/views/recording_dialog.dart +++ b/lib/views/recording_dialog.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'dart:io'; +import 'package:fluffychat/utils/sentry_controller.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:path_provider/path_provider.dart'; @@ -27,21 +27,21 @@ class _RecordingDialogState extends State { try { final tempDir = await getTemporaryDirectory(); _recordedPath = - '${tempDir.path}/recording_${DateTime.now().millisecondsSinceEpoch}.${RecordingDialog.recordingFileType}'; + '${tempDir.path}/recording${DateTime.now().microsecondsSinceEpoch}'; - // delete any existing file - final outputFile = File(_recordedPath); - if (outputFile.existsSync()) { - await outputFile.delete(); + final result = await Record.hasPermission(); + if (result != true) { + setState(() => error = true); + return; } - - await Record.start(path: _recordedPath); + await Record.start(path: _recordedPath, encoder: AudioEncoder.AAC); setState(() => _duration = Duration.zero); _recorderSubscription?.cancel(); _recorderSubscription = Timer.periodic(Duration(seconds: 1), (_) => setState(() => _duration += Duration(seconds: 1))); - } catch (e) { - error = true; + } catch (e, s) { + SentryController.captureException(e, s); + setState(() => error = true); } } @@ -60,11 +60,6 @@ class _RecordingDialogState extends State { @override Widget build(BuildContext context) { - if (error) { - Timer(Duration(seconds: 1), () { - Navigator.of(context, rootNavigator: false).pop(); - }); - } const maxDecibalWidth = 64.0; final decibalWidth = ((_duration.inSeconds % 2) + 1) * (maxDecibalWidth / 4).toDouble(); @@ -72,33 +67,35 @@ class _RecordingDialogState extends State { '${_duration.inMinutes.toString().padLeft(2, '0')}:${(_duration.inSeconds % 60).toString().padLeft(2, '0')}'; return AlertDialog( - content: Row( - children: [ - Container( - width: maxDecibalWidth, - height: maxDecibalWidth, - alignment: Alignment.center, - child: AnimatedContainer( - duration: Duration(seconds: 1), - width: decibalWidth, - height: decibalWidth, - decoration: BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(decibalWidth), - ), + content: error + ? Text(L10n.of(context).oopsSomethingWentWrong) + : Row( + children: [ + Container( + width: maxDecibalWidth, + height: maxDecibalWidth, + alignment: Alignment.center, + child: AnimatedContainer( + duration: Duration(seconds: 1), + width: decibalWidth, + height: decibalWidth, + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(decibalWidth), + ), + ), + ), + SizedBox(width: 8), + Expanded( + child: Text( + '${L10n.of(context).recording}: $time', + style: TextStyle( + fontSize: 18, + ), + ), + ), + ], ), - ), - SizedBox(width: 8), - Expanded( - child: Text( - '${L10n.of(context).recording}: $time', - style: TextStyle( - fontSize: 18, - ), - ), - ), - ], - ), actions: [ TextButton( onPressed: () => Navigator.of(context, rootNavigator: false).pop(), @@ -109,21 +106,22 @@ class _RecordingDialogState extends State { ), ), ), - TextButton( - onPressed: () async { - _recorderSubscription?.cancel(); - await Record.stop(); - Navigator.of(context, rootNavigator: false) - .pop(_recordedPath); - }, - child: Row( - children: [ - Text(L10n.of(context).send.toUpperCase()), - SizedBox(width: 4), - Icon(Icons.send_outlined, size: 15), - ], + if (error != true) + TextButton( + onPressed: () async { + _recorderSubscription?.cancel(); + await Record.stop(); + Navigator.of(context, rootNavigator: false) + .pop(_recordedPath); + }, + child: Row( + children: [ + Text(L10n.of(context).send.toUpperCase()), + SizedBox(width: 4), + Icon(Icons.send_outlined, size: 15), + ], + ), ), - ), ], ); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 48c957df..8eb2b916 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,7 @@ import FlutterMacOS import Foundation +import audioplayers import file_chooser import firebase_core import flutter_local_notifications @@ -15,6 +16,7 @@ import sqflite import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AudioplayersPlugin.register(with: registry.registrar(forPlugin: "AudioplayersPlugin")) FileChooserPlugin.register(with: registry.registrar(forPlugin: "FileChooserPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) diff --git a/macos/Podfile b/macos/Podfile index dade8dfa..22d9caad 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.12' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock index c8748958..0109c503 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,37 +1,41 @@ PODS: + - audioplayers (0.0.1): + - FlutterMacOS - file_chooser (0.0.2): - FlutterMacOS - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) + - Firebase/CoreOnly (7.3.0): + - FirebaseCore (= 7.3.0) + - firebase_core (1.0.4): + - Firebase/CoreOnly (~> 7.3.0) - FlutterMacOS - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) + - FirebaseCore (7.3.0): + - FirebaseCoreDiagnostics (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - FirebaseCoreDiagnostics (7.11.0): + - GoogleDataTransport (~> 8.4) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - nanopb (~> 2.30908.0) - flutter_local_notifications (0.0.1): - FlutterMacOS - FlutterMacOS (1.0.0) - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleUtilities/Environment (6.7.2): + - GoogleDataTransport (8.4.0): + - GoogleUtilities/Environment (~> 7.2) + - nanopb (~> 2.30908.0) - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Environment (7.4.0): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (7.4.0): - GoogleUtilities/Environment - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) + - nanopb (2.30908.0): + - nanopb/decode (= 2.30908.0) + - nanopb/encode (= 2.30908.0) + - nanopb/decode (2.30908.0) + - nanopb/encode (2.30908.0) - package_info (0.0.1): - FlutterMacOS - path_provider_macos (0.0.1): @@ -46,6 +50,7 @@ PODS: - FlutterMacOS DEPENDENCIES: + - audioplayers (from `Flutter/ephemeral/.symlinks/plugins/audioplayers/macos`) - file_chooser (from `Flutter/ephemeral/.symlinks/plugins/file_chooser/macos`) - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`) @@ -68,6 +73,8 @@ SPEC REPOS: - PromisesObjC EXTERNAL SOURCES: + audioplayers: + :path: Flutter/ephemeral/.symlinks/plugins/audioplayers/macos file_chooser: :path: Flutter/ephemeral/.symlinks/plugins/file_chooser/macos firebase_core: @@ -88,17 +95,18 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: + audioplayers: 8b48e22684b6e0d9df143b2d1bbd61dca9dab6b4 file_chooser: 24432cf5dc836722b05c11c2a0a30d19c3c9b996 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: c850f543da09bf8f816c081c748b2d6950871441 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + Firebase: 26223c695fe322633274198cb19dca8cb7e54416 + firebase_core: 6b27a3ad9cd33eb61666336e5c3258937a4d8b5b + FirebaseCore: 4d3c72622ce0e2106aaa07bb4b2935ba2c370972 + FirebaseCoreDiagnostics: 68ad972f99206cef818230f3f3179d52ccfb7f8c flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4 FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc + GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7 + GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc + nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2 path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 @@ -106,6 +114,6 @@ SPEC CHECKSUMS: sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 -PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c +PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176 COCOAPODS: 1.10.1 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 74fb3ab1..0f6b1453 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -167,7 +167,6 @@ 997C663EFCBF8E403128D1D1 /* Pods-Runner.release.xcconfig */, 3CD34DC616BB2AF9B1580285 /* Pods-Runner.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -262,8 +261,12 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", + "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", + "${BUILT_PRODUCTS_DIR}/audioplayers/audioplayers.framework", "${BUILT_PRODUCTS_DIR}/file_chooser/file_chooser.framework", "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", @@ -276,8 +279,12 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audioplayers.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_chooser.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", @@ -442,6 +449,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 4NXF6Z997G; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter/ephemeral", @@ -572,6 +580,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 4NXF6Z997G; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter/ephemeral", @@ -596,6 +605,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 4NXF6Z997G; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter/ephemeral",