PhoneGap and Ratchet

984 views
Skip to first unread message

Ryan Stewart

unread,
Nov 7, 2012, 3:55:50 AM11/7/12
to gora...@googlegroups.com
I spent a little bit of time getting Ratchet to work with PhoneGap. In the end it was an easy fix:

In the xhr.onreadystatechange event, Ratchet checks to make sure that xhr.status == 200. PhoneGap  returns a status of 0 (I'm assuming this is because PhoneGap is working off of the file system on the device). By adding xhr.status == 200 || xhr.status == 0 I was able to get the demo app working with PhoneGap flawlessly.

I'm guessing this was a specific design decision but wanted to ask here about the ramifications of adding support for status 0 to the project so PhoneGap would work out of the box. 

=Ryan

Ryan Stewart

unread,
Nov 7, 2012, 4:03:33 AM11/7/12
to gora...@googlegroups.com
As I've been researching this more it seems like sending status 0 has to do with cross-domain issues. So would adding xhr.status == 0 open Ratchet up to cross-domain problems?

=Ryan

Matthew Ferry

unread,
Nov 8, 2012, 1:07:39 AM11/8/12
to gora...@googlegroups.com
The same goes for running Trigger.io builds.  Added xhr.status == 0 and the demo runs smoothly.

Matteo Annibali

unread,
Jan 9, 2013, 8:57:45 AM1/9/13
to gora...@googlegroups.com
Hi,
I'm using ratchet with phoneGap (Cordova) and it's great but in ios simulator the push event change page listener stop working...what's the problem?

thank you!

Brackston Mayhall

unread,
Apr 9, 2013, 11:33:46 PM4/9/13
to gora...@googlegroups.com
I just loaded up the demo project and the touch response seems a little buggy to me. I take it this wasnt your same problem considering your fix resolved cross domain issues...but did you encounter any touch response issues. Im on Ipad 2

Brackston Mayhall

unread,
Apr 14, 2013, 2:55:40 PM4/14/13
to gora...@googlegroups.com
Ah actually this solved my problem...i looked at your github project fix for ratcher.js


On Wednesday, November 7, 2012 2:55:51 AM UTC-6, Ryan Stewart wrote:
Reply all
Reply to author
Forward
0 new messages