kennylerma / facebook-actionscript-api

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

Reading user permissions #255

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Facebook.getSession().availablePermissions 

2.function handleLogin(session:Object, fail:Object):void {
if (session != null) {
trace (session.perms)
}

3.Facebook.addJSEventListener('auth.sessionChange', callback)   
private function callback(response:Object):void {       
trace( response.perms)
}

What is the expected output? What do you see instead?
i should be able to get comma seperated list with the permissions from the 
current user

What version of the product are you using? On what operating system?
Windows 7, firefox 3.6 - GraphAPI Source_1_5.zip 

Please provide any additional information below.
I have tried all the above but i am not able to get anything.
others also seems to have this problem. 
https://github.com/facebook/connect-js/issues#issue/14  but is still able to 
get the permissions on login.

Original issue reported on code.google.com by meresuk...@gmail.com on 14 Feb 2011 at 12:15

GoogleCodeExporter commented 9 years ago
Are you trying to get the available permissions before logging in? I believe 
they are only available after the user logs in (because that's when the 
permissions are set on the FacebookSession).

Original comment by rovertn...@gmail.com on 16 Feb 2011 at 5:28

GoogleCodeExporter commented 9 years ago
I am trying to only trying to get the permisssions from a already logged in 
user.
or after i have called Facebook.login(handleLogin, opts)

What i am trying to do, is detecting if a user is already logged in to facebook 
and  and if he/she has given my app the needed permissions.

No matter when i try to get the Facebook.getSession().availablePermissions it 
returns null.

logInBtn.addEventListener(MouseEvent.CLICK , doLogin)

private function doLogin(e:MouseEvent = null):void {

var opts:Object = {perms:"publish_stream, user_photos, email"};  
Facebook.login(handleLogin, opts)            
}

function handleLogin(session:Object, fail:Object):void {
if (session != null) {
trace (session.perms)
trace (Facebook.getSession().availablePermissions)
}

Original comment by meresuk...@gmail.com on 3 Mar 2011 at 7:17

GoogleCodeExporter commented 9 years ago
We're looking into whether this is a bug or not right now. In the mean time, I 
would suggest just saving off the permissions as a static const (ex public 
static const PERMISSIONS:String = "publish_stream, user_photos, email") and 
then referencing them if you need them. You'll know that the user given your 
app the needed permissions if you do receive a session object on handleLogin.

Original comment by rovertn...@gmail.com on 8 Mar 2011 at 9:24

GoogleCodeExporter commented 9 years ago
Hola... quizas te pueda ayudar este post para saber que permisos tiene un 
usuario de facebook en tu aplicacion:

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:49

GoogleCodeExporter commented 9 years ago
You should be able to just call
Facebook.api("me/permissions", callback);

http://www.fb-developers.info/blog/2011/using-the-graph-api-to-get-permissions-g
ranted/

Original comment by edwar...@gmail.com on 13 Oct 2011 at 5:35