Tim Lancina db07768133 fix(plugin): handle rejection when Cordova is undefined
Zone.js now (helpfully) throws an error on unhandled rejections in
promises. This is great because they no longer silently fail, but we
were relying on that behavior for the case where the plugin isn't
installed or Cordova isn't available. With this change, those cases
won't throw an unhandled rejection error, but all regular plugin errors
still should.
2016-04-27 13:00:59 -05:00
2016-02-02 15:35:45 +01:00
2015-12-01 13:33:08 -06:00
2015-12-01 13:33:08 -06:00
2016-02-05 15:05:46 -06:00
2016-03-04 12:24:00 -06:00
2015-12-01 13:33:08 -06:00
2016-03-17 16:29:00 -04:00
2016-02-18 11:55:47 -06:00
2016-03-10 19:33:43 -06:00
2016-04-08 16:53:41 -05:00
2016-03-15 14:12:21 -05:00
2016-03-10 15:51:27 -06:00

Circle CI Commitizen friendly npm

NPM

Ionic Native

Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your Ionic, Cordova, or Web View mobile app easy.

Promises and Observables

Ionic Native wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.

import {Geolocation} from 'ionic-native';

Geolocation.getCurrentPosition().then(pos => { 
  console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
});

let watch = Geolocation.watchPosition();
watch.subscribe(pos => {
  console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
});

// to stop watching
watch.unsubscribe();

Runtime Diagnostics

Spent 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.

Installation

Run following commmand to install ionic-native in your project.

npm install ionic-native --save

Plugin Missing?

Let us know or submit a PR! Take a look at the Developer Guide for more on how to contribute. ❤️

Credits

Ibrahim Hadeed - @ihadeed

Tim Lancina - @timlancina

Max Lynch - @maxlynch

Rob Wormald - @robwormald

Description
No description provided
Readme MIT 324 MiB
Languages
TypeScript 98.8%
JavaScript 0.8%
HTML 0.4%