Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios Facebook login : com.facebook.sdk:ErrorLoginFailedReason = invalid_client

I've been testing my FB app with my ios App for quite some time, using sandbox app and my admin account only; it worked fine.

Now, i've disabled sandbox mode in my fb app to have some of my FB friends test the application.

Whenever they try to connect from the iPhone app, they get the following display :

"myApp misconfigured for Facebook login"

and the error is : com.facebook.sdk:ErrorLoginFailedReason = invalid_client (error 2)

can't find any information about it anywhere.

Also (don't know if it matters), i don't use the Facebook native app on my iPhone (so i login through Safari), whereas my friends do (and get the error from Facebook native app).

like image 562
Bruce BENAMRAN Avatar asked Sep 19 '12 10:09

Bruce BENAMRAN


1 Answers

As Bruce answered its own question in comments, I would provide it in a real answer.

The Facebook app bundle ID must be exactly the same than the iOS app bundle ID. If you've recently changed your bundle ID, or event your target name (by default the product name is set to $(TARGET_NAME) and the bundle ID to ${PRODUCT_NAME}), this could be the cause of your problem.
Be careful, because bundle ID is case sensitive!

Finally, it could also be the Facebook App Configuration namespace field. My client did fill it with the application name, and that was the error. Leaving it empty resolved my problem.

like image 196
Martin Avatar answered Sep 29 '22 07:09

Martin