2012-02-24 17 views
3

私は「見て」行動を投稿しようが、私はいつもこのエラーをしました:不明なパスコンポーネント

Error occured 

Type: OAuthException 

Message: Unknown path components: /MyAppName:watch 

これは私のJS関数です:

function postWatch() 
    { 
FB.api('/me/MyAppName:watch' + 
    '?video=http//myLink.com','post', 
    function(response) { 
    var msg = 'Error occured'; 
    if (!response || response.error) { 
    if (response.error) { 
    msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message; 
    } 
    alert(msg); 
    } 
    else { 
    alert('Post was successful! Action ID: ' + response.id); 
    } 
    }); 
    } 

は、これが私のOGです:タグ

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" 
     xmlns:fb="https://www.facebook.com/2008/fbml"> 
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#"> 
    <meta property="fb:app_id" content="MyAppID" /> 
    <meta property="og:title" content="MyTitle" /> 
    <meta property="og:image" content="http://MyUrlImage.com" /> 
    <meta property="og:description" content="MyDescription" /> 
    <meta property="og:url" content="MyLink.com"> 
    <meta property="og:site_name" content="MySiteName" /> 
    <meta property="og:type" content="video.movie" /> 

内蔵の構文が異なっているアクションのために

よろしく

答えて

4

);私の下手な英語のため申し訳ありませんが、私はフランス人だ:;

おかげで)

PS。あなたは、次の構文を使用することができ、あなた自身の行動/オブジェクトのために実際に

+1

神ああ!!!完璧に動作します!どうもありがとうございました !!! –

2

にvideo.watchesを使用します。

var params = {}; 
params['video'] = 'http://example.com/myvideo.html'; 
FB.api('me/mynamespace:watch','post',params,function(response){ 
     console.log(response); 
}); 

ユーザーがpublish_actionsを提供している場合、これは実際には、あなたの壁の上のオブジェクトとアクションを公開します権限あなたのチェックはこのようなものになりますので、あなたはおそらく、あなたが権限を持っていることを確認したい権限の事については :

FB.api('me/permissions','get',function(response){ 
     if (response.data[0].publish_actions){ 
      //do your magic 
     }  
});