facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

ShareDialog weird behavior on some devices #777

Closed nateblog closed 4 years ago

nateblog commented 4 years ago

🐛 Bug Report

I am using a using iPhone 8, iPhone 8 Plus, and iPhone 6, the weird behavior is that, the ShareDialog close button does not return anything the same goes to when successfully sharing a content. It just return empty which is hard to identify if canceled or not.

sharedialogissue

This issue is on iOS only

Expected Behavior

It should properly return data if canceled or successfully shared.

Code Example

const shareLinkContent = {
        contentType: 'link',
        contentUrl: `https://www.facebook.com/`,
        contentDescription: 'Start sharing now!',
      };

      ShareDialog.canShow(shareLinkContent).then((canShow) => {
        if (canShow) {
          return ShareDialog.show(shareLinkContent);
        }
      }).then((result) => {
        console.log(result);
      }, (error) => {
        console.log(error);
        _onShareFailed(error);
      })

Environment

"react-native": "0.61.2" "react-native-fbsdk": "1.1.1", iOS only iPhone 6, 8, and 8 plus Simulator and real devices

nateblog commented 4 years ago

I think I sorted it out, I just use the webview mode

ShareDialog.setMode('webview');