Code Monkey home page Code Monkey logo

kleeb / ionic-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielsogl/awesome-cordova-plugins

0.0 2.0 0.0 5.2 MB

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support. The successor to ngCordova. Pairs exquisitely with a nice bottle of Ionic Framework.

Home Page: http://ionicframework.com/docs/v2/native/

License: Other

JavaScript 3.78% Shell 1.28% TypeScript 94.95%

ionic-native's Introduction

Circle CI Commitizen friendly npm

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 2 mobile app easy.

Installation

Run following command to install Ionic Native in your project.

npm install @ionic-native/core --save

You also need to install the Ionic Native package for each plugin you want to add. Please see the Ionic Native documentation for complete instructions on how to add and use the plugins.

Documentation

For the full Ionic Native documentation, please visit http://ionicframework.com/docs/v2/native/.

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';
import { Platform } from 'ionic-angular';

@Component({ ... })
export class MyComponent {

  constructor(private geolocation: Geolocation, private platform: Platform) {
  
    platform.ready().then(() => {
    
      // get position
      geolocation.getCurrentPosition().then(pos => {
        
        console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
        
      });
        
        
      // watch position
      const watch = geolocation.watchPosition().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.

img

Plugin Missing?

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

Credits

Ibby Hadeed - @ihadeed

Tim Lancina - @timlancina

Max Lynch - @maxlynch

Rob Wormald - @robwormald

ionic-native's People

Contributors

amuramoto avatar barryrowe avatar biesbjerg avatar cmanou avatar dudeofawesome avatar fablouis avatar glecaros avatar guillenotfound avatar ihadeed avatar imhoffd avatar ionitron avatar keithdmoore avatar kessiler avatar manduro avatar marcinwadon avatar mattlewis92 avatar mhartington avatar mlynch avatar musahaidari avatar nickgal avatar panuganti avatar perrygovier avatar ramonornela avatar rapropos avatar ritzlgrmft avatar stormwin avatar tlancina avatar tlaverdure avatar vfdev-5 avatar xueron avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.