如何从ShareDialog获取我的用户内容?

时间:2017-03-20 10:57:32

标签: javascript facebook react-native react-native-fbsdk

我的应用正在使用Facebook的ShareDialog。 用户授权应用程序发布到墙后,shareDialog显示。

事情是,我需要发送到Facebook的用户内容,有没有办法通过API调用?

LoginManager.logInWithReadPermissions(['public_profile']).then(
  function(result) {
    if (result.isCancelled) {
    } else {
        LoginManager.setDefaultAudience('friends');
        LoginManager.logInWithPublishPermissions(['publish_actions']).then(
          function(result) {
            console.log("facebook reply is:");
            console.log(result);
            if (result.isCancelled) {
            } else {
              var tmp = this;
              ShareDialog.canShow(shareLinkContent).then(
                function(canShow) {
                  if (canShow) {
                    return ShareDialog.show(shareLinkContent);
                  }
                }
              ).then(
                function(result) {
                  if (result.isCancelled) {
                    console.log("sharing canceled");
                    console.log(result);

                  } else {
                    // SUCCESS!
                    // HERE: RESULT RETURNS post ID. How can I get the user's content?
                    console.log(result);
                     var query = globals.app.buildActionQuery(method,"5",global.bizData,"YES","sdfsdfsdfsdfsfdfsdf");
                     globals.app._executeQuery(query,global.actionPage);

                  }
                },
                function(error) {
                  console.log("can't display share window");
                  console.log(error);
                }
              );

            }
          },
          function(error) {
            console.log("Sharing failed");
            console.log(error);
          }
        )
      }
    },
    function(error) {
      //alert('Login failed with error: ' + error);
      LoginManager.logOut();
    }
  );
}

0 个答案:

没有答案