   /// Called by Cordova before page reload
   override public func onReset() {
     super.onReset()
-    
+
     // Clear existing callbacks
     newVersionDownloadedCallbackId = nil
     downloadFailureCallbackId = nil

  }

  private func notifyNewVersionDownloaded(version: String?) {
    let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAsString: version)
    commandDelegate?.sendPluginResult(result, callbackId: newVersionDownloadedCallbackId)
  }



  private func notifyDownloadFailure(error: ErrorType) {
    NSLog("Failure: \(error)")
    
    guard let downloadFailureCallbackId = downloadFailureCallbackId else { return }

    let errorMessage = String(error)
    let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAsString: errorMessage)
    // This allows us to invoke the callback later
    result.setKeepCallbackAsBool(true)
    commandDelegate?.sendPluginResult(result, callbackId: downloadFailureCallbackId)
  }

