mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ae3cb0d00 | ||
|
|
0dee3500f7 | ||
|
|
b53af8e3c9 | ||
|
|
006f7dc2ad | ||
|
|
19bc8419e0 | ||
|
|
d3d8f8264c | ||
|
|
8262219d05 | ||
|
|
39a91d9520 | ||
|
|
88a19af21e | ||
|
|
1dccff5e49 | ||
|
|
689f0f159c | ||
|
|
5aa484c024 | ||
|
|
ea88c9e4a8 | ||
|
|
bc364d1cb1 | ||
|
|
ffa37e2932 | ||
|
|
f911366c54 | ||
|
|
0ef4a7394e | ||
|
|
68d99461c6 | ||
|
|
6a458b52cc | ||
|
|
a1a4ef94cc | ||
|
|
6e20137340 | ||
|
|
961727ee61 | ||
|
|
9c30a1d0dd | ||
|
|
ee79278503 | ||
|
|
544e7ef4fc | ||
|
|
01aece1fbb | ||
|
|
a7854b7fad | ||
|
|
27d3d2d1c9 | ||
|
|
9074362cae | ||
|
|
fd0a2e9acd | ||
|
|
9348415cf5 | ||
|
|
ad8c04bf9f | ||
|
|
667f9bdde9 | ||
|
|
aedc9d65c8 | ||
|
|
2869c644ed | ||
|
|
200618dee7 | ||
|
|
5d14b16d73 | ||
|
|
b08e3a8ee1 | ||
|
|
3511f24a26 | ||
|
|
fa803f2258 | ||
|
|
d23f13f837 | ||
|
|
d4c876d009 | ||
|
|
d2ef40ccb7 | ||
|
|
8cf332f0ff | ||
|
|
be345ea829 | ||
|
|
c52bb832b4 | ||
|
|
1eebea9df5 | ||
|
|
150b236468 |
71
CHANGELOG.md
71
CHANGELOG.md
@@ -1,3 +1,74 @@
|
||||
<a name="3.4.1"></a>
|
||||
## [3.4.1](https://github.com/driftyco/ionic-native/compare/v3.4.0...v3.4.1) (2017-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob:** fix event listeners ([b53af8e](https://github.com/driftyco/ionic-native/commit/b53af8e)), closes [#1165](https://github.com/driftyco/ionic-native/issues/1165)
|
||||
* **network:** fix onchange method ([006f7dc](https://github.com/driftyco/ionic-native/commit/006f7dc)), closes [#1173](https://github.com/driftyco/ionic-native/issues/1173)
|
||||
* **network:** remove ontypechange method ([19bc841](https://github.com/driftyco/ionic-native/commit/19bc841))
|
||||
|
||||
|
||||
|
||||
<a name="3.4.0"></a>
|
||||
# [3.4.0](https://github.com/driftyco/ionic-native/compare/v3.3.2...v3.4.0) (2017-03-28)
|
||||
|
||||
|
||||
|
||||
<a name="3.3.2"></a>
|
||||
## [3.3.2](https://github.com/driftyco/ionic-native/compare/v3.3.1...v3.3.2) (2017-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sqlite:** fix SQLiteDatabaseConfig interface ([ea88c9e](https://github.com/driftyco/ionic-native/commit/ea88c9e)), closes [#1280](https://github.com/driftyco/ionic-native/issues/1280)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **admob-free:** add AdMobFree plugin (#1272) ([0ef4a73](https://github.com/driftyco/ionic-native/commit/0ef4a73)), closes [#1170](https://github.com/driftyco/ionic-native/issues/1170)
|
||||
* **sqlite-porter:** add SQLite porter plugin (#1273) ([f911366](https://github.com/driftyco/ionic-native/commit/f911366)), closes [#485](https://github.com/driftyco/ionic-native/issues/485)
|
||||
* **taptic-engine:** add taptic engine plugin support (#1271) ([ffa37e2](https://github.com/driftyco/ionic-native/commit/ffa37e2))
|
||||
* **zeroconf:** add cordova-plugin-zeroconf support (#1260) ([68d9946](https://github.com/driftyco/ionic-native/commit/68d9946))
|
||||
|
||||
|
||||
|
||||
<a name="3.3.1"></a>
|
||||
## [3.3.1](https://github.com/driftyco/ionic-native/compare/v3.3.0...v3.3.1) (2017-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background-mode:** add missing config options ([9c30a1d](https://github.com/driftyco/ionic-native/commit/9c30a1d)), closes [#1277](https://github.com/driftyco/ionic-native/issues/1277)
|
||||
* **contacts:** fix major bug ([6e20137](https://github.com/driftyco/ionic-native/commit/6e20137))
|
||||
* **contacts:** handle cordova_not_found errors ([961727e](https://github.com/driftyco/ionic-native/commit/961727e))
|
||||
* **core:** handle unexpected errors in wrapOtherPromise ([9074362](https://github.com/driftyco/ionic-native/commit/9074362)), closes [#1185](https://github.com/driftyco/ionic-native/issues/1185)
|
||||
* **core:** return errors from CordovaCheck decorators ([fd0a2e9](https://github.com/driftyco/ionic-native/commit/fd0a2e9)), closes [#1268](https://github.com/driftyco/ionic-native/issues/1268)
|
||||
* **sqlite:** fixes echoTest and deleteDatabase ([01aece1](https://github.com/driftyco/ionic-native/commit/01aece1)), closes [#1275](https://github.com/driftyco/ionic-native/issues/1275)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **sqlite:** add SQLiteDatabaseConfig interface ([544e7ef](https://github.com/driftyco/ionic-native/commit/544e7ef))
|
||||
|
||||
|
||||
|
||||
<a name="3.3.0"></a>
|
||||
# [3.3.0](https://github.com/driftyco/ionic-native/compare/v3.2.4...v3.3.0) (2017-03-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-full-screen:** add cordova-plugin-fullscreen support (#1255) ([b08e3a8](https://github.com/driftyco/ionic-native/commit/b08e3a8))
|
||||
* **intel-security:** add com-intel-security-cordova-plugin support (#1256) ([aedc9d6](https://github.com/driftyco/ionic-native/commit/aedc9d6))
|
||||
|
||||
|
||||
|
||||
<a name="3.2.4"></a>
|
||||
## [3.2.4](https://github.com/driftyco/ionic-native/compare/v3.2.3...v3.2.4) (2017-03-26)
|
||||
|
||||
|
||||
|
||||
<a name="3.2.3"></a>
|
||||
## [3.2.3](https://github.com/driftyco/ionic-native/compare/v3.2.2...v3.2.3) (2017-03-24)
|
||||
|
||||
|
||||
66
DEVELOPER.md
66
DEVELOPER.md
@@ -17,6 +17,7 @@ gulp plugin:create -n PluginName
|
||||
gulp plugin:create -m -n PluginName
|
||||
```
|
||||
|
||||
Running the command above will create a new directory `src/@ionic-native/plugins/plugin-name/` with a single file in there: `index.ts`. This file is where all the plugin definitions should be.
|
||||
|
||||
Let's take a look at the existing plugin wrapper for Geolocation to see what goes into an Ionic Native plugin (comments have been removed for clarity):
|
||||
|
||||
@@ -110,7 +111,7 @@ The `@Cordova` decorator has a few more options now.
|
||||
|
||||
### Testing your changes
|
||||
|
||||
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. Then, you must go to your ionic application folder and replace your current `node_modules/ionic-native/dist/` with the newly generated one.
|
||||
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. The `dist` directory will contain a sub directory `@ionic-native` with all the packages compiled in there. Copy the package(s) you created/modified to your app's node_modules under the `@ionic-native` directory. (e.g. `cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/`).
|
||||
|
||||
### Cleaning the code
|
||||
|
||||
@@ -147,4 +148,65 @@ The subject contains succinct description of the change:
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* do not capitalize first letter
|
||||
* do not place a period (.) at the end
|
||||
* entire length of the commit message must not go over 50 characters
|
||||
* entire length of the commit message must not go over 50 characters
|
||||
|
||||
|
||||
### Ionic Native Decorators
|
||||
|
||||
#### Plugin
|
||||
A decorator to wrap the main plugin class, and any other classes that will use `@Cordova` or `@CordovaProperty` decorators. This decorator accepts the following configuration:
|
||||
- *pluginName*: Plugin name, this should match the class name
|
||||
- *plugin*: The plugin's NPM package, or Github URL if NPM is not available.
|
||||
- *pluginRef*: The plugin object reference. Example: 'cordova.file'.
|
||||
- *repo*: The plugin's Github Repository URL
|
||||
- *install*: (optional) Install command. This is used in case a plugin has a custom install command (takes variables).
|
||||
- *platforms*: An array of strings indicating the supported platforms.
|
||||
|
||||
#### Cordova
|
||||
Checks if the plugin and the method are available before executing. By default, the decorator will wrap the callbacks of the function and return a Promise. This decorator takes the following configuration options:
|
||||
- **observable**: set to true to return an Observable
|
||||
- **clearFunction**: an optional name of a method to clear the observable we returned
|
||||
- **clearWithArgs**: This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used in the initial function.
|
||||
- **sync**: set to true if the method should return the value as-is without wrapping with Observable/Promise
|
||||
- **callbackOrder**: set to `reverse` if the success and error callbacks are the first two arguements of the method
|
||||
- **callbackStyle**: set to `node` if the plugin has one callback with a node style (e.g: `function(err, result){}`), or set to `object` if the callbacks are part of an object
|
||||
- **successName**: Success function property name. This must be set if callbackStyle is set to object.
|
||||
- **errorName**: Error function property name. This must be set if callbackStyle is set to object.
|
||||
- **successIndex**: Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
|
||||
- **errorIndex**: Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
|
||||
- **eventObservable**: set to true to return an observable that wraps an event listener
|
||||
- **event**: Event name, this must be set if eventObservable is set to true
|
||||
- **element**: Element to attach the event listener to, this is optional, defaults to `window`
|
||||
- **otherPromise**: Set to true if the wrapped method returns a promise
|
||||
- **platforms**: array of strings indicating supported platforms. Specify this if the supported platforms doesn't match the plugin's supported platforms.
|
||||
|
||||
Example:
|
||||
```ts
|
||||
@Cordova()
|
||||
someMethod(): Promise<any> { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
syncMethod(): number { }
|
||||
```
|
||||
|
||||
#### CordovaProperty
|
||||
Checks if the plugin and property exist before getting/setting the property's value
|
||||
|
||||
Example:
|
||||
```ts
|
||||
@CordovaProperty
|
||||
someProperty: string;
|
||||
```
|
||||
|
||||
#### CordovaCheck
|
||||
Checks if the plugin exists before performing a custom written method. By default, the method will return a promise that will reject with an error if the plugin is not available. This wrapper accepts two optional configurations:
|
||||
- **observable**: set to true to return an empty Observable if the plugin isn't available
|
||||
- **sync**: set to true to return nothing if the plugin isn't available
|
||||
|
||||
Example:
|
||||
```ts
|
||||
@CordovaCheck()
|
||||
someMethod(): Promise<any> {
|
||||
// anything here will only run if the plugin is available
|
||||
}
|
||||
```
|
||||
13
gulpfile.js
13
gulpfile.js
@@ -5,7 +5,8 @@ const gulp = require('gulp'),
|
||||
rename = require("gulp-rename"),
|
||||
tslint = require('gulp-tslint'),
|
||||
decamelize = require('decamelize'),
|
||||
replace = require('gulp-replace');
|
||||
replace = require('gulp-replace'),
|
||||
_ = require('lodash');
|
||||
|
||||
const flagConfig = {
|
||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||
@@ -31,16 +32,16 @@ gulp.task('lint', () => {
|
||||
gulp.task('plugin:create', () => {
|
||||
if (flags.n && flags.n !== ''){
|
||||
|
||||
const src = flags.m?'./scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl',
|
||||
const src = flags.m ? './scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl',
|
||||
pluginName = flags.n,
|
||||
pluginPackageName = decamelize(pluginName, '-'),
|
||||
pluginNameSpaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1');
|
||||
|
||||
return gulp.src(src)
|
||||
.pipe(replace('PluginName', pluginName))
|
||||
.pipe(replace('Plugin Name', pluginNameSpaced))
|
||||
.pipe(replace('$PluginName', pluginName))
|
||||
.pipe(replace('$Plugin_Name', pluginNameSpaced))
|
||||
.pipe(replace('$pluginName', _.lowerFirst(pluginName)))
|
||||
.pipe(rename('index.ts'))
|
||||
.pipe(gulp.dest('./src/@ionic-native/plugins/' + pluginPackageName));
|
||||
.pipe(gulp.dest('./src/@ionic-native/plugins/' + _.kebabCase(pluginName)));
|
||||
|
||||
} else {
|
||||
console.log("Usage is: gulp plugin:create -n PluginName");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "3.2.3",
|
||||
"version": "3.4.1",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@@ -43,7 +43,8 @@
|
||||
"clean": "rimraf dist .tmp",
|
||||
"shipit": "npm run build && gulp readmes && npm run npmpub",
|
||||
"npmpub": "node scripts/build/publish.js",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||
"postchangelog": "git commit -am \"chore(): update changelog\""
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
|
||||
@@ -13,6 +13,7 @@ const FLAGS = '--access public'; // add any flags here if you want... (example:
|
||||
|
||||
const PACKAGES = fs.readdirSync(DIST);
|
||||
|
||||
const failedPackages = [];
|
||||
|
||||
const QUEUE = queue({
|
||||
concurrency: 10
|
||||
@@ -26,7 +27,15 @@ PACKAGES.forEach(packageName => {
|
||||
const packagePath = path.resolve(DIST, packageName);
|
||||
exec(`npm publish ${packagePath} ${FLAGS}`)
|
||||
.then(() => done())
|
||||
.catch(done);
|
||||
.catch((e) => {
|
||||
if (e.stderr && e.stderr.indexOf('previously published version') === -1) {
|
||||
failedPackages.push({
|
||||
cmd: e.cmd,
|
||||
stderr: e.stderr
|
||||
});
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -36,9 +45,14 @@ QUEUE.start((err) => {
|
||||
|
||||
if (err) {
|
||||
console.log('Error publishing ionic-native. ', err);
|
||||
} else if (failedPackages.length > 0) {
|
||||
console.log(`${failedPackages.length} packages failed to publish.`);
|
||||
console.log(failedPackages);
|
||||
} else {
|
||||
console.log('Done publishing ionic-native!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
"rootDir": "../../src/",
|
||||
"target": "es5",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["es2015", "dom"]
|
||||
"lib": ["es2015", "dom"],
|
||||
"sourceMap": true,
|
||||
"inlineSources": true
|
||||
},
|
||||
"files": [
|
||||
"../../src/@ionic-native/core/index.ts"
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
"rootDir": "../../../src/@ionic-native/plugins/",
|
||||
"target": "es5",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["es2015", "dom"]
|
||||
"lib": ["es2015", "dom"],
|
||||
"sourceMap": true,
|
||||
"inlineSources": true
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
|
||||
@@ -2,23 +2,29 @@ import { Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name Plugin Name
|
||||
* @name $Plugin_Name
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PluginName } from 'ionic-native';
|
||||
* import { $PluginName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* constructor(private $pluginName: $PluginName) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PluginName',
|
||||
pluginName: '$PluginName',
|
||||
plugin: '',
|
||||
pluginRef: '',
|
||||
repo: ''
|
||||
repo: '',
|
||||
platforms: []
|
||||
})
|
||||
@Injectable()
|
||||
export class PluginName {
|
||||
export class $PluginName {
|
||||
|
||||
}
|
||||
|
||||
@@ -15,29 +15,36 @@ import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Plugin Name
|
||||
* @name $Plugin_Name
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PluginName } from 'ionic-native';
|
||||
* import { $PluginName } from 'ionic-native';
|
||||
*
|
||||
* PluginName.functionName('Hello', 123)
|
||||
* .then((something: any) => doSomething(something))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* constructor(private $pluginName: $PluginName) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.$pluginName.functionName('Hello', 123)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PluginName',
|
||||
pluginName: '$PluginName',
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
install: '' // OPTIONAL install command, in case the plugin requires variables
|
||||
platforms: [], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
})
|
||||
@Injectable()
|
||||
export class PluginName {
|
||||
export class $PluginName {
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { instanceAvailability, checkAvailability, wrap, wrapInstance, overrideFunction } from './plugin';
|
||||
import { getPlugin, getPromise } from './util';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/observable/throw';
|
||||
|
||||
export interface PluginConfig {
|
||||
/**
|
||||
@@ -145,15 +146,16 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
return (pluginObj: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
|
||||
return {
|
||||
value: function(...args: any[]): any {
|
||||
if (checkAvailability(pluginObj) === true) {
|
||||
const check = checkAvailability(pluginObj);
|
||||
if (check === true) {
|
||||
return descriptor.value.apply(this, args);
|
||||
} else {
|
||||
if (opts.sync) {
|
||||
return;
|
||||
return null;
|
||||
} else if (opts.observable) {
|
||||
return new Observable<any>(() => {});
|
||||
return Observable.throw(new Error(check && check.error));
|
||||
}
|
||||
return getPromise(() => {});
|
||||
return Promise.reject(check && check.error);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -203,15 +205,19 @@ export function Plugin(config: PluginConfig) {
|
||||
cls['getPluginName'] = function() {
|
||||
return config.pluginName;
|
||||
};
|
||||
|
||||
cls['getPluginRef'] = function() {
|
||||
return config.pluginRef;
|
||||
};
|
||||
|
||||
cls['getPluginInstallName'] = function() {
|
||||
return config.plugin;
|
||||
};
|
||||
|
||||
cls['getPluginRepo'] = function() {
|
||||
return config.repo;
|
||||
};
|
||||
|
||||
cls['getSupportedPlatforms'] = function() {
|
||||
return config.platforms;
|
||||
};
|
||||
|
||||
@@ -152,11 +152,16 @@ function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any
|
||||
|
||||
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any= {}) {
|
||||
return getPromise((resolve, reject) => {
|
||||
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||
if (pluginResult && pluginResult.error) {
|
||||
reject(pluginResult.error);
|
||||
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||
if (pluginResult) {
|
||||
if (pluginResult.error) {
|
||||
reject(pluginResult.error);
|
||||
} else if (pluginResult.then) {
|
||||
pluginResult.then(resolve).catch(reject);
|
||||
}
|
||||
} else {
|
||||
reject({ error: 'unexpected_error' });
|
||||
}
|
||||
pluginResult.then(resolve).catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
294
src/@ionic-native/plugins/admob-free/index.ts
Normal file
294
src/@ionic-native/plugins/admob-free/index.ts
Normal file
@@ -0,0 +1,294 @@
|
||||
import { Plugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
export interface AdMobFreeBannerConfig {
|
||||
/**
|
||||
* Ad Unit ID
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Receiving test ad
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
/**
|
||||
* Auto show ad when loaded
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
/**
|
||||
* Set to true, to put banner at top
|
||||
*/
|
||||
bannerAtTop?: boolean;
|
||||
/**
|
||||
* Set to true, to allow banner overlap WebView
|
||||
*/
|
||||
overlap?: boolean;
|
||||
/**
|
||||
* Set to true to avoid ios7 status bar overlap
|
||||
*/
|
||||
offsetTopBar?: boolean;
|
||||
/**
|
||||
* Banner size
|
||||
*/
|
||||
size?: string;
|
||||
}
|
||||
|
||||
export interface AdMobFreeInterstitialConfig {
|
||||
/**
|
||||
* Ad Unit ID
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Receiving test ad
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
/**
|
||||
* Auto show ad when loaded
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
}
|
||||
|
||||
export interface AdMobFreeRewardVideoConfig {
|
||||
/**
|
||||
* Ad Unit ID
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Receiving test ad
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
/**
|
||||
* Auto show ad when loaded
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdbMobFree
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { AdMobFree, AdMobFreeBannerConfig } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* constructor(private admobFree: AdMobFree) { }
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* const bannerConfig: AdMobFreeBannerConfig = {
|
||||
* // add your config here
|
||||
* // for the sake of this example we will just use the test config
|
||||
* isTesting: true,
|
||||
* autoShow: true
|
||||
* };
|
||||
* this.admobFree.banner.config(bannerConfig);
|
||||
*
|
||||
* this.admobFree.banner.prepare()
|
||||
* .then(() => {
|
||||
* // banner Ad is ready
|
||||
* // if we set autoShow to false, then we will need to call the show method here
|
||||
* })
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMobFree',
|
||||
plugin: 'cordova-plugin-admob-free',
|
||||
pluginRef: 'admob',
|
||||
repo: 'https://github.com/ratson/cordova-plugin-admob-free',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class AdMobFree {
|
||||
|
||||
/**
|
||||
* Convenience constructor to get event names
|
||||
*/
|
||||
events = {
|
||||
BANNER_LOAD: 'admob.banner.events.LOAD',
|
||||
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
|
||||
BANNER_OPEN: 'admob.banner.events.OPEN',
|
||||
BANNER_CLOSE: 'admob.banner.events.CLOSE',
|
||||
BANNER_EXIT_APP: 'admob.banner.events.EXIT_APP',
|
||||
|
||||
INTERSTITIAL_LOAD: 'admob.interstitial.events.LOAD',
|
||||
INTERSTITIAL_LOAD_FAIL: 'admob.interstitial.events.LOAD_FAIL',
|
||||
INTERSTITIAL_OPEN: 'admob.interstitial.events.OPEN',
|
||||
INTERSTITIAL_CLOSE: 'admob.interstitial.events.CLOSE',
|
||||
INTERSTITIAL_EXIT_APP: 'admob.interstitial.events.EXIT_APP',
|
||||
|
||||
REWARD_VIDEO_LOAD: 'admob.rewardvideo.events.LOAD',
|
||||
REWARD_VIDEO_LOAD_FAIL: 'admob.rewardvideo.events.LOAD_FAIL',
|
||||
REWARD_VIDEO_OPEN: 'admob.rewardvideo.events.OPEN',
|
||||
REWARD_VIDEO_CLOSE: 'admob.rewardvideo.events.CLOSE',
|
||||
REWARD_VIDEO_EXIT_APP: 'admob.rewardvideo.events.EXIT_APP',
|
||||
REWARD_VIDEO_START: 'admob.rewardvideo.events.START',
|
||||
REWARD_VIDEO_REWARD: 'admob.rewardvideo.events.REWARD'
|
||||
};
|
||||
|
||||
/**
|
||||
* Watch an event
|
||||
* @param event {string} event name
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
on(event: string): Observable<any> {
|
||||
return Observable.fromEvent(document, event);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {AdMobFreeBanner}
|
||||
*/
|
||||
banner: AdMobFreeBanner = new AdMobFreeBanner();
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {AdMobFreeInterstitial}
|
||||
*/
|
||||
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {AdMobFreeRewardVideo}
|
||||
*/
|
||||
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMobFree',
|
||||
plugin: 'cordova-plugin-admob-free',
|
||||
pluginRef: 'admob.banner',
|
||||
})
|
||||
export class AdMobFreeBanner {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Update config.
|
||||
* @param options
|
||||
* @return {AdMobFreeBannerConfig}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { return; }
|
||||
|
||||
/**
|
||||
* Hide the banner.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
hide(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Create banner.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
prepare(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Remove the banner.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
remove(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the banner.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
show(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMobFree',
|
||||
plugin: 'cordova-plugin-admob-free',
|
||||
pluginRef: 'admob.interstitial',
|
||||
})
|
||||
export class AdMobFreeInterstitial {
|
||||
|
||||
/**
|
||||
* Update config.
|
||||
* @param options
|
||||
* @return {AdMobFreeInterstitialConfig}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { return; }
|
||||
|
||||
/**
|
||||
* Check if interstitial is ready
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
isReady(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prepare interstitial
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
prepare(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the interstitial
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
show(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMobFree',
|
||||
plugin: 'cordova-plugin-admob-free',
|
||||
pluginRef: 'admob.rewardvideo',
|
||||
})
|
||||
export class AdMobFreeRewardVideo {
|
||||
|
||||
/**
|
||||
* Update config.
|
||||
* @param options
|
||||
* @return {AdMobFreeRewardVideoConfig}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { return; }
|
||||
|
||||
/**
|
||||
* Check if reward video is ready
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
isReady(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prepare reward video
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
prepare(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the reward video
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
show(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -242,7 +242,8 @@ export class AdMob {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onAdFailLoad'
|
||||
event: 'onAdFailLoad',
|
||||
element: document
|
||||
})
|
||||
onAdFailLoad(): Observable<any> { return; }
|
||||
|
||||
@@ -252,7 +253,8 @@ export class AdMob {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onAdLoaded'
|
||||
event: 'onAdLoaded',
|
||||
element: document
|
||||
})
|
||||
onAdLoaded(): Observable<any> { return; }
|
||||
|
||||
@@ -262,7 +264,8 @@ export class AdMob {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onAdPresent'
|
||||
event: 'onAdPresent',
|
||||
element: document
|
||||
})
|
||||
onAdPresent(): Observable<any> { return; }
|
||||
|
||||
@@ -272,7 +275,8 @@ export class AdMob {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onAdLeaveApp'
|
||||
event: 'onAdLeaveApp',
|
||||
element: document
|
||||
})
|
||||
onAdLeaveApp(): Observable<any> { return; }
|
||||
|
||||
@@ -282,7 +286,8 @@ export class AdMob {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onAdDismiss'
|
||||
event: 'onAdDismiss',
|
||||
element: document
|
||||
})
|
||||
onAdDismiss(): Observable<any> { return; }
|
||||
|
||||
|
||||
@@ -144,7 +144,8 @@ export interface AFAEncryptResponse {
|
||||
pluginName: 'AndroidFingerprintAuth',
|
||||
plugin: 'cordova-plugin-android-fingerprint-auth',
|
||||
pluginRef: 'FingerprintAuth',
|
||||
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'
|
||||
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidFingerprintAuth {
|
||||
|
||||
95
src/@ionic-native/plugins/android-full-screen/index.ts
Normal file
95
src/@ionic-native/plugins/android-full-screen/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Android Full Screen
|
||||
* @description
|
||||
* This plugin enables developers to offer users a true full screen experience in their Cordova and PhoneGap apps for Android.
|
||||
* Using Android 4.0+, you can use true full screen in "lean mode", the way you see in apps like YouTube, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts. This is ideally suited to video or cut-scene content.
|
||||
* In Android 4.4+, however, you can now enter true full screen, fully interactive immersive mode. In this mode, your app will remain in true full screen until you choose otherwise; users can swipe down from the top of the screen to temporarily display the system UI.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AndroidFullScreen } from '@ionic-native/android-full-screen';
|
||||
*
|
||||
* constructor(private androidFullScreen: AndroidFullScreen) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.androidFullScreen.isImmersiveModeSupported()
|
||||
* .then(() => this.androidFullScreen.immersiveMode())
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidFullScreen',
|
||||
plugin: 'cordova-plugin-fullscreen',
|
||||
pluginRef: 'AndroidFullScreen',
|
||||
repo: 'https://github.com/mesmotronic/cordova-plugin-fullscreen',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidFullScreen {
|
||||
/**
|
||||
* Is this plugin supported?
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
isSupported(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Is immersive mode supported?
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
isImmersiveModeSupported(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* The width of the screen in immersive mode.
|
||||
* @return {Promise<number>}
|
||||
*/
|
||||
@Cordova()
|
||||
immersiveWidth(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* The height of the screen in immersive mode.
|
||||
* @return {Promise<number>}
|
||||
*/
|
||||
@Cordova()
|
||||
immersiveHeight(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* Hide system UI until user interacts.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
leanMode(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Show system UI.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
showSystemUI(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Extend your app underneath the status bar (Android 4.4+ only).
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
showUnderStatusBar(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Extend your app underneath the system UI (Android 4.4+ only).
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
showUnderSystemUI(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Hide system UI and keep it hidden (Android 4.4+ only).
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
immersiveMode(): Promise<void> { return; }
|
||||
}
|
||||
@@ -21,9 +21,10 @@ import { Injectable } from '@angular/core';
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppPreferences',
|
||||
plugin: 'cordova-plugin-app-preferences', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'plugins.appPreferences', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/apla/me.apla.cordova.app-preferences', // the github repository URL for the plugin
|
||||
plugin: 'cordova-plugin-app-preferences',
|
||||
pluginRef: 'plugins.appPreferences',
|
||||
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'OS X', 'Windows 8', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class AppPreferences {
|
||||
|
||||
@@ -28,7 +28,7 @@ import { Injectable } from '@angular/core';
|
||||
plugin: 'https://github.com/appodeal/appodeal-cordova-plugin',
|
||||
pluginRef: 'Appodeal',
|
||||
repo: 'https://github.com/appodeal/appodeal-cordova-plugin.git',
|
||||
platforms: [ 'ios', 'android' ]
|
||||
platforms: [ 'iOS', 'Android' ]
|
||||
})
|
||||
@Injectable()
|
||||
export class Appodeal {
|
||||
|
||||
@@ -13,26 +13,37 @@ export interface BackgroundModeConfiguration {
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
* Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
* This will look for <icon name>.png in platforms/android/res/drawable|mipmap
|
||||
*/
|
||||
silent?: boolean;
|
||||
icon?: string;
|
||||
|
||||
color?: string;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
hidden?: boolean;
|
||||
|
||||
bigText?: boolean;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability } from '@ionic-native/core';
|
||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck } from '@ionic-native/core';
|
||||
|
||||
declare var window: any,
|
||||
navigator: any;
|
||||
@@ -72,7 +72,7 @@ export class Contact implements IContactProperties {
|
||||
@InstanceProperty urls: IContactField[];
|
||||
|
||||
constructor() {
|
||||
if (checkAvailability(navigator.contacts, 'create', 'Contacts') === true) {
|
||||
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
|
||||
this._objectInstance = navigator.contacts.create();
|
||||
}
|
||||
}
|
||||
@@ -290,7 +290,8 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
pluginName: 'Contacts',
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
pluginRef: 'navigator.contacts',
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts'
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Contacts {
|
||||
@@ -309,6 +310,7 @@ export class Contacts {
|
||||
* @param options {IContactFindOptions} Optional options for the query
|
||||
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
@CordovaCheck()
|
||||
find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.find(fields, (contacts) => {
|
||||
@@ -321,6 +323,7 @@ export class Contacts {
|
||||
* Select a single Contact.
|
||||
* @returns {Promise<Contact>} Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
@CordovaCheck()
|
||||
pickContact(): Promise<Contact> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);
|
||||
|
||||
@@ -26,6 +26,7 @@ import { Injectable } from '@angular/core';
|
||||
plugin: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
||||
pluginRef: 'cblite',
|
||||
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CouchbaseLite {
|
||||
|
||||
@@ -23,7 +23,8 @@ import { Cordova, Plugin } from '@ionic-native/core';
|
||||
pluginName: 'Crop',
|
||||
plugin: 'cordova-plugin-crop',
|
||||
pluginRef: 'plugins',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop'
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Crop {
|
||||
|
||||
@@ -78,7 +78,7 @@ export interface DeeplinkMatch {
|
||||
plugin: 'ionic-plugin-deeplinks',
|
||||
pluginRef: 'IonicDeeplink',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
|
||||
platforms: ['iOS', 'Android'],
|
||||
platforms: ['iOS', 'Android', 'Browser'],
|
||||
install: 'ionic plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
|
||||
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX']
|
||||
})
|
||||
|
||||
@@ -71,7 +71,8 @@ export interface DeviceMotionAccelerometerOptions {
|
||||
pluginName: 'DeviceMotion',
|
||||
plugin: 'cordova-plugin-device-motion',
|
||||
pluginRef: 'navigator.accelerometer',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-motion'
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-motion',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class DeviceMotion {
|
||||
|
||||
@@ -76,7 +76,8 @@ export interface DeviceOrientationCompassOptions {
|
||||
pluginName: 'DeviceOrientation',
|
||||
plugin: 'cordova-plugin-device-orientation',
|
||||
pluginRef: 'navigator.compass',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation'
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class DeviceOrientation {
|
||||
|
||||
@@ -23,7 +23,8 @@ declare var window: any;
|
||||
pluginName: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device'
|
||||
repo: 'https://github.com/apache/cordova-plugin-device',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Device {
|
||||
|
||||
@@ -38,7 +38,8 @@ import {Cordova, Plugin, CordovaProperty} from '@ionic-native/core';
|
||||
pluginName: 'Diagnostic',
|
||||
plugin: 'cordova.plugins.diagnostic',
|
||||
pluginRef: 'cordova.plugins.diagnostic',
|
||||
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
|
||||
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Diagnostic {
|
||||
|
||||
@@ -45,7 +45,8 @@ export interface DialogsPromptCallback {
|
||||
pluginName: 'Dialogs',
|
||||
plugin: 'cordova-plugin-dialogs',
|
||||
pluginRef: 'navigator.notification',
|
||||
repo: 'https://github.com/apache/cordova-plugin-dialogs.git'
|
||||
repo: 'https://github.com/apache/cordova-plugin-dialogs.git',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Dialogs {
|
||||
|
||||
@@ -113,7 +113,8 @@ export interface FacebookLoginResponse {
|
||||
pluginRef: 'facebookConnectPlugin',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
|
||||
install: 'ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
|
||||
installVariables: ['APP_ID', 'APP_NAME']
|
||||
installVariables: ['APP_ID', 'APP_NAME'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Facebook {
|
||||
|
||||
@@ -24,7 +24,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'FileOpener',
|
||||
plugin: 'cordova-plugin-file-opener2',
|
||||
pluginRef: 'cordova.plugins.fileOpener2',
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||
})
|
||||
@Injectable()
|
||||
export class FileOpener {
|
||||
|
||||
@@ -367,7 +367,8 @@ export declare var FileError: {
|
||||
pluginName: 'File',
|
||||
plugin: 'cordova-plugin-file',
|
||||
pluginRef: 'cordova.file',
|
||||
repo: 'https://github.com/apache/cordova-plugin-file'
|
||||
repo: 'https://github.com/apache/cordova-plugin-file',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class File {
|
||||
|
||||
@@ -39,7 +39,7 @@ export interface FingerprintOptions {
|
||||
* clientSecret: "password", //Only necessary for Android
|
||||
* disableBackup:true //Only for Android(optional)
|
||||
* })
|
||||
* .then((result: any) => console.log(any))
|
||||
* .then((result: any) => console.log(result))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
|
||||
@@ -24,7 +24,8 @@ import { Cordova, Plugin } from '@ionic-native/core';
|
||||
pluginName: 'Flashlight',
|
||||
plugin: 'cordova-plugin-flashlight',
|
||||
pluginRef: 'window.plugins.flashlight',
|
||||
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git'
|
||||
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
@Injectable()
|
||||
export class Flashlight {
|
||||
|
||||
@@ -152,7 +152,8 @@ export interface GeolocationOptions {
|
||||
pluginName: 'Geolocation',
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation'
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||
platforms: ['Android', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Geolocation {
|
||||
|
||||
@@ -399,14 +399,14 @@ export class GoogleMap {
|
||||
* // create a new map by passing HTMLElement
|
||||
* let element: HTMLElement = document.getElementById('map');
|
||||
*
|
||||
* let map: GoogleMap = GoogleMaps.create(element);
|
||||
* let map: GoogleMap = this.googleMaps.create(element);
|
||||
*
|
||||
* // listen to MAP_READY event
|
||||
* // You must wait for this event to fire before adding something to the map or modifying it in anyway
|
||||
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
|
||||
*
|
||||
* // create LatLng object
|
||||
* let ionic: LatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
|
||||
* let ionic: LatLng = new LatLng(43.0741904,-89.3809802);
|
||||
*
|
||||
* // create CameraPosition
|
||||
* let position: CameraPosition = {
|
||||
@@ -451,7 +451,8 @@ export class GoogleMap {
|
||||
plugin: 'cordova-plugin-googlemaps',
|
||||
repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps',
|
||||
install: 'ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"',
|
||||
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS']
|
||||
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class GoogleMaps {
|
||||
|
||||
@@ -171,7 +171,8 @@ export interface HealthData {
|
||||
pluginName: 'Health',
|
||||
plugin: 'cordova-plugin-health',
|
||||
pluginRef: 'navigator.health',
|
||||
repo: 'https://github.com/dariosalvi78/cordova-plugin-health'
|
||||
repo: 'https://github.com/dariosalvi78/cordova-plugin-health',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Health {
|
||||
|
||||
@@ -59,7 +59,8 @@ export interface ImagePickerOptions {
|
||||
pluginName: 'ImagePicker',
|
||||
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||
pluginRef: 'window.imagePicker',
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker'
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class ImagePicker {
|
||||
|
||||
@@ -76,7 +76,8 @@ export interface ImageResizerOptions {
|
||||
pluginName: 'ImageResizer',
|
||||
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
|
||||
pluginRef: 'ImageResizer',
|
||||
repo: 'https://github.com/protonet/cordova-plugin-image-resizer'
|
||||
repo: 'https://github.com/protonet/cordova-plugin-image-resizer',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class ImageResizer {
|
||||
|
||||
@@ -162,7 +162,8 @@ export class InAppBrowserObject {
|
||||
pluginName: 'InAppBrowser',
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser',
|
||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser'
|
||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
|
||||
platforms: ['Amazon', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class InAppBrowser {
|
||||
|
||||
@@ -23,7 +23,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'Instagram',
|
||||
plugin: 'cordova-instagram-plugin',
|
||||
pluginRef: 'Instagram',
|
||||
repo: 'https://github.com/vstirbu/InstagramPlugin'
|
||||
repo: 'https://github.com/vstirbu/InstagramPlugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Instagram {
|
||||
|
||||
251
src/@ionic-native/plugins/intel-security/index.ts
Normal file
251
src/@ionic-native/plugins/intel-security/index.ts
Normal file
@@ -0,0 +1,251 @@
|
||||
import { Plugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
declare var window: any;
|
||||
|
||||
export interface IntelSecurityDataOptions {
|
||||
/** Non-empty string. **/
|
||||
data: String;
|
||||
/** Tag text. */
|
||||
tag?: String;
|
||||
/** Valid secure data instance ID. */
|
||||
extraKey?: Number;
|
||||
/** Application access control policy. */
|
||||
appAccessControl?: Number;
|
||||
/** Device locality policy. */
|
||||
deviceLocality?: Number;
|
||||
/** Sensitivity level policy. */
|
||||
sensitivityLevel?: Number;
|
||||
/** Disallow sealed blob access. */
|
||||
noStore?: Boolean;
|
||||
/** Disallow plain-text data access. */
|
||||
noRead?: Boolean;
|
||||
/** Creator unique ID. */
|
||||
creator?: Number;
|
||||
/** Array of owners unique IDs. */
|
||||
owners?: Number[];
|
||||
/** List of trusted web domains. */
|
||||
webOwners?: String[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Intel Security
|
||||
* @description
|
||||
* The App Security API enables the use of security properties and capabilities on the platform, using a new set of API defined for application developers. You are not required to be a security expert to make good use of the API. Key elements, such as encryption of data and establishments of capabilities, is abstracted and done by the API implementation, for you.
|
||||
*
|
||||
* For example:
|
||||
* - Use the API to store (E.g. cache) data locally, using the device non-volatile storage. Data protection/encryption will be done for you by the API implementation
|
||||
* - Establish a connection with remote server (E.g. XHR) using a protected channel. SSL/TLS establishment and usage will be done for you by the API implementation
|
||||
*
|
||||
* For more information please visit the [API documentation](https://software.intel.com/en-us/app-security-api/api).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { IntelSecurity } from '@ionic-native/intel-security';
|
||||
* ...
|
||||
* constructor(private intelSecurity: IntelSecurity) { }
|
||||
* ...
|
||||
*
|
||||
* let storageID = 'id';
|
||||
*
|
||||
* this.intelSecurity.data.createFromData({ data: 'Sample Data' })
|
||||
* .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((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
|
||||
* IntelSecurityStorage
|
||||
* @interfaces
|
||||
* IntelSecurityDataOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IntelSecurity',
|
||||
plugin: 'com-intel-security-cordova-plugin',
|
||||
pluginRef: 'intel.security',
|
||||
repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class IntelSecurity {
|
||||
|
||||
/**
|
||||
* returns an IntelSecurityStorage object
|
||||
* @type {IntelSecurityStorage}
|
||||
*/
|
||||
storage: IntelSecurityStorage = new IntelSecurityStorage();
|
||||
|
||||
/**
|
||||
* Returns an IntelSecurityData object
|
||||
* @type {IntelSecurityData}
|
||||
*/
|
||||
data: IntelSecurityData = new IntelSecurityData();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IntelSecurity',
|
||||
plugin: 'com-intel-security-cordova-plugin',
|
||||
pluginRef: 'intel.security.secureData'
|
||||
})
|
||||
export class IntelSecurityData {
|
||||
|
||||
/**
|
||||
* This creates a new instance of secure data using plain-text data.
|
||||
* @param options {IntelSecurityDataOptions}
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
createFromData(options: IntelSecurityDataOptions): Promise<Number> { return; }
|
||||
|
||||
/**
|
||||
* This creates a new instance of secure data (using sealed data)
|
||||
* @param options {Object}
|
||||
* @param options.sealedData {string} Sealed data in string format.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
createFromSealedData(options: { sealedData: string }): Promise<Number> { return; }
|
||||
|
||||
/**
|
||||
* This returns the plain-text data of the secure data instance.
|
||||
* @param instanceID {Number} Secure data instance ID.
|
||||
* @returns {Promise<string>} Returns a Promise that resolves to the data as plain-text, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getData(instanceID: Number): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* This returns the sealed chunk of a secure data instance.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to the sealed data, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getSealedData(instanceID: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This returns the tag of the secure data instance.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<string>} Returns a Promise that resolves to the tag, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getTag(instanceID: any): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* This returns the data policy of the secure data instance.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<any>} Returns a promise that resolves to the policy object, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getPolicy(instanceID: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This returns an array of the data owners unique IDs.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<Array>} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getOwners(instanceID: any): Promise<Array<any>> { return; }
|
||||
|
||||
/**
|
||||
* This returns the data creator unique ID.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<Number>} Returns a promsie that resolves to the creator's unique ID, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getCreator(instanceID: any): Promise<Number> { return; }
|
||||
|
||||
/**
|
||||
* This returns an array of the trusted web domains of the secure data instance.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<Array>} Returns a promise that resolves to a list of web owners, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getWebOwners(instanceID: any): Promise<Array<any>> { return; }
|
||||
|
||||
/**
|
||||
* This changes the extra key of a secure data instance. To successfully replace the extra key, the calling application must have sufficient access to the plain-text data.
|
||||
* @param options {Object}
|
||||
* @param options.instanceID {any} Secure data instance ID.
|
||||
* @param options.extraKey {Number} Extra sealing secret for secure data instance.
|
||||
* @returns {Promise<any>} Returns a promise that resolves with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
changeExtraKey(options: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This releases a secure data instance.
|
||||
* @param instanceID {any} Secure data instance ID.
|
||||
* @returns {Promise<any>} Returns a promise that resovles with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
destroy(instanceID: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IntelSecurity',
|
||||
plugin: 'com-intel-security-cordova-plugin',
|
||||
pluginRef: 'intel.security.secureStorage'
|
||||
})
|
||||
export class IntelSecurityStorage {
|
||||
|
||||
/**
|
||||
* This deletes a secure storage resource (indicated by id).
|
||||
* @param options {Object}
|
||||
* @param options.id {String} Storage resource identifier.
|
||||
* @param [options.storageType] {Number} Storage type.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
delete(options: {
|
||||
id: string,
|
||||
storageType?: Number
|
||||
}): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This reads the data from secure storage (indicated by id) and creates a new secure data instance.
|
||||
* @param options {Object}
|
||||
* @param options.id {String} Storage resource identifier.
|
||||
* @param [options.storageType] {Number} Storage type.
|
||||
* @param [options.extraKey] {Number} Valid secure data instance ID.
|
||||
* @returns {Promise<Number>} Returns a Promise that resolves with the instance ID of the created secure data instance, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
read(options: {
|
||||
id: string,
|
||||
storageType?: Number,
|
||||
extraKey?: Number
|
||||
}): Promise<Number> { return; }
|
||||
|
||||
/**
|
||||
* This writes the data contained in a secure data instance into secure storage.
|
||||
* @param options {Object}
|
||||
* @param options.id {String} Storage resource identifier.
|
||||
* @param options.instanceID {Number} Valid secure data instance ID
|
||||
* @param [options.storageType] {Number} Storage type.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
write(options: {
|
||||
id: String,
|
||||
instanceID: Number,
|
||||
storageType?: Number
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -25,7 +25,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'IsDebug',
|
||||
plugin: 'cordova-plugin-is-debug',
|
||||
pluginRef: 'cordova.plugins.IsDebug',
|
||||
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
|
||||
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class IsDebug {
|
||||
|
||||
@@ -27,7 +27,8 @@ declare var cordova: any;
|
||||
pluginName: 'Jins Meme',
|
||||
plugin: 'JinsMemeSDK-Plugin-Cordova',
|
||||
pluginRef: 'cordova.plugins.JinsMemePlugin',
|
||||
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova.git'
|
||||
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class JinsMeme {
|
||||
|
||||
@@ -24,7 +24,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
pluginName: 'Keyboard',
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-keyboard',
|
||||
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Keyboard {
|
||||
|
||||
@@ -91,7 +91,8 @@ export interface LaunchNavigatorOptions {
|
||||
pluginName: 'LaunchNavigator',
|
||||
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
|
||||
pluginRef: 'launchnavigator',
|
||||
repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git'
|
||||
repo: 'https://github.com/dpa99c/phonegap-launch-navigator',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class LaunchNavigator {
|
||||
|
||||
@@ -53,7 +53,8 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
|
||||
plugin: 'cordova-plugin-linkedin',
|
||||
pluginRef: 'cordova.plugins.LinkedIn',
|
||||
repo: 'https://github.com/zyramedia/cordova-plugin-linkedin',
|
||||
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID'
|
||||
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class LinkedIn {
|
||||
|
||||
@@ -144,7 +144,8 @@ export interface ILocalNotification {
|
||||
pluginName: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class LocalNotifications {
|
||||
|
||||
@@ -32,7 +32,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'LocationAccuracy',
|
||||
plugin: 'cordova-plugin-request-location-accuracy',
|
||||
pluginRef: 'cordova.plugins.locationAccuracy',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class LocationAccuracy {
|
||||
|
||||
@@ -21,7 +21,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'Market',
|
||||
plugin: 'cordova-plugin-market',
|
||||
pluginRef: 'cordova.plugins.market',
|
||||
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
|
||||
repo: 'https://github.com/xmartlabs/cordova-plugin-market',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Market {
|
||||
|
||||
@@ -56,7 +56,7 @@ export interface MusicControlsOptions {
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
* });
|
||||
*
|
||||
* this.musicControls.subscribe().subscribe(action => {
|
||||
* this.musicControls.subscribe(action => {
|
||||
*
|
||||
* switch(action) {
|
||||
* case 'music-controls-next':
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {Cordova, CordovaProperty, Plugin, CordovaFunctionOverride} from '@ionic-native/core';
|
||||
import { Cordova, CordovaProperty, Plugin, CordovaCheck } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/observable/merge';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
@@ -75,15 +76,10 @@ export class Network {
|
||||
* Returns an observable to watch connection changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onchange(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection type changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
ontypechange(): Observable<any> { return; }
|
||||
@CordovaCheck()
|
||||
onchange(): Observable<any> {
|
||||
return Observable.merge(this.onConnect(), this.onDisconnect());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when the device goes offline
|
||||
|
||||
@@ -67,7 +67,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'PayPal',
|
||||
plugin: 'com.paypal.cordova.mobilesdk',
|
||||
pluginRef: 'PayPalMobile',
|
||||
repo: 'https://github.com/paypal/PayPal-Cordova-Plugin'
|
||||
repo: 'https://github.com/paypal/PayPal-Cordova-Plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class PayPal {
|
||||
|
||||
@@ -44,7 +44,8 @@ import { Injectable } from '@angular/core';
|
||||
plugin: 'cordova-plugin-photo-library',
|
||||
pluginRef: 'cordova.plugins.photoLibrary',
|
||||
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
|
||||
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"'
|
||||
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
|
||||
platforms: ['Android', 'Browser', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class PhotoLibrary {
|
||||
|
||||
@@ -20,7 +20,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
pluginName: 'PhotoViewer',
|
||||
plugin: 'com-sarriaroman-photoviewer',
|
||||
pluginRef: 'PhotoViewer',
|
||||
repo: 'https://github.com/sarriaroman/photoviewer'
|
||||
repo: 'https://github.com/sarriaroman/photoviewer',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class PhotoViewer {
|
||||
|
||||
@@ -92,7 +92,7 @@ export class SecureStorageObject {
|
||||
plugin: 'cordova-plugin-secure-storage',
|
||||
pluginRef: 'cordova.plugins.SecureStorage',
|
||||
repo: 'https://github.com/Crypho/cordova-plugin-secure-storage',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone', 'Browser']
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class SecureStorage {
|
||||
|
||||
113
src/@ionic-native/plugins/sqlite-porter/index.ts
Normal file
113
src/@ionic-native/plugins/sqlite-porter/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import { Plugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name SQLite Porter
|
||||
* @description
|
||||
* This Cordova/Phonegap plugin can be used to import/export to/from a SQLite database using either SQL or JSON.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { SQLitePorter } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* constructor(private sqlitePorter: SQLitePorter) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let db = window.openDatabase("Test", "1.0", "TestDB", 1 * 1024);
|
||||
* // or we can use SQLite plugin
|
||||
* // we will assume that we injected SQLite into this component as sqlite
|
||||
* this.sqlite.create({
|
||||
* name: 'data.db',
|
||||
* location: 'default'
|
||||
* })
|
||||
* .then((db: any) => {
|
||||
* let dbInstance = db._objectInstance;
|
||||
* // we can pass db._objectInstance as the database option in all SQLitePorter methods
|
||||
* });
|
||||
*
|
||||
*
|
||||
* let sql = "CREATE TABLE Artist ([Id] PRIMARY KEY, [Title]);" +
|
||||
* "INSERT INTO Artist(Id,Title) VALUES ('1','Fred');";
|
||||
*
|
||||
* this.sqlitePorter.importSqlToDb(db, sql)
|
||||
* .then(() => console.log('Imported'))
|
||||
* .catch(e => console.error(e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SQLitePorter',
|
||||
plugin: 'uk.co.workingedge.cordova.plugin.sqliteporter',
|
||||
pluginRef: 'cordova.plugins.sqlitePorter',
|
||||
repo: 'https://github.com/dpa99c/cordova-sqlite-porter',
|
||||
platforms: ['Android', 'iOS', 'Tizen', 'BlackBerry 10']
|
||||
})
|
||||
@Injectable()
|
||||
export class SQLitePorter {
|
||||
|
||||
/**
|
||||
* Executes a set of SQL statements against the defined database. Can be used to import data defined in the SQL statements into the database, and may additionally include commands to create the table structure.
|
||||
* @param db {Object} Database object
|
||||
* @param sql {string} SQL statements to execute against the database
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'successFn',
|
||||
errorName: 'errorFn'
|
||||
})
|
||||
importSqlToDb(db: any, sql: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Exports a SQLite DB as a set of SQL statements.
|
||||
* @param db {Object} Database object
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'successFn',
|
||||
errorName: 'errorFn'
|
||||
})
|
||||
exportDbToSql(db: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Converts table structure and/or row data contained within a JSON structure into SQL statements that can be executed against a SQLite database. Can be used to import data into the database and/or create the table structure.
|
||||
* @param db {Object} Database object
|
||||
* @param json {Object|string} JSON structure containing row data and/or table structure as either a JSON object or string
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'successFn',
|
||||
errorName: 'errorFn'
|
||||
})
|
||||
importJsonToDb(db: any, json: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Exports a SQLite DB as a JSON structure
|
||||
* @param db {Object} Database object
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'successFn',
|
||||
errorName: 'errorFn'
|
||||
})
|
||||
exportDbToJson(db: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Wipes all data from a database by dropping all existing tables
|
||||
* @param db {Object} Database object
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'successFn',
|
||||
errorName: 'errorFn'
|
||||
})
|
||||
wipeDb(db: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -4,12 +4,27 @@ import { Cordova, CordovaInstance, Plugin, CordovaCheck, InstanceProperty } from
|
||||
|
||||
declare var sqlitePlugin;
|
||||
|
||||
export interface SQLiteDatabaseConfig {
|
||||
/**
|
||||
* Name of the database. Example: 'my.db'
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Location of the database. Example: 'default'
|
||||
*/
|
||||
location?: string;
|
||||
/**
|
||||
* iOS Database Location. Example: 'Library'
|
||||
*/
|
||||
iosDatabaseLocation?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class SQLiteObject {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
constructor(public _objectInstance: any) { }
|
||||
|
||||
@InstanceProperty databaseFeatures: any;
|
||||
|
||||
@@ -124,19 +139,6 @@ export class SQLiteObject {
|
||||
})
|
||||
abortFromQ(sqlerror): void { }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
echoTest(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @param first
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteDatabase(first): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,6 +175,8 @@ export class SQLiteObject {
|
||||
*
|
||||
* @classes
|
||||
* SQLiteObject
|
||||
* @interfaces
|
||||
* SQLiteDatabaseConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SQLite',
|
||||
@@ -188,14 +192,29 @@ export class SQLite {
|
||||
*
|
||||
* See the plugin docs for an explanation of all options: https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database
|
||||
*
|
||||
* @param config the config for opening the database.
|
||||
* @param config {SQLiteDatabaseConfig} database configuration
|
||||
* @return Promise<SQLiteObject>
|
||||
*/
|
||||
@CordovaCheck()
|
||||
create(config: any): Promise<SQLiteObject> {
|
||||
create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
|
||||
return new Promise((resolve, reject) => {
|
||||
sqlitePlugin.openDatabase(config, db => resolve(new SQLiteObject(db)), reject);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that both the Javascript and native part of this plugin are installed in your application
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
echoTest(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Deletes a database
|
||||
* @param config {SQLiteDatabaseConfig} database configuration
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
62
src/@ionic-native/plugins/taptic-engine/index.ts
Normal file
62
src/@ionic-native/plugins/taptic-engine/index.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Cordova, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name Taptic Engine
|
||||
* @description
|
||||
* An Ionic plugin to use Taptic Engine API on iPHone 7, 7 Plus or newer.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import { TapticEngine } from '@ionic-native/taptic-engine;
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* constructor(private taptic: TapticEngine) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.taptic.selection();
|
||||
*
|
||||
* this.taptic.notification();
|
||||
*
|
||||
* this.taptic.impact();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'TapticEngine',
|
||||
plugin: 'cordova-plugin-taptic-engine',
|
||||
pluginRef: 'TapticEngine',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-taptic-engine',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class TapticEngine {
|
||||
|
||||
/**
|
||||
* Use selection feedback generators to indicate a change in selection.
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
selection(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Use this to indicate success/failure/warning to the user.
|
||||
* @param options {Object} should be of the type { type: 'success' } (or 'warning'/'error')
|
||||
* @param options.type {string}
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
notification(options: { type: string }): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Use this to indicate success/failure/warning to the user.
|
||||
* @param options {Object} should be of the type { style: 'light' } (or 'medium'/'heavy')
|
||||
* @param options.type {string}
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
impact(options: { style: string }): Promise<any> { return; }
|
||||
|
||||
}
|
||||
126
src/@ionic-native/plugins/zeroconf/index.ts
Normal file
126
src/@ionic-native/plugins/zeroconf/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface ZeroconfService {
|
||||
domain: string;
|
||||
type: string;
|
||||
name: string;
|
||||
port: number;
|
||||
hostname: string;
|
||||
ipv4Addresses: Array<string>;
|
||||
ipv6Addresses: Array<string>;
|
||||
txtRecord: any;
|
||||
}
|
||||
|
||||
export interface ZeroconfResult {
|
||||
action: 'registered' | 'added' | 'removed';
|
||||
service: ZeroconfService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Zeroconf
|
||||
* @description
|
||||
* This plugin allows you to browse and publish Zeroconf/Bonjour/mDNS services.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Zeroconf } from '@ionic-native/zeroconf';
|
||||
*
|
||||
* constructor(private zeroconf: Zeroconf) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // watch for services of a specified type
|
||||
* this.zeroconf.watch('_http._tcp.', 'local.').subscribe(result => {
|
||||
* if (result.action == 'added') {
|
||||
* console.log('service added', result.service);
|
||||
* } else {
|
||||
* console.log('service removed', result.service);
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // publish a zeroconf service of your own
|
||||
* this.zeroconf.register('_http._tcp.', 'local.', 'Becvert\'s iPad', 80, {
|
||||
* 'foo': 'bar'
|
||||
* }).then(result => {
|
||||
* console.log('Service registered', result.service);
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // unregister your service
|
||||
* this.zeroconf.unregister('_http._tcp.', 'local.', 'Becvert\'s iPad');
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Zeroconf',
|
||||
plugin: 'cordova-plugin-zeroconf',
|
||||
pluginRef: 'cordova.plugins.zeroconf',
|
||||
repo: 'https://github.com/becvert/cordova-plugin-zeroconf'
|
||||
})
|
||||
@Injectable()
|
||||
export class Zeroconf {
|
||||
/**
|
||||
* Returns this device's hostname.
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getHostname(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Publishes a new service.
|
||||
* @param type {string} Service type name, e.g. "_http._tcp".
|
||||
* @param domain {string} Domain scope of the service, typically "local.".
|
||||
* @param name {string} Unqualified service instance name.
|
||||
* @param port {number} Local port on which the service runs.
|
||||
* @param txtRecord {any} Arbitrary key/value pairs describing the service.
|
||||
* @return {Promise<ZeroconfResult>} Returns a Promise that resolves with the registered service.
|
||||
*/
|
||||
@Cordova()
|
||||
register(type: string, domain: string, name: string, port: number, txtRecord: any): Promise<ZeroconfResult> { return; }
|
||||
|
||||
/**
|
||||
* Unregisters a service.
|
||||
* @param type {string} Service type name, e.g. "_http._tcp".
|
||||
* @param domain {string} Domain scope of the service, typically "local.".
|
||||
* @param name {string} Unqualified service instance name.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
unregister(type: string, domain: string, name: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Unregisters all published services.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Starts watching for services of the specified type.
|
||||
* @param type {string} Service type name, e.g. "_http._tcp".
|
||||
* @param domain {string} Domain scope of the service, typically "local.".
|
||||
* @return {Observable<ZeroconfResult>} Returns an Observable that notifies of each service added or removed.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'unwatch',
|
||||
clearWithArgs: true
|
||||
})
|
||||
watch(type: string, domain: string): Observable<ZeroconfResult> { return; }
|
||||
|
||||
/**
|
||||
* Stops watching for services of the specified type.
|
||||
* @param type {string} Service type name, e.g. "_http._tcp".
|
||||
* @param domain {string} Domain scope of the service, typically "local.".
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
unwatch(type: string, domain: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Closes the service browser and stops watching.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
close(): Promise<void> { return; }
|
||||
}
|
||||
Reference in New Issue
Block a user