Facebook mobile can't connect nothing happens with no errors

438 views
Skip to first unread message

Andrew Tan

unread,
Feb 7, 2013, 9:21:01 PM2/7/13
to facebook-act...@googlegroups.com
Hi, I'm trying to test the GraphAPI_Mobile_1_8_1 api but it doesn't seem to work.

I'm using flash cs5 with Air 3.5 for ios for testing

when i click on the button nothing happens and it returns double null.

Been figuring this for 2 days :(

I'm currently testing Movie on my desktop
I did try porting to ipad to test and it still the same.

Can someone here help me firgure this out thankyou

below is the code im trying to make it work

import flash.display.BitmapData;
import flash.display.MovieClip;
import flash.events.Event;
import com.facebook.graph.FacebookMobile;
import flash.geom.Rectangle;
import flash.media.StageWebView;

const APP_ID:String = "xxxxxxx"; 
var APP_ORIGIN:String = "xxxxxxxx"; 
var extendedPermissions:Array = ["publish_stream","user_website","user_status","user_about_me"];

login.addEventListener(MouseEvent.CLICK, alogin); 

function alogin(e:MouseEvent):void { 
FacebookMobile.init(APP_ID, handleInit); 
FacebookMobile.login(handleLogin, stage, extendedPermissions, new StageWebView());
}

function handleInit(response:Object, fail:Object):void { 
    trace(response); 

function handleLogin(response:Object, fail:Object):void { 
    trace(response); 
}

Cedric Nicolas

unread,
Feb 8, 2013, 1:04:37 PM2/8/13
to facebook-act...@googlegroups.com
I've the same issue since today. It was perfectly working yesterday. After a bit of search the URL returned by the facebook connect is : https://www.facebook.com/connect/login_success.html and thats all, with no access_token.
If we try to do an auth request by browser, it works. It is seems that the way facebook handles the login window produced by GraphAPI has changed, and the locationChangeEvent do not return the parameters in the redirect url.

Any clue ?

Cedric Nicolas

unread,
Feb 8, 2013, 7:02:46 PM2/8/13
to facebook-act...@googlegroups.com
Finally i found the solution.. after 4 hours searching. You need to check the protocol of the return_uri, should be https if facebook authentication url is in https too.

You can modify the Graph_API.MobileLoginWindow.formatData call like this :

protected function formatData(applicationId:String,
 display:String,
 extendedPermissions:Array = null  
):URLVariables {

var vars:URLVariables = new URLVariables();
vars.client_id = applicationId;
vars.redirect_uri = FacebookURLDefaults.LOGIN_SUCCESS_SECUREURL; //instead of FacebookURLDefaults.LOGIN_SUCCESS_URL !!!!!!!



Cedric Nicolas

unread,
Feb 8, 2013, 7:03:32 PM2/8/13
to facebook-act...@googlegroups.com
it seems a side effect of February Breaking changes from facebook.

吉嶺豊彦

unread,
Feb 19, 2013, 4:35:09 AM2/19/13
to facebook-act...@googlegroups.com
AIR 3.6 ?

2013年2月8日金曜日 11時21分01秒 UTC+9 Andrew Tan:
Message has been deleted

Andrew Tan

unread,
Apr 20, 2013, 1:34:31 PM4/20/13
to facebook-act...@googlegroups.com
Thanks Cedric Nicolas.

Toyohiko Yoshimine that was the problem i'm facing too. i solve it by modifying using Cedric Nicolas way.

djib

unread,
Apr 22, 2013, 5:00:12 AM4/22/13
to facebook-act...@googlegroups.com
This works. Thanks !

Daniel Ruiz Sanchez

unread,
Apr 22, 2013, 1:04:38 PM4/22/13
to facebook-act...@googlegroups.com
Hello,

I have the same problem. I only get null. I try modify the code, but I can´t recompile the swc. I try use the directory directly, but i get a JSON error about static call.

Someone can recompile the swc with the change and upload for everyone? Please. Thank you.


Message has been deleted

lokov...@gmail.com

unread,
Apr 22, 2013, 9:49:36 PM4/22/13
to facebook-act...@googlegroups.com
how can I make this change in SWC file?

Roberto Vidal

unread,
Apr 23, 2013, 5:53:45 PM4/23/13
to facebook-act...@googlegroups.com
Lokov, you can´t do that. You must use the source code version of the API, include it in your project and then edit the MobileLoginWindow.as file as Cedric pointed.

Thanks for the info, Cedric!

Hugo Van Krimpen

unread,
Apr 24, 2013, 7:11:16 PM4/24/13
to facebook-act...@googlegroups.com
Perfect! It worked!

Op zaterdag 9 februari 2013 01:02:46 UTC+1 schreef Cedric Nicolas het volgende:

中村俊樹

unread,
Apr 27, 2013, 9:00:51 PM4/27/13
to facebook-act...@googlegroups.com
cannot post.  I could log in following Cedric Nicolas's way, but using next code, I could not post. Is there anyone who know how to solve this problem?
 
FacebookMobile.api("/me/feed",callApi,{"message":"eating lunch"},"POST");
 
 

Daniel Ruiz Sanchez

unread,
May 11, 2013, 4:25:06 AM5/11/13
to facebook-act...@googlegroups.com
Hello,

I´m trying to probe with the source code, but I get a problem about JSON call:

......com\facebook\graph\data\FQLMultiQuery.as, Line 80    1061: Call encode method possibly not defined by Class static reference.

This is the code´s part get the error:

        /**
         *
         * @return String The JSON encoded value of the queries object
         *
         */       
        public function toString():String {
            return JSON.encode(queries);      ----> Line 80 
        }

What is the problem? Thank you.

Andres Muñoz

unread,
May 22, 2013, 2:00:50 AM5/22/13
to facebook-act...@googlegroups.com
hi Cedric

i did what you said, but happends the same problem, why do you thik this occurs, txs (sorry for my english)
Reply all
Reply to author
Forward
0 new messages