capawesome-team / capacitor-file-opener

⚡️ Capacitor plugin to open a file with the default application.

Home Page:https://capawesome.io/plugins/file-opener/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ 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.

About

⚡️ Capacitor plugin to open a file with the default application.

https://capawesome.io/plugins/file-opener/

License:MIT License


Languages

Language:Swift 36.3%Language:Java 36.3%Language:TypeScript 10.1%Language:Ruby 7.9%Language:Objective-C 5.5%Language:JavaScript 3.9%