{"id":13433415,"url":"https://github.com/danielsogl/awesome-cordova-plugins","last_synced_at":"2026-04-15T07:02:11.177Z","repository":{"id":37046558,"uuid":"46805578","full_name":"danielsogl/awesome-cordova-plugins","owner":"danielsogl","description":"Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support. ","archived":false,"fork":false,"pushed_at":"2025-04-14T03:00:08.000Z","size":38258,"stargazers_count":2426,"open_issues_count":12,"forks_count":2426,"subscribers_count":104,"default_branch":"master","last_synced_at":"2025-04-22T11:42:28.546Z","etag":null,"topics":["angular","cordova","cordova-plugin","ionic","ionic-framework"],"latest_commit_sha":null,"homepage":"https://danielsogl.gitbook.io/awesome-cordova-plugins/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielsogl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-11-24T16:54:58.000Z","updated_at":"2025-04-16T10:53:05.000Z","dependencies_parsed_at":"2024-01-13T07:18:59.504Z","dependency_job_id":"e80adb31-0a83-4577-8883-2e571b47ece9","html_url":"https://github.com/danielsogl/awesome-cordova-plugins","commit_stats":{"total_commits":4272,"total_committers":780,"mean_commits":5.476923076923077,"dds":0.7731741573033708,"last_synced_commit":"740268a75bc45f6f2b8dd080770629bb4cd5a772"},"previous_names":["ionic-team/ionic-native","driftyco/ionic-native","driftyco/cordova-wrap"],"tags_count":234,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsogl%2Fawesome-cordova-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsogl%2Fawesome-cordova-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsogl%2Fawesome-cordova-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsogl%2Fawesome-cordova-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielsogl","download_url":"https://codeload.github.com/danielsogl/awesome-cordova-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360249,"owners_count":21417717,"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":["angular","cordova","cordova-plugin","ionic","ionic-framework"],"created_at":"2024-07-31T02:01:25.477Z","updated_at":"2026-04-15T07:02:05.940Z","avatar_url":"https://github.com/danielsogl.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Third Party Components","Links"],"sub_categories":["UI Library and Framework Ionic","Push notification listeners"],"readme":"[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@awesome-cordova-plugins/core.svg)\n\n# Awesome Cordova Plugins\n\nAwesome Cordova Plugins is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](https://ionicframework.com/) mobile app easy.\n\nAwesome Cordova Plugins wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and making it easy to use plugins with Angular change detection.\n\nTo learn more about the reasons why Ionic Native was renamed to Awesome Cordova Plugins, read the official [Ionic blog](https://ionicframework.com/blog/a-new-chapter-for-ionic-native/) post by Max Lyncht.\n\n## Capacitor Support\n\nIn addition to Cordova, Awesome Cordova Plugins also works with [Capacitor](https://capacitorjs.com), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitorjs.com/docs/v2/cordova/using-cordova-plugins).\n\n## Installation\n\nRun following command to install Awesome Cordova Plugins in your project.\n\n```bash\nnpm install @awesome-cordova-plugins/core --save\n```\n\nYou also need to install the Awesome Cordova Plugins package for each plugin you want to add. Please see the [Awesome Cordova Plugins documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.\n\n## Documentation\n\nFor the full Awesome Cordova Plugins documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).\n\n### Basic Usage\n\n#### Ionic/Angular apps\n\nTo use a plugin, import and add the plugin provider to your `@NgModule`, and then inject it where you wish to use it.\nMake sure to import the injectable class from the `/ngx` directory as shown in the following examples:\n\n```typescript\n// app.module.ts\nimport { Camera } from '@awesome-cordova-plugins/camera/ngx';\n\n...\n\n@NgModule({\n  ...\n\n  providers: [\n    ...\n    Camera\n    ...\n  ]\n  ...\n})\nexport class AppModule { }\n```\n\n```typescript\nimport { Geolocation } from '@awesome-cordova-plugins/geolocation/ngx';\nimport { Platform } from 'ionic-angular';\n\n@Component({ ... })\nexport class MyComponent {\n\n  constructor(private geolocation: Geolocation, private platform: Platform) {\n\n    this.platform.ready().then(() =\u003e {\n\n      // get position\n      this.geolocation.getCurrentPosition().then(pos =\u003e {\n        console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)\n      });\n\n\n      // watch position\n      const watch = geolocation.watchPosition().subscribe(pos =\u003e {\n        console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)\n      });\n\n      // to stop watching\n      watch.unsubscribe();\n    });\n\n  }\n\n}\n```\n\n#### Ionic/React apps\n\nReact apps must use Capacitor to build native mobile apps. However, Awesome Cordova Plugins (and therefore, Cordova plugins) can still be used.\n\n```bash\n# Install Core library (once per project)\nnpm install @awesome-cordova-plugins/core\n\n# Install Awesome Cordova Plugins TypeScript wrapper\nnpm install @awesome-cordova-plugins/barcode-scanner\n\n# Install Cordova plugin\nnpm install phonegap-plugin-barcodescanner\n\n# Update native platform project(s) to include newly added plugin\nionic cap sync\n```\n\nImport the plugin object then use its static methods:\n\n```typescript\nimport { BarcodeScanner } from '@awesome-cordova-plugins/barcode-scanner';\n\nconst Tab1: React.FC = () =\u003e {\n  const openScanner = async () =\u003e {\n    const data = await BarcodeScanner.scan();\n    console.log(`Barcode data: ${data.text}`);\n  };\n  return (\n    \u003cIonPage\u003e\n      \u003cIonHeader\u003e\n        \u003cIonToolbar\u003e\n          \u003cIonTitle\u003eTab 1\u003c/IonTitle\u003e\n        \u003c/IonToolbar\u003e\n      \u003c/IonHeader\u003e\n      \u003cIonContent\u003e\n        \u003cIonButton onClick={openScanner}\u003eScan barcode\u003c/IonButton\u003e\n      \u003c/IonContent\u003e\n    \u003c/IonPage\u003e\n  );\n};\n```\n\n#### ES2015+/TypeScript\n\nThese modules can work in any ES2015+/TypeScript app (including Angular/Ionic apps). To use any plugin, import the class from the appropriate package, and use it's static methods.\n\n```js\nimport { Camera } from '@awesome-cordova-plugins/camera';\n\ndocument.addEventListener('deviceready', () =\u003e {\n  Camera.getPicture()\n    .then((data) =\u003e console.log('Took a picture!', data))\n    .catch((e) =\u003e console.log('Error occurred while taking a picture', e));\n});\n```\n\n#### AngularJS\n\nAwesome Cordova Plugins generates an AngularJS module in runtime and prepares a service for each plugin. To use the plugins in your AngularJS app:\n\n1. Download the latest bundle from the [Github releases](https://github.com/danielsogl/awesome-cordova-plugins/releases) page.\n2. Include it in `index.html` before your app's code.\n3. Inject `ionic.native` module in your app.\n4. Inject any plugin you would like to use with a `$cordova` prefix.\n\n```js\nangular.module('myApp', ['ionic.native']).controller('MyPageController', function ($cordovaCamera) {\n  $cordovaCamera.getPicture().then(\n    function (data) {\n      console.log('Took a picture!', data);\n    },\n    function (err) {\n      console.log('Error occurred while taking a picture', err);\n    }\n  );\n});\n```\n\n#### Vanilla JS\n\nTo use Awesome Cordova Plugins in any other setup:\n\n1. Download the latest bundle from the [Github releases](https://github.com/danielsogl/awesome-cordova-plugins/releases) page.\n2. Include it in `index.html` before your app's code.\n3. Access any plugin using the global `IonicNative` variable.\n\n```js\ndocument.addEventListener('deviceready', function () {\n  IonicNative.Camera.getPicture().then(\n    function (data) {\n      console.log('Took a picture!', data);\n    },\n    function (err) {\n      console.log('Error occurred while taking a picture', err);\n    }\n  );\n});\n```\n\n### Mocking and Browser Development (Ionic/Angular apps only)\n\nAwesome Cordova Plugins makes it possible to mock plugins and develop nearly the entirety of your app in the browser or in `ionic serve`.\n\nTo do this, you need to provide a mock implementation of the plugins you wish to use. Here's an example of mocking the `Camera` plugin to return a stock image while in development:\n\nFirst import the `Camera` class in your `src/app/app.module.ts` file:\n\n```typescript\nimport { Camera } from '@awesome-cordova-plugins/camera/ngx';\n```\n\nThen create a new class that extends the `Camera` class with a mock implementation:\n\n```typescript\nclass CameraMock extends Camera {\n  getPicture(options) {\n    return new Promise((resolve, reject) =\u003e {\n      resolve('BASE_64_ENCODED_DATA_GOES_HERE');\n    });\n  }\n}\n```\n\nFinally, override the previous `Camera` class in your `providers` for this module:\n\n```typescript\nproviders: [{ provide: Camera, useClass: CameraMock }];\n```\n\nHere's the full example:\n\n```typescript\nimport { ErrorHandler, NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';\nimport { MyApp } from './app.component';\nimport { HomePage } from '../pages/home/home';\n\nimport { Camera } from '@awesome-cordova-plugins/camera/ngx';\n\nimport { HomePage } from '../pages/home/home';\nimport { MyApp } from './app.component';\n\nclass CameraMock extends Camera {\n  getPicture(options) {\n    return new Promise((resolve, reject) =\u003e {\n      resolve('BASE_64_ENCODED_DATA_GOES_HERE');\n    });\n  }\n}\n\n@NgModule({\n  declarations: [MyApp, HomePage],\n  imports: [BrowserModule, IonicModule.forRoot(MyApp)],\n  bootstrap: [IonicApp],\n  entryComponents: [MyApp, HomePage],\n  providers: [\n    { provide: ErrorHandler, useClass: IonicErrorHandler },\n    { provide: Camera, useClass: CameraMock },\n  ],\n})\nexport class AppModule {}\n```\n\n### Runtime Diagnostics\n\nSpent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Awesome Cordova Plugins lets you know what the issue is and how you can resolve it.\n\n![img](https://ionic-io-assets.s3.amazonaws.com/ionic-native-console.png)\n\n## Plugin Missing?\n\nLet us know or submit a PR! Take a look at [the Developer Guide](https://github.com/danielsogl/awesome-cordova-plugins/blob/master/DEVELOPER.md) for more on how to contribute. :heart:\n\n# Credits\n\nIbby Hadeed - [@ihadeed](https://github.com/ihadeed)\n\nDaniel Sogl - [@sogldaniel](https://twitter.com/sogldaniel)\n\nTim Lancina - [@timlancina](https://twitter.com/timlancina)\n\nMike Hartington - [@mhartington](https://twitter.com/mhartington)\n\nMax Lynch - [@maxlynch](https://twitter.com/maxlynch)\n\nRob Wormald - [@robwormald](https://twitter.com/robwormald)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsogl%2Fawesome-cordova-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielsogl%2Fawesome-cordova-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsogl%2Fawesome-cordova-plugins/lists"}