问题描述
科尔多瓦升级到3.1.0后,onNotificationGCM功能事件=寄存器不能被调用。所以,我可以得到推送通知已登记的手机,但新手机不能注册。
After Cordova upgrading to 3.1.0, onNotificationGCM function event = register cannot been called. So I can get push notification for the registered phone, but new phone cannot be registered.
检查ATD的控制台,我得到这样的:
Checking console of ATD, I got this:
W/PluginManager(31200): THREAD WARNING: exec() call to PushPlugin.
register blocked the main thread for 30ms. Plugin should use
CordovaInterface.getThreadPool().
任何人有同样的问题,可以给一些这方面的建议?
Anyone has same problem and could give some suggestions on this?
推荐答案
找到某种方式gWebView.sendJavascript(_D);是不是在 sendJavascript 功能运行的 PushPlugin.java 。它可以PushPlugin错误或科尔多瓦错误。
Found somehow gWebView.sendJavascript(_d); is not running in sendJavascript function in PushPlugin.java. It could PushPlugin error or Cordova error.
/*
* Sends a json object to the client as parameter to a method which is defined in gECB.
*/
public static void sendJavascript(JSONObject _json) {
String _d = "javascript:" + gECB + "(" + _json.toString() + ")";
Log.v(TAG, "sendJavascript: " + _d);
if (gECB != null && gWebView != null) {
gWebView.sendJavascript(_d);
}
}
修改 gWebView.sendJavascript(_D);
(线105)为 gWebView.loadUrl(_D)将解决问题
Change gWebView.sendJavascript(_d);
(line 105) to gWebView.loadUrl(_d) will fix problem.
这篇关于PushPlugin升级到科尔多瓦3.1.0后无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!