daogr / facebook-actionscript-api

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

Problem with Request for Permissions #291

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In my application I want to publish the results of the games on facebook. I 
used this tutorial: 
http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt1.html

Here is a fragment of my source code:

<fx:Script>
        <![CDATA[
            import com.facebook.graph.FacebookMobile;

            import mx.events.Request;

            import valueObjects.GlobalVariables;

            protected var extendedPermissions:Array = ["publish_stream","user_website","user_status","user_about_me"];
           protected function initApp():void
            {
                FacebookMobile.init("app ID",loginHandler);
            }
            protected function loginHandler(success:Object,fail:Object):void
            {
                if(success){   
                    currentState="loggedin";
                    nameLbl.text=success.user.name;
                    userImg.source=FacebookMobile.getImageUrl(success.uid,"small");
                    birthdayLbl.text=success.user.birthday;
                    FacebookMobile.api("/me/statuses",getStatusHandler);
                }
                else{   
                    this.login();
                }
            }
            protected function login():void
            {
                FacebookMobile.login(loginHandler, stage, []);
            }
            protected function logout():void
            {
                FacebookMobile.logout();
                currentState="loggedout";
            }
            protected function getStatusHandler(result:Object, fail:Object):void
            {
                statusLbl.text=result[0].message;
            }
            protected function submitPost():void
            {
                FacebookMobile.api("/me/feed",submitPostHandler,{message:GlobalVariab les.d.toString()}, "POST");
            }
            protected function submitPostHandler(result:Object,fail:Object):void
            {
                FacebookMobile.api("/me/statuses",getStatusHandler);
            }
        ]]>
    </fx:Script>

I have problem with permissions. After login I see a white screen instead of 
request for permission.  The desktop application does not have a problem with 
it. When I log for the first time to the desktop application and I will give 
the permissions applications, then in the mobile application everything works 
fine. But this is not a good solution. And so please help.

I used Flash Builder Burrito.

Original issue reported on code.google.com by leszczyn...@gmail.com on 16 Apr 2011 at 9:10

GoogleCodeExporter commented 8 years ago
This very similar to the issue found here: 
http://code.google.com/p/facebook-actionscript-api/issues/detail?id=236
It turned out to be an issue with css changes on Facebook and is supposed to 
have been resolved (http://bugs.developers.facebook.net/show_bug.cgi?id=14462). 
In the meanwhile, you can workaround this issue by changing the 'display' 
parameter on the login request from 'touch' to 'wap' (MobileLoginWindow, line 
121).

vars.display = 'wap';

Original comment by edwar...@gmail.com on 18 Apr 2011 at 10:13

GoogleCodeExporter commented 8 years ago
Thanks for your reply, but this didn't help. I changed the 'display' parameter 
on the login request from 'touch' to 'wap' (MobileLoginWindow, line 121) and I 
still have the same problem. I can log in, but instead of request for 
permission, I see a white screen... 

Original comment by leszczyn...@gmail.com on 18 Apr 2011 at 10:55

GoogleCodeExporter commented 8 years ago
Where exactly in the above code are you using the permissions array that you 
created.?
Also Sometimes what works for me is, not using the array and using the request 
extended permissions method and specifying the request individually rather than 
an array.

But that just solves your problem, the API code is still messy and crashes.

Original comment by vaibhavv...@gmail.com on 26 Aug 2011 at 4:10

GoogleCodeExporter commented 8 years ago
The api has gone through several revisions, is this still an issue with the 
latest api?

Original comment by edwar...@gmail.com on 25 Oct 2011 at 8:20