Software Archive
Read-only legacy content
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Facebook 3rd party plug-in walkthrough

Hooman_F_
初学者
644 次查看

I am new to the XDK platform.  I am trying to use the Facebook Connect plugin listed under the Featured plug-ins of the project.  I have checked the box and provided my App ID and Name.  The Wizcorp site the plug-in refers to (https://github.com/Wizcorp/phonegap-facebook-plugin/) shows the javascript calls to make to login, example:

var fbLoginSuccess = function (userData) {
    alert("UserInfo: " + JSON.stringify(userData));
}

facebookConnectPlugin.login(["public_profile"],
    fbLoginSuccess,
    function (error) { alert("" + error) }
);

I have a button in my app that I click to invoke the login function above, but nothing happens.  Can someone provide some step-by-step instructions on how to use this plug-in?

 

0 项奖励
3 回复数
PaulF_IntelCorp
644 次查看
0 项奖励
Amrita_C_Intel
644 次查看

Hi,

When I executed above specified link sample, the app was running.So below is the part of that sample code for Login.

var login = function () {
                if (window.cordova.platformId == "browser") {
                    var appId = "your app ID"// Specify your App id here
                    facebookConnectPlugin.browserInit(appId);
                    alert(JSON.stringify(facebookConnectPlugin))
                }
                facebookConnectPlugin.login( ["email"], 
                    function (response) { alert(JSON.stringify(response)) },// Success Message
                    function (response) { alert(JSON.stringify(response)) });// Failure Message
            }

I believe that you need to specify your app Id if it is not updating in index.html.

0 项奖励
Hooman_F_1
初学者
644 次查看

I think my issue (which doesn't seem very well documented IMHO) is that I was trying this in the emulator.  Now, the documents do mention that only "core" plugins work in the emulator tab (for the time being - build 1826).  However, the Facebook Connect plugin is not listed under the 3rd party plugins.  It's listed as "featured." And  the nomenclature "core" is not seen in the project properties pages. For future (noobie) users might be good to sync up the terminology.  If the "core" label is used in docs, then the project properties should say "core" as well.  This "featured" section is really 3rd party (Intel validated?). 

Anyhow, once I built the app (under IOS in my case), and downloaded the app to my phone, the code worked as shown and I was redirected to the FB login page.

0 项奖励
回复