Comments (4)
@andyfenelon, @IsTheJack, Actually, this is solved by just adding in a catch
. If a user doesn't share, it throws an error of Object {error: "User did not share"}
โย which will be unhandled without a catch.
So to prevent the warning you can do:
Share.open({
// share config here
})
.catch(err => console.log(err));
from react-native-share.
I don't really like this workaround. IMO the module shouldn't reject the promise in this case because it's not an "error scenario". Can anybody reopen the issue ?
At least, the rejected value must allow distinction between this case and real errors (creating a UserCancelError
should do the job).
According to the JS coding conventions, a promise should reject a instance of Error (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject#Description), not an object containing a key named error
I'd remove the use of Exception
that is not standard in JavaScript: https://github.com/EstebanFuentealba/react-native-share/blob/master/index.js#L71 (or maybe it's a Windows thing ?)
Are you guys open to a PR ?
from react-native-share.
from react-native-share.
I'm getting this also.
from react-native-share.
Related Issues (20)
- Sharing through telegram opens it inside the app HOT 2
- Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. HOT 10
- One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts HOT 11
- Sharing video to Instagram story works on iOS but not android HOT 2
- [Android] [Facebook] can't share.open usual text message HOT 1
- i want to share my base64 mp3 i decded my base64 and store it in local storage but it appears as an empty message -Android HOT 1
- after update I cannot compile my project HOT 2
- string not assignable to type Social HOT 4
- iOS shareSingle js code migrated to promise, but native still returns a tuple used for callbacks HOT 1
- Exclude own (Ios) app from sharesheet? HOT 2
- canOpenURL reports wrong value for ig stories url HOT 3
- Exclude own (Ios) app from sharesheet? HOT 1
- Share.shareSingle not working HOT 4
- URL icons don't work at all HOT 2
- Share didn't seem work if device has the Instagram Lite app, does this package support? HOT 1
- Image not sharing to WhatsApp HOT 4
- Permission issue at AndroidTV 10 HOT 1
- Cant send video to whatsapp HOT 2
- The File Format not supported Error HOT 2
- shareSingle does not work with multiple emails on iOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-share.