Closed GoogleCodeExporter closed 9 years ago
You can't get a user's info without a connection. But you can get their info by
doing this:
import com.facebook.graph.Facebook;
Facebook.init(applicationId, handleInit);
function handleInit(response:Object, fail:Object):void {
if (response) {
// User is logged in.
Facebook.api(USER_ID, handleUserInfo);
} else if (fail) {
// User hasn't logged in.
Facebook.login(hanleLogin, options);
}
}
function handleLogin(response:Object, fail:Object):void {
if (response) {
// User is logged in.
Facebook.api(USER_ID, handleUserInfo);
} else if (fail) {
// User failed to log in.
}
}
function handleUserInfo(response:Object, fail:Object):void {
if (response) {
// User info received.
// Look here for additional props of response: http://developers.facebook.com/docs/reference/api/
trace(response.name);
}
}
Original comment by rovertn...@gmail.com
on 31 Mar 2011 at 3:15
Ok thanks !
And do you know if this code works just with the ".swf" ? Without a page with
the Facebook's javascript and without "<div id="fb-root"></div>" ?
Just with AS ?
Original comment by maximus...@gmail.com
on 31 Mar 2011 at 6:14
The only way you can do this without the HTML wrapper is by packaging in for
AIR (make sure to use FacebookDesktop) or mobile (FacebookMobile) platform.
Original comment by rovertn...@gmail.com
on 4 Apr 2011 at 8:44
Original issue reported on code.google.com by
maximus...@gmail.com
on 23 Mar 2011 at 4:06