Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement proposal]: Add phone and storage macros so users can choose to include or not #1120

Open
3 of 5 tasks
victorsanni opened this issue Aug 7, 2023 · 0 comments
Open
3 of 5 tasks
Labels
good first issue Good for newcomers who would like to start contributing to the project. P2 Important issues not at the top of the work list. platform: ios Issue is related to the iOS platform type: enhancement New feature or request up for graps Issues marked with this label are relatively easy problems that are ideal for starting contributors.

Comments

@victorsanni
Copy link
Contributor

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Proposal

Currently on iOS, no enum values exist for phone and storage permission strategies in PermissionHandlerEnums.h. However, enum values exist for all other permission strategies (camera, microphone, etc).

Other permission strategies are executed only if their enum values are defined. For example, for bluetooth, the enum value PERMISSION_BLUETOOTH is defined in PermissionHandlerEnums.h. Then, in BluetoothPermissionStrategy.h, bluetooth permission is only implemented if its enum value is defined:

#if PERMISSION_BLUETOOTH
...
#else

#import "UnknownPermissionStrategy.h"
...
#endif

Currently, this if...else block doesn't exist in PhonePermissionStrategy.h or StoragePermissionStrategy.h:

NS_ASSUME_NONNULL_BEGIN

@interface StoragePermissionStrategy : NSObject <PermissionStrategy>

@end

NS_ASSUME_NONNULL_END

This means phone and storage permission strategies are always added, including dependencies like CoreTelephony needed for phone permissions strategy.

Instead, we can add macros PERMISSION_STORAGE and PERMISSION_PHONE to PermissionHandlerEnums.h, and add an if...else block in phone and storage permission strategy header files, as follows:

#if PERMISSION_STORAGE
...
#else

#import "UnknownPermissionStrategy.h"
...
#endif

Pitch

This will allow users to specify if they want phone and storage permissions in their Podfiles.

For phone permission strategy, this would mean users who don't need phone permissions can leave out the CoreTelephony framework from their applications.

@JeroenWeener JeroenWeener added good first issue Good for newcomers who would like to start contributing to the project. platform: ios Issue is related to the iOS platform type: enhancement New feature or request up for graps Issues marked with this label are relatively easy problems that are ideal for starting contributors. P2 Important issues not at the top of the work list. labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers who would like to start contributing to the project. P2 Important issues not at the top of the work list. platform: ios Issue is related to the iOS platform type: enhancement New feature or request up for graps Issues marked with this label are relatively easy problems that are ideal for starting contributors.
Projects
None yet
Development

No branches or pull requests

2 participants