thebergamo / react-native-fbsdk-next

MIT License
633 stars 165 forks source link

Need help for the facebook sharing #516

Open Flano-123 opened 2 weeks ago

Flano-123 commented 2 weeks ago

I just want to share photo and some text to facebook using react-native-fbsdk-next. But after sharing action, I cannot see anything on my facebook app. I dont know if I 've shared successfully or something went wrong?

Code Example

                                       `const shareLinkContent = {
                                            contentType: 'link',
                                            contentUrl: productLink,
                                            imageUrl: shareImage,
                                            quote: `Product Price ${"\u20A6"}${price}`
                                        };
                                        console.log(`shareLinkContent `,shareLinkContent)

                                        ShareDialog.canShow(shareLinkContent).then(
                                            function(canShow) {
                                                if (canShow) {
                                                    return ShareDialog.show(shareLinkContent);
                                                }
                                            }
                                        ).then(
                                            function(result) {
                                                if (result.isCancelled) {
                                                    console.log('Share cancelled');
                                                } else {
                                                    console.log(`facebook share result `,result)
                                                }
                                            },
                                            function(error) {
                                                console.log('Share fail with error: ' + error);
                                            }
                                        );`

The share result log is an empty object and after sharing I can't see anything new on my facebook. Do I need to publish the app on facebook developer first? Or did I make a mistake anywhere ? I have read the previous issues but it seems that no one has encountered my problem. Could someone plz help me ? Thank you very much.

Environment

platform:ios version: 17.4.1 react native version: 0.71.14 react native fbsdk next version: 12.1.4 expo version: 48.0.15