Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Latest commit

 

History

History
114 lines (74 loc) · 4.46 KB

README.md

File metadata and controls

114 lines (74 loc) · 4.46 KB

⚠️ Deprecated repository

This project has been moved to the following monorepo: capawesome-team/capacitor-plugins.



File Opener

@capawesome-team/capacitor-file-opener

Capacitor plugin to open a file with the default application.


Maintainers

Maintainer GitHub Social
Robin Genz robingenz @robin_genz

Demo

A working example can be found here: robingenz/capacitor-plugin-demo

Android iOS

Installation

If you are an Insider, see Getting started with Insiders and follow the instructions to install the plugin.

If you are not an Insider, please install the package from the public npm registry:

npm install @capawesome-team/capacitor-file-opener
npx cap sync

Configuration

No configuration required for this plugin.

Usage

import { FileOpener } from '@capawesome-team/capacitor-file-opener';

const open = async () => {
  await FileOpener.openFile({
    path: 'file:///var/mobile/Containers/Data/Application/22A433FD-D82D-4989-8BE6-9FC49DEA20BB/Images/test.png'
  });
};

API

openFile(...)

openFile(options: OpenFileOptions) => Promise<void>

Open a file with the default application.

Only available on Android and iOS.

Param Type
options OpenFileOptions

Since: 0.0.1


Interfaces

OpenFileOptions

Prop Type Description Since
path string The path of the file. 0.0.1
mimeType string The mime type of the file. If not specified, the mime type will be determined. 0.0.1

Changelog

See CHANGELOG.md.

License

See LICENSE.