Let me try to make sure everyone understands this. Facebook tries to detect if their native app is installed. If it is, it uses it for SSO or Single Sign On. Your app gets backgrounded, the native Facebook app launches and prompts you to login and agree to a set of permissions. It then calls back to your app to bring it out of the background and let it know you’ve logged in correctly.
If you DO NOT have the native facebook app installed, it opens up a webView and tries to log you in through their web interface. This is why you can make it work without the native app installed.
Why won’t it work with the native app installed? Well its all about that big about being able to bring your app out of the background to the foreground and re-establish communications. On Apple’s iOS they use a URL scheme to do it. That’s why you have to put that bit in your build.settings about “fbYOURAPPID” so that the native facebook app can restart you.
On Android, your stuff has to match in their portal at https://developers.facebook.com See this screen shot:
Your package name must match the package name that you’re building your APK with. Your Key Hash is used to secure the login and it must match what your app is being built with. In the past, you could provide FB a bogus key hash and they would spit out what they were expecting in the console log, but there are reports they are not longer doing that, so you have to make sure you get it right.
Thanks
Rob