{"id":14385095,"url":"https://github.com/axemclion/react-native-cordova-plugin","last_synced_at":"2025-08-23T18:31:37.359Z","repository":{"id":57336258,"uuid":"43692236","full_name":"axemclion/react-native-cordova-plugin","owner":"axemclion","description":"Cordova Plugin Adapter for React Native","archived":true,"fork":false,"pushed_at":"2017-07-09T15:58:57.000Z","size":515,"stargazers_count":440,"open_issues_count":12,"forks_count":35,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-12-21T13:34:52.002Z","etag":null,"topics":["cordova-plugin","react-native"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axemclion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T15:14:50.000Z","updated_at":"2023-09-26T12:19:15.000Z","dependencies_parsed_at":"2022-09-11T12:21:03.757Z","dependency_job_id":null,"html_url":"https://github.com/axemclion/react-native-cordova-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axemclion/react-native-cordova-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axemclion%2Freact-native-cordova-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axemclion%2Freact-native-cordova-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axemclion%2Freact-native-cordova-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axemclion%2Freact-native-cordova-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axemclion","download_url":"https://codeload.github.com/axemclion/react-native-cordova-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axemclion%2Freact-native-cordova-plugin/sbom","scorecard":{"id":219976,"data":{"date":"2025-08-11","repo":{"name":"github.com/axemclion/react-native-cordova-plugin","commit":"a794a93a2702759863795dd4636bddc703dad678"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: ISC License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T02:16:37.144Z","repository_id":57336258,"created_at":"2025-08-17T02:16:37.144Z","updated_at":"2025-08-17T02:16:37.144Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271762969,"owners_count":24816843,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cordova-plugin","react-native"],"created_at":"2024-08-28T18:01:56.890Z","updated_at":"2025-08-23T18:31:37.097Z","avatar_url":"https://github.com/axemclion.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"​\n# React-Native Cordova Plugin Adapter\n\nA way to use Cordova plugins in React-Native Applications\n\n## Why?\n\nThe [Cordova plugin ecosystem](http://plugins.cordova.io) is diverse and rich. Many native device capabilities are already available as a plugin with a W3C like Javascript API in most cases.\nUsing them to access native capabilities from React Native can be done using Cordova plugins without having to rewrite all those plugins.\n\n## How?\n\nTo start using Cordova Plugins in your ReactNative project, follow these steps\n\n1. [Getting Started](#step-0---getting-started)\n2. Setup your ReactNative project with this `react-native-cordova-plugin` module.\n    - [For Android](#step-11-for-anrdoid)\n    - For iOS (Not yet supported)\n3. Add/Removing the required Cordova Plugin to the ReactNative project. ([link](#step-3---adding-cordova-plugin-to-reactnative-project))\n4. Use the required Cordova Plugin in your ReactNative Javascript code. ([link](#step-4---using-the-plugins))\n\nYou can also check out the [example project](https://github.com/axemclion/react-native-cordova-plugin/tree/examples) in the `example` branch of this repository.\n\n\n### Step 0 - Getting Started\n\nFirst, Install this native module in your ReactNative project by running the following at the root of your ReactNative Project.\n\n```\nnpm install react-native-cordova-plugin --save\n```\n\n### Step 1 - Setup the ReactNative project\n\nAs with all other React Native plugins, the integration experience is different for iOS and Android, so perform the next set of  setup steps depending on which platform(s) you are targetting.\n\n#### Step 1.1 For Anrdoid\n\n1. In __android/settings.gradle__ file, make the following changes\n\n```gradle\n  include ':app'\n+ include ':cordovaplugin'\n+ project(':cordovaplugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cordova-plugin/framework/android')\n```\n\n2. In __android/app/build.gradle__, look for `dependencies` section and add the following line\n\n```gradle\n...\nandroid {\n  ...\n}\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile \"com.android.support:appcompat-v7:23.0.1\"\n    compile \"com.facebook.react:react-native:+\"  // From node_modules    ...\n+   compile project(':cordovaplugin')\n}\n\n```\n\n3. In __android/app/src/main/java/com/appname/MainActivity.java__ (your main Android activity file), add a reference to __react-native-cordova-plugin__.\n```diff\n...\n+  import io.cordova.reactnative.CordovaPluginPackage;\n...\npublic class MainActivity extends ReactActivity {\n     ...\n     @Override\n     protected List\u003cReactPackage\u003e getPackages() {\n         return Arrays.\u003cReactPackage\u003easList(\n                 new MainReactPackage(),\n+                cordovaPluginPackage = new CordovaPluginPackage(this)\n         );\n     }\n+    private CordovaPluginPackage cordovaPluginPackage;\n+    @Override\n+    protected void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        cordovaPluginPackage.setSavedInstanceState(savedInstanceState);\n+    }\n+    @Override\n+    public void onActivityResult(int requestCode, int resultCode, Intent intent) {\n+        super.onActivityResult(requestCode, resultCode, intent);\n+        cordovaPluginPackage.onActivityResult(requestCode, resultCode, intent);\n+    }\n}\n\n```\n\n### Step 3 - Adding Cordova Plugin to ReactNative project\nTo install a plugin, say the `cordova-plugin-camera` and `cordova-plugin-contacts`, run the following command from the root of your ReactNative project\n\n```bash\n$ node_modules/.bin/cordova-plugin add cordova-plugin-camera cordova-plugin-contacts\n```\n\nYou can install plugins that require variables as well. Here we add the Cordova purchase plugin that handles In App Purchasing, supplying it the Billing Key of our Android application. You would replace the fake billing key (MIIBFJIEOF....) with your billing key (a very long string).\n\n```bash\n$ node_modules/.bin/cordova-plugin add cc.fovea.cordova.purchase --variable BILLING_KEY=\"MIIBFJIEOF....\"\n```\n\nThe __add__ command takes one of more Cordova plugins that can be added to the project. To remove a plugin, use\n```bash\n$ node_modules/.bin/cordova-plugin rm cordova-plugin-contacts\n```\n\n### Step 4 - Using the Plugins\nIn either __index.android.js__ or any other component, simply require this module using\n\n```javascript\nvar Cordova = require('react-native-cordova-plugin');\n```\n\nIn Cordova, all plugin methods are available on the `window` object. ReactNative does not run in a WebView and does not have a `window` object. Thus, all the methods and constants that a Cordova plugin defines are available in the `Cordova` object that was just required using the statement above.\n\n```javascript\nCordova.navigator.camera.getPicture(onSuccess, onFail, {sourceType: Cordova.Camera.PictureSourceType.SAVEDPHOTOALBUM)});\n\n// Listen to cordova-plugin-network-information plugin's events\nCordova.addEventListener('offline', onEvent);\n```\n\nThere are more examples of using the plugins in the [examples](https://github.com/axemclion/react-native-cordova-plugin/blob/examples/) branch - look for files with plugin names.\n\n## Older Versions\nTo run this plugin for older versions of ReactNative, use older versions published on npm\n\n- 0.14 to 0.17: react-native-cordova-plugin@0.0.9\n- 0.18 and above: Latest published on npm\n\nTo use CLI commands with react-native-cordova-plugin versions less than 1.0.0, replace `$ node_modules/.bin/cordova-plugin` with `$ node_modules/.bin/react-native-cordova-plugin`.\n\n## Troubleshooting\n\nSome JavaScript errors may be caused due to the way `cordova.js` is generated. You can try tto re-generate `cordova.js` using\n\n```bash\n$ node_modules/.bin/cordova-plugin repair\n```\n\nIf that does not work, try cleaning all the cordova plugins using the following, and then add the plugins again\n```bash\n$ node_modules/.bin/cordova-plugin clean\n```\n\nIf none of these work, please open an issue with a prefix __[QUESTION]__ in the title, and I could try helping you. It would help to open the issue with a reduced way to reproduce the error.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxemclion%2Freact-native-cordova-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxemclion%2Freact-native-cordova-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxemclion%2Freact-native-cordova-plugin/lists"}