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

Share.share resolves promise on open not on file share #24920

Closed
TerrellLinnell opened this issue May 16, 2019 · 3 comments
Closed

Share.share resolves promise on open not on file share #24920

TerrellLinnell opened this issue May 16, 2019 · 3 comments
Labels
API: Share Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@TerrellLinnell
Copy link

TerrellLinnell commented May 16, 2019

When using Share.share on android the promise resolves on open rather than when the file is actually shared. This means when a user opens the share on android we get the response "sharedAction" so it looks like they shared the link even though they may have opened the share and dismissed it without actually sharing the message with anyone. This only happens on android, on ios it works as expected.

React Native version:
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 2.94 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.10.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.8.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
Build Tools: 25.0.2
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
npmGlobalPackages:
react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. run Share.share(...) with appropriate arguments
  2. check result in console
  3. see on android we get a response as soon as share opens

Describe what you expected to happen:
When share is opened on android, response would only be received once content was shared or when shared menu was dismissed.

Snack, code example, or link to a repository:

      Share.share(
        {
          title: 'some title',
          message: 'some message',
        },
        { dialogTitle: 'another title' },
      ).then((result) => {
        if (result.action === Share.sharedAction) {
          if (result.activityType) {
            console.log('share shared with activity', result.activityType);
          } else {
            console.log('share shared without activity', result);
          }
        } else {
          console.log('SHARE DISMISSED');
        }
      });
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@stale
Copy link

stale bot commented Aug 15, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 15, 2019
@stale
Copy link

stale bot commented Aug 22, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 22, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Share Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants