Uh oh!
There was an error while loading. Please reload this page.
fix(share_plus): return correct share result on android - #1301
Conversation
The Linux test failed because it got a 404 while installing packages through apt - that should not affect this PR Thank you for re-running the timedout Android integration tests :) |
vbuberen
left a comment
There was a problem hiding this comment.
Tested and it seems to be working good.
Left a few Kotlin related comments, but otherwise looks good to me.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thanks for your review! Fixed all points mentioned and updated my example project and all references to it :) PS: I just submitted a PR for the failing Linux test #1305 |
miquelbeltran
commented
Oct 29, 2022
LGTM, but I'll have to run this on Monday before merging. |
vbuberen
commented
Oct 29, 2022
I have tested it on Android 10 physical device and emulator of Android 12. Worked well. |
Description
The
share_plusandroidshareWithResultandshareFilesWithResultimplementations are broken. The returnedShareResult.rawis alwaysnullon successful share. This PR fixes this by usingFLAG_MUTABLEinstead ofFLAG_IMMUTABLE, as pointed out by @aakash-pamnani. This issue was not found when initially implementing theshareWithResultmethods, as theFLAG_IMMUTABLEwas only required by the highest API versions. Back then, a simple warning was emitted that strongly suggested usingFLAG_IMMUTABLE, which seemed to break nothing.This PR now fixes the behavior and ensures that the
FLAG_MUTABLEPendingIntentgiven out may not be abused by moving from an implicit internalIntentto an explicit one. This also reduces mental complexity of the implementation.I also added some more documentation throughout the android implementation.
As always, I provide share_plus_example as a pre-setup example project for this PR.
Related Issues
Fixes#916
Checklist
CHANGELOG.mdnor thepubspec.yamlfiles.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).