Description
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
- run Share.share(...) with appropriate arguments
- check result in console
- 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');
}
});