Comments (4)
@LukasMod indeed, but I tried to state in my post that by doing so, you are not honouring the implemented behaviour:
NativeRNShare.getConstants().INSTAGRAMSTORIES || Social.InstagramStories
Not sure what NativeRNShare.getConstants().INSTAGRAMSTORIES
is used for, but I guess the idea would be, that a platform version might define different values, so it's better to use them... I guess...
In any case, they did it for a reason, so the work around, as you proposed, might have undesirable effects in certain platforms or versions thereof (current or in the future).
My 2c, anyways.
Thanks for your comments!
from react-native-share.
this is in 10.0.2. The typescript types does not seem to be properly used.
As a work around, cast it to what is needed:
import { Social } from 'react-native-share';
Share.shareSingle({
social: Share.Social.INSTAGRAM_STORIES as Social.InstagramStories ,
stickerImage: url,
backgroundTopColor: '#000',
backgroundBottomColor: '#000',
appId: Constants.expoConfig?.extra?.fbAppId,
});
Problem Description
social
expects something of type Social
which is an enum.
Though what is exposed is:
INSTAGRAM_STORIES: NativeRNShare.getConstants().INSTAGRAMSTORIES || Social.InstagramStories,
which is indeed string || Social
possible solution
Perhaps casting it at the right place might do the trick (untested).
(NativeRNShare.getConstants().INSTAGRAMSTORIES || Social.InstagramStories) as Social.InstagramStories
``
from react-native-share.
@estani
You can use that enum Social.InstagramStories as value:
import Share, { Social } from 'react-native-share';
and use it like that:
social: Social.InstagramStories,
"react-native-share": "^10.0.2",
from react-native-share.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open
from react-native-share.
Related Issues (20)
- 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
- root path security issue HOT 2
- Black screen on iOS when Share.open and then choosing Instagram story on iOS HOT 15
- when sharing a video to whatsapp a message is required on iOS, but not in types HOT 2
- Share menu suggestion applications are missing HOT 1
- Sending a URL along with a message does not work on IOS, only on Android. HOT 7
- [windows] LINK : fatal error LNK1104: cannot open file 'hermes.lib' HOT 1
- [Android] Sharing via LinkedIn opens play store link instead of application HOT 1
- playing music get stopped when call Share.open() HOT 1
- [Android] shareSingle opens Play Store instead of the installed app (WhatsApp) HOT 2
- File Extension Duplicated on Android During Sharing HOT 1
- Support for sharing attachment or text only on email and Slack HOT 3
- App Hang with Termination Error HOT 2
- iOS share instagram story crashes for any iOS version below 17 when using base64 backgroundImage HOT 2
- Messenger Share on iOS not working for me HOT 2
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.