phonegap无法与facebook集成
我正在尝试在我的Phonegap应用程序上执行Facebook登录,该应用程序专门用于Windows Phone平台 我已经下载了所需的插件(文件:ChildBrowserCommand.cs、ChildBrowser.js)和FBConnect.js,可从以下站点获得。我还将ChildBrowser.cs文件包含到我的项目中 下面是我的简单html文件。一段时间后,我想执行Facebook登录:phonegap无法与facebook集成,facebook,windows-phone-7,jquery-mobile,cordova,phonegap-plugins,Facebook,Windows Phone 7,Jquery Mobile,Cordova,Phonegap Plugins,我正在尝试在我的Phonegap应用程序上执行Facebook登录,该应用程序专门用于Windows Phone平台 我已经下载了所需的插件(文件:ChildBrowserCommand.cs、ChildBrowser.js)和FBConnect.js,可从以下站点获得。我还将ChildBrowser.cs文件包含到我的项目中 下面是我的简单html文件。一段时间后,我想执行Facebook登录: <!DOCTYPE html> <html> <head&g
<!DOCTYPE html>
<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" href="css/jquery.mobile-1.3.2.min.css" />
<script type="text/javascript" charset="utf-8" src="js/jquery/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript" src="js/run/cordova.js"></script>
<script type="text/javascript" src="js/utils/ChildBrowser.js"></script>
<script type="text/javascript" src="js/utils/FBConnect.js"></script>
<title></title>
</head>
<body>
<script>
$.support.cors = true;
</script>
<div id="testPage" data-role="page">
<script>
setTimeout(function () {
var client_id = "...";
var redir_url = "http://www.facebook.com/connect/login_success.html";
var friendsMap = {};
var fb = FBConnect.install(client_id, redir_url, "touch");
fb.connect('email, read_stream, read_friendlists');
fb.onConnect = onFBConnected;
}, 2500);
function onFBConnected() {
}
</script>
<div data-role="content">
</div>
</div>
</body>
</html>
关于第一个错误,我看到ChildBrowserCommand.cs文件中有不正确的名称空间。我已经解决了这个问题,但我不知道在哪里可以找到丢失的JSON模块。从归档文件下载Phonegap 2.9.1后,可以创建Visual Studio模板(解压后在lib/windows phone目录下,我已经完成了),但该库似乎还不完整。还有一个错误,我无法执行我的Facebook登录。你曾经遇到过这个问题吗?在哪里可以找到丢失的模块?下面是我的ChildBrowserCommand.cs更改。我将感谢任何帮助
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Diagnostics;
using System.Runtime.Serialization;
using WP7CordovaClassLib.Cordova;
using WPCordovaClassLib.Cordova.Commands; // previous: using WP7CordovaClassLib.Cordova.Commands;
using WP7CordovaClassLib.Cordova.JSON; // it's missing
using Microsoft.Phone.Shell;
更新:不久前,我发现了非常好的解决方案。它适用于我的Windows Phone应用程序!为了正确登录Facebook,您需要在Phonegap项目中设置InAppBrowser插件,并在.FaceGap方法调用之前输入应用ID和应用密钥。太棒了!:)
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Diagnostics;
using System.Runtime.Serialization;
using WP7CordovaClassLib.Cordova;
using WPCordovaClassLib.Cordova.Commands; // previous: using WP7CordovaClassLib.Cordova.Commands;
using WP7CordovaClassLib.Cordova.JSON; // it's missing
using Microsoft.Phone.Shell;