Skip to content
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

Promise returned by share dialog won't resolve if cancelled on iOS #26809

Closed
v-fernandez opened this issue Oct 10, 2019 · 5 comments
Closed

Promise returned by share dialog won't resolve if cancelled on iOS #26809

v-fernandez opened this issue Oct 10, 2019 · 5 comments
Labels
API: Share Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@v-fernandez
Copy link
Contributor

On iOS, the share text dialog won't resolve the returned promise when the dialog is dismissed by pressing the Cancel button or by pressing outside the dialog. Other share options resolve the promise as expected.

shareLink = async () => {
  await Share.share({ message: 'message-to-share' }) // Hangs if the dialog is dismissed by the Cancel button or by pressing outside the dialog
}

React Native version: 0.61.2

Steps To Reproduce

  1. Open share dialog with Share.share(content, options)
  2. Dismiss the dialog by pressing Cancel or pressing outside the dialog.

Describe what you expected to happen: The promise returned by Share.share(content, options) should be resolved when the dialog is dismissed.

Snack, code example, screenshot, or link to a repository:

@v-fernandez
Copy link
Contributor Author

v-fernandez commented Oct 11, 2019

To add more info to this. I believe the bug might be here: https://github.com/facebook/react-native/blob/master/React/CoreModules/RCTActionSheetManager.mm#L183

Changing the else if to an else has resolved my issue.

Opened a PR addressing this issue.

@cdunkel
Copy link

cdunkel commented Nov 6, 2019

@v-fernandez, do you know when this fix will be available, if it's not already?

@v-fernandez
Copy link
Contributor Author

@cdunkel I'm not sure when this will be available, but in the meantime, you can use patch-package to make the fix available for you in the version you are using.

@metawort
Copy link

Why is the fix still not merged? I still encounter this issue in 0.61.5

@v-fernandez
Copy link
Contributor Author

@metawort this will be available on v0.62.0. See #26842 (comment)

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Share Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants