- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey can some body help me with this, I try to get email and public profile from facebook app, I included the plugin cordova facebook connect and enter my App ID and App Name, but when nothing happens when I execute this function, do not show nothing, thank you in advance.
function facebook_login(){
//get login status
facebookConnectPlugin.getLoginStatus(fbLoginSuccess,
function (error){
alert("" + error);
}
);
var fbLoginSuccess = function(data){
alert(data);
if(data.status == 'connected'){
//get info
facebookConnectPlugin.api(data.userID + "/?fields=email", ["public_profile"],
function(result){
var form = document.getElementById('registerform');
form.email.value = data.email;
window.localStorage.setItem('fb_first_name', result.first_name);
window.localStorage.setItem('fb_last_name', result.last_name);
//load create_account_page
$.mobile.changePage('#create_account', {transition: 'flip'} );
},
function(error){
alert('Failed ' + error);
}
);
}else{
alert(data);
facebookConnectPlugin.login(["email", "public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
}
}
}
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check this screens, when I try to login on facebook, and here is the new code, please help ASAP.
function facebook_login(){
var fbLoginSuccess = function (userData) {
alert("UserInfo: " + JSON.stringify(userData));
//get info
facebookConnectPlugin.api("me/?fields=id,email", ["public_profile"],
function (result) {
alert("Result: " + JSON.stringify(result));
},
function (error) {
alert("Failed: " + error);
}
);
}
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) {
alert("" + JSON.stringify(error));
}
);
}
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are required to provide a hashkey in your Facebook application. For more information about the creation of key hashes, visit the following links as a startingpoint:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm just getting this error in the chrome log when debuggon on a physical device and using AppPreview:
Uncaught ReferenceError: facebookConnectPlugin is not defined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So the facebook plugin only works when you do a full build and deploy to a phone. It doesn't work when you use the Debug tab. So the question is how are you supposed to use the debugger when you've got FB integrated as it seems to be be rather useless now?. :\
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you must build your app to use the fb plugin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JOHN H. (Intel) wrote:
Yes, you must build your app to use the fb plugin.
So the app is built as crosswalk for android but I'm seeing the Invalid facebook keys error still. Where do I set/get the key?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide some screenshots? You can refer to this article as well.
https://software.intel.com/en-us/xdk/article/facebook-connect-plugin-android-ios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Amrita. I tried again this morning and it worked. I created a new test facebook app on developers.facebook.com but this time I didn't add the android platform to the app as I did in the previous one. I guess that's what might have caused the issue.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think there is still an issue here. Here's what happens.
1. Build android app and deploy to device.
2. FB connect works, my app is connected to the user.
3. I make another build (same FB_APP_ID etc.), remove the first original build from the phone and redeploy.
4. FB connect plugin has a login status of 'unknown' as opposed to 'connected' before. The FB window is also now shown with "This app has no Android key hashes configured. Configure your app key hashes at...".
So how do users receive updated versions of the app without removing it from their facebook settings first? I don't understand.
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page