# phonegap-sharedimage

> This Cordova/PhoneGap plugin will allow your app to receive shared Android image intents easily.

Latest version **1.0.10** (published 2016-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install phonegap-sharedimage
pnpm add phonegap-sharedimage
yarn add phonegap-sharedimage
bun add phonegap-sharedimage
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2016-02-05 |
| First published | 2016-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leonard Lin |
| Maintainers | lhl |
| Keywords | cordova, ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/phonegap-sharedimage
- Repository: https://github.com/Lensley/phonegap-sharedimage
- Homepage: https://github.com/Lensley/phonegap-sharedimage#readme
- Issues: https://github.com/Lensley/phonegap-sharedimage/issues
- npm.io page: https://npm.io/package/phonegap-sharedimage

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2016-02-05

## README

# PhoneGap Shared Image Plugin
By Leonard Lin

This Cordova/PhoneGap plugin will allow your app to receive shared Android image intents easily.

## Requirements
* v1.1.0 of this plugin has been tested to work w/ [Cordova](https://cordova.apache.org/) 6.0.0 
* [v1.0](https://github.com/Lensley/phonegap-sharedimage/tree/1.0) of this plugin has been tested to work w/ [PhoneGap](http://phonegap.com/download) 2.1.0

## Installing the Plugin

Install via cordova (or plugman):

    cordova plugin add phonegap-sharedimage


## Usage

First you'll need to install the appropriate Intent in your `AndroidManifest.xml`:

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


Then in your PhoneGap app, add a Handler (put this in your `deviceready` callback):

    sharedimage.shared(function(e) {
      // the media uri - e.img is the only attribute
      console.log("IMAGE: " + e.img);

      // actual file name
      window.resolveLocalFileSystemURI(e.img, function(imgfile) {
        console.log("FILENAME: " + imgfile.name);
      });
    });

That's about it.

## Mentions

The skeleton of the code was originally pulled from [phonegap-nfc](https://github.com/chariotsolutions/phonegap-nfc). I wrote this because [WebIntent](https://github.com/phonegap/phonegap-plugins/tree/master/Android/WebIntent) was bugging out in conjunction with phonegap-nfc. 

npm packaging/Cordova plugin updates and contributions by @ntheile.

## License
The MIT License

Copyright (c) 2012 Leonard Lin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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