2012-03-21 1 views
1

mp3 첨부 파일이있는 활성 사용자 벽에 게시하려고합니다. 그것은 페이스 북의 테스트 콘솔 (아래 참조)에서 잘 작동하지만, 모바일 앱에서 호출하면 메시지 만 게시됩니다. 무엇을 나는 여기에 놓치고 :(Facebook JS - FB.api()는 메시지 첨부 만 미디어 첨부 파일에 게시하지 않습니다.

페이스 북의 시험 콘솔 : 여기

http://developers.facebook.com/docs/reference/rest/stream.publish/ 내 JS입니다 ... 첨부 파일에 벽

로그인

  FB.login(
       function(response) { 
        if (response.authResponse) { 
         alert('logged in'); 
        } else { 
         alert('not logged in'); 
        } 
       },{ scope: "email,user_likes,publish_stream,offline_access" } //added offline_access to see if that was the problem 
      ); 

포스트

  var attachment = { 
        'message': 'testing', 
        'attachment': {'media': [{ 
         'type': 'mp3', 
         'src': 'http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3', 
         'title': 'Test Title', 
         'artist': 'My Artist', 
         'album': 'My Album' }]} 
      }; 

      FB.api('/me/feed', 'post', attachment, function(response) { 
       if (!response || response.error) { 
       alert(response.error.message); 
       } else { 
       alert('Post ID: ' + response.id); 
       } 
      }); 

답변

0
 var attachment = { 
       'message': 'testing', 
       'source': 'http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3' 
     }; 

이것은 피드에 mp3를 게시하여 사용자가 재생 버튼을 인라인으로 클릭 할 수있게합니다. 아래의 작업 예제를 참조하십시오. http://jsfiddle.net/dmcs/aggJc/1/

그래프 API에 POST 데이터가있는 경우 서식 지정은 동일한 개체가 다시 GET 인 경우와 다릅니다. 글은 다소 약식 표기법이며, Getting는 긴 손입니다.

+0

코드가 고정되었습니다. 고마워, 정말 고마워. '원본'과 '첨부 파일'을 사용하는 것의 차이점은 무엇입니까? – Allover

+0

어떻게 사운드 제목, 아티스트, 설명을 넣을 수 있습니까? – Allover

+1

열린 그래프 호환 mp3 용 html 웹 페이지를 만듭니다. 정보는 http://ogp.me를 참조하십시오. – DMCS

관련 문제