bertrando / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

FacebookSession "availablePermissions" & "user" properties always returns null #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Call Facebook.login with permission options set
2.Trace out the FacebookSession object properties after login is successful
3.All FacebookSession properties return values except "availablePermissions" & 
"user."

What is the expected output? What do you see instead?

Since the extended permissions are properly set at login I expect to see a 
non-null value for "availablePermissions", however the value is null. Since I 
am properly logged in and can get user info using "/me", I expect my 
FacebookSession to have a non-null "user" value, however the value is null.

What version of the product are you using? On what operating system?

I am using GraphAPI Source 1.0 on a Mac.

Please provide any additional information below.

I've noticed that when using building an AIR application with GraphAPI Desktop 
1.0, "user" returns a value, but "availablePermissions" still does not.

Original issue reported on code.google.com by treest...@gmail.com on 25 Oct 2010 at 11:02

GoogleCodeExporter commented 9 years ago
I got the same problem too....

Original comment by haveanew...@gmail.com on 13 Nov 2010 at 12:54

GoogleCodeExporter commented 9 years ago
Same here. 'user' property is null, rather than an object containing the user's 
full information.

Original comment by jchap...@gmail.com on 23 Nov 2010 at 1:08

GoogleCodeExporter commented 9 years ago
This just seems to be the way the code is designed, which seems odd.  I don't 
know about the availablePermissions parameter, but the user property is 
populated in the AIR version of the SDK, if you pass in an access token.  If 
you do that, the SDK calls the verifyAccessToken() function, which calls:

api('/me', handleUserLoad);

and 

protected function handleUserLoad(result:Object, error:Object):void {
  if (result) {
    session.uid = result.id;
    session.user = new FacebookUser();
    session.user.fromJSON( result );
    if (loginCallback != null) {
      loginCallback(session, null);
    }
  } else {
    if (loginCallback != null) {
      loginCallback(null, error);
    }
  }
}

I guess it's just a case of duplicating this logic manually in your own code, 
for now.

Original comment by psyked84@gmail.com on 23 Nov 2010 at 11:13

GoogleCodeExporter commented 9 years ago
How can I find out current extended permission that user have? Is there any 
other way to find out?

Thanks.

Original comment by tohj...@gmail.com on 11 Dec 2010 at 9:09

GoogleCodeExporter commented 9 years ago
If you know what permission you're looking for, you can obtain information 
about it from an FQL request, such as:

Facebook.fqlQuery( "SELECT publish_stream,email FROM permissions WHERE uid = 
me()", onFQLResponse );

and 

function onFQLResponse( success:Object, failure:Object ):void {
    if ( success ) {
        for ( var i:String in success[ 0 ]) {
            trace( i, "=", success[ 0 ][ i ]);
        }
    } else {
        trace( "FQL query failed." );
    }
}

Original comment by psyked84@gmail.com on 29 Dec 2010 at 10:59

GoogleCodeExporter commented 9 years ago

Original comment by edwar...@gmail.com on 12 Jan 2011 at 10:59

GoogleCodeExporter commented 9 years ago
Muchas gracias psyked84, con tu ayuda organice un codigo para validar permisos 
de un usuario en una aplicación. Te doy la gracias en mi blog.

http://graciasinternet.blogspot.com/2011/05/verificar-permisos-de-facebook-de-tu
.html

Saludos.

Original comment by elkin0...@gmail.com on 25 May 2011 at 4:50