code: function processMessageFromNative(msg) {
    var errorContent = null,
      dataContent = null,
      actionId = null;
  
    try {
      var resultObj = JSON.parse(msg);
      if (resultObj.hasOwnProperty('error')) {
        errorContent = resultObj.error;
      }
      if (resultObj.hasOwnProperty('data')) {
        dataContent = resultObj.data;
      }
      if (resultObj.hasOwnProperty('action')) {
        actionId = resultObj.action;
      }
    } catch (err) {}
  
    return {
      action: actionId,
      error: errorContent,
      data: dataContent
    };
  }
docs: Parse arguments that were sent from the native side.
  Arguments are a JSON string of type:
  { action: "action identifier", error: {...error data...}, data: {...some additional data..} }
  Some parameters may not exist, but the resulting object will have them all.
  
  @param {String} msg - arguments as JSON string
  @return {Object} parsed string