Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonnylazuardi/react-native-image-intent
🔬 Image intent receiver for React Native android
https://github.com/sonnylazuardi/react-native-image-intent
android image-processing javascript react-native
Last synced: 2 months ago
JSON representation
🔬 Image intent receiver for React Native android
- Host: GitHub
- URL: https://github.com/sonnylazuardi/react-native-image-intent
- Owner: sonnylazuardi
- License: mit
- Created: 2017-06-20T01:42:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-21T15:16:55.000Z (over 7 years ago)
- Last Synced: 2024-11-01T23:03:57.944Z (2 months ago)
- Topics: android, image-processing, javascript, react-native
- Language: Java
- Homepage: http://taplak.sonnylab.com
- Size: 8.46 MB
- Stars: 57
- Watchers: 6
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-image-intent ★47 - Image intent receiver for React Native android (Components / UI)
- awesome-react-native-native-modules - react-native-image-intent ★41
- awesome-reactnative-ui - react-native-image-intent
- awesome-react-native - react-native-image-intent ★47 - Image intent receiver for React Native android (Components / UI)
- awesome-reactnative-ui - react-native-image-intent
- awesome-react-native - react-native-image-intent ★47 - Image intent receiver for React Native android (Components / UI)
- awesome-react-native - react-native-image-intent ★47 - Image intent receiver for React Native android (Components / UI)
README
react-native-image-intent
===============
[![npm version](https://badge.fury.io/js/react-native-image-intent.svg)](https://badge.fury.io/js/react-native-image-intent)🔬 Image intent receiver for React Native android. This allows react native app to receive data (image) from other app https://developer.android.com/training/sharing/receive.html.
![demo](https://media.giphy.com/media/3oKIPgUzGIHU5rVXdC/giphy.gif)
[![download](https://lh3.googleusercontent.com/v8DXc8EpIgPZCFJSJcE8me4_-PCnAZSTSm-eq5ZtCIA=s0 "google play")
](https://play.google.com/store/apps/details?id=info.mejamakan.floatingview)## Installation
```
npm install --save react-native-image-intent
```*Recommended via yarn*
```
yarn add react-native-image-intent
```## Automatically link
### With React Native 0.27+
```
react-native link react-native-image-intent
```### With older versions of React Native
You need [rnpm](https://github.com/rnpm/rnpm) (npm install -g rnpm)
```
rnpm link react-native-image-intent
```
*Hey, bro! react-native-image-intent wasn't support older version of React Native yet.*### Setting Up AndroidManifest
*THIS IS AN IMPORTANT STEP*```diff
+
+
+
+
+
...
```## Manually link
### Android
- in `android/app/build.gradle`:
```diff
dependencies {
...
compile "com.facebook.react:react-native:+" // From node_modules
+ compile project(':react-native-image-intent')
}
```- in `android/settings.gradle`:
```diff
...
include ':app'
+ include ':react-native-image-intent'
+ project(':react-native-image-intent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-intent/android')
```#### With React Native 0.29+
- in `MainApplication.java`:
```diff
+ import com.sonnylab.imageintent.ImageIntentPackage;public class MainApplication extends Application implements ReactApplication {
//......@Override
protected List getPackages() {
return Arrays.asList(
+ new ImageIntentPackage(),
new MainReactPackage()
);
}......
}
```#### With older versions of React Native:
- in `MainActivity.java`:
```diff
+ import com.sonnylab.imageintent.ImageIntentPackage;public class MainActivity extends ReactActivity {
......@Override
protected List getPackages() {
return Arrays.asList(
+ new ImageIntentPackage(),
new MainReactPackage()
);
}
}
```## Usage
### Base64
```javascript
// ES5
var ImageIntent = require('react-native-image-intent');
// or ES6
// import ImageIntent from 'react-native-image-intent';ImageIntent.getImageIntentBase64().then((imageBase64) => {
console.log('BASE64', imageBase64);
}).catch(e => console.log(e));```
### Image URL
```javascript
// ES5
var ImageIntent = require('react-native-image-intent');
// or ES6
// import ImageIntent from 'react-native-image-intent';ImageIntent.getImageIntentUrl().then((imageUrl) => {
console.log('IMAGE_URL', imageUrl);
}).catch(e => console.log(e));```
## License
Copyright (c) [sonnylazuardi](https://github.com/sonnylazuardi). This software is licensed under the [MIT License](https://github.com/sonnylazuardi/react-native-image-intent/blob/master/LICENSE).