- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The plugin author has some examples here > https://github.com/Wizcorp/phonegap-facebook-plugin/tree/master/platforms and an extensive help thread here > https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/TROUBLESHOOTING.md
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page