Skip to content

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

StanleyCocos
Copy link
Contributor

@StanleyCocos StanleyCocos commented Dec 3, 2024

The iOS platform is missing the exclusion feature. This PR adds the platform exclusion functionality for iOS.

fix: #3377

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (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?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@miquelbeltran
Copy link
Member

miquelbeltran commented Dec 3, 2024

Thanks for this contribution as well! We have to keep this one on hold because I plan to refactor the share() method parameters, as also discussed in #3307 (comment)

Your input on this topic would be appreciated as well.

@StanleyCocos
Copy link
Contributor Author

@miquelbeltran
Thank you for your reply.
I understand your plan now. If needed, I can still improve this PR after your plan.

@miquelbeltran
Copy link
Member

FYI, started working on the shareplus refactor, that should simplify adding this and other optional parameters: #3404

@StanleyCocos
Copy link
Contributor Author

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.

ozyl added a commit to ozyl/plus_plugins that referenced this pull request Feb 27, 2025
# 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
@StanleyCocos
Copy link
Contributor Author

@miquelbeltran
I’ve updated my request based on #3404. If you have time, please take a look. Thank you.

@miquelbeltran miquelbeltran self-assigned this Apr 21, 2025
@miquelbeltran
Copy link
Member

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 README.md so users are aware of it.

@StanleyCocos
Copy link
Contributor Author

Let me briefly describe the changes in this PR:

  • In share_plus_platform_interface, I declared a CupertinoActivityType enum and added it as a parameter to ShareParams. Before passing it to the iOS layer, it is transmitted as a string to make it easier for users to exclude unwanted share options on iOS and macOS.

  • On the iOS native side, the string passed from the Flutter layer is received and converted back into an enum, which is then applied to the share configuration.

  • In the example, I added a multi-selection page for easier testing. Due to structural issues, I also introduced a new MyApp class that returns a MaterialApp (this caused a number of structural and formatting changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request]: (share_plus) Add platform exclusion functionality for iOS.
2 participants