获取Facebook用户电子邮件和用户名/姓与Phonegap FB插件为IOS应用程序

问题描述:

使用我的第一个phonegap ios应用程序。
尝试合并此插件 https:// github.com/Wizcorp/phonegap-facebook-plugin/tree/master/platforms/ios/www

Working on my first phonegap ios app. Trying to incorporate this plugin https://github.com/Wizcorp/phonegap-facebook-plugin/tree/master/platforms/ios/www

基本上我只需要提醒用户电子邮件和

Basically I just need to alert the users email and first/last name, although I'm a bit stuck on how to do so using this plugin.

我想做的是检索这些信息,然后预先填充一些

What I wanted to do was retrieve that information, then pre populate some forms to create a new user to use with Parse.

我可以从此函数获取一个响应,显示一个状态和authResponse与令牌和用户ID :

I'm able to get a response from this function that displays a status and an authResponse with tokens and the user ID:

           var login = function () {
            if (!window.cordova) {
                var appId = prompt("Enter FB Application ID", "");
                facebookConnectPlugin.browserInit(appId);
            }
            facebookConnectPlugin.login( ["email"], 
                function (response) { alert(JSON.stringify(response)) },
                function (response) { alert(JSON.stringify(response)) });
        }



我只是不确定如何进行下一步用户电子邮件和第一/姓氏,以及是否必须深入到facebooks API。

I'm just unsure in terms of next steps on how to go about retrieving the users email and first/lastname..and whther or not I have to dig deeper into facebooks API.

任何帮助是赞赏。

* UPDATED *

想象出来。我缺少一个步骤,我发现在facebook api页面

Figured it out. I was missing a step that i found over at the facebook api page

         var login = function() {
         if (!window.cordova) {
             facebookConnectPlugin.browserInit('APPID');
             facebookConnectPlugin.browserInit(appId);
         }
         facebookConnectPlugin.login(["email"], function(response) {
             if (response.authResponse) {
                 facebookConnectPlugin.api('/me', null,
                     function(response) {
                         alert('Good to see you, ' +
                             response.email + response.name + '.');
                     });

             }
         });
     }


href =http://plugins.cordova.io/#/package/com.ccsoft.plugin.cordovafacebook =nofollow> http://plugins.cordova.io/#/package/com.ccsoft.plugin .cordovafacebook ),这涵盖了您的所有需求。

Try this plugin(http://plugins.cordova.io/#/package/com.ccsoft.plugin.cordovafacebook) this covers all of your needs.