0

我的应用程序正在使用 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();
    }
  );
}
4

0 回答 0