diff --git a/README.md b/README.md index 2950a2bdc..2ba89149f 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,30 @@ -[![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) +[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@cordova-awesome-plugins/core.svg) -# Ionic Native +# Cordova Awesome Plugins -Ionic 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. +Cordova Awesome 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. -Ionic 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. +Cordova Awesome 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. -Ionic Native is available in two versions: -1. Ionic Native [Community Edition](https://ionicframework.com/docs/native/community), featuring open source, community-maintained Cordova and Capacitor plugins and APIs. -2. Ionic Native [Enterprise Edition](https://ionicframework.com/docs/enterprise), featuring a library of Premier plugins and solutions that are fully supported and maintained by the Ionic team, with access to Ionic experts and a guaranteed response SLA to mission-critical app development. +To 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. ## Capacitor Support -In addition to Cordova, Ionic Native also works with [Capacitor](https://capacitor.ionicframework.com), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins). +In addition to Cordova, Cordova Awesome Plugins also works with [Capacitor](https://capacitor.ionicframework.com), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins). ## Installation -Run following command to install Ionic Native in your project. +Run following command to install Cordova Awesome Plugins in your project. ```bash -npm install @ionic-native/core --save +npm install @cordova-awesome-plugins/core --save ``` -You 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. +You also need to install the Cordova Awesome Plugins package for each plugin you want to add. Please see the [Cordova Awesome Plugins documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins. ## Documentation -For the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/). +For the full Cordova Awesome Plugins documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/). ### Basic Usage @@ -37,7 +35,7 @@ Make sure to import the injectable class from the `/ngx` directory as shown in t ```typescript // app.module.ts -import { Camera } from '@ionic-native/camera/ngx'; +import { Camera } from '@cordova-awesome-plugins/camera/ngx'; ... @@ -55,7 +53,7 @@ export class AppModule { } ``` ```typescript -import { Geolocation } from '@ionic-native/geolocation/ngx'; +import { Geolocation } from '@cordova-awesome-plugins/geolocation/ngx'; import { Platform } from 'ionic-angular'; @Component({ ... }) @@ -87,14 +85,14 @@ export class MyComponent { #### Ionic/React apps -React apps must use Capacitor to build native mobile apps. However, Ionic Native (and therefore, Cordova plugins) can still be used. +React apps must use Capacitor to build native mobile apps. However, Cordova Awesome Plugins (and therefore, Cordova plugins) can still be used. ```bash # Install Core library (once per project) -npm install @ionic-native/core +npm install @cordova-awesome-plugins/core -# Install Ionic Native TypeScript wrapper -npm install @ionic-native/barcode-scanner +# Install Cordova Awesome Plugins TypeScript wrapper +npm install @cordova-awesome-plugins/barcode-scanner # Install Cordova plugin npm install phonegap-plugin-barcodescanner @@ -106,7 +104,7 @@ ionic cap sync Import the plugin object then use its static methods: ```typescript -import { BarcodeScanner } from '@ionic-native/barcode-scanner'; +import { BarcodeScanner } from '@cordova-awesome-plugins/barcode-scanner'; const Tab1: React.FC = () => { const openScanner = async () => { @@ -133,7 +131,7 @@ const Tab1: React.FC = () => { These 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. ```js -import { Camera } from '@ionic-native/camera'; +import { Camera } from '@cordova-awesome-plugins/camera'; document.addEventListener('deviceready', () => { Camera.getPicture() @@ -144,9 +142,9 @@ document.addEventListener('deviceready', () => { #### AngularJS -Ionic Native generates an AngularJS module in runtime and prepares a service for each plugin. To use the plugins in your AngularJS app: +Cordova Awesome Plugins generates an AngularJS module in runtime and prepares a service for each plugin. To use the plugins in your AngularJS app: -1. Download the latest bundle from the [Github releases](https://github.com/ionic-team/ionic-native/releases) page. +1. Download the latest bundle from the [Github releases](https://github.com/danielsogl/cordova-awesome-plugins/releases) page. 2. Include it in `index.html` before your app's code. 3. Inject `ionic.native` module in your app. 4. Inject any plugin you would like to use with a `$cordova` prefix. @@ -166,9 +164,9 @@ angular.module('myApp', ['ionic.native']).controller('MyPageController', functio #### Vanilla JS -To use Ionic Native in any other setup: +To use Cordova Awesome Plugins in any other setup: -1. Download the latest bundle from the [Github releases](https://github.com/ionic-team/ionic-native/releases) page. +1. Download the latest bundle from the [Github releases](https://github.com/danielsogl/cordova-awesome-plugins/releases) page. 2. Include it in `index.html` before your app's code. 3. Access any plugin using the global `IonicNative` variable. @@ -187,14 +185,14 @@ document.addEventListener('deviceready', function () { ### Mocking and Browser Development (Ionic/Angular apps only) -Ionic Native makes it possible to mock plugins and develop nearly the entirety of your app in the browser or in `ionic serve`. +Cordova Awesome Plugins makes it possible to mock plugins and develop nearly the entirety of your app in the browser or in `ionic serve`. To 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: First import the `Camera` class in your `src/app/app.module.ts` file: ```typescript -import { Camera } from '@ionic-native/camera/ngx'; +import { Camera } from '@cordova-awesome-plugins/camera/ngx'; ``` Then create a new class that extends the `Camera` class with a mock implementation: @@ -224,7 +222,7 @@ import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; import { MyApp } from './app.component'; import { HomePage } from '../pages/home/home'; -import { Camera } from '@ionic-native/camera/ngx'; +import { Camera } from '@cordova-awesome-plugins/camera/ngx'; import { HomePage } from '../pages/home/home'; import { MyApp } from './app.component'; @@ -252,13 +250,13 @@ export class AppModule {} ### 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. +Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Cordova Awesome Plugins lets you know what the issue is and how you can resolve it. ![img](https://ionic-io-assets.s3.amazonaws.com/ionic-native-console.png) ## Plugin Missing? -Let 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: +Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/danielsogl/cordova-awesome-plugins/blob/master/DEVELOPER.md) for more on how to contribute. :heart: # Credits