Compare commits

..

66 Commits

Author SHA1 Message Date
Ibby Hadeed
955476b45b chore(): update changelog 2017-04-27 01:01:19 -04:00
Ibby Hadeed
95aa3e2f26 3.6.0 2017-04-27 01:01:08 -04:00
Ibby Hadeed
facdcdc956 docs(): add save flag
closes #1385
2017-04-27 00:55:23 -04:00
Ibby Hadeed
ab782f7093 chore(): update templates 2017-04-27 00:53:06 -04:00
Ibby Hadeed
6811750711 docs(secure-storage): fix types
closes #1416
2017-04-27 00:51:57 -04:00
Ibby Hadeed
c3d23b0ee9 refactor(): cleanup 2017-04-27 00:49:23 -04:00
Ibby Hadeed
17366a29da feat(): add IonicNativePlugin base class (#1425)
* add base class

* properties are static

* some fixes

* tslint
2017-04-27 00:36:12 -04:00
Matt Thiessen
39eaebfafd docs(): fix docs (#1423) 2017-04-27 00:36:01 -04:00
Andrew Crites
66874cc598 chore(build): allow option to specify plugins to build (#1421) 2017-04-27 00:35:47 -04:00
Andrew Crites
16dc71ab71 feat(keychain): add Keychain plugin (#1420)
* feat(keychain): adding keychain plugin

ionic-native for cordova ios keychain plugin

* feat(keychain): make touchID params optional in type def
2017-04-27 00:35:29 -04:00
Ronald Mak
b58149f2f2 fix(media): function 'create' never returns media object (#1419)
The function never returns an object of MediaObject. The onSuccess callback is wrongly used to return the object. In fact, onSuccess/onError callbacks are only invoked after the current play, record, or stop action is called.
2017-04-27 00:34:43 -04:00
Kendall González León
b6afc19e72 docs(): fix docs (#1418)
On line 11 there was not closing single quote.
2017-04-27 00:34:22 -04:00
Daniel Sogl
52d731e7d9 chore(): update to Angular 4 (#1391)
Since Ionic 3.0 released, the package should be able  to support Angular 4.0.0.
I updated the dependencies for that.
2017-04-18 17:52:34 -04:00
Ibby Hadeed
7df7a557da chore(): update changelog 2017-04-18 17:48:08 -04:00
Ibby Hadeed
c720bfead1 3.5.0 2017-04-18 17:48:00 -04:00
Ibby Hadeed
b4102310e7 tslint 2017-04-18 17:47:24 -04:00
Ibby Hadeed
1b84db035f feat(camera-preview): add new plugin methods
New methods and constants available for CameraPreview
2017-04-18 17:44:01 -04:00
Ibby Hadeed
37e8eddd86 feat(background-fetch): add new status method
feat(background-fetch): add status method
2017-04-18 17:42:00 -04:00
Ibby Hadeed
4fb9b949d7 feat(action-sheet): update to match latest version
feat(action-sheet): update to newest version
2017-04-18 17:41:11 -04:00
Ibby Hadeed
66bc034c80 fix(google-maps): fix Geocoder pluginRef
Fix Geocoder's pluginRef
2017-04-18 17:40:33 -04:00
Ibby Hadeed
593c1ee6ca feat(health): update datatypes
Update datatypes to match recent release of plugin
2017-04-18 17:39:47 -04:00
Ibby Hadeed
91439be0bd feat(native-geocoder): add district property
native-geocoder: added district for larger cities
2017-04-18 17:38:17 -04:00
Ibby Hadeed
4ae50561b4 feat(flurry-analytics): add flurry analytics plugin
Added Flurry Analytics wrapper
2017-04-18 17:37:39 -04:00
Ibby Hadeed
1f0986fa6f docs(): fix reference
change executeSql doc to mention create instead of openDatabase
2017-04-18 17:36:39 -04:00
Ibby Hadeed
1be4c1c669 docs(): battery-status example fix (#1387)
Closes #1383
2017-04-18 17:36:15 -04:00
Dylan v.d Merwe
c7a6e6625a docs(): fix typo in media example (#1386) 2017-04-18 17:35:27 -04:00
SVANNER
0a7f56d960 New methods and constants available 2017-04-18 07:15:15 +02:00
Dylan v.d Merwe
f7044a08de bug(doc): battery-status example fix
Fix for https://github.com/driftyco/ionic-native/issues/1383
2017-04-17 23:26:56 +02:00
John-Luke
6168eaee47 feat(background-fetch): add status method 2017-04-17 15:22:44 -03:00
John-Luke
9c925806ed feat(action-sheet): update to newest version 2017-04-17 14:27:13 -03:00
Robert Coie
3e8211461a change executeSql doc to mention create instead of openDatabase 2017-04-16 16:27:09 -07:00
hodak
b2120c68e2 Fix Geocoder's pluginRef 2017-04-15 13:29:10 +02:00
Ankush Aggarwal
1da12b9330 added HealthDataType interface and usage instructions 2017-04-14 08:21:45 -07:00
Amit Moryossef
4bd6aaba2b fix(core): fix bug when checking if plugin exists (#1348)
* fix(cordova-plugin): add check if method exists

For https://github.com/driftyco/ionic-native/issues/1327

* fix(plugin): add typeof to undefined check
2017-04-14 09:49:57 -04:00
Ibby Hadeed
f396940044 fix(rollbar): fix pluginRef 2017-04-14 09:42:46 -04:00
Ibby Hadeed
6bba72d32a fix(media): fix issue with create method
closes #1333
2017-04-14 09:19:25 -04:00
Juan J. San Emeterio
d30b534150 docs(google-plus): options parameter is required (#1368)
Issue reported: https://forum.ionicframework.com/t/ionic-native-googleplus-unrecognized-selector-sent-to-instance/81944/3

In order to correctly call the login method on the GooglePlus provider you need to pass it the 'options' parameter even if it's empty.
2017-04-14 09:14:41 -04:00
Kendall González León
8edc27079c docs(): fix example (#1362)
Line 224 fixed, Incorrect single quotes in the string.
(don't -> do not) remove quotes for avoid bad format.
2017-04-14 09:13:52 -04:00
Stefan Huber
55f9943f86 docs(media): minor fix (#1358)
`getDuration` is synchronous, inside the example it was used with a promise, which is quite missleading...
2017-04-14 09:07:27 -04:00
Ctibor Laky
352ad7ab2f docs(): fix example (#1355) 2017-04-14 09:04:46 -04:00
Gianfrancø Palumbo
15bf509ae0 docs(): fix typo (#1354) 2017-04-14 09:04:32 -04:00
Nikhil
6b9f650a19 docs(social-sharing): fix example (#1351)
ShareViaEmail parameter for providing email "must be null or an array" because it's type is "string:[]" and the provided syntax is wrong, so i have updated that syntax.
2017-04-14 09:04:11 -04:00
Leonardo Ruhland
b30883a876 docs(): fix package name (#1340)
Fixes documentation with the new import syntax
2017-04-14 08:59:15 -04:00
Garry-H
caec80b661 docs(nfc): enhance docs (#1325)
labeled methods with classes, improved method descriptions
2017-04-14 08:58:53 -04:00
LAÉCIO FERREIRA MORAIS
620289f54b docs(): fix typo (#1324) 2017-04-14 08:58:01 -04:00
Lenglet Anthony
5a6246425f docs(): fix typo (#1323) 2017-04-14 08:57:41 -04:00
Ankush Aggarwal
43b75af58b changed any to specific types 2017-04-13 17:56:59 -07:00
Ankush Aggarwal
44957e2197 Update datatypes to match recent release of plugin
I made changes to cordova-plugin-health to accept the following array as datatypes. Earlier it was just an array of strings. Now it also contains an object with `read` and `write` array.

```
[
  'calories', 'distance',   //read and write permissions
  {
    read : ['steps'],       //read only permission
    write : ['height', 'weight']  //write only permission
  }
]
```

Don't know how to specify this array in typescript so just replaced by 'any'
2017-04-11 09:39:24 -07:00
fredroo
c15c11cf95 docs(): enhance example (#1336) 2017-04-08 16:58:36 -04:00
Ankush Aggarwal
1b429638fe docs(): add types (#1342)
Resolves - https://github.com/driftyco/ionic-native/issues/1331
2017-04-08 16:58:07 -04:00
Andréas Hanss
99576d823d Edit for 3.0 (#1345) 2017-04-08 16:57:38 -04:00
Robert Herhold
0147704a4f docs(): fix typo (#1329) 2017-04-05 23:37:08 -04:00
Yasin Simsek
f6a7e5fe9b native-geocoder: added district for larger cities 2017-04-03 12:49:29 +02:00
anastasia
ebb47ce591 fixed doc of flurry analytics wrapper 2017-04-03 13:14:08 +03:00
gujiman
57eabc002a docs(paypal): fix package name in example (#1313)
The import ref for paypal is incorrect. I've added the correct name.
2017-04-01 22:38:42 -04:00
Joel Szwarga
24c8d5d627 docs(music-controls): fix example code (#1315)
The sample code does not work...this change returns the observable first with subscribe() before actually calling the Observable's subscribe method.

In fact, the way it's written in the example, the code would not build because of typescript errors.
2017-04-01 22:38:17 -04:00
Ibby Hadeed
4ceb340630 docs(admob-free): fix plugin name 2017-03-31 23:15:27 -04:00
anastasia
ec8d318280 Finish flurry-analytics 2017-03-31 17:38:11 +03:00
anastasia
8add83612d added flurry analytics wrapper 2017-03-31 17:36:09 +03:00
Gengjun Wu
0beefb3079 docs(flashlight): fix typo (#1306)
There is a typo on line 14, changed from

 * constructor(private flashlight: FlashLight) { }

to

 * constructor(private flashlight: Flashlight) { }
2017-03-31 03:02:39 -04:00
Ibby Hadeed
4d2f720b01 chore(): update changelog 2017-03-30 15:58:15 -04:00
Ibby Hadeed
d29ca88b18 3.4.4 2017-03-30 15:58:12 -04:00
Ibby Hadeed
c94dd41f92 Merge branch 'master' of github.com:driftyco/ionic-native 2017-03-30 15:58:11 -04:00
gurnard123
b005efc52b docs(intel-security): fix references (#1305)
corrected the documentation to correct the read code snippet. As detailed here:
https://forum.ionicframework.com/t/crypto-libraries-with-ionic-2/84629
2017-03-30 15:50:26 -04:00
mugenyi henry
f4c4317f16 docs(admob): fix package name (#1301)
remove the dash "import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';" to import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob' because typescript will not import the specified clases
2017-03-30 15:50:02 -04:00
Ibby Hadeed
145577f9bc fix(push): hasPermission is part of Push object
addresses comment in #1297
2017-03-30 15:48:46 -04:00
153 changed files with 1019 additions and 422 deletions

View File

@@ -5,7 +5,7 @@
###### Before you submit an issue:
* Do a quick search to see if there are similar issues
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save ionic-native@latest`
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
###### Still having problems? submit an issue with the following details:
* Short description of the issue
@@ -16,4 +16,4 @@
## Feature request?
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.

View File

@@ -1,3 +1,47 @@
<a name="3.6.0"></a>
# [3.6.0](https://github.com/driftyco/ionic-native/compare/v3.5.0...v3.6.0) (2017-04-27)
### Bug Fixes
* **media:** function 'create' never returns media object (#1419) ([b58149f](https://github.com/driftyco/ionic-native/commit/b58149f))
### Features
* **keychain:** add Keychain plugin (#1420) ([16dc71a](https://github.com/driftyco/ionic-native/commit/16dc71a))
* add IonicNativePlugin base class (#1425) ([17366a2](https://github.com/driftyco/ionic-native/commit/17366a2))
<a name="3.5.0"></a>
# [3.5.0](https://github.com/driftyco/ionic-native/compare/v3.4.4...v3.5.0) (2017-04-18)
### Bug Fixes
* **core:** fix bug when checking if plugin exists (#1348) ([4bd6aab](https://github.com/driftyco/ionic-native/commit/4bd6aab)), closes [#1348](https://github.com/driftyco/ionic-native/issues/1348)
* **media:** fix issue with create method ([6bba72d](https://github.com/driftyco/ionic-native/commit/6bba72d)), closes [#1333](https://github.com/driftyco/ionic-native/issues/1333)
* **rollbar:** fix pluginRef ([f396940](https://github.com/driftyco/ionic-native/commit/f396940))
### Features
* **action-sheet:** update to newest version ([9c92580](https://github.com/driftyco/ionic-native/commit/9c92580))
* **background-fetch:** add status method ([6168eae](https://github.com/driftyco/ionic-native/commit/6168eae))
<a name="3.4.4"></a>
## [3.4.4](https://github.com/driftyco/ionic-native/compare/v3.4.3...v3.4.4) (2017-03-30)
### Bug Fixes
* **push:** hasPermission is part of Push object ([145577f](https://github.com/driftyco/ionic-native/commit/145577f))
<a name="3.4.3"></a>
## [3.4.3](https://github.com/driftyco/ionic-native/compare/v3.4.2...v3.4.3) (2017-03-29)

View File

@@ -1,12 +1,12 @@
{
"name": "ionic-native",
"version": "3.4.3",
"version": "3.6.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"license": "MIT",
"devDependencies": {
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"canonical-path": "0.0.2",
"child-process-promise": "2.2.0",
"conventional-changelog-cli": "1.2.0",
@@ -27,12 +27,12 @@
"q": "1.4.1",
"queue": "4.2.1",
"rimraf": "2.5.4",
"rxjs": "5.0.1",
"rxjs": "5.1.1",
"semver": "5.3.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.7",
"typescript": "2.0.09",
"zone.js": "0.7.2"
"typescript": "2.2.1",
"zone.js": "^0.8.4"
},
"scripts": {
"start": "npm run test:watch",

View File

@@ -40,7 +40,6 @@ PLUGIN_PACKAGE_JSON.peerDependencies = PLUGIN_PEER_DEPS;
console.log('Making new TMP directory');
fs.mkdirpSync(BUILD_TMP);
// Prepare and copy the core module's package.json
console.log('Preparing core module package.json');
CORE_PACKAGE_JSON.version = IONIC_NATIVE_VERSION;
@@ -51,6 +50,11 @@ fs.writeJsonSync(path.resolve(BUILD_CORE_DIST, 'package.json'), CORE_PACKAGE_JSO
// Fetch a list of the plugins
const PLUGINS = fs.readdirSync(PLUGINS_PATH);
// Build specific list of plugins to build from arguments, if any
let pluginsToBuild = process.argv.slice(2);
if (!pluginsToBuild.length) {
pluginsToBuild = PLUGINS;
}
// Create a queue to process tasks
const QUEUE = queue({
@@ -116,7 +120,7 @@ const addPluginToQueue = pluginName => {
};
PLUGINS.forEach(addPluginToQueue);
pluginsToBuild.forEach(addPluginToQueue);
QUEUE.start((err) => {

View File

@@ -165,7 +165,7 @@ docType: "<$ doc.docType $>"
<@ endif @>
<# --- Install commands --- #>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add --save <$ prop.plugin $><@ endif @>
$ npm install --save @ionic-native/<$ doc.npmId $>
</code></pre>
<p>Repo:

View File

@@ -1,4 +1,4 @@
import { Plugin } from '@ionic-native/core';
import { Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
@@ -25,6 +25,6 @@ import { Injectable } from '@angular/core';
platforms: []
})
@Injectable()
export class $PluginName {
export class $PluginName extends IonicNativePlugin {
}

View File

@@ -10,7 +10,7 @@
* - Remove this note
*
*/
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty } from '@ionic-native/core';
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@@ -44,7 +44,7 @@ import { Observable } from 'rxjs/Observable';
install: '', // OPTIONAL install command, in case the plugin requires variables
})
@Injectable()
export class $PluginName {
export class $PluginName extends IonicNativePlugin {
/**
* This function does something

View File

@@ -1,3 +1,4 @@
export * from './plugin';
export * from './decorators';
export * from './util';
export * from './ionic-native-plugin';

View File

@@ -0,0 +1,41 @@
export class IonicNativePlugin {
static pluginName: string;
static pluginRef: string;
static plugin: string;
static repo: string;
static platforms: string[];
static install: string;
/**
* Returns a boolean that indicates whether the plugin is installed
* @return {boolean}
*/
static installed(): boolean { return false; }
/**
* Returns the original plugin object
*/
static getPlugin(): any {}
/**
* Returns the plugin's name
*/
static getPluginName(): string { return; }
/**
* Returns the plugin's reference
*/
static getPluginRef(): string { return; }
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string { return; }
}

View File

@@ -32,7 +32,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
pluginInstance = getPlugin(pluginRef);
if (!pluginInstance || (!!methodName && pluginInstance[methodName] === 'undefined')) {
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
if (!window.cordova) {
cordovaWarn(pluginName, methodName);
return {
@@ -54,7 +54,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
* @private
*/
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
return pluginObj._objectInstance && (!methodName || pluginObj._objectInstance[methodName] !== 'undefined');
return pluginObj._objectInstance && (!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined');
}
function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaProperty } from '@ionic-native/core';
import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
export interface ActionSheetOptions {
@@ -13,6 +13,11 @@ export interface ActionSheetOptions {
*/
title?: string;
/**
* The subtitle for the actionsheet (IOS only)
*/
subtitle?: string;
/**
* Theme to be used on Android
*/
@@ -43,6 +48,10 @@ export interface ActionSheetOptions {
*/
position?: number[];
/**
* Choose if destructive button will be the last
*/
destructiveButtonLast: boolean;
}
/**
@@ -65,10 +74,12 @@ export interface ActionSheetOptions {
*
* const options: ActionSheetOptions = {
* title: 'What do you want with this image?',
* subtitle: 'Choose an action',
* buttonLabels: buttonLabels,
* addCancelButtonWithLabel: 'Cancel',
* addDestructiveButtonWithLabel: 'Delete',
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK,
* destructiveButtonLast: true
* };
*
* this.actionSheet.show(options).then((buttonIndex: number) => {
@@ -83,10 +94,10 @@ export interface ActionSheetOptions {
plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
platforms: ['Android', 'iOS', 'Windows Phone 8']
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Browser']
})
@Injectable()
export class ActionSheet {
export class ActionSheet extends IonicNativePlugin {
@CordovaProperty
ANDROID_THEMES: {

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
@@ -65,7 +65,7 @@ export interface AdMobFreeRewardVideoConfig {
}
/**
* @name AdbMobFree
* @name AdMob Free
* @description
*
* @usage
@@ -105,7 +105,7 @@ export interface AdMobFreeRewardVideoConfig {
platforms: ['Android', 'iOS']
})
@Injectable()
export class AdMobFree {
export class AdMobFree extends IonicNativePlugin {
/**
* Convenience constructor to get event names
@@ -171,8 +171,6 @@ export class AdMobFree {
})
export class AdMobFreeBanner {
/**
* Update config.
* @param options

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export type AdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
@@ -95,7 +95,7 @@ export interface AdExtras {
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
* @usage
* ```typescript
* import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';
* import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob';
*
* constructor(private admob: AdMob){}
*
@@ -123,7 +123,7 @@ export interface AdExtras {
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class AdMob {
export class AdMob extends IonicNativePlugin {
AD_POSITION: {
NO_CHANGE: number;

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface AlipayOrder {
@@ -103,7 +103,7 @@ export interface AlipayOrder {
install: 'ionic plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
})
@Injectable()
export class Alipay {
export class Alipay extends IonicNativePlugin {
/**
* Open Alipay to perform App pay
* @param order { AlipayOrder } alipay options

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface AFAAuthOptions {
@@ -148,7 +148,7 @@ export interface AFAEncryptResponse {
platforms: ['Android']
})
@Injectable()
export class AndroidFingerprintAuth {
export class AndroidFingerprintAuth extends IonicNativePlugin {
/**
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Android Full Screen
@@ -29,7 +29,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class AndroidFullScreen {
export class AndroidFullScreen extends IonicNativePlugin {
/**
* Is this plugin supported?
* @return {Promise<void>}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name App Availability
@@ -40,7 +40,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class AppAvailability {
export class AppAvailability extends IonicNativePlugin {
/**
* Checks if an app is available on device

View File

@@ -1,4 +1,4 @@
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
@@ -27,7 +27,7 @@ import { Injectable } from '@angular/core';
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'OS X', 'Windows 8', 'Windows Phone']
})
@Injectable()
export class AppPreferences {
export class AppPreferences extends IonicNativePlugin {
/**
* Get a preference value

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin } from '@ionic-native/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare var window;
@@ -134,7 +134,7 @@ export interface AppUrls {
platforms: ['Android', 'iOS', 'Windows (experimental)']
})
@Injectable()
export class AppRate {
export class AppRate extends IonicNativePlugin {
/**
* Configure various settings for the Rating View.

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
@@ -42,7 +42,7 @@ import { Injectable } from '@angular/core';
platforms: ['Android']
})
@Injectable()
export class AppUpdate {
export class AppUpdate extends IonicNativePlugin {
/**
* Check and update
* @param updateUrl {string} update api url

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
@@ -34,7 +34,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class AppVersion {
export class AppVersion extends IonicNativePlugin {
/**
* Returns the name of the app

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
@@ -31,7 +31,7 @@ import { Injectable } from '@angular/core';
platforms: [ 'iOS', 'Android' ]
})
@Injectable()
export class Appodeal {
export class Appodeal extends IonicNativePlugin {
// available types of advertisements
readonly AD_TYPES = {
INTERSTITIAL: 1,

View File

@@ -1,4 +1,4 @@
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
declare var window;
@@ -63,7 +63,7 @@ export interface BackgroundFetchConfig {
platforms: ['iOS']
})
@Injectable()
export class BackgroundFetch {
export class BackgroundFetch extends IonicNativePlugin {
/**
@@ -100,4 +100,11 @@ export class BackgroundFetch {
})
finish(): void { }
/**
* Return the status of the background-fetch
* @returns {Promise<any>}
*/
@Cordova()
status(): Promise<any> { return; }
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var window;
@@ -311,7 +311,7 @@ export interface BackgroundGeolocationConfig {
platforms: ['iOS', 'Android', 'Windows Phone 8']
})
@Injectable()
export class BackgroundGeolocation {
export class BackgroundGeolocation extends IonicNativePlugin {
/**
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
@@ -73,7 +73,7 @@ export interface BackgroundModeConfiguration {
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class BackgroundMode {
export class BackgroundMode extends IonicNativePlugin {
/**
* Enable the background mode.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
@@ -32,7 +32,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class Backlight {
export class Backlight extends IonicNativePlugin {
/**
* This function turns backlight on

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
@@ -30,7 +30,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Browser', 'Windows', 'Amazon FireOS', 'Windows Phone 8']
})
@Injectable()
export class Badge {
export class Badge extends IonicNativePlugin {
/**
* Clear the badge of the app icon.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface BarcodeScannerOptions {
@@ -89,7 +89,7 @@ export interface BarcodeScannerOptions {
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows 10', 'Windows 8', 'BlackBerry 10', 'Browser']
})
@Injectable()
export class BarcodeScanner {
export class BarcodeScanner extends IonicNativePlugin {
Encode: {
TEXT_TYPE: string;

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Base64 To Gallery
@@ -28,7 +28,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Base64ToGallery {
export class Base64ToGallery extends IonicNativePlugin {
/**
* Converts a base64 string to an image file in the device gallery

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface BatteryStatusResponse {
@@ -32,7 +32,7 @@ export interface BatteryStatusResponse {
*
* // watch change in battery status
* let subscription = this.batteryStatus.onChange().subscribe(
* (status: StatusObject) => {
* (status: BatteryStatusResponse) => {
* console.log(status.level, status.isPlugged);
* }
* );
@@ -52,7 +52,7 @@ export interface BatteryStatusResponse {
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']
})
@Injectable()
export class BatteryStatus {
export class BatteryStatus extends IonicNativePlugin {
/**
* Watch the change in battery level

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -176,7 +176,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['iOS', 'Android']
})
@Injectable()
export class BLE {
export class BLE extends IonicNativePlugin {
/**
* Scan and discover BLE peripherals for the specified amount of time.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -38,7 +38,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['Android', 'iOS', 'Windows Phone', 'Browser']
})
@Injectable()
export class BluetoothSerial {
export class BluetoothSerial extends IonicNativePlugin {
/**
* Connect to a Bluetooth device

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Brightness
@@ -29,7 +29,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Brightness {
export class Brightness extends IonicNativePlugin {
/**
* Sets the brightness of the display.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -31,7 +31,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Broadcaster {
export class Broadcaster extends IonicNativePlugin {
/**
* This function listen to an event sent from the native code

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
@@ -40,7 +40,7 @@ import { Injectable } from '@angular/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class BrowserTab {
export class BrowserTab extends IonicNativePlugin {
/**
* Check if BrowserTab option is available

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface CalendarOptions {
@@ -60,7 +60,7 @@ export interface CalendarOptions {
*
* @usage
* ```
* import {Calendar} from '@ionic-native/calendar';
* import { Calendar } from '@ionic-native/calendar';
*
* constructor(private calendar: Calendar) { }
*
@@ -81,7 +81,7 @@ export interface CalendarOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class Calendar {
export class Calendar extends IonicNativePlugin {
/**
* This function checks if we have permission to read/write from/to the calendar.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Call Number
* @description
@@ -7,7 +7,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
*
* @usage
* ```
* import {CallNumber} from '@ionic-native/call-number';
* import { CallNumber } from '@ionic-native/call-number';
*
* constructor(private callNumber: CallNumber) { }
*
@@ -28,7 +28,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['iOS', 'Android']
})
@Injectable()
export class CallNumber {
export class CallNumber extends IonicNativePlugin {
/**
* Calls a phone number

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface CameraPreviewDimensions {
/** The width of the camera preview, default to window.screen.width */
@@ -132,7 +132,39 @@ export interface CameraPreviewPictureOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class CameraPreview {
export class CameraPreview extends IonicNativePlugin {
EXPOSURE_MODES = {
LOCK: 'lock', // IOS Only
AUTO: 'auto', // IOS Only
CONTINUOUS: 'continuous',
CUSTOM: 'custom'
};
FLASH_MODE = {
OFF: 'off',
ON: 'on',
AUTO: 'auto',
RED_EYE: 'red-eye',
TORCH: 'torch' // Android Only
};
COLOR_EFFECT = {
AQUA: 'aqua', // Android Only
BLACKBOARD: 'blackboard', // Android Only
MONO: 'mono',
NEGATIVE: 'negative',
NONE: 'none',
POSTERIZE: 'posterize',
SEPIA: 'sepia',
SOLARIZE: 'solarize', // Android Only
WHITEBOARD: 'whiteboard' // Android Only
};
CAMERA_DIRECTION = {
BACK: 'back',
FRONT: 'front'
};
/**
* Starts the camera preview instance.
@@ -149,40 +181,28 @@ export class CameraPreview {
* Stops the camera preview instance. (iOS & Android)
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
stopCamera(): Promise<any> { return; }
/**
* Switch from the rear camera and front camera, if available.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
switchCamera(): Promise<any> { return; }
/**
* Hide the camera preview box.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
hide(): Promise<any> { return; }
/**
* Show the camera preview box.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
show(): Promise<any> { return; }
/**
@@ -220,6 +240,19 @@ export class CameraPreview {
})
setZoom(zoom?: number): Promise<any> { return; }
/**
* Get the maximum zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getMaxZoom(): Promise<any> { return; }
/**
* Get current zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getZoom(): Promise<any> { return; }
/**
* Set the preview Size
@@ -228,8 +261,7 @@ export class CameraPreview {
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
platforms: ['Android']
errorIndex: 2
})
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
@@ -244,4 +276,68 @@ export class CameraPreview {
})
setFlashMode(flashMode?: string): Promise<any> { return; }
/**
* Get supported picture sizes
* @return {Promise<any>}
*/
@Cordova()
getSupportedPictureSizes(): Promise<any> { return; }
/**
* Get supported flash modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFlashModes(): Promise<any> { return; }
/**
* Get exposure mode
* @return {Promise<any>}
*/
@Cordova()
getExposureMode(): Promise<any> { return; }
/**
* Get exposure modes
* @return {Promise<any>}
*/
@Cordova()
getExposureModes(): Promise<any> { return; }
/**
* Set exposure mode
* @param [lock] {string}
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
setExposureMode(lock?: string): Promise<any> { return; }
/**
* Get exposure compensation (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensation(): Promise<any> { return; }
/**
* Set exposure compensation (Android)
* @param [exposureCompensation] {number}
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
/**
* Get exposure compensation range (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensationRange(): Promise<any> { return; }
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface CameraOptions {
/** Picture quality in range 0-100. Default is 50 */
@@ -128,7 +128,7 @@ export interface CameraPopoverOptions {
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
})
@Injectable()
export class Camera {
export class Camera extends IonicNativePlugin {
/**
* Constant for possible destination types

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface CardIOOptions {
@@ -167,7 +167,7 @@ export interface CardIOResponse {
platforms: ['iOS', 'Android']
})
@Injectable()
export class CardIO {
export class CardIO extends IonicNativePlugin {
/**
* Check whether card scanning is currently available. (May vary by

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Clipboard
* @description
@@ -37,7 +37,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']
})
@Injectable()
export class Clipboard {
export class Clipboard extends IonicNativePlugin {
/**
* Copies the given text

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
namespace Http {
export const enum Verb {
@@ -427,7 +427,7 @@ export interface DownloadProgress {
platforms: ['Android', 'iOS']
})
@Injectable()
export class CodePush {
export class CodePush extends IonicNativePlugin {
/**
* Get the current package information.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck } from '@ionic-native/core';
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
declare var window: any,
navigator: any;
@@ -294,7 +294,7 @@ export class ContactFindOptions implements IContactFindOptions {
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
})
@Injectable()
export class Contacts {
export class Contacts extends IonicNativePlugin {
/**
* Create a single contact.

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
@@ -29,7 +29,7 @@ import { Injectable } from '@angular/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class CouchbaseLite {
export class CouchbaseLite extends IonicNativePlugin {
/**
* Get the database url

View File

@@ -1,12 +1,12 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Crop
* @description Crops images
* @usage
* ```
* import {Crop} from '@ionic-native/crop';
* import { Crop } from '@ionic-native/crop';
*
* constructor(private crop: Crop) { }
*
@@ -27,7 +27,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Crop {
export class Crop extends IonicNativePlugin {
/**
* Crops an image

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {Cordova, Plugin} from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface DatePickerOptions {
/**
@@ -154,7 +154,7 @@ export interface DatePickerOptions {
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class DatePicker {
export class DatePicker extends IonicNativePlugin {
/**
* @hidden

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -42,7 +42,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['iOS', 'Android']
})
@Injectable()
export class DBMeter {
export class DBMeter extends IonicNativePlugin {
/**
* Starts listening

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeeplinkMatch {
@@ -83,7 +83,7 @@ export interface DeeplinkMatch {
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX']
})
@Injectable()
export class Deeplinks {
export class Deeplinks extends IonicNativePlugin {
/**
* Define a set of paths to match against incoming deeplinks.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Device Accounts
@@ -28,7 +28,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class DeviceAccounts {
export class DeviceAccounts extends IonicNativePlugin {
/**
* Gets all accounts registered on the Android Device

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Device Feedback
* @description
@@ -38,7 +38,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class DeviceFeedback {
export class DeviceFeedback extends IonicNativePlugin {
/**
* Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeviceMotionAccelerationData {
@@ -75,7 +75,7 @@ export interface DeviceMotionAccelerometerOptions {
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class DeviceMotion {
export class DeviceMotion extends IonicNativePlugin {
/**
* Get the current acceleration along the x, y, and z axes.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeviceOrientationCompassHeading {
@@ -80,7 +80,7 @@ export interface DeviceOrientationCompassOptions {
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class DeviceOrientation {
export class DeviceOrientation extends IonicNativePlugin {
/**
* Get the current compass heading.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin } from '@ionic-native/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare var window: any;
@@ -27,7 +27,7 @@ declare var window: any;
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Device {
export class Device extends IonicNativePlugin {
/** Get the version of Cordova running on the device. */
@CordovaProperty

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {Cordova, Plugin, CordovaProperty} from '@ionic-native/core';
import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Diagnostic
@@ -42,7 +42,7 @@ import {Cordova, Plugin, CordovaProperty} from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class Diagnostic {
export class Diagnostic extends IonicNativePlugin {
permission = {
READ_CALENDAR: 'READ_CALENDAR',

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface DialogsPromptCallback {
@@ -49,7 +49,7 @@ export interface DialogsPromptCallback {
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Dialogs {
export class Dialogs extends IonicNativePlugin {
/**
* Shows a custom alert or dialog box.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaCheck } from '@ionic-native/core';
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
declare var cordova: any;
@@ -79,7 +79,7 @@ export interface EmailComposerOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class EmailComposer {
export class EmailComposer extends IonicNativePlugin {
/**
* Verifies if sending emails is supported on the device.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface EstimoteBeaconRegion {
@@ -47,7 +47,7 @@ export interface EstimoteBeaconRegion {
platforms: ['iOS', 'Android']
})
@Injectable()
export class EstimoteBeacons {
export class EstimoteBeacons extends IonicNativePlugin {
/** Proximity value */
ProximityUnknown = 0;

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface FacebookLoginResponse {
@@ -117,7 +117,7 @@ export interface FacebookLoginResponse {
platforms: ['Android', 'iOS']
})
@Injectable()
export class Facebook {
export class Facebook extends IonicNativePlugin {
/**
* Browser wrapper

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name File Chooser
@@ -29,7 +29,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class FileChooser {
export class FileChooser extends IonicNativePlugin {
/**
* Open a file

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name File Opener
@@ -28,7 +28,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
})
@Injectable()
export class FileOpener {
export class FileOpener extends IonicNativePlugin {
/**
* Open an file

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
declare var window: any;
@@ -18,8 +18,8 @@ declare var window: any;
* ...
*
* this.filePath.resolveNativePath(path)
* .then(filePath => console.log(filePath);
* .catch(err => console.log(err);
* .then(filePath => console.log(filePath))
* .catch(err => console.log(err));
*
* ```
*/
@@ -31,7 +31,7 @@ declare var window: any;
platforms: ['Android']
})
@Injectable()
export class FilePath {
export class FilePath extends IonicNativePlugin {
/**
* Resolve native path for given content URL/path.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, CordovaCheck } from '@ionic-native/core';
import { CordovaProperty, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
declare var window: any;
declare var cordova: any;
@@ -371,7 +371,7 @@ export declare var FileError: {
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class File {
export class File extends IonicNativePlugin {
/**
* Read-only directory where the application is installed.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface FingerprintOptions {
@@ -30,7 +30,7 @@ export interface FingerprintOptions {
* ```typescript
* import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
*
* constructor(private faio: FingerpirntAIO) { }
* constructor(private faio: FingerprintAIO) { }
*
* ...
*
@@ -54,7 +54,7 @@ export interface FingerprintOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class FingerprintAIO {
export class FingerprintAIO extends IonicNativePlugin {
/**
* Check if fingerprint authentication is available

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -32,7 +32,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Firebase {
export class Firebase extends IonicNativePlugin {
/**
* Get the device token

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Flashlight
@@ -11,7 +11,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
* ```typescript
* import { Flashlight } from '@ionic-native/flashlight';
*
* constructor(private flashlight: FlashLight) { }
* constructor(private flashlight: Flashlight) { }
*
* ...
*
@@ -28,7 +28,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Flashlight {
export class Flashlight extends IonicNativePlugin {
/**
* Checks if the flashlight is available

View File

@@ -0,0 +1,221 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface FlurryAnalyticsOptions {
/** Flurry API key is required */
appKey: string;
/**
* Overrides the version of the app
*/
version?: string;
/**
* How long can the app be paused before a new session is created,
* must be less than or equal to five for Android devices
*/
continueSessionSeconds?: number;
/**
* Set id of the user
*/
userId?: string;
/**
* Set gender of the user
* Valid values are "m", "M", "f" and "F"
*/
gender?: string;
/**
* Set age of the user
*/
age?: number;
/**
* Set error for log
* Values: VERBOSE, DEBUG, INFO, WARN, ERROR
*/
logLevel?: string;
/**
* Defaults to false
*/
enableLogging?: boolean;
/**
* Should every event show up the app's log, defaults to true
*/
enableEventLogging?: boolean;
/**
* Should app crashes be recorded in flurry, defaults to false, iOS only
*/
enableCrashReporting?: boolean;
/**
* Should the session continue when the app is the background, defaults to false, iOS only
*/
enableBackgroundSessions?: boolean;
/**
* Should data be pushed to flurry when the app closes, defaults to true, iOS only
*/
reportSessionsOnClose?: boolean;
/**
* Should data be pushed to flurry when the app is paused, defaults to true, iOS only
*/
reportSessionsOnPause?: boolean;
}
export interface FlurryAnalyticsLocation {
latitude: number;
longitude: number;
/**
* Set altitude
* It is optional and use only for iOS
*/
verticalAccuracy?: number;
/**
* Set radius about 2d point
* It is optional and use only for iOS
*/
horizontalAccuracy?: number;
}
/**
* @name Flurry Analytics
* @description
* This plugin connects to Flurry Analytics SDK
*
* @usage
* ```
* import { FlurryAnalytics } from 'ionic-native/flurry-analytics';
*
* constructor(private flurryAnalytics: FlurryAnalytics) { }
*
* ...
*
* constant options: FlurryAnalyticsOptions = {
* reportSessionsOnClose: true,
* enableLogging: true
* }
*
* FlurryAnalytics.init('12345678965412303214', options)
* .then((something: any) => doSomething(something))
* .catch((error: any) => console.log(error));
*
* ```
* @interfaces
* FlurryAnalyticsOptions
* FlurryAnalyticsLocation
*/
@Plugin({
pluginName: 'FlurryAnalyticsPlugin',
plugin: 'cordova-plugin-flurryanalytics',
pluginRef: 'fa',
repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics.git',
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class FlurryAnalytics extends IonicNativePlugin {
/**
* Set the setting for Flurry Analytics
* @param appKey {string} API key is required
* @param options {FlurryAnalyticsOptions} is optional
* @return {Promise<any>}
*/
@Cordova()
init(appKey: string, options?: FlurryAnalyticsOptions): Promise<any> {
return;
}
/**
* This function set the Event
* @param eventName {string} The param to configure name of Event
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when event is set
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
logEvent(eventName: string, params?: any): Promise<any> {
return;
}
/**
* This function start a timed event
* @param eventName
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when timed event is started tracking
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
startTimedEvent(eventName: string, params?: Object): Promise<any> {
return;
}
/**
* This function complete a timed event
* @param eventName
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when timed event is ended tracking
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
endTimedEvent(eventName: string, params?: Object): Promise<any> {
return;
}
/**
* This function log an error
* @param code
* @param message
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
logError(code, message): Promise<any> {
return;
}
/**
* This function log a page view
* @return {Promise<any>}
*/
@Cordova()
logPageView(): Promise<any> {
return;
}
/**
* This function set the location for the event
* (this is will only be used for very course grained statistics like city)
* @param location
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
setLocation(location: FlurryAnalyticsLocation): Promise<any> {
return;
}
/**
* This function start the session
* Only needed for older versions of Android
* @return {Promise<any>}
*/
@Cordova()
startSession(): Promise<any> {
return;
}
/**
* This function end the session
* Only needed for older versions of Android
* @return {Promise<any>}
*/
@Cordova()
endSession(): Promise<any> {
return;
}
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaFunctionOverride } from '@ionic-native/core';
import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var window: any;
@@ -83,7 +83,7 @@ declare var window: any;
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows Phone']
})
@Injectable()
export class Geofence {
export class Geofence extends IonicNativePlugin {
public TransitionType = {
ENTER: 1,

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var navigator: any;
@@ -156,7 +156,7 @@ export interface GeolocationOptions {
platforms: ['Android', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Geolocation {
export class Geolocation extends IonicNativePlugin {
/**
* Get the device's current position.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Globalization
@@ -29,7 +29,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
})
@Injectable()
export class Globalization {
export class Globalization extends IonicNativePlugin {
/**
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare var window;
@@ -22,6 +22,7 @@ declare var window;
* this.ga.startTrackerWithId('YOUR_TRACKER_ID')
* .then(() => {
* console.log('Google analytics is ready now');
this.ga.trackView('test');
* // Tracker is ready
* // You can now track pages or set additional information such as AppVersion or UserId
* })
@@ -38,7 +39,7 @@ declare var window;
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class GoogleAnalytics {
export class GoogleAnalytics extends IonicNativePlugin {
/**
* In your 'deviceready' handler, set up your Analytics tracker.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaInstance, CordovaCheck, Plugin, InstanceProperty, InstanceCheck, checkAvailability } from '@ionic-native/core';
import { Cordova, CordovaInstance, CordovaCheck, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
@@ -384,7 +384,7 @@ export class GoogleMap {
* export class MapPage {
* constructor(private googleMaps: GoogleMaps) {}
*
* // Load map only after view is initialize
* // Load map only after view is initialized
* ngAfterViewInit() {
* this.loadMap();
* }
@@ -455,7 +455,7 @@ export class GoogleMap {
platforms: ['Android', 'iOS']
})
@Injectable()
export class GoogleMaps {
export class GoogleMaps extends IonicNativePlugin {
/**
* Checks if a map object has been created and is available.
@@ -1749,7 +1749,7 @@ export interface GeocoderResult {
*/
@Plugin({
pluginName: 'Geocoder',
pluginRef: 'plugins.google.maps.Geocoder',
pluginRef: 'plugin.google.maps.Geocoder',
plugin: 'cordova-plugin-googlemaps',
repo: ''
})

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Google Plus
@@ -12,7 +12,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
*
* ...
*
* this.googlePlus.login()
* this.googlePlus.login({})
* .then(res => console.log(res))
* .catch(err => console.error(err));
*
@@ -28,7 +28,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
installVariables: ['REVERSED_CLIENT_ID']
})
@Injectable()
export class GooglePlus {
export class GooglePlus extends IonicNativePlugin {
/**
* The login function walks the user through the Google Auth process.

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
@@ -81,7 +81,7 @@ export interface GyroscopeOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class Gyroscope {
export class Gyroscope extends IonicNativePlugin {
/**
* Watching for gyroscope sensor changes

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Header Color
@@ -25,7 +25,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android']
})
@Injectable()
export class HeaderColor {
export class HeaderColor extends IonicNativePlugin {
/**
* Set a color to the task header

View File

@@ -1,6 +1,21 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @hidden
*/
export interface HealthDataType {
/**
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
read?: string[];
/**
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
write?: string[];
}
/**
* @hidden
*/
@@ -154,9 +169,19 @@ export interface HealthData {
* ...
*
* this.health.isAvailable()
* .then((available:boolean) => {
* console.log(available);
* this.health.requestAuthorization([
* 'distance', 'nutrition', //read and write permissions
* {
* read: ['steps'], //read only permission
* write: ['height', 'weight'] //write only permission
* }
* ])
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
* })
* .catch(e => console.log(e));
*
* ```
* See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.
@@ -175,7 +200,7 @@ export interface HealthData {
platforms: ['Android', 'iOS']
})
@Injectable()
export class Health {
export class Health extends IonicNativePlugin {
/**
* Tells if either Google Fit or HealthKit are available.
@@ -204,7 +229,7 @@ export class Health {
promptInstallFit(): Promise<any> { return; }
/**
* Requests read and write access to a set of data types. It is recommendable to always explain why the app
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
* needs access to the data before asking the user to authorize it.
* This function must be called before using the query and store functions, even if the authorization has already
* been given at some point in the past.
@@ -219,22 +244,25 @@ export class Health {
* In Android 6 and over, this function will also ask for some dynamic permissions if needed
* (e.g. in the case of "distance", it will need access to ACCESS_FINE_LOCATION).
*
* @param {Array<String>} datatypes a list of data types you want to be granted access to
*
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to be granted access to.
* @return {Promise<any>}
*/
@Cordova()
requestAuthorization(datatypes: Array<string>): Promise<any> { return; }
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
/**
* Check if the app has authorization to read/write a set of datatypes.
* This function is similar to requestAuthorization() and has similar quirks.
*
* @param {Array<String>} datatypes a list of data types you want to be granted access to
* Quirks of isAuthorized()
*
* In iOS, this function will only check authorization status for writeable data.
* Read-only data will always be considered as not authorized. This is an intended behaviour of HealthKit.
*
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to check access of, same as in requestAuthorization
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
*/
@Cordova()
isAuthorized(datatypes: Array<string>): Promise<boolean> { return; }
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
/**
* Gets all the data points of a certain data type within a certain time window.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface HotspotConnectionInfo {
@@ -133,7 +133,7 @@ export interface HotspotDevice {
platforms: ['Android']
})
@Injectable()
export class Hotspot {
export class Hotspot extends IonicNativePlugin {
/**
* @returns {Promise<boolean>}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface HTTPResponse {
/**
@@ -65,7 +65,7 @@ export interface HTTPResponse {
platforms: ['Android', 'iOS']
})
@Injectable()
export class HTTP {
export class HTTP extends IonicNativePlugin {
/**
* This returns an object representing a basic HTTP Authorization header of the form.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface HttpdOptions {
@@ -55,7 +55,7 @@ export interface HttpdOptions {
platforms: ['iOS', 'Android']
})
@Injectable()
export class Httpd {
export class Httpd extends IonicNativePlugin {
/**
* Starts a web server.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaCheck } from '@ionic-native/core';
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var cordova: any;
@@ -286,7 +286,7 @@ export interface IBeaconDelegate {
platforms: ['Android', 'iOS']
})
@Injectable()
export class IBeacon {
export class IBeacon extends IonicNativePlugin {
/**
* Instances of this class are delegates between the {@link LocationManager} and

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface ImagePickerOptions {
@@ -63,7 +63,7 @@ export interface ImagePickerOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class ImagePicker {
export class ImagePicker extends IonicNativePlugin {
/**
* Pick pictures from the library.
* @param {ImagePickerOptions} options

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface ImageResizerOptions {
/**
@@ -80,7 +80,7 @@ export interface ImageResizerOptions {
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class ImageResizer {
export class ImageResizer extends IonicNativePlugin {
/**
* @returns {Promise<any>}
*/

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance } from '@ionic-native/core';
import { Plugin, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
@@ -166,7 +166,7 @@ export class InAppBrowserObject {
platforms: ['Amazon', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class InAppBrowser {
export class InAppBrowser extends IonicNativePlugin {
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
@@ -61,7 +61,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase'
})
@Injectable()
export class InAppPurchase {
export class InAppPurchase extends IonicNativePlugin {
/**
* Retrieves a list of full product data from Apple/Google. This method must be called before making purchases.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
@@ -37,7 +37,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Insomnia {
export class Insomnia extends IonicNativePlugin {
/**
* Keeps awake the application

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Instagram
@@ -27,7 +27,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Instagram {
export class Instagram extends IonicNativePlugin {
/**
* Detect if the Instagram application is installed on the device.

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
declare var window: any;
@@ -49,18 +49,17 @@ export interface IntelSecurityDataOptions {
* let storageID = 'id';
*
* this.intelSecurity.data.createFromData({ data: 'Sample Data' })
* .then((instanceID: Number) => this.IntelSecurity.storage.write({ id: storageId, instanceID: instanceID }))
* .then((instanceID: Number) => this.intelSecurity.storage.write({ id: storageId, instanceID: instanceID }))
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.read({id: storageID })
* .then(this.intelSecurity.data.getData)
* .then((instanceID: number) => this.intelSec.data.getData(instanceID))
* .then((data: string) => console.log(data)) // Resolves to 'Sample Data'
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.delete({ id: storageID })
* .then(() => console.log('Deleted Successfully'))
* .catch((error: any) => console.log(error));
*
* ```
* @classes
* IntelSecurityData
@@ -76,7 +75,7 @@ export interface IntelSecurityDataOptions {
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class IntelSecurity {
export class IntelSecurity extends IonicNativePlugin {
/**
* returns an IntelSecurityStorage object

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Is Debug
@@ -29,7 +29,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class IsDebug {
export class IsDebug extends IonicNativePlugin {
/**
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaCheck } from '@ionic-native/core';
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var cordova: any;
@@ -38,7 +38,7 @@ declare var cordova: any;
platforms: ['Android', 'iOS']
})
@Injectable()
export class JinsMeme {
export class JinsMeme extends IonicNativePlugin {
/**
* Authentication and authorization of App and SDK.
* Must call this method first.

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
@@ -28,7 +28,7 @@ import { Observable } from 'rxjs/Observable';
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
})
@Injectable()
export class Keyboard {
export class Keyboard extends IonicNativePlugin {
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.

View File

@@ -0,0 +1,94 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Keychain
* @description
* Get and set data in the iOS Keychain
*
* Requires Cordova plugin: `cordova-plugin-ios-keychain`. For more info, please see the [Keychain plugin docs](https://github.com/driftyco/cordova-plugin-ios-keychain).
*
* @usage
* ```typescript
* import { Keychain } from '@ionic-native/keychain';
*
* constructor(private keychain: Keychain) { }
*
* ...
*
* this.keychain.set(key, value).then(() => {
* this.keychain.get(key)
* .then(value => console.log('Got value', value))
* .catch(err => console.error('Error getting', err));
* })
* .catch(err => console.error('Error setting', err));
* ```
*/
@Plugin({
pluginName: 'Keychain',
plugin: 'cordova-plugin-ios-keychain',
pluginRef: 'window.Keychain',
repo: 'https://github.com/driftyco/cordova-plugin-ios-keychain/',
platforms: ['iOS']
})
@Injectable()
export class Keychain extends IonicNativePlugin {
/**
* Retrieves a value for a key
*
* @param {string} key the key to retrieve
* @param {string} [touchIDMessage] the message to show underneath the TouchID prompt (if any)
*/
@Cordova({
callbackOrder: 'reverse'
})
get(key: string, touchIDMessage?: string): Promise<any> { return; }
/**
* Sets a value for a key
*
* @param {string} key the key to set
* @param {string|number|boolean} value the value to set
* @param {boolean} [useTouchID] whether to store the value with security such that TouchID will be needed to grab it
*/
@Cordova({
callbackOrder: 'reverse'
})
set(key: string, value: string|number|boolean, useTouchID?: boolean): Promise<any> { return; }
/**
* Gets a JSON value for a key
*
* @param {string} key the key to retrieve
* @param {string} touchIDMessage the message to show underneath the TouchID prompt (if any)
*/
@Cordova({
callbackOrder: 'reverse'
})
getJson(key: string, touchIDMessage?: string): Promise<any> { return; }
/**
* Sets a JSON value for a key
*
* @param {string} key the key to set
* @param {any} obj value the value to set
* @param {boolean} [useTouchId] Wether to store the value with security such that TouchID will be needed to grab it
*/
@Cordova({
callbackOrder: 'reverse'
})
setJson(key: string, obj: any, useTouchId?: boolean): Promise<any> { return; }
/**
* Removes a value for a key
*
* @param {string} key the key to remove
*/
@Cordova({
callbackOrder: 'reverse'
})
remove(key: string): Promise<any> { return; }
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface LaunchNavigatorOptions {
@@ -95,7 +95,7 @@ export interface LaunchNavigatorOptions {
platforms: ['Android', 'iOS']
})
@Injectable()
export class LaunchNavigator {
export class LaunchNavigator extends IonicNativePlugin {
/**
* Launches navigator app

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Launch Review
@@ -30,7 +30,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class LaunchReview {
export class LaunchReview extends IonicNativePlugin {
/**
* Launch store app using given app ID

View File

@@ -1,4 +1,4 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_company_admin' | 'w_share';
@@ -57,7 +57,7 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
platforms: ['Android', 'iOS']
})
@Injectable()
export class LinkedIn {
export class LinkedIn extends IonicNativePlugin {
/**
* Login with the LinkedIn App

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface ILocalNotification {
@@ -148,7 +148,7 @@ export interface ILocalNotification {
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class LocalNotifications {
export class LocalNotifications extends IonicNativePlugin {
/**
* Schedules a single or multiple notifications

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Location Accuracy
@@ -36,7 +36,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class LocationAccuracy {
export class LocationAccuracy extends IonicNativePlugin {
/**
* Indicates if you can request accurate location
* @returns {Promise<boolean>} Returns a promise that resovles with a boolean that indicates if you can request accurate location

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Market
* @description
@@ -25,7 +25,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
platforms: ['Android', 'iOS']
})
@Injectable()
export class Market {
export class Market extends IonicNativePlugin {
/**
* Opens an app in Google Play / App Store

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin } from '@ionic-native/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var navigator: any;
@@ -149,7 +149,7 @@ export interface ConfigurationData {
repo: 'https://github.com/apache/cordova-plugin-media-capture'
})
@Injectable()
export class MediaCapture {
export class MediaCapture extends IonicNativePlugin {
/**
* The recording image sizes and formats supported by the device.
* @returns {ConfigurationData[]}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, CordovaCheck } from '@ionic-native/core';
import { CordovaInstance, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
declare var Media: any;
@@ -92,7 +92,6 @@ export class MediaObject {
})
startRecord(): void { }
/**
* Stops recording
*/
@@ -124,8 +123,27 @@ export class MediaObject {
sync: true
})
stop(): void { }
}
export type MediaStatusUpdateCallback = (statusCode: number) => void;
export interface MediaError {
/**
* Error message
*/
message: string;
/**
* Error code
*/
code: number;
}
export type MediaErrorCallback = (error: MediaError) => void;
/**
* @name Media
* @description
@@ -144,55 +162,53 @@ export class MediaObject {
* // We can optionally pass a second argument to track the status of the media
*
* const onStatusUpdate = (status) => console.log(status);
* const onSuccess = () => console.log('Action is successful.');
* const onError = (error) => console.error(error.message);
*
* this.media.create('path/to/file.mp3', onStatusUpdate)
* .then((file: MediaObject) => {
* const file: MediaObject = this.media.create('path/to/file.mp3', onStatusUpdate, onSuccess, onError);
*
* // play the file
* file.play();
* // play the file
* file.play();
*
* // pause the file
* file.pause();
* // pause the file
* file.pause();
*
* // get current playback position
* file.getCurrentPosition().then((position) => {
* console.log(position);
* });
* // get current playback position
* file.getCurrentPosition().then((position) => {
* console.log(position);
* });
*
* // get file duration
* file.getDuration().then((duration) => {
* console.log(position);
* });
* // get file duration
* let duration = file.getDuration();
* console.log(duration);
*
* // skip to 10 seconds (expects int value in ms)
* file.seekTo(10000);
* // skip to 10 seconds (expects int value in ms)
* file.seekTo(10000);
*
* // stop playing the file
* file.stop();
* // stop playing the file
* file.stop();
*
* // release the native audio resource
* // Platform Quirks:
* // iOS simply create a new instance and the old one will be overwritten
* // Android you must call release() to destroy instances of media when you are done
* file.release();
* // release the native audio resource
* // Platform Quirks:
* // iOS simply create a new instance and the old one will be overwritten
* // Android you must call release() to destroy instances of media when you are done
* file.release();
*
* })
* .catch(e => console.log('Error opening media file', e));
*
*
* // Recording to a file
* this.media.create('path/to/file.mp3')
* .then((file: MedieObject) => {
* const file: MediaObject = this.media.create('path/to/file.mp3');
*
* file.startRecord();
* file.startRecord();
*
* file.stopRecord();
* file.stopRecord();
*
* });
*
* ```
* @classes
* MediaObject
* @interfaces
* MediaError
*/
@Plugin({
pluginName: 'MediaPlugin',
@@ -201,7 +217,7 @@ export class MediaObject {
pluginRef: 'Media'
})
@Injectable()
export class MediaPlugin {
export class MediaPlugin extends IonicNativePlugin {
// Constants
/**
@@ -246,19 +262,20 @@ export class MediaPlugin {
/**
* Open a media file
* @param src {string} A URI containing the audio content.
* @param onStatusUpdate {Function} A callback function to be invoked when the status of the file changes
* @return {Promise<MediaObject>}
* @param [onStatusUpdate] {MediaStatusUpdateCallback} A callback function to be invoked when the status of the file changes
* @param [onSuccess] {Function} A callback function to be invoked after the current play, record, or stop action is completed
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
* @return {MediaObject}
*/
@CordovaCheck()
create(src: string, onStatusUpdate?: Function): Promise<MediaObject> {
create(src: string,
onStatusUpdate?: MediaStatusUpdateCallback,
onSuccess?: Function,
onError?: MediaErrorCallback): MediaObject {
return new Promise<MediaObject>((resolve, reject) => {
// Creates a new media object
// Resolves with the media object
// or rejects with the error
const instance = new Media(src, resolve, reject, onStatusUpdate);
return resolve(new MediaObject(instance));
});
const instance = new Media(src, onSuccess, onError, onStatusUpdate);
return new MediaObject(instance);
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare var mixpanel: any;
@@ -31,7 +31,7 @@ declare var mixpanel: any;
repo: 'https://github.com/samzilverberg/cordova-mixpanel-plugin'
})
@Injectable()
export class Mixpanel {
export class Mixpanel extends IonicNativePlugin {
/**
*
@@ -115,7 +115,7 @@ export class Mixpanel {
pluginName: 'Mixpanel'
})
@Injectable()
export class MixpanelPeople {
export class MixpanelPeople extends IonicNativePlugin {
/**
*

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface MusicControlsOptions {
@@ -56,7 +56,7 @@ export interface MusicControlsOptions {
* ticker : 'Now playing "Time is Running Out"'
* });
*
* this.musicControls.subscribe(action => {
* this.musicControls.subscribe().subscribe(action => {
*
* switch(action) {
* case 'music-controls-next':
@@ -107,7 +107,7 @@ export interface MusicControlsOptions {
repo: 'https://github.com/homerours/cordova-music-controls-plugin'
})
@Injectable()
export class MusicControls {
export class MusicControls extends IonicNativePlugin {
/**
* Create the media controls

Some files were not shown because too many files have changed in this diff Show More