Capacitor plugin to open files
npm install @whiteguru/capacitor-plugin-file-opener
npx cap sync
npm install @whiteguru/capacitor-plugin-file-opener@^5.0.0
npx cap sync
npm install @whiteguru/capacitor-plugin-file-opener@^4.0.0
npx cap sync
npm install @whiteguru/[email protected]
npx cap sync
Add or update next lines inside <manifest>
tag on your AndroidManifest.xml
<manifest>
<!-- Rest of manifest -->
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<!-- If you don't know the MIME type in advance, set "mimeType" to "*/*". -->
<data android:mimeType="application/pdf" />
</intent>
</queries>
</manifest>
open(options: FileOpenerOptions) => Promise<void>
Param | Type |
---|---|
options |
FileOpenerOptions |
Prop | Type | Description |
---|---|---|
path |
string |
Path to file |
mime |
string |
Mime to select (optional, android only) |