-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(share_plus): Added excludedActivityTypes support for the iOS platform. #3376
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
base: main
Are you sure you want to change the base?
feat(share_plus): Added excludedActivityTypes support for the iOS platform. #3376
Conversation
Thanks for this contribution as well! We have to keep this one on hold because I plan to refactor the Your input on this topic would be appreciated as well. |
@miquelbeltran |
FYI, started working on the shareplus refactor, that should simplify adding this and other optional parameters: #3404 |
Hi, that's great! I've been studying the code in your branch. It's really well-organized and tidy. Next, I need to add the parameter excludedActivityType for this pull request (PR) to ShareParams. After that, I'll wait for you to finish merging xx into the main branch. Once that's done, I'll synchronize my changes accordingly. |
# Conflicts: # packages/share_plus/share_plus/ios/share_plus/Sources/share_plus/FPPSharePlusPlugin.m # packages/share_plus/share_plus/lib/share_plus.dart # packages/share_plus/share_plus/lib/src/share_plus_linux.dart # packages/share_plus/share_plus/lib/src/share_plus_web.dart # packages/share_plus/share_plus/lib/src/share_plus_windows.dart # packages/share_plus/share_plus_platform_interface/lib/method_channel/method_channel_share.dart # packages/share_plus/share_plus_platform_interface/lib/platform_interface/share_plus_platform.dart # packages/share_plus/share_plus_platform_interface/test/share_plus_platform_interface_test.dart
@miquelbeltran |
Thanks! I haven't looked too deep into it yet, but can you describe how it works in this PR, so I can understand the change better. And as well, add a bit of documentation about this feature on the |
Let me briefly describe the changes in this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments, I like the overall idea. I will also have to test this somehow.
files: [XFile(fd.path)], | ||
subject: 'some subject to share', | ||
text: 'some text to share', | ||
sharePositionOrigin: const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), | ||
excludedActivityType: null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma missing after null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, it’s been updated.
you can set the excludedActivityTypes array. | ||
For the list of supported excludedActivityTypes, you can refer to Apple’s [documentation](https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/excludedactivitytypes/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can set the excludedActivityTypes array. | |
For the list of supported excludedActivityTypes, you can refer to Apple’s [documentation](https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/excludedactivitytypes/). | |
you can set the `excludedActivityTypes` array. | |
For the list of supported `excludedActivityTypes`, you can refer to Apple's [documentation](https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/excludedactivitytypes/). |
Small formatting suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't devs check the CupertinoActivityType
enum instead of the Apple docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re right, it should be based on CupertinoActivityType first.
/// | ||
/// * Supported platforms: iOS, macOS | ||
/// Parameter ignored on other platforms. | ||
final List<CupertinoActivityType>? excludedActivityType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's an apple exclusive param, can we name it so it references that? e.g. excludedCupertinoActivities
since the type is CupertinoActivityType
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion is excellent — the naming alone makes the purpose clear to developers.
), | ||
uri: Uri.parse('https://pub.dev/packages/share_plus'), | ||
sharePositionOrigin: const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), | ||
excludedActivityType: [CupertinoActivityType.airDrop]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing trailing comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, it’s been updated.
The iOS platform is missing the exclusion feature. This PR adds the platform exclusion functionality for iOS.
fix: #3377
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!
in the title as explained in Conventional Commits).