Skip to content

[Bug]: No save image item shown after upgrading to v4.0.6 #897

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

Closed
maxhis opened this issue Jun 5, 2022 · 18 comments · Fixed by #906
Closed

[Bug]: No save image item shown after upgrading to v4.0.6 #897

maxhis opened this issue Jun 5, 2022 · 18 comments · Fixed by #906
Labels
bug Something isn't working ios share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin

Comments

@maxhis
Copy link

maxhis commented Jun 5, 2022

Platform

iOS

Plugin

share_plus

Version

4.0.6

Flutter SDK

3.0.1

Steps to reproduce

  1. Upgrade share_plus to version 4.0.0
  2. Share an image with Share.shareFiles([file_path], mimeTypes: ['image/png'])
  3. No Save image item shown.

Logs

Probably at least one of the constraints in the following list is one you don't want.
	Try this:
		(1) look at each constraint and try to figure out which you don't expect;
		(2) find the code that added the unwanted constraint or constraints and fix it.
(
    "<NSLayoutConstraint:0x2830b64e0 _UIActivityActionCellTitleLabel:0x131d9eb70.height >= 22   (active)>",
    "<NSLayoutConstraint:0x283089220 UIView:0x131d9d4a0.height >= _UIActivityActionCellTitleLabel:0x131d9eb70.height + 30   (active)>",
    "<NSLayoutConstraint:0x2830e5310 'UIView-Encapsulated-Layout-Height' UIView:0x131d9d4a0.height == 30   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x2830b64e0 _UIActivityActionCellTitleLabel:0x131d9eb70.height >= 22   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
[ShareSheet] connection invalidated


### Flutter Doctor

```shell
No issues.
@maxhis maxhis added bug Something isn't working triage labels Jun 5, 2022
@miquelbeltran
Copy link
Member

Duplicated from #870 ?

@maxhis
Copy link
Author

maxhis commented Jun 6, 2022

@miquelbeltran It should not be the same problem. The share menu is shown, missing just the Save Image item.

The output logs may be the same, IMO it doesn't directly relate to the issue.

@miquelbeltran
Copy link
Member

Can you check if the issue is caused by the change introduced in 4.0.6?

4.0.6
iOS: Fix file names not preserved and poor previews for files

you can do that by forcing it to be 4.0.5 (without the ^ symbol)

If you can find the exact version that breaks this, it would be very helpful!

@miquelbeltran miquelbeltran added share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin ios and removed triage labels Jun 6, 2022
@maxhis
Copy link
Author

maxhis commented Jun 7, 2022

Tried and confirmed, the Save Image item appears with 4.0.5!

@maxhis
Copy link
Author

maxhis commented Jun 7, 2022

Another issue: on iOS 12.5.5, tappingSave Image item does not save the image to the album, even getting the ShareResultStatus.success result.

@miquelbeltran
Copy link
Member

Thanks a lot for verifying that! I will have to revert the changes in 4.0.6 then.

Another issue: on iOS 12.5.5, tappingSave Image item does not save the image to the album, even getting the ShareResultStatus.success result.

If it is not a problem, place create another ticket for that issue, so it can be investigated accordingly

@maxhis maxhis changed the title [Bug]: No save image item shown after upgrading to v4.0.0 [Bug]: No save image item shown after upgrading to v4.0.6 Jun 7, 2022
@maxhis
Copy link
Author

maxhis commented Jun 7, 2022

Thanks a lot for verifying that! I will have to revert the changes in 4.0.6 then.

Another issue: on iOS 12.5.5, tappingSave Image item does not save the image to the album, even getting the ShareResultStatus.success result.

If it is not a problem, place create another ticket for that issue, so it can be investigated accordingly

Thanks for response, created a new issue: #899

@Tecmesh
Copy link

Tecmesh commented Jun 7, 2022

I have kinda the same problem, but mine is on android. i have tested with multiple v4 versions from 4.0.3 to 4.0.7 and same problem. Even the result of executing shareFilesWithResult save that it is OK. but the image is not shown where i shared it to.

I am taking a screen shot from a widget with a global key, saving the bytes as a png image, retrieve the image and share through the package, on version ^3.1.0 it worked perfectly.

final result = await Share.shareFilesWithResult(
[imgFile.path],
mimeTypes: ['image/*'],
);
This is my flutter doctor result:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1706], locale es-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.15)
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

@miquelbeltran
Copy link
Member

@Tecmesh please create a new ticket with your issue

@Coronon
Copy link
Contributor

Coronon commented Jun 12, 2022

Hi there, I was the author of version 4.0.6, could you send me a screenshot where the 'save image' option is not displayed? Everything works as expected on my iPhone 12 Pro Max.

@Coronon
Copy link
Contributor

Coronon commented Jun 12, 2022

Btw. the 'mineTypes' option for images was changed in 4.0.6, before we forced a way to handle the file, which was pretty limited and did not allow us to set tiles, previews etc. 4.0.6 basically lets the OS handle how to interpret the data shared. Everything worked as expected on my phone (which is still running iOS 14 though).

I would be very interested in the exact file you attempted to share @maxhis

@Coronon
Copy link
Contributor

Coronon commented Jun 12, 2022

Sorry to spam here, but I jsut noticed #899, which talks about iOS 12 - 4.0.6 depends on iOS 13 SDK API's. This should be fine as Apple made them a requiremend for submissions in 2020.

@maxhis
Copy link
Author

maxhis commented Jun 12, 2022

@Coronon Here is the screenshot with 4.0.5 while sharing an image:

image

And here is the same action with 4.0.6:

image

@Coronon
Copy link
Contributor

Coronon commented Jun 12, 2022

Reproducible, I think I found the fix within activityViewControllerPlaceholderItem, which was already implemented in the before abandoned SharePlusData class.

Will open a PR asap - thanks for raising this issue @maxhis :)

@Coronon
Copy link
Contributor

Coronon commented Jun 12, 2022

As always, I provide a working example here.

Please try my example (or override your dependencies like I did in my example) and report if this is fixed for you :)

PS: Please try this with a 'real' device as the simulator seems to be 'broken' in 4.0.5 and after my fix ^^

image

@maxhis
Copy link
Author

maxhis commented Jun 13, 2022

@Coronon Tried in my project with your repo and branch, works both on the actual device and simulator. Thanks for your efforts.

Just added the following lines in pubspec.yml:

dependency_overrides:
  share_plus:
    git:
      url: https://github.com/Coronon/plus_plugins
      ref: ab99d3c46dcb4ee5c357839c8db2dde66cce18e6
      path: packages/share_plus/share_plus

@Coronon
Copy link
Contributor

Coronon commented Jun 13, 2022

@maxhis Awesome! Must have bricked my simulator somehow... We are ready for merge and just waiting for a review then.

@miquelbeltran
Copy link
Member

fix released in 4.0.8. As always, thanks a lot @Coronon !!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working ios share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants