Framework v4 BETA

FileOpener

This plugin will open a file on your device file system with its default application.

Repo: https://github.com/pwlin/cordova-plugin-file-opener2

Installation

  1. Install the Cordova and Ionic Native plugins:
    shell
    $ ionic cordova plugin add cordova-plugin-file-opener2
    $ npm install --save @ionic-native/[email protected]
    
  2. Add this plugin to your app's module

Supported Platforms

  • Android
  • iOS
  • Windows
  • Windows Phone 8

Usage

typescript
import { FileOpener } from '@ionic-native/file-opener/ngx';

constructor(private fileOpener: FileOpener) { }

...

this.fileOpener.open('path/to/file.pdf', 'application/pdf')
  .then(() => console.log('File is opened'))
  .catch(e => console.log('Error opening file', e));


Instance Members

appIsInstalled

Check if an app is already installed

Parameters

packageId

Type: string
Package ID


open

Open an file

Parameters

filePath

Type: string
File Path

fileMIMEType

Type: string
File MIME Type


uninstall

Uninstalls a package

Parameters

packageId

Type: string
Package ID