Issue
How to use the react-native-share library to share to Instagram Stories? Why does it always redirect to another application every time onPress is triggered, even though it is according to the documentation?
import Share from 'react-native-share';
const shareOptions = {
stickerImage: 'data:image/png;base64,<imageInBase64>', //or you can use "data:" link
backgroundBottomColor: '#fefefe',
backgroundTopColor: '#906df4',
social: Share.Social.INSTAGRAM_STORIES,
appId: 'your_fb_app_id'
};
Share.shareSingle(shareOptions);
Solution
First you need to add intent in XML file
Add intent to androidManifest.xml
file
<queries>
<!-- Specific apps you share to -->
<package android:name="com.instagram.android" />
<intent>
<action android:name="android.intent.action.SEND"/>
</intent>
</queries>
Update your shareOptions
with my shareOptions
let options = {
title: "APP",
message: "",
url: "Url is here",
subject: "",
social: Share.Social.INSTAGRAM_STORIES, // or Share.Social.INSTAGRAM,
forceDialog: true,
type: "mime type", //it is required for Instagram
}
Answered By - Shivo'ham
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.