Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,21 @@ end
post_install do |installer|
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/Baseflow/flutter-permission-handler/blob/main/permission_handler_apple/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=1',

## dart: PermissionGroup.calendarFullAccess
'PERMISSION_EVENTS_FULL_ACCESS=1',

## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1',
]
end
Comment on lines +39 to +54
Copy link
Contributor

@gnunicorn gnunicorn Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the actual fix then? I don't understand why this would fix anything. Clearly notifications worked before without this, so whatever this is doing, it isn't overwriting the Info.plist settings. And as said before, the same is true for calendar events - it is used to work fine before, why is this necessary now?

I think this requires more documentation than a link to a list of things, like maybe a github issue or readme describing that doing this is necessary?!?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a huge explanation but I still don't know where this code comes from. It is not on the permission_handler setup README as implied. If this is not the setup usually needed for permission_handler, why do we need it?

end
end
2 changes: 1 addition & 1 deletion app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,6 @@ SPEC CHECKSUMS:
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56

PODFILE CHECKSUM: d2243213672c3c48aae53c36642ba411a6be7309
PODFILE CHECKSUM: fcb1d6a8b69ef1614eadff3ce844375007098b37

COCOAPODS: 1.16.2
7 changes: 3 additions & 4 deletions app/lib/common/utils/device_permissions/calendar.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:io';
import 'package:acter/common/themes/app_theme.dart';
import 'package:acter/features/calendar_sync/calendar_sync_permission_page.dart';
import 'package:device_calendar/device_calendar.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';

/// Handles calendar permission request for both Android and iOS platforms
Future<bool> handleCalendarPermission(BuildContext context) async {
Expand Down Expand Up @@ -39,7 +39,6 @@

/// Checks if calendar permission is granted
Future<bool> _checkCalendarPermission() async {
final deviceCalendar = DeviceCalendarPlugin();
final hasPermission = await deviceCalendar.hasPermissions();
return hasPermission.data ?? false;
Comment on lines -42 to -44
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This permission checking was managed by device_calendar code which was always buggy and not giving proper status so I replaced it with permission_handler which we are using in other places of the app as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this idea that "device_calendar code which was always buggy" come from? It worked fine for at least a bunch of cases, including some iOS testing (I had done here before). Replacing this raises the question: has this been tested on other platforms than iOS? And: is this change really necessary for the fix?

final status = await Permission.calendarFullAccess.request();
return status.isGranted;

Check warning on line 43 in app/lib/common/utils/device_permissions/calendar.dart

View check run for this annotation

Codecov / codecov/patch

app/lib/common/utils/device_permissions/calendar.dart#L42-L43

Added lines #L42 - L43 were not covered by tests
}
Loading