2012-11-30 138 views
0

我有一个使用Phonegap构建的应用程序,所以我拥有全部HTML和Java脚本。
我可以使用两行目标C代码来检查Facebook是否安装在特定设备上,或不在我的应用程序中。
我想在我的应用程序中有一个Facebook分享按钮,
通过点击哪个将从我的应用程序打开Facebook应用程序,并将一些数据放在用户的墙上,我可以通过这个应用程序调用。从iOS应用程序发布到Facebook墙使用Phonegap构建

回答

0

为什么不尝试FacebookConnect PhoneGap的插件,它适用于iOS和Android。

请在您的代码下载sample应用程序并尝试在下面的代码片段:

<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
     <meta name="format-detection" content="telephone=no" /> 
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> 
     <link rel="stylesheet" type="text/css" href="css/index.css" /> 
     <link rel="stylesheet" type="text/css" href="css/plugin.css" /> 
     <title>Hello World</title> 
    </head> 
    <body> 
     <div class="app"> 
      <h1>Apache Cordova</h1> 
      <div id="deviceready" class="blink"> 
       <p class="event listening">Connecting to Device</p> 
       <p class="event received">Device is Ready</p> 
      </div> 
      <div id="plugindemo"> 
       <h3>FacebookConnect Plugin</h3> 
       <a href="#" class="btn large" onclick="plugin.login();">login()</a> 
       <a href="#" class="btn large" onclick="plugin.requestWithGraphPath();">requestWithGraphPath()</a> 
       <a href="#" class="btn large" onclick="plugin.dialog();">dialog()</a> 
       <a href="#" class="btn large" onclick="plugin.logout();">logout()</a> 
      </div> 
     </div> 
     <script type="text/javascript" src="cordova-2.2.0.js"></script> 
     <script type="text/javascript" src="js/index.js"></script> 
     <script type="text/javascript" src="js/plugin.js"></script> 
     <script type="text/javascript" src="js/FacebookConnect.js"></script> 
     <script type="text/javascript"> 
      app.initialize(); 
     </script> 
    </body> 
</html> 
相关问题