2013-05-26 49 views
8

我使用PhoneGap的插件連接到Facebook 這一個:https://github.com/phonegap-build/FacebookConnect的PhoneGap連接Facebook插件設置

我感到困惑的Facebook應用程序的設置,當我打電話FB.init()我收到此錯誤信息:

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. 

我編輯的網站與Facebook登錄(網站網址)指向:http://本地主機/(無空間ofcourse我只加它,因爲計算器不允許在它的「localhost」的鏈接)和我等了幾分鐘(超過一天)纔開始工作,但仍然無法工作。

任何想法我怎麼才能讓它工作?

感謝在Facebook上EIT

+0

你有沒有嘗試這個版本,它可能允許更多的定製。 https://github.com/phonegap/phonegap-facebook-plugin – Blynn

+0

我注意到它試圖發送到Facebook的url是file:// android_assets/www/[file_name_here]。我還沒有解決我應用程序中的問題,但是當我更改FB.init({})代碼以匹配https://github.com/phonegap-build/FacebookConnect/blob/master/example/Simple/index .html錯誤消失了。 –

+0

有沒有解決這個問題?有相同的問題... – K2xL

回答

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


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

您的應用程序設置 設置你的 「與Facebook登錄網站」,以

http://localhost/ 
+0

但後來Facebook的登錄在真實的網站將無法正常工作 –

4

有你需要設置幾個設置。
這些設置適用於Phonegap Build環境。

原生Android應用程序

其他步驟:

  • 你並不需要設置「網站與Facebook登錄(網址)「到http://localhost/了。如果你有一個真實的網站(有Facebook登錄),那麼這是放置真實網站URL的地方。
  • 確保沙盒模式中禁用
+0

嗨。謝謝我已經完成了所有這些,但它仍然沒有工作。你能幫忙嗎?你認爲這可能是與.ProjectActivity,因爲我有一個主要的index.html代替。 – Sarah