{"id":4205,"url":"https://github.com/sonnylazuardi/react-native-image-intent","last_synced_at":"2025-04-15T23:30:36.308Z","repository":{"id":57337606,"uuid":"94837542","full_name":"sonnylazuardi/react-native-image-intent","owner":"sonnylazuardi","description":"🔬 Image intent receiver for React Native android","archived":false,"fork":false,"pushed_at":"2017-06-21T15:16:55.000Z","size":8870,"stargazers_count":57,"open_issues_count":1,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-01T23:03:57.944Z","etag":null,"topics":["android","image-processing","javascript","react-native"],"latest_commit_sha":null,"homepage":"http://taplak.sonnylab.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonnylazuardi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-20T01:42:57.000Z","updated_at":"2023-07-19T19:36:48.000Z","dependencies_parsed_at":"2022-09-14T15:01:09.233Z","dependency_job_id":null,"html_url":"https://github.com/sonnylazuardi/react-native-image-intent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonnylazuardi%2Freact-native-image-intent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonnylazuardi%2Freact-native-image-intent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonnylazuardi%2Freact-native-image-intent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonnylazuardi%2Freact-native-image-intent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonnylazuardi","download_url":"https://codeload.github.com/sonnylazuardi/react-native-image-intent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223688702,"owners_count":17186298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","image-processing","javascript","react-native"],"created_at":"2024-01-05T20:17:04.438Z","updated_at":"2024-11-08T13:12:13.135Z","avatar_url":"https://github.com/sonnylazuardi.png","language":"Java","funding_links":[],"categories":["Components","\u003ca name=\"Image-\u0026-Audio-\u0026-Video-\u0026-Docs:-Native-Modules\"\u003eImage, Audio, Video \u0026 Docs: Native Modules\u003c/a\u003e","Others"],"sub_categories":["UI"],"readme":"react-native-image-intent\n===============\n[![npm version](https://badge.fury.io/js/react-native-image-intent.svg)](https://badge.fury.io/js/react-native-image-intent)\n\n🔬 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.\n\n![demo](https://media.giphy.com/media/3oKIPgUzGIHU5rVXdC/giphy.gif)\n\n[![download](https://lh3.googleusercontent.com/v8DXc8EpIgPZCFJSJcE8me4_-PCnAZSTSm-eq5ZtCIA=s0 \"google play\")\n](https://play.google.com/store/apps/details?id=info.mejamakan.floatingview)\n\n## Installation\n```\nnpm install --save react-native-image-intent\n```\n\n*Recommended via yarn*\n```\nyarn add react-native-image-intent\n```\n\n## Automatically link\n\n### With React Native 0.27+\n```\nreact-native link react-native-image-intent\n```\n\n### With older versions of React Native\nYou need [rnpm](https://github.com/rnpm/rnpm) (npm install -g rnpm)\n```\nrnpm link react-native-image-intent\n```\n*Hey, bro! react-native-image-intent wasn't support older version of React Native yet.*\n\n### Setting Up AndroidManifest\n*THIS IS AN IMPORTANT STEP*\n\n```diff\n\u003cactivity\n    android:name=\".MainActivity\"\n    android:label=\"@string/app_name\"\n    android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\"\n    android:windowSoftInputMode=\"adjustResize\"\u003e\n+   \u003cintent-filter\u003e\n+       \u003caction android:name=\"android.intent.action.SEND\" /\u003e\n+       \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n+       \u003cdata android:mimeType=\"image/*\" /\u003e\n+   \u003c/intent-filter\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n        \u003ccategory android:name=\"android.intent.category.LAUNCHER\" /\u003e\n    \u003c/intent-filter\u003e\n...\n```\n\n\n## Manually link\n\n### Android\n\n- in `android/app/build.gradle`:\n\n```diff\ndependencies {\n    ...\n    compile \"com.facebook.react:react-native:+\"  // From node_modules\n+   compile project(':react-native-image-intent')\n}\n```\n\n- in `android/settings.gradle`:\n\n```diff\n...\ninclude ':app'\n+ include ':react-native-image-intent'\n+ project(':react-native-image-intent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-intent/android')\n```\n\n#### With React Native 0.29+\n\n- in `MainApplication.java`:\n\n```diff\n+ import com.sonnylab.imageintent.ImageIntentPackage;\n\n  public class MainApplication extends Application implements ReactApplication {\n    //......\n\n    @Override\n    protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.\u003cReactPackage\u003easList(\n+         new ImageIntentPackage(),\n          new MainReactPackage()\n      );\n    }\n\n    ......\n  }\n```\n\n#### With older versions of React Native:\n\n- in `MainActivity.java`:\n\n```diff\n+ import com.sonnylab.imageintent.ImageIntentPackage;\n\n  public class MainActivity extends ReactActivity {\n    ......\n\n    @Override\n    protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.\u003cReactPackage\u003easList(\n+       new ImageIntentPackage(),\n        new MainReactPackage()\n      );\n    }\n  }\n```\n\n## Usage\n\n### Base64\n\n```javascript\n// ES5\nvar ImageIntent = require('react-native-image-intent');\n// or ES6\n// import ImageIntent from 'react-native-image-intent';\n\nImageIntent.getImageIntentBase64().then((imageBase64) =\u003e {\n  console.log('BASE64', imageBase64);\n}).catch(e =\u003e console.log(e));\n\n\u003cImage style={{width: 100, height: 100}} source={{uri: `data:image/png;base64,${imageBase64}`}} /\u003e\n```\n\n### Image URL\n\n```javascript\n// ES5\nvar ImageIntent = require('react-native-image-intent');\n// or ES6\n// import ImageIntent from 'react-native-image-intent';\n\nImageIntent.getImageIntentUrl().then((imageUrl) =\u003e {\n  console.log('IMAGE_URL', imageUrl);\n}).catch(e =\u003e console.log(e));\n\n\u003cImage style={{width: 100, height: 100}} source={{uri: `file://${imageUrl}`}} /\u003e\n```\n\n## License\nCopyright (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).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonnylazuardi%2Freact-native-image-intent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonnylazuardi%2Freact-native-image-intent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonnylazuardi%2Freact-native-image-intent/lists"}