使用facebookconnect插件时不能调用未定义的分割

cannot call split of undefined when using facebook connect plugin for phonegap

本文关键字:未定义 分割 调用 不能 facebookconnect 插件 使用      更新时间:2023-09-26

我在尝试调用FB.login()函数时遇到问题。

堆栈跟踪表明facebook连接插件被正确初始化,但当我试图调用登录函数时,我得到一个错误:///android_asset/www/cd -plugin-fb-connect.js:39

似乎第39行的params变量没有定义。

我使用cordova 2.6.0.js在android 4.1.1上开发HTC one X

04-17 11:07:18.804: I/CordovaLog(27283): Changing log level to DEBUG(3)
04-17 11:07:18.804: I/CordovaLog(27283): Found preference for useBrowserHistory=true
04-17 11:07:18.804: D/CordovaLog(27283): Found preference for useBrowserHistory=true
04-17 11:07:18.804: I/CordovaLog(27283): Found preference for exit-on-suspend=false
04-17 11:07:18.804: D/CordovaLog(27283): Found preference for exit-on-suspend=false
04-17 11:07:18.804: D/DroidGap(27283): DroidGap.onCreate()
04-17 11:07:19.499: D/JsMessageQueue(27283): Set native->JS mode to 2
04-17 11:07:19.519: D/DroidGap(27283): DroidGap.init()
04-17 11:07:19.559: D/CordovaWebView(27283): >>> loadUrl(file:///android_asset/www/login.html)
04-17 11:07:19.559: D/PluginManager(27283): init()
04-17 11:07:19.584: D/CordovaWebView(27283): >>> loadUrlNow()
04-17 11:07:19.584: D/DroidGap(27283): Resuming the App
04-17 11:07:19.664: D/SoftKeyboardDetect(27283): Ignore this event
04-17 11:07:19.879: E/(27283): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
04-17 11:07:19.879: I/(27283): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
04-17 11:07:20.154: I/(27283): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl
04-17 11:07:20.569: I/(27283): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl
04-17 11:07:20.609: I/Choreographer(27283): Skipped 53 frames! The application may be doing too much work on its main thread.
04-17 11:07:21.059: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:21.164: D/SoftKeyboardDetect(27283): Ignore this event
04-17 11:07:21.319: D/DroidGap(27283): onMessage(onPageStarted,file:///android_asset/www/login.html)
04-17 11:07:24.679: D/chromium(27283): Unknown chromium error: -6
04-17 11:07:24.689: D/Cordova(27283): onPageFinished(file:///android_asset/www/login.html)
04-17 11:07:24.689: D/Cordova(27283): Trying to fire onNativeReady
04-17 11:07:24.689: D/DroidGap(27283): onMessage(onNativeReady,null)
04-17 11:07:24.689: D/DroidGap(27283): onMessage(onPageFinished,file:///android_asset/www/login.html)
04-17 11:07:24.739: D/CordovaNetworkManager(27283): Connection Type: 3g
04-17 11:07:24.739: D/DroidGap(27283): onMessage(networkconnection,3g)
04-17 11:07:24.739: D/CordovaNetworkManager(27283): Connection Type: 3g
04-17 11:07:24.744: D/DroidGap(27283): onMessage(spinner,stop)
04-17 11:07:25.094: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:26.699: D/ConnectPlugin(27283): init: Initializing plugin.
04-17 11:07:26.739: D/DroidGap(27283): onMessage(spinner,stop)
04-17 11:07:26.759: D/CordovaLog(27283): Cordova Facebook Connect plugin initialized successfully.
04-17 11:07:26.759: I/Web Console(27283): Cordova Facebook Connect plugin initialized successfully. at file:///android_asset/www/cdv-plugin-fb-connect.js:24
04-17 11:07:26.759: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:28.004: D/CordovaLog(27283): Uncaught TypeError: Cannot call method 'split' of undefined
04-17 11:07:28.004: E/Web Console(27283): Uncaught TypeError: Cannot call method 'split' of undefined at file:///android_asset/www/cdv-plugin-fb-connect.js:39

没关系,我已经修好了。正如我从这个线程中发现的,我在FB.login()调用中使用了错误的范围。