{"id":21967134,"url":"https://github.com/presttec/vsms-native","last_synced_at":"2026-04-17T01:31:32.277Z","repository":{"id":32586047,"uuid":"137632639","full_name":"presttec/vsms-native","owner":"presttec","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-25T14:36:34.000Z","size":8016,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T22:12:55.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/presttec.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}},"created_at":"2018-06-17T05:59:44.000Z","updated_at":"2019-06-29T12:35:50.000Z","dependencies_parsed_at":"2022-08-24T20:30:46.432Z","dependency_job_id":null,"html_url":"https://github.com/presttec/vsms-native","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/presttec/vsms-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presttec%2Fvsms-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presttec%2Fvsms-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presttec%2Fvsms-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presttec%2Fvsms-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/presttec","download_url":"https://codeload.github.com/presttec/vsms-native/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presttec%2Fvsms-native/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31911437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-29T13:21:44.732Z","updated_at":"2026-04-17T01:31:32.246Z","avatar_url":"https://github.com/presttec.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Circle CI](https://circleci.com/gh/ionic-team/ionic-native.svg?style=shield)](https://circleci.com/gh/ionic-team/ionic-native) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@ionic-native/core.svg)\n\n# Ionic Native\n\nIonic Native 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\nIonic Native 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\n## Installation\n\nRun following command to install Ionic Native in your project.\n\n```bash\nnpm install @ionic-native/core --save\n```\n\nYou also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.\n\n## Documentation\n\nFor the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).\n\n### Basic Usage\n\n#### Ionic/Angular apps\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 '@ionic-native/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 '@ionic-native/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#### ES2015+/TypeScript\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```js\nimport { Camera } from '@ionic-native/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\nIonic Native generates an AngularJS module in runtime and prepares a service for each plugin. To use the plugins in your AngularJS app:\n1. Download the latest bundle from the [Github releases](https://github.com/ionic-team/ionic-native/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'])\n  .controller('MyPageController', function($cordovaCamera) {\n    $cordovaCamera.getPicture()\n      .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\nTo use Ionic Native in any other setup:\n1. Download the latest bundle from the [Github releases](https://github.com/ionic-team/ionic-native/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()\n    .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\n### Mocking and Browser Development (Ionic/Angular apps only)\n\nIonic Native 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 '@ionic-native/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 '@ionic-native/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? Ionic Native 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/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:\n\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%2Fpresttec%2Fvsms-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpresttec%2Fvsms-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresttec%2Fvsms-native/lists"}