Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap Facebook connect plugin settings

I'm using phonegap plugin to connect to facebook this one : https://github.com/phonegap-build/FacebookConnect

I'm confused about Facebook app settings, when I call FB.init() I get this error message:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. 

I edited Website with Facebook Login (site url) to : http:// localhost/ (without the space ofcourse I only added it because stackoverflow doesn't allow a link with 'localhost' in it) and I waited for several minutes (more than one day) for it to work but it's still not working.

any idea how can I get it to work ?

thanks

like image 354
Vanddel Avatar asked May 26 '13 12:05

Vanddel


2 Answers

There are several settings which you need to set.
These settings worked for me for a Phonegap Build environment.

Under Native Android App:

  • package name: the "widget id" you have in your config.xml (e.g. com.aaa.bbb)
  • class name: the "widget id" with ".ProjectActivity" appended (e.g. com.aaa.bbb.ProjectActivity)
  • key hash: generate the key hash using the android instructions. Facebook explains this at https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/
  • facebook login: enabled
  • deep linking: disabled

Other steps:

  • You don't need to set "Website with Facebook Login (site url) " to http://localhost/ anymore. If you have a real website (with facebook login), then that's the place to put the real website URL.
  • Ensure sandbox mode is disabled
like image 91
Gary Weiss Avatar answered Sep 19 '22 02:09

Gary Weiss


 Write this code in onDeviceReady after creating your application id on facebook


 FB.init({
            appId: "<your appId>",
            nativeInterface: CDV.FB
 });
like image 31
Abdulqadir_WDDN Avatar answered Sep 22 '22 02:09

Abdulqadir_WDDN