Facebook login issue on iPad

I’m using the facebook API to login and then share content. It works perfectly on Android devices and on iPhones (tested on 2 different devices, one running iOS 6 and the other iOS 7).

On iPad (tested on 2 different devices - iPad 2 and iPad air both running iOS 7), I get the following error:

“The operation couldn’t be completed. (com.facebook.sdk error 2.)”

Are there any iPad-specific settings I’m missing here?

EDIT:  Apparently, if the user has logged in to facebook from the settings app on the device, then the facebook login throws this error. Is there any way to detect this?

What build of Corona SDK are you using?

Rob

I’m using version 2014.2189. I think that had there been a way to determine if the user is already logged in, it would’ve solved a lot of issues. So right now, if I get an error from the facebook.login, I just use the social plugin instead. The problem with the social plugin, is that it doesn’t look like a facebook share popup…

The social plugin brings up the native post dialog.  This should be the same dialog that’s generated with the facebook.showDialog().  Your login process should be two fold:  One to login and request read permissions:

facebook.login(yourAppId, yourFBListener)

then later when you need to write something request it with permissions
 

facebook.login(yourAppId, yourFBListener, { “publish_actions” } )

Now if you’re using the social plugin, you can check to see if they are logged in or not in the settings screen with this: 

http://docs.coronalabs.com/api/library/facebook/accessDenied.html

but it can be useful to see if someone has disabled Facebook in the settings. 

Also see this thread about the facebook error #2.

http://stackoverflow.com/questions/14159965/com-facebook-sdk-error-2-on-ios

What build of Corona SDK are you using?

Rob

I’m using version 2014.2189. I think that had there been a way to determine if the user is already logged in, it would’ve solved a lot of issues. So right now, if I get an error from the facebook.login, I just use the social plugin instead. The problem with the social plugin, is that it doesn’t look like a facebook share popup…

The social plugin brings up the native post dialog.  This should be the same dialog that’s generated with the facebook.showDialog().  Your login process should be two fold:  One to login and request read permissions:

facebook.login(yourAppId, yourFBListener)

then later when you need to write something request it with permissions
 

facebook.login(yourAppId, yourFBListener, { “publish_actions” } )

Now if you’re using the social plugin, you can check to see if they are logged in or not in the settings screen with this: 

http://docs.coronalabs.com/api/library/facebook/accessDenied.html

but it can be useful to see if someone has disabled Facebook in the settings. 

Also see this thread about the facebook error #2.

http://stackoverflow.com/questions/14159965/com-facebook-sdk-error-2-on-ios