moslem parve
moslem parve

Reputation: 5

I am trying to share a post on Facebook and WhatsApp only

is there any way to limit platforms for sharing on social media in expo, for example, I want to share only one Facebook and WhatsApp and don't show other platforms on the dialogue box

Upvotes: 0

Views: 476

Answers (1)

Nitin Sidhu
Nitin Sidhu

Reputation: 161

you can use the official dependencies react-native-share here's the link :- https://github.com/react-native-community/react-native-share

These can be assessed using Share.Social property For eg.

import Share from 'react-native-share';

const shareOptions = {
    title: 'Share via',
    message: 'some message',
    url: 'some share url',
    social: Share.Social.WHATSAPP,
    whatsAppNumber: "9199999999",  // country code + phone number(currently only works             on Android)
    filename: 'test' , // only for base64 file in Android 
};
Share.shareSingle(shareOptions);

if you have any problem then feel free to ask me.

Thank You.

Upvotes: 1

Related Questions