# capacitor-share-with-plugin

> This plugin allows you to share images and pdfs with your capacitor app

Latest version **0.1.1** (published 2022-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install capacitor-share-with-plugin
pnpm add capacitor-share-with-plugin
yarn add capacitor-share-with-plugin
bun add capacitor-share-with-plugin
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-10-06 |
| First published | 2022-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yash Solanki |
| Maintainers | solanki1709 |
| Keywords | capacitor, plugin, native |

## Links

- npm: https://www.npmjs.com/package/capacitor-share-with-plugin
- Repository: https://github.com/yksolanki9/share-with-plugin
- Homepage: https://github.com/yksolanki9/share-with-plugin#readme
- Issues: https://github.com/yksolanki9/share-with-plugin/issues
- npm.io page: https://npm.io/package/capacitor-share-with-plugin

## Recent versions

- 0.1.1 (latest) — 2022-10-06
- 0.1.0 — 2022-10-06
- 0.0.1 — 2022-09-24

## README

# capacitor-share-with-plugin

This plugin allows you to share files from the device's file explorer to any capacitor app.

## Install

```bash
npm install capacitor-share-with-plugin
npx cap sync android
```

## Initial setup

### Android

Inside `AndroidManifest.xml`, in the `activity` element, add a `intent-filter` to allow the app to receive images and pdfs from the file explorer and/or other apps.

```xml
   <intent-filter>
      <action android:name="android.intent.action.SEND" />
      <action android:name="android.intent.action.SEND_MULTIPLE" />
      <category android:name="android.intent.category.DEFAULT" />
      <data android:mimeType="image/*" />
      <data android:mimeType="application/pdf" />
    </intent-filter>
```

### IOS
**_This plugin currently supports only Android devices. Support for IOS will be added soon._**

## API

<docgen-index>

* [`addListener('FILE_SINGLE', ...)`](#addlistenerfile_single)
* [`addListener('FILE_MULTIPLE', ...)`](#addlistenerfile_multiple)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### addListener('FILE_SINGLE', ...)

```typescript
addListener(eventName: 'FILE_SINGLE', listenerFunc: (event: FileDetails) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
```

| Param              | Type                                                                    | Description                                    |
| ------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- |
| **`eventName`**    | <code>'FILE_SINGLE'</code>                                              | Name of the event to listen.                   |
| **`listenerFunc`** | <code>(event: <a href="#filedetails">FileDetails</a>) =&gt; void</code> | Callback to be executed when the event occurs. |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>

--------------------


### addListener('FILE_MULTIPLE', ...)

```typescript
addListener(eventName: 'FILE_MULTIPLE', listenerFunc: (event: FileDetails[]) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
```

| Param              | Type                                           | Description                                    |
| ------------------ | ---------------------------------------------- | ---------------------------------------------- |
| **`eventName`**    | <code>'FILE_MULTIPLE'</code>                   | Name of the event to listen.                   |
| **`listenerFunc`** | <code>(event: FileDetails[]) =&gt; void</code> | Callback to be executed when the event occurs. |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>

--------------------


### Interfaces


#### PluginListenerHandle

| Prop         | Type                                      |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


#### FileDetails

| Prop      | Type                | Description            |
| --------- | ------------------- | ---------------------- |
| **`uri`** | <code>string</code> | URI of the file.       |
| **`ext`** | <code>string</code> | Extension of the file. |

</docgen-api>

---
_Source: https://npm.io/package/capacitor-share-with-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
