iOS Facebook woes (or bug?)

OSX 10.9.2

Xcode 5.1

Corona SDK 2014.2214 (Pro version)

Tested on iOS 6.1.6 and 7.1

I’m trying to implement the Facebook.* Graph API and I’m getting “loginFailed” events in certain situations.

I’m using the Facebook Connect sample app for testing, updated with my Facebook AppID.

Note: Remember to press “Logout” and remove apps from background between testing each case below.

Case 1:

See note above.

No native facebook app installed.

When running the sample app, I get a webView where I’m asked to log in, then returns to sample app.

Result: successful login

Case 2:

See note above.

Native facebook app installed.

*Not* logged in to either the Facebook app or the Facebook section of the Settings app.

When running the sample app, the native app is called where I’m asked to log in, then returns to sample app.

Result: successful login

Case 3:

Native facebook app installed.

Only logged in to the Facebook app, but *not* in the Facebook section of the Settings app.

When running the sample app, the native app is called where it shows a blank grey Facebook page for a while and then returns to the sample app.

Result: successful login

Case 4:

See note above.

Native facebook app installed.

Logged in to both the Facebook app, and the Facebook section of the Settings app.

When running the sample app, a native dialog is displayed saying ““Facebook” would like to access your basic profile info and list of friends [Don’t Allow] [OK]”

Press OK

Result: login failed

Go to Facebook section of the Settings app. 

The sample app “Facebook” is missing from the “Allow These Apps to Use Your Account”

Case 5:

See note above.

Native facebook app installed.

Logged in to both the Facebook app, and the Facebook section of the Settings app.

When running the sample app, a native dialog is displayed saying ““Facebook” would like to access your basic profile info and list of friends [Don’t Allow] [OK]”

Press Don’t Allow

Result: login failed

Go to Facebook section of the Settings app. 

The sample app “Facebook” is *listed* in the “Allow These Apps to Use Your Account” list, but the toggle is false.

Change toggle to true.

Repeat Case 5 from the beginning.

It just repeats with the Native “Don’t Allow OK” dialog with unsuccessful login even though OK is pressed.

I’ve tested this with devices running iOS 6.1.6 and iOS 7.1.

The problem is that in most cases I’d assume that Case 5 is relevant for most users, which makes this approach very unreliable.

Could this be a bug?

Reported as Case 31545.

I had a similar problem, and if I recall I had that problem when I was using a development profile with a wildcard App ID. I had to create a dev profile for the specific App ID I was building the game for. Are you using a wildcard Adhoc profile or a specific one with your App ID in it?

Nope. I never use wildcard provisioning profiles. I’m using a fully qualified profile, and I’ve double/triple checked that it’s being used when compiling. I’ve also read and checked all related Facebook app setup guides and made sure all is set up properly.

Everything works as long as no login info is set up in the Facebook section of iOS’s Settings app. I’m starting to believe that there is a communication problem between the Corona app and the native Facebook app.

Reported as Case 31545.

I had a similar problem, and if I recall I had that problem when I was using a development profile with a wildcard App ID. I had to create a dev profile for the specific App ID I was building the game for. Are you using a wildcard Adhoc profile or a specific one with your App ID in it?

Nope. I never use wildcard provisioning profiles. I’m using a fully qualified profile, and I’ve double/triple checked that it’s being used when compiling. I’ve also read and checked all related Facebook app setup guides and made sure all is set up properly.

Everything works as long as no login info is set up in the Facebook section of iOS’s Settings app. I’m starting to believe that there is a communication problem between the Corona app and the native Facebook app.