docs(readme): switch to new name
This commit is contained in:
parent
4d37585980
commit
740717fc8a
56
README.md
56
README.md
@ -1,32 +1,30 @@
|
|||||||
[](https://circleci.com/gh/ionic-team/ionic-native) [](http://commitizen.github.io/cz-cli/) 
|
[](http://commitizen.github.io/cz-cli/) 
|
||||||
|
|
||||||
# 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:
|
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.
|
||||||
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.
|
|
||||||
|
|
||||||
## Capacitor Support
|
## 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
|
## Installation
|
||||||
|
|
||||||
Run following command to install Ionic Native in your project.
|
Run following command to install Cordova Awesome Plugins in your project.
|
||||||
|
|
||||||
```bash
|
```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
|
## 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
|
### Basic Usage
|
||||||
|
|
||||||
@ -37,7 +35,7 @@ Make sure to import the injectable class from the `/ngx` directory as shown in t
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// app.module.ts
|
// 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
|
```typescript
|
||||||
import { Geolocation } from '@ionic-native/geolocation/ngx';
|
import { Geolocation } from '@cordova-awesome-plugins/geolocation/ngx';
|
||||||
import { Platform } from 'ionic-angular';
|
import { Platform } from 'ionic-angular';
|
||||||
|
|
||||||
@Component({ ... })
|
@Component({ ... })
|
||||||
@ -87,14 +85,14 @@ export class MyComponent {
|
|||||||
|
|
||||||
#### Ionic/React apps
|
#### 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
|
```bash
|
||||||
# Install Core library (once per project)
|
# Install Core library (once per project)
|
||||||
npm install @ionic-native/core
|
npm install @cordova-awesome-plugins/core
|
||||||
|
|
||||||
# Install Ionic Native TypeScript wrapper
|
# Install Cordova Awesome Plugins TypeScript wrapper
|
||||||
npm install @ionic-native/barcode-scanner
|
npm install @cordova-awesome-plugins/barcode-scanner
|
||||||
|
|
||||||
# Install Cordova plugin
|
# Install Cordova plugin
|
||||||
npm install phonegap-plugin-barcodescanner
|
npm install phonegap-plugin-barcodescanner
|
||||||
@ -106,7 +104,7 @@ ionic cap sync
|
|||||||
Import the plugin object then use its static methods:
|
Import the plugin object then use its static methods:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { BarcodeScanner } from '@ionic-native/barcode-scanner';
|
import { BarcodeScanner } from '@cordova-awesome-plugins/barcode-scanner';
|
||||||
|
|
||||||
const Tab1: React.FC = () => {
|
const Tab1: React.FC = () => {
|
||||||
const openScanner = async () => {
|
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.
|
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
|
```js
|
||||||
import { Camera } from '@ionic-native/camera';
|
import { Camera } from '@cordova-awesome-plugins/camera';
|
||||||
|
|
||||||
document.addEventListener('deviceready', () => {
|
document.addEventListener('deviceready', () => {
|
||||||
Camera.getPicture()
|
Camera.getPicture()
|
||||||
@ -144,9 +142,9 @@ document.addEventListener('deviceready', () => {
|
|||||||
|
|
||||||
#### AngularJS
|
#### 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.
|
2. Include it in `index.html` before your app's code.
|
||||||
3. Inject `ionic.native` module in your app.
|
3. Inject `ionic.native` module in your app.
|
||||||
4. Inject any plugin you would like to use with a `$cordova` prefix.
|
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
|
#### 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.
|
2. Include it in `index.html` before your app's code.
|
||||||
3. Access any plugin using the global `IonicNative` variable.
|
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)
|
### 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:
|
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:
|
First import the `Camera` class in your `src/app/app.module.ts` file:
|
||||||
|
|
||||||
```typescript
|
```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:
|
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 { MyApp } from './app.component';
|
||||||
import { HomePage } from '../pages/home/home';
|
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 { HomePage } from '../pages/home/home';
|
||||||
import { MyApp } from './app.component';
|
import { MyApp } from './app.component';
|
||||||
@ -252,13 +250,13 @@ export class AppModule {}
|
|||||||
|
|
||||||
### Runtime Diagnostics
|
### 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Plugin Missing?
|
## 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
|
# Credits
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user