Facebook: App Center

And here is a Bug #4, related to the other bugs. If you manage to log in, and then do facebook.logout, and then do another login, this exception is thrown:
 

Generic error

com.facebook.sdk:InvalidOperationException: FBSession: It is not valid to reauthorize while a previous reauthorize call has not yet completed.

(

    0   CoreFoundation                      0x2d7e7e9b <redacted> + 154

    1   libobjc.A.dylib                     0x37e836c7 objc_exception_throw + 38

    2   CoreFoundation                      0x2d7e7b89 <redacted> + 0

    3   BoardRush                           0x000a529d -[FBSession reauthorizeWithPermissions:isRead:behavior:defaultAudience:completionHandler:] + 212

    4   BoardRush                           0x000a2bb3 -[FBSession reauthorizeWithReadPermissions:completionHandler:] + 42

    5   BoardRush                           0x00048c57 ___ZNK6Corona12IOSFBConnect5LoginEPKcPS2_i_block_invoke159 + 86

    6   Foundation                          0x2e106929 <redacted> + 292

    7   CoreFoundation                      0x2d7a9e71 <redacted> + 12

    8   CoreFoundation                      0x2d71dab1 _CFXNotificationPost + 1720

    9   Foundation                          0x2e103ec5 <redacted> + 72

    10  Foundation                          0x2e1087c7 <redacted> + 30

    11  BoardRush                           0x000a3b23 -[FBSession transitionToState:andUpdateToken:andExpirationDate:shouldCache:loginType:] + 1518

    12  BoardRush                           0x000a5651 -[FBSession transitionAndCallHandlerWithState:error:token:expirationDate:shouldCache:loginType:] + 64

    13  BoardRush                           0x000a2b55 -[FBSession openWithBehavior:completionHandler:] + 436

    14  BoardRush                           0x000a5ba1 +[FBSession openActiveSessionWithPermissions:allowLoginUI:allowSystemAccount:isRead:defaultAudience:completionHandler:] + 212

    15  BoardRush                           0x000a3119 +[FBSession openActiveSessionWithAllowLoginUI:] + 56

    16  BoardRush                           0x00048aa1 _ZNK6Corona12IOSFBConnect5LoginEPKcPS2_i + 664

    17  BoardRush                           0x0004a69b _ZN6Corona15FacebookLibrary5loginEP9lua_State + 198

    18  BoardRush                           0x00118711 luaD_precall + 988

    19  BoardRush                           0x0012511b luaV_execute + 1478

    20  BoardRush                           0x001188e7 luaD_call + 78

    21  BoardRush                           0x00112329 f_call + 16

    22  BoardRush                           0x00125e87 luai_objcttry + 90

    23  BoardRush                           0x00118b17 luaD_pcall + 62

    24  BoardRush                           0x001122fd lua_pcall + 232

    25  BoardRush                           0x0013c52b _ZN3Rtt10LuaContext6DoCallEP9lua_Stateii + 62

    26  BoardRush                           0x00131b29 _ZNK3Rtt13DisplayObject23DispatchEventWithTargetEP9lua_StateRKNS_6MEventEi + 112

    27  BoardRush                           0x00131b3f _ZNK3Rtt13DisplayObject13DispatchEventEP9lua_StateRKNS_6MEventE + 14

    28  BoardRush                           0x00135951 _ZNK3Rtt8HitEvent15DispatchFocusedEP9lua_StateRNS_7RuntimeERNS_11StageObjectEPNS_13DisplayObjectEb + 224

    29  BoardRush                           0x00135e0d _ZNK3Rtt10TouchEvent15DispatchFocusedEP9lua_StateRNS_7RuntimeERNS_11StageObjectEPNS_13DisplayObjectEb + 92

    30  BoardRush                           0x00135a63 _ZNK3Rtt8HitEvent8DispatchEP9lua_StateRNS_7RuntimeE + 150

    31  BoardRush                           0x00135daf _ZNK3Rtt10TouchEvent8DispatchEP9lua_StateRNS_7RuntimeE + 70

    32  BoardRush                           0x001526dd _ZN3Rtt7Runtime13DispatchEventERKNS_6MEventE + 36

    33  BoardRush                           0x000cd67f -[EAGLView touchesEnded:withEvent:] + 314

    34  UIKit                               0x300f2ea3 <redacted> + 234

    35  UIKit                               0x300f2ea3 <redacted> + 234

    36  UIKit                               0x2ffa0425 <redacted> + 528

    37  UIKit                               0x2ff9b451 <redacted> + 832

    38  UIKit                               0x2ff70d79 <redacted> + 196

    39  UIKit                               0x2ff6f569 <redacted> + 7116

    40  CoreFoundation                      0x2d7b2f1f <redacted> + 14

    41  CoreFoundation                      0x2d7b23e7 <redacted> + 206

    42  CoreFoundation                      0x2d7b0bd7 <redacted> + 630

    43  CoreFoundation                      0x2d71b471 CFRunLoopRunSpecific + 524

    44  CoreFoundation                      0x2d71b253 CFRunLoopRunInMode + 106

    45  GraphicsServices                    0x3241c2eb GSEventRunModal + 138

    46  UIKit                               0x2ffd0845 UIApplicationMain + 1136

    47  BoardRush                           0x00017091 main + 100

    48  BoardRush                           0x00017028 start + 40

)

[quote name=“haakon” post=“215438” timestamp=“1384637840”]Issue #2 and #3 needs fixing, and it must be fixed in the legacy builds, not just the new public release with Graphics 2.0, since it’s too big a task to port a bunch of games to use it, and too many bugs in the new graphics engine and the widgets.[/quote] Exactly!!! It is a shame that we are forced to upgrade in order to get fixes to basic issues and the platform we are forced to upgrade introduces even more bugs… Talk about a vicious cycle.

What you can do it to call facebook.login without having any permissions.  When you actually need to do a facebook.request which requires permissions you can call facebook.login again with the needed permissions before doing the request and calling the request in the listener.  This is the flow that facebook likes.  Try it and see if that works.

Hi,

you will get the exact same errors even if you do facebook.login without permissions. The above Session bug is not fixed by changing the lua implementation, it’s a bug in Core.

Hi RJ5,

Did you follow the “Implementing Facebook” guide? You also should follow through the related “Facebook Portal Setup” guide. I’ve listed both links here for your convenience:

http://docs.coronalabs.com/guide/social/setupFacebook/index.html

http://docs.coronalabs.com/guide/social/implementFacebook/index.html

Brent

Hi Brent

Yes I have followed both those guides. Everything is setup the same in the “Facebook Portal Setup” and for the “Implementing Facebook” part I am using the Facebook Library (as I dont have the social plugin)

Stupid thing is that I can post to facebook from my app no problem

I’m just trying to add it to the www.facebook.com/appcenter pages. From reading the error message they gave me, 1 of the links takes me to the following Facebook Login Checklist where it has - 

iOS and Android apps should use the native Login dialog that comes with our SDKs instead of custom web views (Effective
October 2, 2013)

Is it this thats the issue??

In the Corona “Implement Facebook” doc it say if the user doesnt have the facebook app installed that

If the mobile device does not have the native Facebook app installed, it will use Facebook’s website to log in through. This happens through a web view, so your app is never actually suspended to the background. In general, the web-based login method is very reliable, but you (the developer) cannot control if your app’s user does or doesn’t have the native Facebook app installed. Therefore, you must support both methods.

Is this in conflict to what facebook (since Oct 2, 2013) are saying??

It’s not in conflict.  Engineering checked and even using the webView it’s part of their native.login process.  We call facebook’s SDK to log you in.  Their SDK checks to see if the native FB apps is installed and manages the login process.  What they don’t want you doing is calling something like network.request() to their REST API.

I don’t know if that’s a generic warning or what, but from everything we know, we should be in compliance with this rule.

Hi,

we just got our open graph objects and app details page rejected by Facebook for the same reason. So I doubt you are in compliance with their guidelines.

I have said for at least 6 months that you are not up to date on the login implementation, and now it finally starts to backfire on you guys.

@Rob

Im using all the default code

in build.settings

 iphone = { plist = { UIApplicationExitsOnSuspend = false, FacebookAppID = "XXXXXXXXXXXXXXX", CFBundleURLTypes = { { CFBundleURLSchemes = {"fbXXXXXXXXXXXXXXX",} } } } }

and then in my main.lua

local facebookButton = function( event ) if event.phase == "release" then local function listener( event ) if ( "session" == event.type ) then if ( "login" == event.phase ) then facebook.showDialog( "feed", { message="My Message", name="My App Name", caption="My Caption", link="Link to App", picture="Icon Lin" }) end elseif ( "dialog" == event.type ) then print( event.response ) end end facebook.login( "XXXXXXXXXXXXXXX", listener ) end end

no use of network.request() anywhere, so I’m not sure what I should do???

@haakon… you found a solution at all yet??

Hi,

nope. I re-submitted to Facebook and wrote a message that referred to this thread, and explained that we’re using Corona SDK, and that Corona Labs claims their Facebook implementation is compliant. But we just got a new rejection with the same reason; not implementing their login correctly.

So Corona Labs - what’s up?

Hi haakon,

We’re checking into this right now…

Best regards,

Brent

We are looking into it.

Engineering has identified the cause and it should get fixed in an upcoming daily build.  

whens this likely going to to added to the public builds? Its important that I get this up and running

We don’t have a scheduled date for the next public build yet.  It will be sometime after Graphics 2.0 settles down enough that we can release the build with the G2.0 engine in it.

Hi! I have the same feedback from Facebook when trying the create the app page: 

Your iOS app must use the native Login dialog that comes with Facebook’s SDKs instead of custom web views. Ensure you have successfully tested your Facebook Login integration for Single Sign On or remove this integration as a listed platform in the developer app. See more details here

 

The app is posting to my own wall, but not viewable by anyone else until the app facebook page has been approved!

Just wondering if this issue has been fixed yet?

 

Thanks,

Alan.

Hi Alan, what version of Corona SDK are you building with?

Thanks

Rob

Hi Rob,

It’s 2013.1212

Thanks,

Alan.

*Edit: just seen a newer version…going to try with that!

If you want to stay with the Graphics 1.0 engine, you should get 1260 and it has fixes that address this for Facebook.  If you can move to the Graphics 2.0 engine, any version of that should have the fixes for Facebook.

For most people adding:   graphicsCompatibility = 1 to your config.lua will take care of most of the G2.0 changes if you don’t want to convert to the G2.0 way of life :slight_smile:

Rob