0
我有一個混合移動應用程序(應該在android和ios中工作)。我需要在我的應用程序中發佈在Facebook牆上。請注意它的hybrib應用程序,所以我不應該使用任何java或c代碼。來自混合移動應用程序的Facebook上的帖子
我嘗試了以下方法,它在模擬器中工作,但不是在實際設備中。請幫幫我。
<script>
window.fbAsyncInit = function() {
FB.init({
appId : ' my appID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#share_button').live('click', function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: 'HyperArts Blog',
link: 'http://hyperarts.com/blog',
picture: 'http://www.hyperarts.com/_img/TabPress-LOGO-Home.png',
caption: 'I love HyperArts tutorials',
description: 'The HyperArts Blog provides tutorials for all things Facebook',
message: ''
});
});
});
</script>
感謝
你有一個例子如何做到這一點?謝謝。 – 2013-12-15 18:55:56