Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.91k stars 2k forks source link

How to take off loading facebook-native.js in cordova_plugin.js of browser platform? #1286

Open mrcoolbiz opened 8 years ago

mrcoolbiz commented 8 years ago

I installed success the facebook plugin. If I emulate IOS, it's working... then I try with browser platform. It come up with the error: index.js:44 Uncaught ReferenceError: facebookConnectPlugin is not defined So I just found, this error happen because of the script in file cordova-plugins.js in browser platform: module.exports = [ { "file": "plugins/cordova-plugin-facebook4/www/facebook-native.js", "id": "cordova-plugin-facebook4.FacebookConnectPlugin", "pluginId": "cordova-plugin-facebook4", "clobbers": [ "facebookConnectPlugin" ] }, So if I delete it, the browser platform is working. But every time I run "cordova emulate browser". That script just copy again. So I just wonder if anyway to let cordova won't copy that script back to browser platform ?

This is the full script in cordova_plugins.js @ platform/browser/www/cordova_plugins.js. The part that cordova always regenerate is the bold text.

cordova.define('cordova/plugin_list', function(require, exports, module) { module.exports = [ { "file": "plugins/cordova-plugin-facebook4/www/facebook-native.js", "id": "cordova-plugin-facebook4.FacebookConnectPlugin", "pluginId": "cordova-plugin-facebook4", "clobbers": [ "facebookConnectPlugin" ] }, { "file": "plugins/cordova-plugin-facebook4/www/facebook-browser.js", "id": "cordova-plugin-facebook4.FacebookConnectPluginBrowser", "pluginId": "cordova-plugin-facebook4", "clobbers": [ "facebookConnectPlugin" ] } ]; module.exports.metadata = // TOP OF METADATA { "cordova-plugin-whitelist": "1.2.2", "cordova-plugin-facebook4": "1.7.1" } // BOTTOM OF METADATA });