科尔多瓦而processMessage失败:堆栈:未定义(和)错误:非法访问 [英] Cordova processMessage failed: Stack: undefined (and) Error: illegal access
问题描述
我想通过 PushPlugin 得到这个GCM REGID。
我找不到每'非法访问错误信息的任何文件...听起来几乎像一个权限的事情。该JS功能onNotificationGCM坪日志消息,表示它的执行...
错误消息:
而processMessage失败:堆栈:未定义
而processMessage失败:错误:非法访问
而processMessage失败:消息: Jjavascript:onNotificationGCM({\\\"regid\\\":\\\"APA91bGQkVTa6KGBQzNz9spnYgYEL6RSJKyyoNh5GnhrkD04wVgm1detXbuATLRC_Evjduv4NCPZWzw_Q-ilEl4U_XBjibiSHPgzWEoO0_VBqB6HT_TDNMsJoxoGZu1ZXyFZNDXQawCJxv5KcQiCp7zmbaICt9n4TQ\\\",\\\"event\\\":\\\"registered\\\"})
好了,去图。看来,我试图解析与JSON.parse,其中一个JS对象 - 发现还可以通过<一做href=\"http://samritchie.net/2011/04/01/uncaught-illegal-access-exception-in-android-browser-on-json-parse/\"相对=nofollow>这篇文章 --throws这些非法访问错误。有一次,我确信JSON解析之前,通过了味精是一个字符串,错误消失,REGID已成功处理。 w00t。
I'm trying to get this GCM regId via PushPlugin.
I can't find any documentation per 'illegal access' error message... sounds almost like a permissions thing. The JS function onNotificationGCM pings a log message, indicating it's execution...
Error message:
processMessage failed: Stack: undefined
processMessage failed: Error: illegal access
processMessage failed: Message: Jjavascript:onNotificationGCM({\"regid\":\"APA91bGQkVTa6KGBQzNz9spnYgYEL6RSJKyyoNh5GnhrkD04wVgm1detXbuATLRC_Evjduv4NCPZWzw_Q-ilEl4U_XBjibiSHPgzWEoO0_VBqB6HT_TDNMsJoxoGZu1ZXyFZNDXQawCJxv5KcQiCp7zmbaICt9n4TQ\",\"event\":\"registered\"})
Well, go figure. It seems that I was attempting to parse a JS object with JSON.parse, which--a discovery also made via this article--throws these 'Illegal access' errors. Once I made sure the passed in msg was a string before parsing JSON, the errors disappeared and regId was handled successfully. w00t.
这篇关于科尔多瓦而processMessage失败:堆栈:未定义(和)错误:非法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!