Facebook: App Center

Am just submitting my app to list on the facebook app center but have got back the following error message after they had reviewed it

Your iOS app must use the native Login dialogthat 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

I am using the following code to post to facebook and am not sure what to do to fix this problem??

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

can anyone help me out??
 

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,

this bug has just gone from bad to critical. We uploaded a new build to Apple using 1259 a few days ago. It got rejected with the following reason:

We found that your app exhibited one or more bugs, when reviewed on iPad running iOS 7.0.4 & iPhone 5s running iOS 7.0.4, on both Wi-Fi and cellular networks, which is not in compliance with the App Store Review Guidelines.

Specifically the facebook log in does not work.

How will that be handled and how quick? We can’t take 4 weeks to switch over to Graphics 2.0 (the amount of work we expect for that switch), so the bug must be fixed in the legacy builds as well.

Thanks.

Was it working with a developer or adHoc build?

Thanks

Rob

Hi,

I had a crash on my iPad Retina using an adhoc build, but only the first time I used the facebook login. The next time it worked.

However, I just sat down to get to the bottom of this, to provide you with a use case, but I met another facebook bug that has stopped me completely from figuring out the original bug.

When the alert box popped up asking for my permission to read my friends list etc, I pressed “NO”. Since then I have been unable to login at all. I have deleted and reinstalled the app, booted the device, cleared the safari cache, deleted the app from my facebook settings etc. Nothing helps. facebook.login is called (I’ve tried with and without permissions), but nothing at all is returned in the listener - it isn’t even invoked. I just see the spinner for 10-20 seconds, then it goes away - and I am still at the same scene. Not logged in. No wonder, since the listener is not invoked by your facebook implementation.

Steps to reproduce

===============

  1. do facebook.login(appId, listener, {“publish_actions”}) – choose whatever kind of permission you feel like

  2. Say NO when the facebook alert box pops up

  3. try facebook.login again.

  4. watch how the listener is not invoked

– now try to reinstall the app, boot the device, delete safari cache, delete the app from your facebook settings and see how nothing mends the bug.

When you’ve fixed that so that I am able to get the app working on my device again, I can dive into the original bug I reported that had Apple reject our submission - something crashing when logging in.

I’ll go back to the daily build before you changed the facebook login to get our app approved by Apple. Being rejected in the Facebook App Center is not such a big deal at the moment.

On Nov 1 Rob said …

So I suppose they know about the first issue anyways. Let’s hope they can fix both in one go and roll it all out on G1 so you aren’t forced to go through that 4 week transition for the sake of this fix. I find it appalling that we are all forced to go to G2 if we need fixes to bugs of this nature.

ksan - no. The first issue was FACEBOOK rejecting apps due to Coronalabs having implemented their SDK wrong. Like I’ve tried to tell them for a year :).

The second issue was APPLE rejecting our app because it crashed on facebook login. The crashing came as a result of Coronalabs fixing the first issue.

The third issue is about what happens when you press NO in the facebook permissions prompt.

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.

Here is the stack trace for ISSUE #3 - this is thrown in the xcode console when I try to do facebook.login after first having pressed NO in the permissions prompt. You need to end the session when the user cancels or NO’s the prompt…
 

Generic error

com.facebook.sdk:InvalidOperationException: FBSession: an attempt was made reauthorize permissions on an unopened session

(

    0   CoreFoundation                      0x2d7e7e9b <redacted> + 154

    1   libobjc.A.dylib                     0x37e836c7 objc_exception_throw + 38

    2   CoreFoundation                      0x2d7e7b89 <redacted> + 0

    3   QuizPix                             0x0009c239 -[FBSession reauthorizeWithPermissions:isRead:behavior:defaultAudience:completionHandler:] + 112

    4   QuizPix                             0x00099bb3 -[FBSession reauthorizeWithReadPermissions:completionHandler:] + 42

    5   QuizPix                             0x0003fad7 _ZNK6Corona12IOSFBConnect5LoginEPKcPS2_i + 718

    6   QuizPix                             0x0004169b _ZN6Corona15FacebookLibrary5loginEP9lua_State + 198

    7   QuizPix                             0x0010f711 luaD_precall + 988

    8   QuizPix                             0x0011c11b luaV_execute + 1478

    9   QuizPix                             0x0010f8e7 luaD_call + 78

    10  QuizPix                             0x00109329 f_call + 16

    11  QuizPix                             0x0011ce87 luai_objcttry + 90

    12  QuizPix                             0x0010fb17 luaD_pcall + 62

    13  QuizPix                             0x001092fd lua_pcall + 232

    14  QuizPix                             0x0013352b _ZN3Rtt10LuaContext6DoCallEP9lua_Stateii + 62

    15  QuizPix                             0x00128b29 _ZNK3Rtt13DisplayObject23DispatchEventWithTargetEP9lua_StateRKNS_6MEventEi + 112

    16  QuizPix                             0x00128b3f _ZNK3Rtt13DisplayObject13DispatchEventEP9lua_StateRKNS_6MEventE + 14

    17  QuizPix                             0x0012c951 _ZNK3Rtt8HitEvent15DispatchFocusedEP9lua_StateRNS_7RuntimeERNS_11StageObjectEPNS_13DisplayObjectEb + 224

    18  QuizPix                             0x0012ce0d _ZNK3Rtt10TouchEvent15DispatchFocusedEP9lua_StateRNS_7RuntimeERNS_11StageObjectEPNS_13DisplayObjectEb + 92

    19  QuizPix                             0x0012ca63 _ZNK3Rtt8HitEvent8DispatchEP9lua_StateRNS_7RuntimeE + 150

    20  QuizPix                             0x0012cdaf _ZNK3Rtt10TouchEvent8DispatchEP9lua_StateRNS_7RuntimeE + 70

    21  QuizPix                             0x001496dd _ZN3Rtt7Runtime13DispatchEventERKNS_6MEventE + 36

    22  QuizPix                             0x000c467f -[EAGLView touchesEnded:withEvent:] + 314

    23  UIKit                               0x300f2ea3 <redacted> + 234

    24  UIKit                               0x300f2ea3 <redacted> + 234

    25  UIKit                               0x2ffa0425 <redacted> + 528

    26  UIKit                               0x2ff9b451 <redacted> + 832

    27  UIKit                               0x2ff70d79 <redacted> + 196

    28  UIKit                               0x2ff6f569 <redacted> + 7116

    29  CoreFoundation                      0x2d7b2f1f <redacted> + 14

    30  CoreFoundation                      0x2d7b23e7 <redacted> + 206

    31  CoreFoundation                      0x2d7b0bd7 <redacted> + 630

    32  CoreFoundation                      0x2d71b471 CFRunLoopRunSpecific + 524

    33  CoreFoundation                      0x2d71b253 CFRunLoopRunInMode + 106

    34  GraphicsServices                    0x3241c2eb GSEventRunModal + 138

    35  UIKit                               0x2ffd0845 UIApplicationMain + 1136

    36  QuizPix                             0x0000e091 main + 100

    37  QuizPix                             0x0000e028 start + 40

)

Here’s the xcode console output for the crash that made APPLE rejected our submission.

2013-11-16 23:05:29.739 BoardRush[302:60b] *** Terminating app due to uncaught exception ‘com.facebook.sdk:InvalidOperationException’, reason: 'FBSession: It is not valid to reauthorize while a previous reauthorize call has not yet completed.'

*** First throw call stack:

(0x2d7e7e83 0x37e836c7 0x2d7e7b89 0x13929d 0x136bb3 0xdcc57 0x2e106929 0x2d7a9e71 0x2d71dab1 0x2e103ec5 0x2e1087c7 0x137b23 0x139651 0x138591 0x383680c3 0x383680af 0x3836a9a9 0x2d7b25b1 0x2d7b0e7d 0x2d71b471 0x2d71b253 0x3241c2eb 0x2ffd0845 0xab091 0xab028)

libc++abi.dylib: terminating with uncaught exception of type NSException