だから私はFacebookの開発者向けドキュメントを調べてきましたが、ユーザーがFacebookのログインボタンをクリックして公開許可を与えるところまで到達しました。次に、私の関数は壁に何かを投稿します。
私の質問: Facebook アプリが、javascript SDK または PHP SDK のいずれかを使用して、アプリの公開許可を与えたすべてのユーザーの壁に投稿する方法はありますか。
私の現在のコード:
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected') {
testAPI();
} else if (response.status === 'not_authorized') {
FB.login(function(response) {
console.log(response);
},{scope: 'publish_actions'});
} else {
FB.login(function(response) {
console.log(response);
},{scope: 'publish_actions'});
};
});
function postAPI() {
var body = 'We are testing the ability of posting on users behalf.';
FB.api('/me/feed','post',{message:body},function(response){
if (!response || response.error) {
alert('Error occurred');
} else {
console.log('Post ID: ' + response.id);
};
});
};