File Opener

Improve this doc

$ ionic plugin add cordova-plugin-file-opener2
$ npm install --save @ionic-native/file-opener

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

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

Supported platforms

Usage

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

constructor(private fileOpener: FileOpener) { }

...

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

Instance Members

open(filePath, fileMIMEType)

Open an file

Param Type Details
filePath string

File Path

fileMIMEType string

File MIME Type

Returns: Promise<any>

uninstall(packageId)

Uninstalls a package

Param Type Details
packageId string

Package ID

Returns: Promise<any>

appIsInstalled(packageId)

Check if an app is already installed

Param Type Details
packageId string

Package ID

Returns: Promise<any>

API

Native

General