-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor to support multi-package architecture #143
Merged
Alex009
merged 10 commits into
icerockdev:develop
from
MeLlamoPablo:refactor/multi-package
Feb 8, 2025
Merged
Refactor to support multi-package architecture #143
Alex009
merged 10 commits into
icerockdev:develop
from
MeLlamoPablo:refactor/multi-package
Feb 8, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wonder if we don't need to split into multiple modules. Maybe it's enough to split into multiple packages that get distributed under the same artifact. When I have time I'll prototype this and update the PR if that's the case. |
also faced the same issue. I hope this gets merged soon! 🙏 |
will it be merged? |
@viktor-savchik-idf yes i have plans to review and merge it. sorry for long waiting. |
Alex009
approved these changes
Feb 7, 2025
This was
linked to
issues
Feb 8, 2025
Nice |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR splits the multiple supported permissions across different packages, allowing users to only install the packages for the permissions they need. This comes with the upside that we won't reference unnecessary iOS libraries and we will no longer trigger AppStore Connect automated alerts. Even though those alerts can be disregarded, it feels wrong to do so, and they can be confusing (especially for newbie iOS devs like me!)
Fixes #103
Migration path
This PR introduces a breaking change, but it is pretty minimal. Developers must complete the following steps:
Permission.xxx
symbolsThis should be pretty painless, as Android Studio features context actions for both steps.
Code walkthrough
This refactor introduces evolves the existing concept of iOS pemission delegates into multiplatform permission delegates. A "permission delegate" is now an object that contains
platform-specific logic to request the permission and retrieve its state. For iOS, this is platform code calling iOS-specific APIs. For Android, this is simply a list of
Manifest.permission
values.The iOS code is pretty much untouched in this PR, as it already was structured in an isolated way. On the other hand, the Android code was moved from
PermissionsControllerImpl
into android-specific delegates.A permission now contains a reference to its platform-dependant delegate:
The
Permission
enum is transformed into an empty object, and each permission-specific package extends it to ease the migration path:Thank you @Alex009 for this brilliant suggestion!
Now, both Android's and iOS'
PermissionController
are not aware of which permissions exist anymore. Instead we pass aPermission
object which contains the delegate, and the controller interacts with the delegate to request the permission or retrieve its state.