I am using Share API in React native as follows.
handleSharePress() {
Share.share({
message: `I scored ${this.score}% in React Quiz: https://play.google.com/store/apps/details?id=com.vijayt.reactquiz`
}, {
dialogTitle: 'Share my score'
});
}
The Share works fine in Android with Twitter. But with Facebook, I am not seeing the message text in the share.
Share has text in Twitter:
Share does not have text in Facebook (only URL):
This is because Facebook doesn't let you do so. According to their Platform Policy 2.3, you can't pre-fill text to your sharing dialogs, all content must be entered by the user:
Pre-fill the user message parameter with any content the user didn't enter themselves, even if they can edit or delete that content before sharing. This applies to posts, comments, photo captions, and photo album captions.
Source: https://developers.facebook.com/docs/apps/review/prefill
I guess to add this functionality you need to include Facebook SDK and perform login before sharing. You can use this library or implement the SDK yourself through official documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With