Debugging Ionic using the Ripple Emulator

I assume you have already ripple up and running. Ripple is able emulate some of the Cordova’s core plugins but not everything.

If you’re developing with the Ionic framework then you’re surely adding the keyboard plugin to your project: this makes Ripple to break and display the annoying popup “I haz CheezBurger ??”.

You can fix this by adding some mock functions to ripple as explained below.

Detecting Ripple

To detect Ripple just put this line of code in one of your top-level javascript file:

window.has_ripple = true && window.parent && window.parent.ripple;

Making Ionic’s Keyboard Plugin Work

If windows.has_ripple is true then grab the Ripple’s bridge object and add mock functions for the Keyboard object.

    var bridge = window.parent.ripple('platform/cordova/2.0.0/bridge');
    bridge.add( 'Keyboard',  {
        init: function (){},
        close: function (){},
        hideKeyboardAccessoryBar: function (){ console.log('hideKeyboardAccessoryBar'); }

This solve the problem.

You can apply the same concept to other plugins that breaks under Ripple.

Debugging Ionic using the Ripple Emulator, 5.0 out of 5 based on 1 rating
GD Star Rating