-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[android_intent_plus] fix flutter/flutter#71518 by adding launchChooser method. #88
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
Conversation
| * @see #buildIntent(String, Integer, String, Uri, Bundle, String, ComponentName, String) | ||
| * @return Whether the package manager found {@link android.content.pm.ResolveInfo} using its | ||
| * {@link PackageManager#resolveActivity(Intent, int)} method. | ||
| * @see #buildIntent(String, Integer, String, Uri, Bundle, String, ComponentName, String) |
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.
I think the java formatter moved this line
|
Hey @miquelbeltran thank you so much for this, it looks very good so far. One question, there is a way in which i can try this out in my codebase to validate if this indeed solves my issue? |
|
Yes indeed! You can clone this repo, checkout the branch Note that the action, category, etc. must match the Android constants. I actually tried your email example and the OS told me "there's no app available" 🤷, but at least the chooser intent was launched. |
|
Ok, i'll try that! In my use case i'm attempting to open the inbox (not sending an email) with the following code: Now i'll try to see what happen if i try to launch the chooser using that I'll let you know 👍🏼 |
|
Just tried your example and seems to work, it opened the GMail app although there was no chooser displayed (maybe because I have no other apps) |
|
From the answers I was able to get online seems like there is no "easy" way of accomplish that. There are some complex workaround such as this one: https://stackoverflow.com/a/42532719/4420152 But i guess there are no easy way to do that only using this plugin |
Description
In flutter/flutter#71518 the author requested a way to be able to launch Intents with the createChooser wrapper.
In this PR I have added the method channel
launchChooserwhich allows users to do that.Usage:
Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.Note: I have added e2e and unit tests, but there's also some Espresso Android tests which won't even run, so I couldn't add anything there.
///).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?