feat(android_intent_plus): ignoring apps in intent
Description
This update allows to specify apps (by their package names) that should not be used to resolve an intent and should not be displayed in the chooser. Next, I will describe the situation in which I needed these changes. Perhaps it will be useful to someone else, which is why I am creating this PR. It became necessary for me when opening the links of the Steam store. The problem is that the Steam application appears in the chooser, but if you select it, then the first time a gray screen appears for a moment (probably an attempt to open a link), and next times nothing happens at all (tap on Steam, the chooser disappears and that's it). Therefore, I found it necessary to remove Steam from the list of applications in the chooser, so as not to upset users. And if the user wants to open the link in the Steam app, and not in the browser, then I do it with explicit intent.
Related Issues
No related issues.
Checklist
- [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
- [x] All existing and new tests are passing.
- [x] I updated/added relevant documentation (doc comments with
///). - [x] The analyzer (
flutter analyze) does not report any problems on my PR. - [x] I read and followed the [Flutter Style Guide].
- [x] I am willing to follow-up on review comments in a timely manner.
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 a breaking change in CHANGELOG.md and increment major revision).
- [x] No, this is not a breaking change.
@piotrsed this will help us with facebook and whatsapp which don't work
Finally got to this PR. Thanks for contribution, but after some testing I see that it doesn't work for launchChooser and breaks launch. I will rework this PR.
Here is how I tested:
-
Re-used one of functions in example app to show all apps that can handle ACTION_SEND and saw multiple apps in my chooser:

-
Added new
ignoredPackageswith package name for Gmail and no chooser appears as well as not log entries about something going wrong:
It seems that the suggested implementation causes issues and can't be merged.
-
launch()is broken in case user specifiesignoredPackagesparameter because new added code picks first element of the list which can handle the intent, ignoring the fact that it can be something not suitable (in my case I saw some system bluetooth package receiving that SEND intent a screenshot above). -
launchChooser()is broken as well due to the same logic and causes the phone to showNo apps can handle this intenteven for those, which can be handled for sure.
I researched for options on ignoring specific packages and there is no universal solution, especially for intents called via launch() in this plugin. So closing this PR and will try to play around the topic later. In case there is a success I will create a separate PR.