2013-09-03 2 views
0

Ti Studio 3.1.1 GA를 사용하여 페이스 북에 통합 된 기본 iOS 앱 (6.1)을 제작하고 있습니다. 내가 소유 한 팬 페이지 중 하나에 기사를 게시하려고합니다. 이야기는 페이스 북 페이지 ID를 사용하는 것보다 페이스 북의 "최근에 다른 사람들이 올린 글"섹션에 항상 쓰여집니다. 나는 {데이터} 섹션에서 '메시지'가있는 경우페이 스북 페이지 피드에 게시하는 방법?

fb.requestWithGraphPath('me/accounts', {}, 'GET', function(e) { 
    if (e.success) { 
     fb.permissions = ['publish_stream', 'read_stream','manage_pages']; 
     fb.authorize(); 

     access_tokens = JSON.parse(e.result); 

     for (var i = 0; i < fanpages.length; i++) { 
      for (var j=0; j < access_tokens.data.length; j++) { 
       if (fanpages[i].id === access_tokens.data[j].id){ 
       var data = { 
       link: "http://www.example.co/index.html", 
       picture: returnedData[0].image,        }; 
      fb.requestWithGraphPath(fanpages[i].id + '/feed' , data,  'POST',showRequestResult); 
       } 
      } 
     } 
    } 
}); 

} 

대신 위의 '링크'의 경우, 다음 페이지의 ID와 팬 페이지에 기록하지만 '링크'를 사용하는 경우 다음은 '최근 글 다른 사람들의 이야기 ... http://developers.facebook.com의 도구 -> 그래프 API 탐색기를 사용하여 위의 기능을 테스트했을 때 페이지 ID 토큰을 사용하여 이야기가 페이지 id로 facebook 팬 페이지에 게시됩니다. '링크'가있는 경우 어떻게 페이지 액세스 토큰을 전달할 수 있는지 잘 모르겠습니다. 위의 코드는 이미 페이지 액세스 토큰을 전달하고 있다고 생각합니다 .... 누구나 구현 방법이나 앞으로 갈 방법에 대한 아이디어가 있습니까? 미리 감사드립니다. 감사합니다. KP

답변

1

피드 대화 상자 API 호출을 사용해 보셨습니까? Appcelerator 문서에서

http://docs.appcelerator.com/titanium/latest/#!/api/Modules.Facebook-method-dialog

샘플

var data = { 
    link : "http://www.appcelerator.com", 
    name : "Appcelerator Titanium Mobile", 
    message : "Checkout this cool open source project for creating mobile apps", 
    caption : "Appcelerator Titanium Mobile", 
    picture : "http://developer.appcelerator.com/assets/img/DEV_titmobile_image.png", 
    description : "You've got the ideas, now you've got the power. Titanium translates " + 
        "your hard won web skills into native applications..." 
}; 
fb.dialog("feed", data, function(e) { 
    if(e.success && e.result) { 
     alert("Success! New Post ID: " + e.result); 
    } else { 
     if(e.error) { 
      alert(e.error); 
     } else { 
      alert("User canceled dialog."); 
     } 
    } 
}); 
관련 문제