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
fix: resolve promise on ios every time #969
fix: resolve promise on ios every time #969
Conversation
@@ -266,7 +266,7 @@ - (NSDictionary *)constantsToExport | |||
if (activityError) { | |||
[controller dismissViewControllerAnimated:true completion:nil]; | |||
failureCallback(activityError); | |||
} else if (completed || activityType == nil) { |
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.
The condition here is unnecessary as the completion is checked here in JS code and in situations like canceled print it causes that the JS callback isn't called at all. So the bug is fixed just by removing the condition and calling the callback every time except there is activityError.
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.
Nice!!! Thanks, @krystofcelba! 🚀 🚀 🚀
## [5.1.2](v5.1.1...v5.1.2) (2021-02-23) ### Bug Fixes * resolve callback on ios every time on completion ([#969](#969)) ([8be5897](8be5897))
🎉 This PR is included in version 5.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This introduced the following bug: #972 I'm already testing a "fix", but it would be great to get @krystofcelba input. |
Proposed update:
This has the side effect that the share UI is always closed if the selected app was "cancelled". However, it doesn't seem possible to detect if the share UI was closed automatically by the system or not |
## [5.1.2](react-native-share/react-native-share@v5.1.1...v5.1.2) (2021-02-23) ### Bug Fixes * resolve callback on ios every time on completion ([#969](react-native-share/react-native-share#969)) ([8be5897](react-native-share/react-native-share@8be5897))
Overview
The
Share.open
promise doesn't resolve in some situations on iOS. For example when you cancel printing. It's well described in #865. This PR fixes that.Fix #865 #857
Test Plan
Please check #865, there are steps for reproduce and it should work as expected with this fix.