After deeper investigation I've managed to solve this problem (at least partially -- some events are fired some are not). In my case it was a missing .js
(PhoneGap source) file problem.
The key to the success was to:
Actually have PhoneGap / Cordova JS file placed in your app content and have it correctly referenced (valid path and file name) in your source files.
Have source file in correct version (2.0.0) as of writing this.
First can be especially confusing for PhoneGap Build users, which are instructed to remove source file. Reference in source file (<script type="text/javascript" src="cordova.js"></script>
) should be untouched, but file, it references, should not exits. PhoneGap Build will inject this file (in proper version) during compile / build process.
This is fine for PhoneGap, but completely wrong for Ripple. If you want Ripple to be fully functional and be able to fire events (at least certain), you should leave that file in place. I found out, that this does not interfere PhoneGap at all. Apps are builded without problems, with and without that file in place.
Second is also important. I found out, that current version of Ripple is build basing on PhoneGap API 2.0.0, which is very, very old against currently available PhoneGap API 3.0.0. So, to have Ripple working nearly without glitches, you have to [browse PhoneGap repository(http://phonegap.com/install/) and grab PhoneGap 2.0.0 sources, released 20 Jul 2012 and extract cordova.js
files out of it. Then place it in source folder of your webapp, add correct reference to it and try Ripple then.
At least some events should now be fired (some, like deviceready
) may still fail.
Also, keep in mind, that everything, including event handlers, must be defined in a deviceready
event listener code, or the whole thing will fail.
Ripple's JIRA issues, that might be related:
- Support for the last version of PhoneGap,
- Ripple Emulator under Windows doesn't fire events,
- Ripple should check, if
phonegap.js
/cordova.js
files really exists.
BTW: if you open up browser's console and manually fire an event you'll see a proper notice written to console by Ripple. Which means, that Ripple thinks, if fires an even on an emulated webapp, but it actually doesn't fire it.