Phonegap Facebook connect plugin settings

你说的曾经没有我的故事 提交于 2020-01-22 14:18:06

问题


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


回答1:


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



回答2:


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


 FB.init({
            appId: "<your appId>",
            nativeInterface: CDV.FB
 });



回答3:


on facebook eit your app settings set your "Website with Facebook Login" to

http://localhost/


来源:https://stackoverflow.com/questions/16759110/phonegap-facebook-connect-plugin-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!