|
Hello. Your article looks very helpful, but it would help me resolve a bug, if I could actually read the text in your screen shots. The images are so small that I can't even see the text. If I zoom in, they get too pixelated to see.
Specifically, I need to see the one that shows the app configuration. I'm getting an error when I try to use the facebook js library. the error says that my localhost:{port#} domain isn't valid.
Could you please update your screenshots and other images so that they are bigger, and easy to read? Thanks in advance. 
|
|
|
|
|
I cant able to see the fb login button.Please help and suggest some changes if required
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="fblogin.aspx.cs" Inherits="fblogin" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script src="scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="scripts/all.js" type="text/javascript"></script>
<script>
$("document").ready(function () {
FB.init({
appId: '687092678024142',
channelUrl: '//' + window.location.hostname + '/channel',
scope: 'id,name,gender,user_birthday,email',
status: true,
cookie: true,
xfbml: true
});
FB.Event.subscribe('auth.statusChange', OnLogin);
});
</script>
<script>
function OnLogin(response) {
if (response.authResponse) {
FB.api('/me?fields=id,name,gender,email,birthday', LoadValues);
}
}
function LoadValues (me) {
if (me.name) {
document.getElementById('displayname').innerHTML = me.name;
document.getElementById('FBId').innerHTML = me.id;
document.getElementById('DisplayEmail').innerHTML = me.email;
document.getElementById('Gender').innerHTML = me.gender;
document.getElementById('DOB').innerHTML = me.birthday;
document.getElementById('auth-loggedin').style.display = 'block';
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="fb-root"></div>
<div class="fb-login-button" >
Login with Facebook
</div>
<div id="auth-status">
<div id="auth-loggedin" style="display: none">
Hi, <span id="displayname"></span><br/>
Your Facebook ID : <span id="FBId"></span><br/>
Your Email : <span id="DisplayEmail"></span><br/>
Your Sex:, <span id="Gender"></span><br/>
Your Date of Birth :, <span id="DOB"></span><br/>
</div>
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Hello Sir,
When I try to login then it prompts to username and password and after that I get javascript error "Object doesn't support property or method '_gcb2'".
|
|
|
|
|
Hi,
The JS file which is being used in this article have changed quite much now, please look into that. Seems like some object property has changed.
Regards
S Ravi Kumar
|
|
|
|
|
Thanks a lot for reply, that worked for me but I am facing new issue that it is working for only my email id(from which i have created apps), if I am supplying another user id/email id then nothing changes on page after entering fb id and password.
|
|
|
|
|
Yeah I have solved this. This was just because of sandbox mode, I make it disable and applied Canvas URL to make it visible publicly. It worked for me.
Thanks again..
|
|
|
|
|
|
Hi friends
I got this error while execute this code
{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}
kmp
|
|
|
|
|
Hi,
It seems like you are trying to access those fields, which require access token for them, I have not updated the article for this.
You will have to look over internet for that.
Regards
S Ravi Kumar
|
|
|
|
|
It is nice article. After I set up on my website, it works. However, the user information doesn't display after login? any suggestion?
How can I allow user to browser multiple pages which requires authentication?
|
|
|
|
|
Very good. I've a problem: I store me.id in an hiddenfield and I need to retrieve the value in the Page_load,but it seem to be null. Only after the complete load of the page I can retrieve the value of hidden field. I can I get it in the page_load?
|
|
|
|
|
Hello sir, Its a nice article.
Everything works great but with the Fb.Login, I want the user to redirect to my home page after login just like google, hotmail etc. I have tried the below code it remain on the same page.
<pre lang="xml">Fb.Login (function (response) {
if (response.authResponse) {
window.location = ../Default2.aspx;
}
});</pre>
The other way I have tried copied the same code in Default2.aspx and in Default1.aspx I have written this code
<pre lang="cs"><pre lang="xml">FB.Event.subscribe('auth.statusChange', function (response) {
if (response.authResponse) {
window.location = '../Default2.aspx'
...
<pre></pre>
with window.location I could able to redirect and get user details in Default2.aspx
Is this the right way? If so how can I stop user accessing Default2.aspx without login
Thanks.
|
|
|
|
|
your article is simple, and very easy to understand and to follow.
Thx, very helpful
modified 15-May-13 8:03am.
|
|
|
|
|
hi , can you please tell me how to get user country and city
|
|
|
|
|
Hi,
Please refer to the second reference link given in article (https://developers.facebook.com/docs/reference/api/user/) it has all the properties exposed by Facebook for the user.
Regards
S Ravi Kumar
|
|
|
|
|
Hi,
i tried your code and also run code , but there is nothing displayed on loggin in like facebook if , email ,
Please reply
|
|
|
|
|
The code will not work directly as I have not put the Facebook app ID in the sample code, please the article fully and create your app ID then provide that in the sample code then run the code.
|
|
|
|
|
I have pasted that ID already , i put some alert and came to know that line
FB.Event.subscribe('auth.statusChange', OnLogin);
doesnt fire or control donot goto onlogin function.
|
|
|
|
|
Can you please check you JQuery initialization, it seems like there is some issue in that. Also check which browser you are using please use IE as Chrome gices issues with this code.
Regards
S Ravi Kumar
|
|
|
|
|
thanks , i had not written the url in app. when i write it works perfectly
thanks
|
|
|
|
|
you haven't used ANY asp.net in your article
this "solution" is just the standard javascript implementation, it uses absolutely zero dot-net code.
just because you launched visual studio to edit your front-end code doesn't make this an asp.net solution - just like opening the HTML file in xcode wouldn't make it a tutorial about "facebook integration in iOS apps", and like editing the HTML file in eclipse wouldn't make it a "facebook integration on android" solution.
|
|
|
|
|
Dear Sir,
with all the respect to your opinion, but if you wish to add the fb login faeture to your website, all you need to do is add these simple lines of code .it's true that they are JS, but here you are using fb as a service and thats the only way to communicate with FB- using services.
you can implement these lines of code anywhere, and that's up to you to know how to use it in your asp.net app.
lets say you want to restrict some of your website pages to only registered people, yet you want to make it easy for them to register, moreover you want to get a hold on their email to contact them in the future, so. implement this code into your code, whose role is only to simply fill-in the registration for the user with a simple click, and then your asp.net will do the rest of the magic.
Hope this clarifies stuff. 
|
|
|
|
|
Hi Ravi Kumar I want the same concept like facebook authenitication in my vb.net application. Can it is possible?
|
|
|
|
|
Hi,
You are putting webapplication ID in Java Script so any one can see my app id from view source. Can you confirm is it not any security threat.
Please reply
Suman
|
|
|
|
|
Hi Suman,
It is the way suggested by Facebook, of course it is a security threat.
S Ravi Kumar
|
|
|
|