diff --git a/Scripts/build.sh b/Scripts/build.sh index e39c2d7c..2cde3e71 100644 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -26,6 +26,9 @@ flutter pub run build_runner build --delete-conflicting-outputs if [[ ! -v SKIP_BUILD ]]; then if [[ $OS == 'macos-latest' ]]; then + cd ios + pod install + cd .. flutter build ipa $DEBUG --no-codesign --build-number="$BUILD_NUMBER" --build-name="$VERSION" else flutter build apk --split-debug-info=./symbols $DEBUG --build-number="$BUILD_NUMBER" --build-name="$VERSION" diff --git a/ios/Podfile b/ios/Podfile index 2c068c40..ed543674 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -38,4 +38,70 @@ post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end -end + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + + target.build_configurations.each do |config| + # You can remove unused permissions here + # for more information: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h + # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: PermissionGroup.calendar + 'PERMISSION_EVENTS=0', + + ## dart: PermissionGroup.calendarFullAccess + 'PERMISSION_EVENTS_FULL_ACCESS=0', + + ## dart: PermissionGroup.reminders + 'PERMISSION_REMINDERS=0', + + ## dart: PermissionGroup.contacts + 'PERMISSION_CONTACTS=0', + + ## dart: PermissionGroup.camera + 'PERMISSION_CAMERA=0', + + ## dart: PermissionGroup.microphone + 'PERMISSION_MICROPHONE=0', + + ## dart: PermissionGroup.speech + 'PERMISSION_SPEECH_RECOGNIZER=0', + + ## dart: PermissionGroup.photos + 'PERMISSION_PHOTOS=0', + + ## The 'PERMISSION_LOCATION' macro enables the `locationWhenInUse` and `locationAlways` permission. If + ## the application only requires `locationWhenInUse`, only specify the `PERMISSION_LOCATION_WHENINUSE` + ## macro. + ## + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_LOCATION=0', + 'PERMISSION_LOCATION_WHENINUSE=0', + + ## dart: PermissionGroup.notification + 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + 'PERMISSION_MEDIA_LIBRARY=0', + + ## dart: PermissionGroup.sensors + 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + 'PERMISSION_CRITICAL_ALERTS=0', + + ## dart: PermissionGroup.criticalAlerts + 'PERMISSION_ASSISTANT=0', + ] + + end + end +end \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cfb00c25..76178a19 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -39,20 +39,88 @@ PODS: - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter + - Firebase/CoreOnly (10.24.0): + - FirebaseCore (= 10.24.0) + - Firebase/Messaging (10.24.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 10.24.0) + - firebase_core (2.30.1): + - Firebase/CoreOnly (= 10.24.0) + - Flutter + - firebase_messaging (14.9.1): + - Firebase/Messaging (= 10.24.0) + - firebase_core + - Flutter + - FirebaseCore (10.24.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.12) + - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreInternal (10.25.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseInstallations (10.25.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - FirebaseMessaging (10.24.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.3) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Reachability (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) - Flutter (1.0.0) - flutter_keyboard_visibility (0.0.1): - Flutter + - flutter_local_notifications (0.0.1): + - Flutter - flutter_native_splash (0.0.1): - Flutter - fluttertoast (0.0.2): - Flutter - Toast + - GoogleDataTransport (9.4.1): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/AppDelegateSwizzler (7.13.2): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Privacy + - GoogleUtilities/Environment (7.13.2): + - GoogleUtilities/Privacy + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.13.2): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - GoogleUtilities/Network (7.13.2): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Privacy + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.13.2)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (7.13.2) + - GoogleUtilities/Reachability (7.13.2): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GoogleUtilities/UserDefaults (7.13.2): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy - in_app_review (0.2.0): - Flutter - install_referrer (1.0.0): - Flutter - integration_test (0.0.1): - Flutter + - nanopb (2.30910.0): + - nanopb/decode (= 2.30910.0) + - nanopb/encode (= 2.30910.0) + - nanopb/decode (2.30910.0) + - nanopb/encode (2.30910.0) - package_info_plus (0.4.5): - Flutter - path_provider_foundation (0.0.1): @@ -64,6 +132,7 @@ PODS: - Flutter - permission_handler_apple (9.3.0): - Flutter + - PromisesObjC (2.4.0) - Protobuf (3.26.1) - proximity_sensor (0.0.1): - Flutter @@ -77,7 +146,7 @@ PODS: - sensors_plus (0.0.1): - Flutter - Sentry/HybridSDK (8.25.0) - - sentry_flutter (7.20.1): + - sentry_flutter (8.1.0): - Flutter - FlutterMacOS - Sentry/HybridSDK (= 8.25.0) @@ -97,8 +166,11 @@ DEPENDENCIES: - cupertino_http (from `.symlinks/plugins/cupertino_http/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) + - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - in_app_review (from `.symlinks/plugins/in_app_review/ios`) @@ -121,6 +193,15 @@ SPEC REPOS: trunk: - DKImagePickerController - DKPhotoGallery + - Firebase + - FirebaseCore + - FirebaseCoreInternal + - FirebaseInstallations + - FirebaseMessaging + - GoogleDataTransport + - GoogleUtilities + - nanopb + - PromisesObjC - Protobuf - SDWebImage - Sentry @@ -137,10 +218,16 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/device_info_plus/ios" file_picker: :path: ".symlinks/plugins/file_picker/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter flutter_keyboard_visibility: :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" + flutter_local_notifications: + :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_native_splash: :path: ".symlinks/plugins/flutter_native_splash/ios" fluttertoast: @@ -179,29 +266,41 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc cupertino_http: 5f8b1161107fe6c8d94a0c618735a033d93fa7db - device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 + device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d DKImagePickerController: a7836546cfdfe014171694f643a7d575bc8ace7f DKPhotoGallery: acbd8a3bab19cf6e5fe64a853fc07bfbd247a8f6 file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 + Firebase: 91fefd38712feb9186ea8996af6cbdef41473442 + firebase_core: 7f1e1156934d0da3be260174812842df9420e4ab + firebase_messaging: 28b49260e70d10042fa2bea79f37e1edae48f1bd + FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894 + FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7 + FirebaseInstallations: 91950fe859846fff0fbd296180909dd273103b09 + FirebaseMessaging: 4d52717dd820707cc4eadec5eb981b4832ec8d5d Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 + flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778 fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db + GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a + GoogleUtilities: c56430aef51a1aa57b25da78c3f8397e522c67b7 in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d install_referrer: 1bde9acf8b1bfd372706454234444a01b5732bcf integration_test: 13825b8a9334a850581300559b8839134b124670 + nanopb: 438bc412db1928dac798aa6fd75726007be04262 package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c pdfx: 7b876b09de8b7a0bf444a4f82b439ffcff4ee1ec pedometer: 381969883680ade42559782cc41a3bbd453d8234 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 Protobuf: a53f5173a603075b3522a5c50be63a67a5f3353a proximity_sensor: 87bc974f9d94b03b4b5911ff1f93a61e561e6183 reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb sensors_plus: 18a9b346c43e157da17d2c8e99def703f9efb9d8 Sentry: cd86fc55628f5b7c572cabe66cc8f95a9d2f165a - sentry_flutter: 4cb24c1055c556d7b27262ab2e179d1e5a0b9b0c + sentry_flutter: ca7760fc008dc3bc2981730dc0c1d2f892178370 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 SwiftProtobuf: 5e8349171e7c2f88f5b9e683cb3cb79d1dc780b3 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 @@ -209,6 +308,6 @@ SPEC CHECKSUMS: url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586 wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 -PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 +PODFILE CHECKSUM: f9d9cd7f72d22327c1a52573bad03d16adcc3ac4 COCOAPODS: 1.15.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c41ebf20..b616273b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -157,7 +157,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1530; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -387,6 +387,7 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Gear on the Go"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -527,6 +528,7 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Gear on the Go"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -553,6 +555,7 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Gear on the Go"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index fcac5347..89993c94 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + + + UIStatusBarHidden UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight diff --git a/lib/Backend/firebase.dart b/lib/Backend/firebase.dart index dbe2bead..68125823 100644 --- a/lib/Backend/firebase.dart +++ b/lib/Backend/firebase.dart @@ -2,6 +2,7 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:logging/logging.dart'; +import 'package:tail_app/firebase_options.dart'; final fireLogger = Logger('Firebase'); @@ -11,49 +12,58 @@ Future firebaseMessagingBackgroundHandler(RemoteMessage message) async { } Future initFirebase() async { - fireLogger.info("Begin init Firebase"); - await Firebase.initializeApp(); - FirebaseMessaging messaging = FirebaseMessaging.instance; - messaging.app.setAutomaticDataCollectionEnabled(false); - FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler); - await messaging.subscribeToTopic("newsletter"); - final notificationSettings = await messaging.requestPermission( - provisional: true, - sound: false, - ); - NotificationSettings settings = await messaging.requestPermission( - alert: true, - announcement: false, - badge: true, - carPlay: false, - criticalAlert: false, - provisional: false, - sound: false, - ); - FirebaseMessaging.onMessage.listen((RemoteMessage message) async { - fireLogger.info('Got a message whilst in the foreground!'); - fireLogger.info('Message data: ${message.data}'); + try { + fireLogger.info("Begin init Firebase"); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + + FirebaseMessaging messaging = FirebaseMessaging.instance; + messaging.app.setAutomaticDataCollectionEnabled(false); + FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler); + await messaging.subscribeToTopic("newsletter"); + final notificationSettings = await messaging.requestPermission( + provisional: true, + sound: false, + ); + NotificationSettings settings = await messaging.requestPermission( + alert: true, + announcement: false, + badge: true, + carPlay: false, + criticalAlert: false, + provisional: false, + sound: false, + ); + FirebaseMessaging.onMessage.listen((RemoteMessage message) async { + fireLogger.info('Got a message whilst in the foreground!'); + fireLogger.info('Message data: ${message.data}'); - if (message.notification != null) { - fireLogger.info('Message also contained a notification: ${message.notification}'); - const AndroidNotificationDetails androidNotificationDetails = AndroidNotificationDetails( - 'newsletter', - 'Newsletter', - channelDescription: 'Notifications from the Tail Company Newsletter', - priority: Priority.low, - playSound: false, - enableVibration: false, - enableLights: false, - ); - const NotificationDetails notificationDetails = NotificationDetails(android: androidNotificationDetails); - await flutterLocalNotificationsPlugin?.show( - message.notification.hashCode, - message.notification?.title, - message.notification?.body, - notificationDetails, - ); - } - }); + if (message.notification != null) { + fireLogger.info( + 'Message also contained a notification: ${message.notification}'); + const AndroidNotificationDetails androidNotificationDetails = + AndroidNotificationDetails( + 'newsletter', + 'Newsletter', + channelDescription: 'Notifications from the Tail Company Newsletter', + priority: Priority.low, + playSound: false, + enableVibration: false, + enableLights: false, + ); + const NotificationDetails notificationDetails = + NotificationDetails(android: androidNotificationDetails); + await flutterLocalNotificationsPlugin?.show( + message.notification.hashCode, + message.notification?.title, + message.notification?.body, + notificationDetails, + ); + } + }); + } + catch(e,s) { + fireLogger.shout('error setting up firebase',e,s); + } } Future getFirebaseToken() async { @@ -65,8 +75,11 @@ FlutterLocalNotificationsPlugin? flutterLocalNotificationsPlugin; Future initNotificationPlugin() async { flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project - const AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings("@mipmap/ic_launcher"); - const DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings(defaultPresentSound: false, requestSoundPermission: false); + const AndroidInitializationSettings initializationSettingsAndroid = + AndroidInitializationSettings("@mipmap/ic_launcher"); + const DarwinInitializationSettings initializationSettingsDarwin = + DarwinInitializationSettings( + defaultPresentSound: false, requestSoundPermission: false); const InitializationSettings initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsDarwin, @@ -74,12 +87,14 @@ Future initNotificationPlugin() async { await flutterLocalNotificationsPlugin?.initialize( initializationSettings, onDidReceiveNotificationResponse: onDidReceiveNotificationResponse, - onDidReceiveBackgroundNotificationResponse: onDidReceiveBackgroundNotificationResponse, + onDidReceiveBackgroundNotificationResponse: + onDidReceiveBackgroundNotificationResponse, ); } //Foreground -void onDidReceiveNotificationResponse(NotificationResponse notificationResponse) async { +void onDidReceiveNotificationResponse( + NotificationResponse notificationResponse) async { final String? payload = notificationResponse.payload; if (notificationResponse.payload != null) { fireLogger.info('notification payload: $payload'); @@ -88,7 +103,8 @@ void onDidReceiveNotificationResponse(NotificationResponse notificationResponse) //background @pragma('vm:entry-point') -void onDidReceiveBackgroundNotificationResponse(NotificationResponse notificationResponse) { +void onDidReceiveBackgroundNotificationResponse( + NotificationResponse notificationResponse) { final String? payload = notificationResponse.payload; if (notificationResponse.payload != null) { fireLogger.info('notification payload: $payload'); diff --git a/lib/Frontend/pages/intro.dart b/lib/Frontend/pages/intro.dart index 08725bd1..86fdfa91 100644 --- a/lib/Frontend/pages/intro.dart +++ b/lib/Frontend/pages/intro.dart @@ -42,17 +42,25 @@ class OnBoardingPageState extends ConsumerState { Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle( Theme.of(context).brightness == Brightness.dark - ? SystemUiOverlayStyle.light.copyWith(statusBarColor: Theme.of(context).canvasColor, systemNavigationBarColor: Theme.of(context).canvasColor) - : SystemUiOverlayStyle.dark.copyWith(statusBarColor: Theme.of(context).canvasColor, systemNavigationBarColor: Theme.of(context).canvasColor), + ? SystemUiOverlayStyle.light.copyWith( + statusBarColor: Theme.of(context).canvasColor, + systemNavigationBarColor: Theme.of(context).canvasColor) + : SystemUiOverlayStyle.dark.copyWith( + statusBarColor: Theme.of(context).canvasColor, + systemNavigationBarColor: Theme.of(context).canvasColor), ); const bodyStyle = TextStyle(fontSize: 19.0); - bool bluetoothPoweredOff = ref.watch(btStatusProvider).valueOrNull == BleStatus.poweredOff; + bool bluetoothPoweredOff = + ref.watch(btStatusProvider).valueOrNull == BleStatus.poweredOff; var pageDecoration = PageDecoration( - titleTextStyle: const TextStyle(fontSize: 28.0, fontWeight: FontWeight.w700), + titleTextStyle: + const TextStyle(fontSize: 28.0, fontWeight: FontWeight.w700), bodyTextStyle: bodyStyle, bodyPadding: const EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 16.0), pageColor: Theme.of(context).canvasColor, imagePadding: EdgeInsets.zero, + footerFlex: 0, + footerPadding: EdgeInsets.zero, ); return SafeArea( @@ -106,7 +114,8 @@ class OnBoardingPageState extends ConsumerState { children: [ FilledButton( onPressed: () async { - await launchUrl(Uri.parse('https://github.com/Codel1417/tail_app/blob/master/PRIVACY.md')); + await launchUrl(Uri.parse( + 'https://github.com/Codel1417/tail_app/blob/master/PRIVACY.md')); }, child: Text( onboardingPrivacyPolicyViewButtonLabel(), @@ -118,7 +127,8 @@ class OnBoardingPageState extends ConsumerState { : () { setState(() { privacyAccepted = true; - SentryHive.box(settings).put(allowErrorReporting, true); + SentryHive.box(settings) + .put(allowErrorReporting, true); SentryHive.box(settings).put(allowAnalytics, true); introKey.currentState?.next(); }); @@ -154,7 +164,8 @@ class OnBoardingPageState extends ConsumerState { onPressed: !bluetoothPoweredOff ? null : () { - AppSettings.openAppSettings(type: AppSettingsType.bluetooth); + AppSettings.openAppSettings( + type: AppSettingsType.bluetooth); }, child: Text( onboardingBluetoothEnableButtonLabel(), @@ -218,7 +229,8 @@ class OnBoardingPageState extends ConsumerState { onPressed: () { _onIntroEnd(context); }, - child: Text(onboardingDoneButtonLabel(), style: const TextStyle(fontWeight: FontWeight.w600)), + child: Text(onboardingDoneButtonLabel(), + style: const TextStyle(fontWeight: FontWeight.w600)), ), )); } diff --git a/lib/Frontend/utils.dart b/lib/Frontend/utils.dart index 4dda4b0d..683d6a22 100644 --- a/lib/Frontend/utils.dart +++ b/lib/Frontend/utils.dart @@ -10,10 +10,12 @@ Future getBluetoothPermission() async { if (Platform.isAndroid && (await DeviceInfoPlugin().androidInfo).version.sdkInt > 30) { granted = PermissionStatus.granted == await Permission.bluetoothScan.request(); granted = granted && PermissionStatus.granted == await Permission.bluetoothConnect.request(); - } else { + } else if (Platform.isAndroid){ granted = PermissionStatus.granted == await Permission.location.request(); granted = granted && PermissionStatus.granted == await Permission.locationWhenInUse.request(); granted = granted && PermissionStatus.granted == await Permission.bluetooth.request(); + } else { + granted = PermissionStatus.granted == await Permission.bluetooth.request(); } return granted; }