title: Phonegap: "processMessage failed" unable to send javascript function (Cordova 2.5.0)
body: <p>I am trying to make GCM push notifications work in my app and therefore I am using this project (<a href="https://github.com/marknutter/GCM-Cordova" rel="nofollow">https://github.com/marknutter/GCM-Cordova</a>) as an example.</p>
  
  <p>When I run the example code everything works fine, but when I transfer all the required files and edit my code to let it work in my own app it does not work anymore.
  I also tried the following plugin (<a href="https://github.com/phonegap-build/PushPlugin" rel="nofollow">https://github.com/phonegap-build/PushPlugin</a>) and after installing it automatically it gives exactly the same error.</p>
  
  <p>The app does not crash, but when I call the register function my callback function "onNotificationGCM" does not receive any messages back.</p>
  
  <p><strong>Register function:</strong></p>
  
  <pre><code>window.plugins.GCM.register("my_gcm_id", "onNotificationGCM", successHandler, errorHandler );
  </code></pre>
  
  <p>After some debugging I figured out that the native android code is able to register the phone and does indeed get an ID message from the GCM server, but that it is unable to send this to my javascript. </p>
  
  <p><strong>Native android code:</strong></p>
  
  <pre><code>public static void sendJavascript( JSONObject _json )
  {
    String _d =  "javascript:"+gECB+"(" + _json.toString() + ")";
        Log.v(ME + ":sendJavascript", _d);
  
        if (gECB != null ) {
          gwebView.sendJavascript( _d );
        }
  }
  </code></pre>
  
  <p><strong>LogCat gives the following 'failed' message:</strong></p>
  
  <pre><code>03-24 17:05:21.844: V/GCMPlugin:sendJavascript(31782): javascript:onNotificationGCM({"regid":"APA91bHX...31ASD","event":"registered"})
  
  03-24 17:05:22.834: D/CordovaLog(31782): processMessage failed: Message: Jjavascript:onNotificationGCM({"regid":"APA91bHX...31ASD","event":"registered"})
  </code></pre>
  
  <p>The capital <strong>J</strong> in front of the message is strange and maybe that is what causes the problem, but it seems to be happening somewhere in the Cordova 2.5.0 code.</p>
  
  <p>Does anyone have any idea how I can solve this?</p>