code: function fire(event, data) {
    var channel = require('cordova/channel');
    var cordova = require('cordova');
    var payload = {};
  
    channel.onCordovaReady.subscribe(function() {
      var prop = (event === 'error') ? event : 'data';
      payload[prop] = data;
      cordova.fireDocumentEvent(event, payload);
    });
  }
docs: fire
  
  @param {String} event Event name
  @param {String} data Success or error data
  @returns {void}