0

我有我连接到 facebook 的 phonegap 应用程序。我有一个点赞按钮,单击该按钮我希望触发一个事件并将通知发送到我的 facebook 页面。但另一方面,它只是打开一个空白网页。这是我的代码。任何人都可以指出我是否在某个地方出错了..

//Graph Tag
<meta property="og:title" content="Hello world" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Hello World" />
<meta property="og:description" content="Hello World!  This is my mobile web sample app." />
<meta property="og:image" content="http://www.facebookmobileweb.com/start/img/facebook_icon_large.png"/>

//Initializing the facebook JS and the javascript
<!-- This initializes the Facebook JS SDK. -->
<div id="fb-root"></div>
<!--<script src=" http://connect.facebook.net/en_US/all.js"></script>-->
<script src="cordova-1.5.0.js"></script>
 <!-- cordova facebook plugin -->
<script src="cdv-plugin-fb-connect.js"></script>
 <!-- facebook js sdk -->
<script src="facebook_js_sdk.js"></script>

   <script>
window.fbAsyncInit = function() {
  FB.init({
    appId      : '281846961912565', // App ID
    channelUrl : 'https://www.facebook.com/appcenter/281846961912565?preview=1', // Channel File
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML
  });



    // Additional initialization code here
   };

    // Load the SDK Asynchronously
    (function(d){
   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);
 }(document));

</script>


//The like button
<fb:like href="https://www.facebook.com/appcenter/281846961912565?preview=1" send="true" width="450" show_faces="true"></fb:like>

在此先感谢,

4

0 回答 0