1

Facebookアプリケーションを作成しています。拡張パブリッシュ ストリーム アプリケーションを管理しました。アプリの結果をユーザーの壁に表示したい。以下の方法を実行すると、ユーザーのウォールに自動的に投稿されます。公開/スキップ ダイアログから実行したいと考えています。誰でも私を助けてください。どうもありがとう!!

        $facebook->api('/me/feed', 'post', array(
        'message' => message,
        'name' => $fbme['first_name'],
        'description' => 'here goes description',
        'caption' => 'this is caption',
        'picture' => $imageurl,
        'link' => 'some link here',

// 次のパート、友達を招待します。ユーザーが公開/スキップをクリックしたときにのみ、ダイアログウィンドウが表示され、友達を招待するように要求されます。この方法で試してみますが、うまくいきません。

function(response) {
 if (response && response.post_id) {
   alert('Post was published.');
   '<?php echo("invitefriends.php")'
 } else {
   alert('Post was not published.');
   '<?php echo("invitefriends.php")' 
 }

私が抱えている問題は、3 つのウィンドウとそれらすべてを同時に取得することです。invokefriends.php には、javascript sdk の例で述べたのと同じコードがあり、正常に動作します。

どこにどのようにinvitefriends.phpを含めるか教えてください。

ありがとう!!

4

3 に答える 3

3

使用する必要がありますFB.ui

 FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );

これをテストするには、テスト コンソールに移動します ->例をクリックします-> 次に、fb.uiリストからfeedを選択します。

于 2011-03-19T17:03:24.983 に答える
1

これには、FB の JS API を使用できます。

このチュートリアルに従うことができます

http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/

于 2011-03-19T13:47:16.427 に答える
0

よくわかりませんが、推測できる限り、ユーザーウォールに投稿するにはアクセストークンが必要です。

$token = $facebook->getAccesstoken();

$facebook->api('/me/feed', 'post', array(
    'message' => message,
    'name' => $fbme['first_name'],
    'description' => 'here goes description',
    'caption' => 'this is caption',
    'picture' => $imageurl,
    'link' => 'some link here',
    'access_token' =>$toekn);

私はそれを願っています

于 2012-10-29T02:08:49.630 に答える