/cordova-plugin-fileviewer2

A Cordova Plugin For Previewing Files in iOS Device with QuickLook Framework

Primary LanguageObjective-CMIT LicenseMIT

Cordova File Preview Plugin

This plugin can preview local files on your iOS device.

Supported Platforms

  • iOS

Installation

The plugin can be installed with the Cordova CLI:

cordova plugin add cordova-plugin-fileviewer2

The plugin is hosted on NPM so requires Cordova CLI 5.0.0 as a minimum. If you have any issues installing, make sure you have the most upto date version of Cordova from NPM:

npm install -g cordova

Usage

open a file

fileviewer2.open(cordova.file.documentsDirectory+'test.png',{ 
        error : function(e) { 
            console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
        },
        success : function () {
            console.log('file opened successfully'); 				
        }
    }
);

close the fileviewer2

fileviewer2.dismiss();