mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
43b70a12b5
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,5 +3,5 @@ node_modules/
|
|||||||
.idea
|
.idea
|
||||||
.tmp
|
.tmp
|
||||||
aot/
|
aot/
|
||||||
dist/
|
|
||||||
scripts/ionic-native-bower
|
scripts/ionic-native-bower
|
||||||
|
dist/
|
||||||
|
118
CHANGELOG.md
118
CHANGELOG.md
@ -1,3 +1,117 @@
|
|||||||
|
<a name="4.3.1"></a>
|
||||||
|
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.2) (2017-10-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
|
||||||
|
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
|
||||||
|
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
|
||||||
|
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.3.0"></a>
|
||||||
|
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
|
||||||
|
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
|
||||||
|
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
|
||||||
|
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
|
||||||
|
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
|
||||||
|
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
|
||||||
|
* **stripe:** fix stripe create card token ([#2002](https://github.com/ionic-team/ionic-native/issues/2002)) ([5b15bb9](https://github.com/ionic-team/ionic-native/commit/5b15bb9))
|
||||||
|
* **zeroconf:** extend the ZeroconfResult.action definition ([#1985](https://github.com/ionic-team/ionic-native/issues/1985)) ([e2f3702](https://github.com/ionic-team/ionic-native/commit/e2f3702))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **android-full-screen:** add support for setSystemUiVisiblity ([#1942](https://github.com/ionic-team/ionic-native/issues/1942)) ([4246d47](https://github.com/ionic-team/ionic-native/commit/4246d47))
|
||||||
|
* **document-reader:** add cordova-plugin-documentreader ([#1996](https://github.com/ionic-team/ionic-native/issues/1996)) ([7b94d4f](https://github.com/ionic-team/ionic-native/commit/7b94d4f))
|
||||||
|
* **extended-device-information:** add Extended Device Info plugin ([#1980](https://github.com/ionic-team/ionic-native/issues/1980)) ([806766e](https://github.com/ionic-team/ionic-native/commit/806766e))
|
||||||
|
* **music-controls:** add support for next/prev track and skip forward/backward in control center ([#1927](https://github.com/ionic-team/ionic-native/issues/1927)) ([fff9969](https://github.com/ionic-team/ionic-native/commit/fff9969))
|
||||||
|
* **push:** update PushOptions interfaces to match new version ([#1908](https://github.com/ionic-team/ionic-native/issues/1908)) ([34bf136](https://github.com/ionic-team/ionic-native/commit/34bf136))
|
||||||
|
* **qr-scanner:** added destroy method ([#1916](https://github.com/ionic-team/ionic-native/issues/1916)) ([#1971](https://github.com/ionic-team/ionic-native/issues/1971)) ([10eb3ee](https://github.com/ionic-team/ionic-native/commit/10eb3ee))
|
||||||
|
* **uid:** add UID plugin ([#1946](https://github.com/ionic-team/ionic-native/issues/1946)) ([e2419a2](https://github.com/ionic-team/ionic-native/commit/e2419a2))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* **push:** this wrapper will work only with `phonegap-plugin-push@2.0.0`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.2.0"></a>
|
||||||
|
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **fingerprint-aio:** add missing FingerprintOptions properties ([#1845](https://github.com/ionic-team/ionic-native/issues/1845)) ([85825c7](https://github.com/ionic-team/ionic-native/commit/85825c7))
|
||||||
|
* **geofence:** remove duplicate onTransitionReceived method ([00c0707](https://github.com/ionic-team/ionic-native/commit/00c0707))
|
||||||
|
* **google-maps:** add missing debug option ([#1832](https://github.com/ionic-team/ionic-native/issues/1832)) ([39ec515](https://github.com/ionic-team/ionic-native/commit/39ec515))
|
||||||
|
* **ms-adal:** make userId optional ([#1894](https://github.com/ionic-team/ionic-native/issues/1894)) ([21045ea](https://github.com/ionic-team/ionic-native/commit/21045ea))
|
||||||
|
* **native-geocoder:** update NativeGeocoderReverse result ([#1840](https://github.com/ionic-team/ionic-native/issues/1840)) ([7c1b409](https://github.com/ionic-team/ionic-native/commit/7c1b409))
|
||||||
|
* **native-spinner:** update pluginRef ([#1859](https://github.com/ionic-team/ionic-native/issues/1859)) ([262e18f](https://github.com/ionic-team/ionic-native/commit/262e18f))
|
||||||
|
* **serial:** add missing options for the open method ([#1844](https://github.com/ionic-team/ionic-native/issues/1844)) ([1acade4](https://github.com/ionic-team/ionic-native/commit/1acade4))
|
||||||
|
* **sqlite:** add optional key parameter to SQLiteDatabaseConfig to support sqlcipher-adapter ([#1917](https://github.com/ionic-team/ionic-native/issues/1917)) ([0c097ba](https://github.com/ionic-team/ionic-native/commit/0c097ba))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **google-maps:** update plugin and fix a few issues ([#1834](https://github.com/ionic-team/ionic-native/issues/1834)) ([c11aec3](https://github.com/ionic-team/ionic-native/commit/c11aec3))
|
||||||
|
* **http:** use a different plugin source with better features ([#1921](https://github.com/ionic-team/ionic-native/issues/1921)) ([a2d3396](https://github.com/ionic-team/ionic-native/commit/a2d3396))
|
||||||
|
* **keychain-touch-id:** add KeychainTouchId plugin ([#1837](https://github.com/ionic-team/ionic-native/issues/1837)) ([a2cc187](https://github.com/ionic-team/ionic-native/commit/a2cc187))
|
||||||
|
* **local-notifications:** add `un` method to unsubscribe from events ([#1871](https://github.com/ionic-team/ionic-native/issues/1871)) ([ce5966b](https://github.com/ionic-team/ionic-native/commit/ce5966b))
|
||||||
|
* **paypal:** add payeeEmail for third party merchants ([#1864](https://github.com/ionic-team/ionic-native/issues/1864)) ([cde87e2](https://github.com/ionic-team/ionic-native/commit/cde87e2))
|
||||||
|
* **push:** add Browser Push notification support ([#1848](https://github.com/ionic-team/ionic-native/issues/1848)) ([aa4c3b3](https://github.com/ionic-team/ionic-native/commit/aa4c3b3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.1.0"></a>
|
||||||
|
# [4.1.0](https://github.com/ionic-team/ionic-native/compare/v4.0.1...v4.1.0) (2017-07-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **media:** add setRate method ([4af3d5b](https://github.com/ionic-team/ionic-native/commit/4af3d5b)), closes [#1825](https://github.com/ionic-team/ionic-native/issues/1825)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **firebase:** add unregister method ([#1823](https://github.com/ionic-team/ionic-native/issues/1823)) ([6230958](https://github.com/ionic-team/ionic-native/commit/6230958))
|
||||||
|
* **google-maps:** add missing features and fix wrong definitions ([#1815](https://github.com/ionic-team/ionic-native/issues/1815)) ([976401a](https://github.com/ionic-team/ionic-native/commit/976401a))
|
||||||
|
* **hyper-track:** add HyperTrack plugin ([#1816](https://github.com/ionic-team/ionic-native/issues/1816)) ([47fa44c](https://github.com/ionic-team/ionic-native/commit/47fa44c))
|
||||||
|
* **open-native-settings:** add Open Native Settings plugin ([0fa82e5](https://github.com/ionic-team/ionic-native/commit/0fa82e5)), closes [#1821](https://github.com/ionic-team/ionic-native/issues/1821)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.0.1"></a>
|
||||||
|
## [4.0.1](https://github.com/ionic-team/ionic-native/compare/v4.0.0...v4.0.1) (2017-07-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **media:** fix success/error/statusUpdate observables ([7105048](https://github.com/ionic-team/ionic-native/commit/7105048)), closes [#1806](https://github.com/ionic-team/ionic-native/issues/1806)
|
||||||
|
* **social-sharing:** fix issues caused by omitting optional params ([25c1cf4](https://github.com/ionic-team/ionic-native/commit/25c1cf4)), closes [#1805](https://github.com/ionic-team/ionic-native/issues/1805)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **camera:** add enums for camera options ([6061af6](https://github.com/ionic-team/ionic-native/commit/6061af6))
|
||||||
|
* **launch-navigator:** update plugin wrapper to support v4 ([9538416](https://github.com/ionic-team/ionic-native/commit/9538416)), closes [#1738](https://github.com/ionic-team/ionic-native/issues/1738)
|
||||||
|
* **media:** add MEDIA_STATUS and MEDIA_ERROR enums ([1decedd](https://github.com/ionic-team/ionic-native/commit/1decedd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.0.0"></a>
|
<a name="4.0.0"></a>
|
||||||
# [4.0.0](https://github.com/ionic-team/ionic-native/compare/v3.14.0...v4.0.0) (2017-07-11)
|
# [4.0.0](https://github.com/ionic-team/ionic-native/compare/v3.14.0...v4.0.0) (2017-07-11)
|
||||||
|
|
||||||
@ -1684,13 +1798,13 @@ The whole implementation has changed now. You must update your code.
|
|||||||
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
|
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
|
||||||
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
|
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
|
||||||
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
|
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
|
||||||
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
||||||
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||||
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
||||||
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
|
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
|
||||||
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))
|
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))
|
||||||
|
14
README.md
14
README.md
@ -52,34 +52,24 @@ import { NgZone } from '@angular/core';
|
|||||||
@Component({ ... })
|
@Component({ ... })
|
||||||
export class MyComponent {
|
export class MyComponent {
|
||||||
|
|
||||||
constructor(private geolocation: Geolocation, private platform: Platform, private ngZone: NgZone) {
|
constructor(private geolocation: Geolocation, private platform: Platform) {
|
||||||
|
|
||||||
platform.ready().then(() => {
|
platform.ready().then(() => {
|
||||||
|
|
||||||
// get position
|
// get position
|
||||||
geolocation.getCurrentPosition().then(pos => {
|
geolocation.getCurrentPosition().then(pos => {
|
||||||
|
|
||||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// watch position
|
// watch position
|
||||||
const watch = geolocation.watchPosition().subscribe(pos => {
|
const watch = geolocation.watchPosition().subscribe(pos => {
|
||||||
|
|
||||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||||
|
this.position = pos;
|
||||||
// Currently, observables from Ionic Native plugins
|
|
||||||
// need to run inside of zone to trigger change detection
|
|
||||||
ngZone.run(() => {
|
|
||||||
this.position = pos;
|
|
||||||
})
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// to stop watching
|
// to stop watching
|
||||||
watch.unsubscribe();
|
watch.unsubscribe();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
8985
package-lock.json
generated
8985
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ionic-native",
|
"name": "ionic-native",
|
||||||
"version": "4.0.0",
|
"version": "4.3.1",
|
||||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||||
"homepage": "https://ionicframework.com/",
|
"homepage": "https://ionicframework.com/",
|
||||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||||
|
@ -19,7 +19,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
|
|||||||
// dependency versions
|
// dependency versions
|
||||||
const ANGULAR_VERSION = '*',
|
const ANGULAR_VERSION = '*',
|
||||||
RXJS_VERSION = '^5.0.1',
|
RXJS_VERSION = '^5.0.1',
|
||||||
MIN_CORE_VERSION = '^3.6.0 || >=4.0.0',
|
MIN_CORE_VERSION = '^4.2.0',
|
||||||
IONIC_NATIVE_VERSION = require(path.resolve(ROOT, 'package.json')).version;
|
IONIC_NATIVE_VERSION = require(path.resolve(ROOT, 'package.json')).version;
|
||||||
|
|
||||||
// package dependencies
|
// package dependencies
|
||||||
|
@ -41,7 +41,7 @@ module.exports = currentVersion => {
|
|||||||
docTypes: ['class'],
|
docTypes: ['class'],
|
||||||
getOutputPath: doc => doc.originalModule.replace(config.pluginDir + '/', '')
|
getOutputPath: doc => doc.originalModule.replace(config.pluginDir + '/', '')
|
||||||
.replace('/plugins', '')
|
.replace('/plugins', '')
|
||||||
.replace('/index', '/README.md')
|
.replace(/\/index$/, '/README.md')
|
||||||
}];
|
}];
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -22,6 +22,10 @@ module.exports = function jekyll(renderDocsProcessor) {
|
|||||||
doc.URL = doc.outputPath.replace('docs//', 'docs/')
|
doc.URL = doc.outputPath.replace('docs//', 'docs/')
|
||||||
.replace('/index.md', '')
|
.replace('/index.md', '')
|
||||||
.replace('content/', '');
|
.replace('content/', '');
|
||||||
|
// add trailing slash to plugin pages
|
||||||
|
if(!doc.URL.endsWith("/") && !doc.URL.endsWith(".html")) {
|
||||||
|
doc.URL = doc.URL+'/';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const betaDocs = [];
|
const betaDocs = [];
|
||||||
|
2
scripts/docs/templates/common.template.html
vendored
2
scripts/docs/templates/common.template.html
vendored
@ -186,7 +186,7 @@ docType: "<$ doc.docType $>"
|
|||||||
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
|
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
|
||||||
<ol class="installation">
|
<ol class="installation">
|
||||||
<li>Install the Cordova and Ionic Native plugins:<br>
|
<li>Install the Cordova and Ionic Native plugins:<br>
|
||||||
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
|
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '<').replace('>', '>') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
|
||||||
$ npm install --save @ionic-native/<$ doc.npmId $>
|
$ npm install --save @ionic-native/<$ doc.npmId $>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</li>
|
</li>
|
||||||
|
@ -2,6 +2,7 @@ import 'core-js';
|
|||||||
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
|
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
|
||||||
import { IonicNativePlugin } from './ionic-native-plugin';
|
import { IonicNativePlugin } from './ionic-native-plugin';
|
||||||
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
|
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare const window: any;
|
declare const window: any;
|
||||||
|
|
||||||
@ -47,6 +48,17 @@ class TestPlugin extends IonicNativePlugin {
|
|||||||
return new TestObject(TestPlugin.getPlugin().create());
|
return new TestObject(TestPlugin.getPlugin().create());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Cordova({
|
||||||
|
destruct: true
|
||||||
|
})
|
||||||
|
destructPromise(): Promise<any> { return; }
|
||||||
|
|
||||||
|
@Cordova({
|
||||||
|
destruct: true,
|
||||||
|
observable: true
|
||||||
|
})
|
||||||
|
destructObservable(): Observable<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function definePlugin() {
|
function definePlugin() {
|
||||||
@ -59,7 +71,9 @@ function definePlugin() {
|
|||||||
this.ping = (success: Function, error: Function) => success('pong');
|
this.ping = (success: Function, error: Function) => success('pong');
|
||||||
this.name = 'John Smith';
|
this.name = 'John Smith';
|
||||||
return this;
|
return this;
|
||||||
}
|
},
|
||||||
|
destructPromise: (success: Function) => success('hello', 'world'),
|
||||||
|
destructObservable: (success: Function) => success('hello', 'world')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +191,30 @@ describe('Regular Decorators', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('CordovaOptions', () => {
|
||||||
|
|
||||||
|
describe('destruct', () => {
|
||||||
|
|
||||||
|
it('should destruct values returned by a Promise', (done) => {
|
||||||
|
plugin.destructPromise()
|
||||||
|
.then((args: any[]) => {
|
||||||
|
expect(args).toEqual(['hello', 'world']);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should destruct values returned by an Observable', (done) => {
|
||||||
|
plugin.destructObservable()
|
||||||
|
.subscribe((args: any[]) => {
|
||||||
|
expect(args).toEqual(['hello', 'world']);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Instance Decorators', () => {
|
describe('Instance Decorators', () => {
|
||||||
|
@ -37,6 +37,7 @@ export interface PluginConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CordovaOptions {
|
export interface CordovaOptions {
|
||||||
|
destruct?: boolean;
|
||||||
/**
|
/**
|
||||||
* Set to true if the wrapped method is a sync function
|
* Set to true if the wrapped method is a sync function
|
||||||
*/
|
*/
|
||||||
@ -252,7 +253,7 @@ export function Cordova(opts: CordovaOptions = {}) {
|
|||||||
*
|
*
|
||||||
* Wrap an instance method
|
* Wrap an instance method
|
||||||
*/
|
*/
|
||||||
export function CordovaInstance(opts: any = {}) {
|
export function CordovaInstance(opts: CordovaOptions = {}) {
|
||||||
return (target: Object, methodName: string) => {
|
return (target: Object, methodName: string) => {
|
||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function(...args: any[]) {
|
||||||
|
@ -136,7 +136,11 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
|||||||
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||||
let pluginResult: any, rej: Function;
|
let pluginResult: any, rej: Function;
|
||||||
const p = getPromise((resolve: Function, reject: Function) => {
|
const p = getPromise((resolve: Function, reject: Function) => {
|
||||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
if (opts.destruct) {
|
||||||
|
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||||
|
} else {
|
||||||
|
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
|
}
|
||||||
rej = reject;
|
rej = reject;
|
||||||
});
|
});
|
||||||
// Angular throws an error on unhandled rejection, but in this case we have already printed
|
// Angular throws an error on unhandled rejection, but in this case we have already printed
|
||||||
@ -166,7 +170,14 @@ function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts:
|
|||||||
|
|
||||||
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||||
return new Observable(observer => {
|
return new Observable(observer => {
|
||||||
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
let pluginResult;
|
||||||
|
|
||||||
|
if (opts.destruct) {
|
||||||
|
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
|
||||||
|
} else {
|
||||||
|
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||||
|
}
|
||||||
|
|
||||||
if (pluginResult && pluginResult.error) {
|
if (pluginResult && pluginResult.error) {
|
||||||
observer.error(pluginResult.error);
|
observer.error(pluginResult.error);
|
||||||
observer.complete();
|
observer.complete();
|
||||||
@ -266,7 +277,14 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
|||||||
} else if (opts.observable) {
|
} else if (opts.observable) {
|
||||||
|
|
||||||
return new Observable(observer => {
|
return new Observable(observer => {
|
||||||
let pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
|
||||||
|
let pluginResult;
|
||||||
|
|
||||||
|
if (opts.destruct) {
|
||||||
|
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
|
||||||
|
} else {
|
||||||
|
pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||||
|
}
|
||||||
|
|
||||||
if (pluginResult && pluginResult.error) {
|
if (pluginResult && pluginResult.error) {
|
||||||
observer.error(pluginResult.error);
|
observer.error(pluginResult.error);
|
||||||
@ -287,9 +305,13 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else if (opts.otherPromise) {
|
} else if (opts.otherPromise) {
|
||||||
|
|
||||||
return getPromise((resolve: Function, reject: Function) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
let result;
|
||||||
|
if (opts.destruct) {
|
||||||
|
result = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||||
|
} else {
|
||||||
|
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
|
}
|
||||||
if (result && !!result.then) {
|
if (result && !!result.then) {
|
||||||
result.then(resolve, reject);
|
result.then(resolve, reject);
|
||||||
} else {
|
} else {
|
||||||
@ -298,8 +320,24 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
let pluginResult: any, rej: Function;
|
||||||
|
const p = getPromise((resolve: Function, reject: Function) => {
|
||||||
|
if (opts.destruct) {
|
||||||
|
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||||
|
} else {
|
||||||
|
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
|
}
|
||||||
|
rej = reject;
|
||||||
|
});
|
||||||
|
// Angular throws an error on unhandled rejection, but in this case we have already printed
|
||||||
|
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
|
||||||
|
// to error
|
||||||
|
if (pluginResult && pluginResult.error) {
|
||||||
|
p.catch(() => { });
|
||||||
|
typeof rej === 'function' && rej(pluginResult.error);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
|
||||||
return getPromise((resolve: Function, reject: Function) => callInstance(pluginObj, methodName, args, opts, resolve, reject));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,35 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bit flag values for setSystemUiVisibility()
|
||||||
|
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
|
||||||
|
*/
|
||||||
|
export enum AndroidSystemUiFlags {
|
||||||
|
/** View has requested the system UI (status bar) to be visible (the default). SYSTEM_UI_FLAG_VISIBLE */
|
||||||
|
Visible = 0,
|
||||||
|
/** View has requested the system UI to enter an unobtrusive "low profile" mode. SYSTEM_UI_FLAG_LOW_PROFILE */
|
||||||
|
LowProfile = 1,
|
||||||
|
/** View has requested that the system navigation be temporarily hidden. SYSTEM_UI_FLAG_HIDE_NAVIGATION */
|
||||||
|
HideNavigation = 2,
|
||||||
|
/** View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. SYSTEM_UI_FLAG_FULLSCREEN */
|
||||||
|
Fullscreen = 4,
|
||||||
|
/** Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds. SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR */
|
||||||
|
LightNavigationBar = 16,
|
||||||
|
/** When using other layout flags, we would like a stable view of the content insets given to fitSystemWindows(Rect). SYSTEM_UI_FLAG_LAYOUT_STABLE */
|
||||||
|
LayoutStable = 256,
|
||||||
|
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_HIDE_NAVIGATION, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION */
|
||||||
|
LayoutHideNavigation = 512,
|
||||||
|
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_FULLSCREEN, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN */
|
||||||
|
LayoutFullscreen = 1024,
|
||||||
|
/** View would like to remain interactive when hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE */
|
||||||
|
Immersive = 2048,
|
||||||
|
/** View would like to remain interactive when hiding the status bar with SYSTEM_UI_FLAG_FULLSCREEN and/or hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE_STICKY */
|
||||||
|
ImmersiveSticky = 4096,
|
||||||
|
/** Requests the status bar to draw in a mode that is compatible with light status bar backgrounds. SYSTEM_UI_FLAG_LIGHT_STATUS_BAR */
|
||||||
|
LightStatusBar = 8192
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Android Full Screen
|
* @name Android Full Screen
|
||||||
* @description
|
* @description
|
||||||
@ -92,4 +121,13 @@ export class AndroidFullScreen extends IonicNativePlugin {
|
|||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
immersiveMode(): Promise<void> { return; }
|
immersiveMode(): Promise<void> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manually set the the system UI to a custom mode. This mirrors the Android method of the same name. (Android 4.4+ only).
|
||||||
|
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
|
||||||
|
* @param {AndroidSystemUiFlags} visibility Bitwise-OR of flags in AndroidSystemUiFlags
|
||||||
|
* @return {Promise<void>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setSystemUiVisibility(visibility: AndroidSystemUiFlags): Promise<void> { return; }
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
|
|||||||
*
|
*
|
||||||
* this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
|
* this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
|
||||||
* success => console.log('Permission granted'),
|
* success => console.log('Permission granted'),
|
||||||
* err => this.androidPermissions.requestPermissions(this.androidPermissions.PERMISSION.CAMERA)
|
* err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
|
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
|
||||||
|
@ -264,7 +264,7 @@ export interface BackgroundGeolocationConfig {
|
|||||||
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
|
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { BackgroundGeolocation, BackgroundGeolocationConfig } from '@ionic-native/background-geolocation';
|
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
|
||||||
*
|
*
|
||||||
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
|
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
|
||||||
*
|
*
|
||||||
|
@ -19,14 +19,14 @@ export interface BackgroundModeConfiguration {
|
|||||||
text?: String;
|
text?: String;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This will look for <icon name>.png in platforms/android/res/drawable|mipmap
|
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
|
||||||
*/
|
*/
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
|
||||||
color?: 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.
|
* By default the app will come to foreground when taping on the notification. If false, plugin won't come to foreground when tapped.
|
||||||
*/
|
*/
|
||||||
resume?: boolean;
|
resume?: boolean;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ export interface BackgroundModeConfiguration {
|
|||||||
* @name Background Mode
|
* @name Background Mode
|
||||||
* @description
|
* @description
|
||||||
* Cordova plugin to prevent the app from going to sleep while in background.
|
* Cordova plugin to prevent the app from going to sleep while in background.
|
||||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
|
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, visit: https://github.com/katzer/cordova-plugin-background-mode
|
||||||
*@usage
|
*@usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { BackgroundMode } from '@ionic-native/background-mode';
|
* import { BackgroundMode } from '@ionic-native/background-mode';
|
||||||
@ -179,7 +179,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
|||||||
overrideBackButton(): void { }
|
overrideBackButton(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exclude the app from the recent task list works on Android 5.0+.
|
* Exclude the app from the recent task list. Works on Android 5.0+.
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['Android'],
|
platforms: ['Android'],
|
||||||
|
@ -441,7 +441,7 @@ export class BLE extends IonicNativePlugin {
|
|||||||
*@returns {Promise<any>}
|
*@returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static readRSSI(
|
readRSSI(
|
||||||
deviceId: string,
|
deviceId: string,
|
||||||
): Promise<any> { return; }
|
): Promise<any> { return; }
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Bluetooth Serial
|
* @name Bluetooth Serial
|
||||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
|
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino (not Android to Android or iOS to iOS).
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
|
* import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
|
||||||
|
@ -85,6 +85,42 @@ export interface CameraPopoverOptions {
|
|||||||
arrowDir: number;
|
arrowDir: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum DestinationType {
|
||||||
|
DATA_URL = 0,
|
||||||
|
FILE_URL,
|
||||||
|
NATIVE_URI
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EncodingType {
|
||||||
|
JPEG = 0,
|
||||||
|
PNG
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MediaType {
|
||||||
|
PICTURE = 0,
|
||||||
|
VIDEO,
|
||||||
|
ALLMEDIA
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PictureSourceType {
|
||||||
|
PHOTOLIBRARY = 0,
|
||||||
|
CAMERA,
|
||||||
|
SAVEDPHOTOALBUM
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PopoverArrowDirection {
|
||||||
|
ARROW_UP = 1,
|
||||||
|
ARROW_DOWN,
|
||||||
|
ARROW_LEFT,
|
||||||
|
ARROW_RIGHT,
|
||||||
|
ARROW_ANY
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Direction {
|
||||||
|
BACK = 0,
|
||||||
|
FRONT
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Camera
|
* @name Camera
|
||||||
* @description
|
* @description
|
||||||
|
@ -133,6 +133,11 @@ export interface CardIOResponse {
|
|||||||
* @name Card IO
|
* @name Card IO
|
||||||
* @description
|
* @description
|
||||||
* @usage
|
* @usage
|
||||||
|
* Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element.
|
||||||
|
* ```xml
|
||||||
|
*<key>NSCameraUsageDescription</key>
|
||||||
|
*<string>To scan credit cards.</string>
|
||||||
|
*```
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { CardIO } from '@ionic-native/card-io';
|
* import { CardIO } from '@ionic-native/card-io';
|
||||||
*
|
*
|
||||||
@ -147,7 +152,7 @@ export interface CardIOResponse {
|
|||||||
* if(res){
|
* if(res){
|
||||||
* let options = {
|
* let options = {
|
||||||
* requireExpiry: true,
|
* requireExpiry: true,
|
||||||
* requireCCV: false,
|
* requireCVV: false,
|
||||||
* requirePostalCode: false
|
* requirePostalCode: false
|
||||||
* };
|
* };
|
||||||
* CardIO.scan(options);
|
* CardIO.scan(options);
|
||||||
|
@ -29,10 +29,10 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Clipboard',
|
pluginName: 'Clipboard',
|
||||||
plugin: 'danielsogl-cordova-plugin-clipboard',
|
plugin: 'cordova-clipboard',
|
||||||
pluginRef: 'cordova.plugins.clipboard',
|
pluginRef: 'cordova.plugins.clipboard',
|
||||||
repo: 'https://github.com/danielsogl/cordova-plugin-clipboard',
|
repo: 'https://github.com/ihadeed/cordova-clipboard',
|
||||||
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Clipboard extends IonicNativePlugin {
|
export class Clipboard extends IonicNativePlugin {
|
||||||
|
@ -10,14 +10,53 @@ import { Injectable } from '@angular/core';
|
|||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { CouchbaseLite } from '@ionic-native/couchbase-lite';
|
* import { CouchbaseLite } from '@ionic-native/couchbase-lite';
|
||||||
*
|
* import { Http } from '@angular/http';
|
||||||
* constructor(private couchbase: CouchbaseLite) {
|
* import { Observable } from 'rxjs/Observable'
|
||||||
*
|
* constructor(private couchbase: CouchbaseLite, private platform:Platform,private _http:Http) {
|
||||||
* couchbase.getURL()
|
* this.initMethod();
|
||||||
* .then(url => console.log(url))
|
|
||||||
* .catch(error => console.error(error));
|
|
||||||
*
|
|
||||||
* }
|
* }
|
||||||
|
* url:string;
|
||||||
|
* initMethod() {
|
||||||
|
* this.couchbase.getURL().then((url)=> {
|
||||||
|
* this.url = url;
|
||||||
|
* })
|
||||||
|
* }
|
||||||
|
* getUrl() {
|
||||||
|
* return this.url;
|
||||||
|
* }
|
||||||
|
* // DATABASES //
|
||||||
|
* createDatabase(database_name:string) {
|
||||||
|
* let url = this.getUrl();
|
||||||
|
* url = url+database_name;
|
||||||
|
* return this._http
|
||||||
|
* .put(url)
|
||||||
|
* .map(data => { this.results = data['results'] })
|
||||||
|
* .catch((error:any) => {
|
||||||
|
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||||
|
* })
|
||||||
|
* }
|
||||||
|
* deleteDatabase(database_name:string) {
|
||||||
|
* let url = this.getUrl();
|
||||||
|
* url = url+database_name;
|
||||||
|
* return this._http
|
||||||
|
* .delete(url)
|
||||||
|
* .map(data => { this.results = data['results'] })
|
||||||
|
* .catch((error:any) => {
|
||||||
|
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||||
|
* })
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* getAllDbs() {
|
||||||
|
* let url = this.getUrl();
|
||||||
|
* url = url+'_all_dbs';
|
||||||
|
* return this._http
|
||||||
|
* .get(url)
|
||||||
|
* .map(data => { this.results = data['results'] })
|
||||||
|
* .catch((error:any) => {
|
||||||
|
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||||
|
* })
|
||||||
|
* }
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Extended Device Information
|
||||||
|
* @description
|
||||||
|
* Retrieves additional device information that is not provided by other plugins
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'ExtendedDeviceInformation',
|
||||||
|
plugin: 'cordova-plugin-extended-device-information',
|
||||||
|
pluginRef: 'extended-device-information',
|
||||||
|
repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class ExtendedDeviceInformation extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the device's memory size
|
||||||
|
*/
|
||||||
|
@CordovaProperty
|
||||||
|
memory: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the device's CPU mhz
|
||||||
|
*/
|
||||||
|
@CordovaProperty
|
||||||
|
cpumhz: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the total storage
|
||||||
|
*/
|
||||||
|
@CordovaProperty
|
||||||
|
totalstorage: string;
|
||||||
|
|
||||||
|
}
|
@ -17,6 +17,16 @@ export interface FingerprintOptions {
|
|||||||
* Disable 'use backup' option. Only for android (optional)
|
* Disable 'use backup' option. Only for android (optional)
|
||||||
*/
|
*/
|
||||||
disableBackup?: boolean;
|
disableBackup?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title of fallback button. Only for iOS
|
||||||
|
*/
|
||||||
|
localizedFallbackTitle?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description in authentication dialogue. Only for iOS
|
||||||
|
*/
|
||||||
|
localizedReason?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +46,9 @@ export interface FingerprintOptions {
|
|||||||
* this.faio.show({
|
* this.faio.show({
|
||||||
* clientId: 'Fingerprint-Demo',
|
* clientId: 'Fingerprint-Demo',
|
||||||
* clientSecret: 'password', //Only necessary for Android
|
* clientSecret: 'password', //Only necessary for Android
|
||||||
* disableBackup:true //Only for Android(optional)
|
* disableBackup:true, //Only for Android(optional)
|
||||||
|
* localizedFallbackTitle: 'Use Pin', //Only for iOS
|
||||||
|
* localizedReason: 'Please authenticate' //Only for iOS
|
||||||
* })
|
* })
|
||||||
* .then((result: any) => console.log(result))
|
* .then((result: any) => console.log(result))
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
|
@ -7,7 +7,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* @description
|
* @description
|
||||||
* Cordova plugin for Firebase Analytics
|
* Cordova plugin for Firebase Analytics
|
||||||
*
|
*
|
||||||
* Go yo firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||||
*
|
*
|
||||||
* NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
|
* NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,8 @@ export interface DynamicLinksOptions {
|
|||||||
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
|
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
|
||||||
*
|
*
|
||||||
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
|
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
|
||||||
*
|
* Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
|
||||||
|
* Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.
|
||||||
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||||
*
|
*
|
||||||
* Preferences:
|
* Preferences:
|
||||||
|
@ -71,10 +71,10 @@ export class Firebase extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check permission to receive push notifications
|
* Check permission to receive push notifications
|
||||||
* @return {Promise<any>}
|
* @return {Promise<{isEnabled: boolean}>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
hasPermission(): Promise<any> { return; }
|
hasPermission(): Promise<{isEnabled: boolean}> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set icon badge number. Set to 0 to clear the badge.
|
* Set icon badge number. Set to 0 to clear the badge.
|
||||||
@ -107,6 +107,13 @@ export class Firebase extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
unsubscribe(topic: string): Promise<any> { return; }
|
unsubscribe(topic: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregister from firebase, used to stop receiving push notifications.
|
||||||
|
* Call this when you logout user from your app.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
unregister(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log an event using Analytics
|
* Log an event using Analytics
|
||||||
* @param type {string}
|
* @param type {string}
|
||||||
|
@ -85,7 +85,7 @@ declare const window: any;
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class Geofence extends IonicNativePlugin {
|
export class Geofence extends IonicNativePlugin {
|
||||||
|
|
||||||
public TransitionType = {
|
TransitionType = {
|
||||||
ENTER: 1,
|
ENTER: 1,
|
||||||
EXIT: 2,
|
EXIT: 2,
|
||||||
BOTH: 3
|
BOTH: 3
|
||||||
@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
|
|||||||
* @return {Observable<any>}
|
* @return {Observable<any>}
|
||||||
*/
|
*/
|
||||||
@CordovaFunctionOverride()
|
@CordovaFunctionOverride()
|
||||||
onTrasitionReceived(): Observable<any> { return; };
|
onTransitionReceived(): Observable<any> { return; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||||
@ -139,20 +139,6 @@ export class Geofence extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
getWatched(): Promise<string> { return; };
|
getWatched(): Promise<string> { return; };
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a geofence is crossed in the direction specified by `TransitType`.
|
|
||||||
*
|
|
||||||
* @returns {Observable<any>}
|
|
||||||
*/
|
|
||||||
onTransitionReceived(): Observable<any> {
|
|
||||||
|
|
||||||
return new Observable<any>((observer) => {
|
|
||||||
window && window.geofence && (window.geofence.onTransitionReceived = observer.next.bind(observer));
|
|
||||||
return () => window.geofence.onTransitionReceived = () => { };
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||||
*
|
*
|
||||||
|
@ -153,6 +153,8 @@ export interface GeolocationOptions {
|
|||||||
plugin: 'cordova-plugin-geolocation',
|
plugin: 'cordova-plugin-geolocation',
|
||||||
pluginRef: 'navigator.geolocation',
|
pluginRef: 'navigator.geolocation',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||||
|
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
|
||||||
|
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
|
||||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -59,9 +59,9 @@ export interface HTTPResponse {
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'HTTP',
|
pluginName: 'HTTP',
|
||||||
plugin: 'cordova-plugin-http',
|
plugin: 'cordova-plugin-advanced-http',
|
||||||
pluginRef: 'cordovaHTTP',
|
pluginRef: 'cordova.plugin.http',
|
||||||
repo: 'https://github.com/wymsee/cordova-HTTP',
|
repo: 'https://github.com/silkimen/cordova-plugin-advanced-http',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -92,6 +92,34 @@ export class HTTP extends IonicNativePlugin {
|
|||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
setHeader(header: string, value: string): void { }
|
setHeader(header: string, value: string): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
|
||||||
|
* @param serializer {string} The name of the serializer. Can be urlencoded or json
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
setDataSerializer(serializer: string): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all cookies
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
clearCookies(): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove cookies
|
||||||
|
* @param url {string}
|
||||||
|
* @param cb
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
removeCookies(url: string, cb: () => void): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set request timeout
|
||||||
|
* @param timeout {number} The timeout in seconds. Default 60
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
setRequestTimeout(timeout: number): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable SSL Pinning. This defaults to false.
|
* Enable or disable SSL Pinning. This defaults to false.
|
||||||
*
|
*
|
||||||
@ -131,7 +159,7 @@ export class HTTP extends IonicNativePlugin {
|
|||||||
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Make a GET request
|
||||||
* @param url {string} The url to send the request to
|
* @param url {string} The url to send the request to
|
||||||
* @param parameters {Object} Parameters to send with the request
|
* @param parameters {Object} Parameters to send with the request
|
||||||
* @param headers {Object} The headers to set for this request
|
* @param headers {Object} The headers to set for this request
|
||||||
@ -140,6 +168,36 @@ export class HTTP extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a PUT request
|
||||||
|
* @param url {string} The url to send the request to
|
||||||
|
* @param body {Object} The body of the request
|
||||||
|
* @param headers {Object} The headers to set for this request
|
||||||
|
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a DELETE request
|
||||||
|
* @param url {string} The url to send the request to
|
||||||
|
* @param parameters {Object} Parameters to send with the request
|
||||||
|
* @param headers {Object} The headers to set for this request
|
||||||
|
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a HEAD request
|
||||||
|
* @param url {string} The url to send the request to
|
||||||
|
* @param parameters {Object} Parameters to send with the request
|
||||||
|
* @param headers {Object} The headers to set for this request
|
||||||
|
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param url {string} The url to send the request to
|
* @param url {string} The url to send the request to
|
||||||
|
180
src/@ionic-native/plugins/hyper-track/index.ts
Normal file
180
src/@ionic-native/plugins/hyper-track/index.ts
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @beta
|
||||||
|
* @name HyperTrack
|
||||||
|
* @description
|
||||||
|
* HyperTrack cordova plugin wrapper for Ionic Native. Location-based services provider.
|
||||||
|
* Make sure to include your publishable key at config.xml (see [HyperTrack Cordova Setup](https://docs.hypertrack.com/sdks/cordova/setup.html#step-2-configure-the-sdk)).
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { HyperTrack } from '@ionic-native/hyper-track';
|
||||||
|
*
|
||||||
|
* constructor(private hyperTrack: HyperTrack) { }
|
||||||
|
*
|
||||||
|
* // Check if app has location permissions enabled
|
||||||
|
* this.hyperTrack.checkLocationPermission().then(response => {
|
||||||
|
* // response (String) can be "true" or "false"
|
||||||
|
* if (response != "true") {
|
||||||
|
* // Ask for permissions
|
||||||
|
* this.hyperTrack.requestPermissions().then(response => {}, error => {});
|
||||||
|
* }
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* // Check if app has location services enabled
|
||||||
|
* this.hyperTrack.checkLocationServices().then(response => {
|
||||||
|
* // response (String) can be "true" or "false"
|
||||||
|
* if (response != "true") {
|
||||||
|
* // Request services to be enabled
|
||||||
|
* this.hyperTrack.requestLocationServices().then(response => {}, error => {});
|
||||||
|
* }
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* // First set the current user. This can be done via getOrCreateUser() or setUserId()
|
||||||
|
* this.hyperTrack.setUserId("xxx").then(user => {
|
||||||
|
* // user (String) is a String representation of a User's JSON
|
||||||
|
*
|
||||||
|
* this.hyperTrack.startTracking().then(userId => {}, trackingError => {});
|
||||||
|
*
|
||||||
|
* this.hyperTrack.createAndAssignAction('visit', 'lookupId','address', 20.12, -100.3).then(action => {
|
||||||
|
* // Handle action. It's a String representation of the Action's JSON. For example:
|
||||||
|
* // '{"eta":"Jul 17, 2017 12:50:03 PM","assigned_at":"Jul 17, 2017 12:34:38 PM",,"distance":"0.0",...}'
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* // You can complete an action with completeAction() or completeActionWithLookupId()
|
||||||
|
* this.hyperTrack.completeAction('action-id').then(response => {
|
||||||
|
* // Handle response (String). Should be "OK".
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* this.hyperTrack.getCurrentLocation().then(location => {
|
||||||
|
* // Handle location. It's a String representation of a Location's JSON.For example:
|
||||||
|
* // '{"mAccuracy":22.601,,"mLatitude":23.123456, "mLongitude":-100.1234567, ...}'
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* this.hyperTrack.stopTracking().then(success => {
|
||||||
|
* // Handle success (String). Should be "OK".
|
||||||
|
* }, error => {});
|
||||||
|
*
|
||||||
|
* }, error => {});*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'HyperTrack',
|
||||||
|
plugin: 'cordova-plugin-hypertrack',
|
||||||
|
pluginRef: 'cordova.plugins.HyperTrack',
|
||||||
|
repo: 'https://github.com/hypertrack/hypertrack-cordova',
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class HyperTrack extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* Returns given text. For testing purposes.
|
||||||
|
* @param {String} text Given text to print
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the result text (which is the same as the given text) if successful, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
helloWorld(text: String): Promise<String> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new user to identify the current device or get a user from a lookup id.
|
||||||
|
* @param {String} name User's name
|
||||||
|
* @param {String} phone User's phone
|
||||||
|
* @param {String} photo User's photo as URL or a Base64 converted string
|
||||||
|
* @param {String} lookupId User's lookupId, which is used to check if a new user is to be created (in this case you could set it to an internal reference for the user that you can use later to identify it), or if one with an existing lookupId is to be used.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the User's JSON, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getOrCreateUser(name: String, phone: String, photo: String, lookupId: String): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set UserId for the SDK created using HyperTrack APIs. This is useful if you already have a user previously created.
|
||||||
|
* @param {String} userId User's ID
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred. An "OK" response doesn't necessarily mean that the userId was found. It just means that it was set correctly.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserId(userId: String): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable the SDK and start tracking. This will fail if there is no user set.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the userId (String) of the User being tracked if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
startTracking(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create and assign an action to the current user using specified parameters
|
||||||
|
* @param {String} type The action type. Can be one from "pickup", "delivery", "dropoff", "visit", "stopover" or "task"
|
||||||
|
* @param {String} lookupId The Action's desired lookupId
|
||||||
|
* @param {String} expectedPlaceAddress The address of the Action
|
||||||
|
* @param {Number} expectedPlaceLatitude The latitude of the Action
|
||||||
|
* @param {Number} expectedPlaceLongitude The longitude of the Action
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Action's JSON, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
createAndAssignAction(type: String, lookupId: String, expectedPlaceAddress: String, expectedPlaceLatitude: Number, expectedPlaceLongitude: Number): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Complete an action from the SDK by its ID
|
||||||
|
* @param {String} actionId ID of the Action that will be marked as completed
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
completeAction(actionId: String): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Complete an action from the SDK using Action's lookupId as parameter
|
||||||
|
* @param {String} lookupId Lookup ID of the Action that will be marked as completed
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
completeActionWithLookupId(lookupId: String): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the SDK and stop tracking.
|
||||||
|
* Needs user setting (via getOrCreateUser() or setUserId()) first.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the an "OK" string if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
stopTracking(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user's current location from the SDK
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Location's JSON, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getCurrentLocation(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Location permission has been granted to the app (for Android).
|
||||||
|
* Returns "true" or "false" in success method accordingly.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location permission was granted, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
checkLocationPermission(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request user to grant Location access to the app (for Anrdoid).
|
||||||
|
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location access was given to the app, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
requestPermissions(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Location services are enabled on the device (for Android).
|
||||||
|
* Returns "true" or "false" in success method accordingly.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location services are enabled, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
checkLocationServices(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request user to enable Location services on the device.
|
||||||
|
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
|
||||||
|
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location services were enabled, or it gets rejected if an error ocurred.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
requestLocationServices(): Promise<any> { return; }
|
||||||
|
}
|
@ -13,6 +13,7 @@ import { Injectable } from '@angular/core';
|
|||||||
* constructor(private store: InAppPurchase2) { }
|
* constructor(private store: InAppPurchase2) { }
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
* * @advanced
|
* * @advanced
|
||||||
*
|
*
|
||||||
|
136
src/@ionic-native/plugins/index-app-content/index.ts
Normal file
136
src/@ionic-native/plugins/index-app-content/index.ts
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface IndexItem {
|
||||||
|
domain: string;
|
||||||
|
identifier: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Url to image
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item keywords
|
||||||
|
*/
|
||||||
|
keywords?: Array<string>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifetime in minutes
|
||||||
|
*/
|
||||||
|
lifetime?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Index App Content
|
||||||
|
* @description
|
||||||
|
* This plugin gives you a Javascript API to interact with Core Spotlight on iOS (=> iOS 9).
|
||||||
|
* You can add, update and delete items to the spotlight search index.
|
||||||
|
* Spotlight Search will include these items in the result list. You can deep-link the search results with your app.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { IndexAppContent } from '@ionic-native/index-app-content';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private indexAppContent: IndexAppContent) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* var items = [
|
||||||
|
* {
|
||||||
|
* domain: 'com.my.domain',
|
||||||
|
* identifier: '88asdf7dsf',
|
||||||
|
* title: 'Foo',
|
||||||
|
* description: 'Bar',
|
||||||
|
* url: 'http://location/of/my/image.jpg',
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* domain: 'com.other.domain',
|
||||||
|
* identifier: '9asd67g6a',
|
||||||
|
* title: 'Baz',
|
||||||
|
* description: 'Woot',
|
||||||
|
* url: 'http://location/of/my/image2.jpg',
|
||||||
|
* }
|
||||||
|
* ];
|
||||||
|
*
|
||||||
|
* this.indexAppContent.setItems(items)
|
||||||
|
* .then((res: any) => console.log(res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'IndexAppContent',
|
||||||
|
plugin: 'cordova-plugin-indexappcontent',
|
||||||
|
pluginRef: 'window.plugins.indexAppContent',
|
||||||
|
repo: 'https://github.com/johanblomgren/cordova-plugin-indexappcontent',
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class IndexAppContent extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The option to index app content might not be available at all due to device limitations or user settings.
|
||||||
|
* Therefore it's highly recommended to check upfront if indexing is possible.
|
||||||
|
* @return {Promise<boolean>} Returns a promise that resolves with true if indexing is available, false if not
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
isIndexingAvailable(): Promise<boolean> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add or change items to spotlight index
|
||||||
|
* @param {Array<IndexItem>} Array of items to index
|
||||||
|
* @return {Promise<any>} Returns if index set was successfull
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setItems(items: Array<IndexItem>): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If user taps on a search result in spotlight then the app will be launched.
|
||||||
|
* You can register a Javascript handler to get informed when this happens.
|
||||||
|
* @param {IndexItem} Clicked Item
|
||||||
|
* @return {Promise<any>} Returns promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
onItemPressed(payload: IndexItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all items stored for a given array of domains
|
||||||
|
* @param {Array<string>} Array of domains to clear
|
||||||
|
* @return {Promise<any>} Resolve if successfull
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
clearItemsForDomains(domains: Array<string>): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all items stored for a given array of identifiers
|
||||||
|
* @param {Array<string>} Array of identifiers to clear
|
||||||
|
* @return {Promise<any>} Resolve if successfull
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You might want to avoid to update spotlight index too frequently.
|
||||||
|
* Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)!
|
||||||
|
* @param {number} Numeric value => 0
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setIndexingInterval(intervalMinutes: number) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
88
src/@ionic-native/plugins/keychain-touch-id/index.ts
Normal file
88
src/@ionic-native/plugins/keychain-touch-id/index.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Keychain Touch Id
|
||||||
|
* @description
|
||||||
|
* A cordova plugin adding the iOS TouchID / Android fingerprint to your
|
||||||
|
* app and allowing you to store a password securely in the device keychain.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { KeychainTouchId } from '@ionic-native/keychain-touch-id';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private keychainTouchId: KeychainTouchId) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* this.keychainTouchId.isAvailable()
|
||||||
|
* .then((res: any) => console.log(res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'KeychainTouchId',
|
||||||
|
plugin: 'cordova-plugin-keychain-touch-id',
|
||||||
|
pluginRef: 'plugins.touchid',
|
||||||
|
repo: 'https://github.com/sjhoeksma/cordova-plugin-keychain-touch-id',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class KeychainTouchId extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Touch ID / Fingerprint is supported by the device
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
isAvailable(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
|
||||||
|
* successful authentication using fingerprint
|
||||||
|
* @param key {string} the key you want to store
|
||||||
|
* @param password {string} the password you want to encrypt and store
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when there is a result
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
save(key: string, password: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve
|
||||||
|
* with the password stored in keychain or will resolve an error code, where -1 indicated not available.
|
||||||
|
* @param key {string} the key you want to retrieve from keychain
|
||||||
|
* @param message {string} a message to the user
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
verify(key: string, message: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if there is a password stored within the keychain for the given key.
|
||||||
|
* @param key {string} the key you want to check from keychain
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
has(key: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the password stored under given key from the keychain.
|
||||||
|
* @param key {string} the key you want to delete from keychain
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
delete(key: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the language of the fingerprint dialog
|
||||||
|
* @param locale {string} locale subtag from [this list](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setLocale(locale: string): void {}
|
||||||
|
|
||||||
|
}
|
@ -313,8 +313,8 @@ export class LaunchNavigator extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
successIndex: 1,
|
successIndex: 2,
|
||||||
errorIndex: 2
|
errorIndex: 3
|
||||||
})
|
})
|
||||||
navigate(destination: string | number[], options?: LaunchNavigatorOptions): Promise<any> { return; }
|
navigate(destination: string | number[], options?: LaunchNavigatorOptions): Promise<any> { return; }
|
||||||
|
|
||||||
|
@ -324,5 +324,15 @@ export class LocalNotifications extends IonicNativePlugin {
|
|||||||
})
|
})
|
||||||
on(eventName: string, callback: any): void { }
|
on(eventName: string, callback: any): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a callback of a specific event
|
||||||
|
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||||
|
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
sync: true
|
||||||
|
})
|
||||||
|
un(eventName: string, callback: any): void { }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin, InstanceProperty } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { Observer } from 'rxjs/Observer';
|
import { Observer } from 'rxjs/Observer';
|
||||||
|
|
||||||
@ -8,7 +8,55 @@ import { Observer } from 'rxjs/Observer';
|
|||||||
*/
|
*/
|
||||||
export class MediaObject {
|
export class MediaObject {
|
||||||
|
|
||||||
constructor(private _objectInstance: any, public onSuccess: Observable<any>, public onError: Observable<any>, public onStatusUpdate: Observable<any>) {}
|
/**
|
||||||
|
* An observable that notifies you on actions success
|
||||||
|
*/
|
||||||
|
onSuccess: Observable<any>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An observable that notifies you when an error occurs
|
||||||
|
*/
|
||||||
|
onError: Observable<MEDIA_ERROR>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An observable that notifies you when the file status changes
|
||||||
|
*/
|
||||||
|
onStatusUpdate: Observable<MEDIA_STATUS>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
@InstanceProperty
|
||||||
|
successCallback: Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
@InstanceProperty
|
||||||
|
errorCallback: Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
@InstanceProperty
|
||||||
|
statusCallback: Function;
|
||||||
|
|
||||||
|
constructor(private _objectInstance: any) {
|
||||||
|
this.onSuccess = new Observable<any>((observer: Observer<any>) => {
|
||||||
|
this.successCallback = observer.next.bind(observer);
|
||||||
|
return () => this.successCallback = () => {};
|
||||||
|
});
|
||||||
|
|
||||||
|
this.onError = new Observable<MEDIA_ERROR>((observer: Observer<MEDIA_ERROR>) => {
|
||||||
|
this.errorCallback = observer.next.bind(observer);
|
||||||
|
return () => this.errorCallback = () => {};
|
||||||
|
});
|
||||||
|
|
||||||
|
this.onStatusUpdate = new Observable<MEDIA_STATUS>((observer: Observer<MEDIA_STATUS>) => {
|
||||||
|
this.statusCallback = observer.next.bind(observer);
|
||||||
|
return () => this.statusCallback = () => {};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current amplitude of the current recording.
|
* Get the current amplitude of the current recording.
|
||||||
@ -66,6 +114,9 @@ export class MediaObject {
|
|||||||
@CordovaInstance({ sync: true })
|
@CordovaInstance({ sync: true })
|
||||||
setVolume(volume: number): void { }
|
setVolume(volume: number): void { }
|
||||||
|
|
||||||
|
@CordovaInstance({ sync: true })
|
||||||
|
setRate(speedRate: number): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts recording an audio file.
|
* Starts recording an audio file.
|
||||||
*/
|
*/
|
||||||
@ -114,6 +165,21 @@ export interface MediaError {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum MEDIA_STATUS {
|
||||||
|
NONE = 0,
|
||||||
|
STARTING,
|
||||||
|
RUNNING,
|
||||||
|
PAUSED,
|
||||||
|
STOPPED
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MEDIA_ERROR {
|
||||||
|
ABORTED = 1,
|
||||||
|
NETWORK,
|
||||||
|
DECODE,
|
||||||
|
SUPPORTED
|
||||||
|
}
|
||||||
|
|
||||||
export type MediaErrorCallback = (error: MediaError) => void;
|
export type MediaErrorCallback = (error: MediaError) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -266,39 +332,17 @@ export class Media extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Open a media file
|
* Open a media file
|
||||||
* @param src {string} A URI containing the audio content.
|
* @param src {string} A URI containing the audio content.
|
||||||
* @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}
|
* @return {MediaObject}
|
||||||
*/
|
*/
|
||||||
create(src: string): MediaObject {
|
create(src: string): MediaObject {
|
||||||
|
let instance: any;
|
||||||
let instance: any,
|
|
||||||
onSuccess: Function,
|
|
||||||
onError: Function,
|
|
||||||
onStatusUpdate: Function;
|
|
||||||
|
|
||||||
|
|
||||||
const onSuccessObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
|
|
||||||
onSuccess = observer.next.bind(observer);
|
|
||||||
return () => {};
|
|
||||||
}),
|
|
||||||
onErrorObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
|
|
||||||
onError = observer.next.bind(observer);
|
|
||||||
return () => {};
|
|
||||||
}),
|
|
||||||
onStatusUpdateObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
|
|
||||||
onStatusUpdate = observer.next.bind(observer);
|
|
||||||
return () => {};
|
|
||||||
});
|
|
||||||
|
|
||||||
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
|
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
|
||||||
// Creates a new media object
|
// Creates a new media object
|
||||||
instance = new (Media.getPlugin())(src, onSuccess, onError, onStatusUpdate);
|
instance = new (Media.getPlugin())(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MediaObject(instance, onSuccessObservable, onErrorObservable, onStatusUpdateObservable);
|
return new MediaObject(instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ export class AuthenticationContext {
|
|||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
otherPromise: true
|
otherPromise: true
|
||||||
})
|
})
|
||||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
|
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
|
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
|
||||||
@ -152,6 +152,6 @@ export class AuthenticationContext {
|
|||||||
@CordovaInstance({
|
@CordovaInstance({
|
||||||
otherPromise: true
|
otherPromise: true
|
||||||
})
|
})
|
||||||
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId: string): Promise<AuthenticationResult> { return; }
|
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise<AuthenticationResult> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,10 @@ export interface MusicControlsOptions {
|
|||||||
dismissable: boolean;
|
dismissable: boolean;
|
||||||
hasPrev: boolean;
|
hasPrev: boolean;
|
||||||
hasNext: boolean;
|
hasNext: boolean;
|
||||||
|
hasSkipForward: boolean;
|
||||||
|
hasSkipBackward: boolean;
|
||||||
|
skipForwardInterval: number;
|
||||||
|
skipBackwardInterval: number;
|
||||||
hasClose: boolean;
|
hasClose: boolean;
|
||||||
album: string;
|
album: string;
|
||||||
duration: number;
|
duration: number;
|
||||||
@ -50,6 +54,10 @@ export interface MusicControlsOptions {
|
|||||||
* album : 'Absolution' // optional, default: ''
|
* album : 'Absolution' // optional, default: ''
|
||||||
* duration : 60, // optional, default: 0
|
* duration : 60, // optional, default: 0
|
||||||
* elapsed : 10, // optional, default: 0
|
* elapsed : 10, // optional, default: 0
|
||||||
|
* hasSkipForward : true, // show skip forward button, optional, default: false
|
||||||
|
* hasSkipBackward : true, // show skip backward button, optional, default: false
|
||||||
|
* skipForwardInterval: 15, // display number for skip forward, optional, default: 0
|
||||||
|
* skipBackwardInterval: 15, // display number for skip backward, optional, default: 0
|
||||||
*
|
*
|
||||||
* // Android only, optional
|
* // Android only, optional
|
||||||
* // text displayed in the status bar when the notification (and the ticker) are updated
|
* // text displayed in the status bar when the notification (and the ticker) are updated
|
||||||
@ -89,6 +97,12 @@ export interface MusicControlsOptions {
|
|||||||
* });
|
* });
|
||||||
* // Do something
|
* // Do something
|
||||||
* break;
|
* break;
|
||||||
|
* case 'music-controls-skip-forward':
|
||||||
|
* // Do something
|
||||||
|
* break;
|
||||||
|
* case 'music-controls-skip-backward':
|
||||||
|
* // Do something
|
||||||
|
* break;
|
||||||
*
|
*
|
||||||
* // Headset events (Android only)
|
* // Headset events (Android only)
|
||||||
* // All media button events are listed below
|
* // All media button events are listed below
|
||||||
|
@ -15,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
||||||
* .then((result: NativeGeocoderReverseResult) => console.log('The address is ' + result.street + ' in ' + result.countryCode))
|
* .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
* this.nativeGeocoder.forwardGeocode('Berlin')
|
* this.nativeGeocoder.forwardGeocode('Berlin')
|
||||||
@ -40,7 +40,7 @@ export class NativeGeocoder extends IonicNativePlugin {
|
|||||||
* Reverse geocode a given latitude and longitude to find location address
|
* Reverse geocode a given latitude and longitude to find location address
|
||||||
* @param latitude {number} The latitude
|
* @param latitude {number} The latitude
|
||||||
* @param longitude {number} The longitude
|
* @param longitude {number} The longitude
|
||||||
* @return {Promise<any>}
|
* @return {Promise<NativeGeocoderReverseResult>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
@ -50,48 +50,59 @@ export class NativeGeocoder extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Forward geocode a given address to find coordinates
|
* Forward geocode a given address to find coordinates
|
||||||
* @param addressString {string} The address to be geocoded
|
* @param addressString {string} The address to be geocoded
|
||||||
* @return {Promise<any>}
|
* @return {Promise<NativeGeocoderForwardResult>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates format information about a reverse geocoding result.
|
* Encapsulates format information about a reverse geocoding result.
|
||||||
|
* more Info:
|
||||||
|
* - https://developer.apple.com/documentation/corelocation/clplacemark
|
||||||
|
* - https://developer.android.com/reference/android/location/Address.html
|
||||||
*/
|
*/
|
||||||
export interface NativeGeocoderReverseResult {
|
export interface NativeGeocoderReverseResult {
|
||||||
/**
|
/**
|
||||||
* The street.
|
* The country code.
|
||||||
*/
|
*/
|
||||||
street: string;
|
countryCode: string;
|
||||||
/**
|
|
||||||
* The house number.
|
|
||||||
*/
|
|
||||||
houseNumber: string;
|
|
||||||
/**
|
|
||||||
* The postal code.
|
|
||||||
*/
|
|
||||||
postalCode: string;
|
|
||||||
/**
|
|
||||||
* The city.
|
|
||||||
*/
|
|
||||||
city: string;
|
|
||||||
/**
|
|
||||||
* The district.
|
|
||||||
*/
|
|
||||||
district: string;
|
|
||||||
/**
|
/**
|
||||||
* The country name.
|
* The country name.
|
||||||
*/
|
*/
|
||||||
countryName: string;
|
countryName: string;
|
||||||
/**
|
/**
|
||||||
* The country code.
|
* The postal code.
|
||||||
*/
|
*/
|
||||||
countryCode: string;
|
postalCode: string;
|
||||||
|
/**
|
||||||
|
* The administrativeArea.
|
||||||
|
*/
|
||||||
|
administrativeArea: string;
|
||||||
|
/**
|
||||||
|
* The subAdministrativeArea.
|
||||||
|
*/
|
||||||
|
subAdministrativeArea: string;
|
||||||
|
/**
|
||||||
|
* The locality.
|
||||||
|
*/
|
||||||
|
locality: string;
|
||||||
|
/**
|
||||||
|
* The subLocality.
|
||||||
|
*/
|
||||||
|
subLocality: string;
|
||||||
|
/**
|
||||||
|
* The thoroughfare.
|
||||||
|
*/
|
||||||
|
thoroughfare: string;
|
||||||
|
/**
|
||||||
|
* The subThoroughfare.
|
||||||
|
*/
|
||||||
|
subThoroughfare: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates format information about a forward geocoding result.
|
* Encapsulates format information about a forward geocoding result.
|
||||||
*/
|
*/
|
||||||
|
@ -23,8 +23,17 @@ declare let window: any;
|
|||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* let message = this.ndef.textRecord('Hello world');
|
* this.nfc.addNdefListener(() => {
|
||||||
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
* console.log('successfully attached ndef listener');
|
||||||
|
* }, (err) => {
|
||||||
|
* console.log('error attaching ndef listener', err);
|
||||||
|
* }).subscribe((event) => {
|
||||||
|
* console.log('received ndef message. the tag contains: ', event.tag);
|
||||||
|
* console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
|
||||||
|
*
|
||||||
|
* let message = this.ndef.textRecord('Hello world');
|
||||||
|
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
||||||
|
* });
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -165,7 +165,7 @@ export interface OSNotificationPayload {
|
|||||||
/**
|
/**
|
||||||
* URL to open when opening the notification.
|
* URL to open when opening the notification.
|
||||||
*/
|
*/
|
||||||
launchUrl?: string;
|
launchURL?: string;
|
||||||
/**
|
/**
|
||||||
* Sound resource to play when the notification is shown.
|
* Sound resource to play when the notification is shown.
|
||||||
*/
|
*/
|
||||||
|
111
src/@ionic-native/plugins/open-native-settings/index.ts
Normal file
111
src/@ionic-native/plugins/open-native-settings/index.ts
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Open Native Settings
|
||||||
|
* @description
|
||||||
|
* Plugin to open native screens of iOS/android settings
|
||||||
|
* @usage
|
||||||
|
* You can open any of these settings:
|
||||||
|
* ```
|
||||||
|
* "about", // ios
|
||||||
|
"accessibility", // ios, android
|
||||||
|
"account", // ios, android
|
||||||
|
"airplane_mode", // ios, android
|
||||||
|
"apn", // android
|
||||||
|
"application_details", // ios, android
|
||||||
|
"application_development", // android
|
||||||
|
"application", // android
|
||||||
|
"autolock", // ios
|
||||||
|
"battery_optimization", // android
|
||||||
|
"bluetooth", // ios, android
|
||||||
|
"castle", // ios
|
||||||
|
"captioning", // android
|
||||||
|
"cast", // android
|
||||||
|
"cellular_usage", // ios
|
||||||
|
"configuration_list", // ios
|
||||||
|
"data_roaming", // android
|
||||||
|
"date", // ios, android
|
||||||
|
"display", // ios, android
|
||||||
|
"dream", // android
|
||||||
|
"facetime", // ios
|
||||||
|
"home", // android
|
||||||
|
"keyboard", // ios, android
|
||||||
|
"keyboard_subtype", // android
|
||||||
|
"locale", // ios, android
|
||||||
|
"location", // ios, android
|
||||||
|
"locations", // ios
|
||||||
|
"manage_all_applications", // android
|
||||||
|
"manage_applications", // android
|
||||||
|
"memory_card", // android
|
||||||
|
"music", // ios
|
||||||
|
"music_equalizer", // ios
|
||||||
|
"music_volume", // ios
|
||||||
|
"network", // ios, android
|
||||||
|
"nike_ipod", // ios
|
||||||
|
"nfcsharing", // android
|
||||||
|
"nfc_payment", // android
|
||||||
|
"nfc_settings", // android
|
||||||
|
"notes", // ios
|
||||||
|
"notification_id", // ios
|
||||||
|
"passbook", // ios
|
||||||
|
"phone", // ios
|
||||||
|
"photos", // ios
|
||||||
|
"print", // android
|
||||||
|
"privacy", // android
|
||||||
|
"quick_launch", // android
|
||||||
|
"reset", // ios
|
||||||
|
"ringtone", // ios
|
||||||
|
"browser", // ios
|
||||||
|
"search", // ios, android
|
||||||
|
"security", // android
|
||||||
|
"settings", // ios, android
|
||||||
|
"show_regulatory_info",
|
||||||
|
"sound", // ios, android
|
||||||
|
"software_update", // ios
|
||||||
|
"storage", // ios, android
|
||||||
|
"store", // ios, android
|
||||||
|
"sync", // android
|
||||||
|
"tethering", // ios
|
||||||
|
"twitter", // ios
|
||||||
|
"touch", // ios
|
||||||
|
"usage", // ios, android
|
||||||
|
"user_dictionary", // android
|
||||||
|
"video", // ios
|
||||||
|
"voice_input", // android
|
||||||
|
"vpn", // ios
|
||||||
|
"wallpaper", // ios
|
||||||
|
"wifi_ip", // android
|
||||||
|
"wifi", // ios, android
|
||||||
|
"wireless" // android
|
||||||
|
```
|
||||||
|
* ```typescript
|
||||||
|
* import { OpenNativeSettings } from '@ionic-native/open-native-settings';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private openNativeSettings: OpenNativeSettings) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'OpenNativeSettings',
|
||||||
|
plugin: 'cordova-open-native-settings',
|
||||||
|
pluginRef: 'cordova.plugins.settings',
|
||||||
|
repo: 'https://github.com/guyromb/Cordova-open-native-settings',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class OpenNativeSettings extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a setting dialog
|
||||||
|
* @param setting {string} setting name
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
open(setting: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
}
|
@ -204,6 +204,12 @@ export class PayPalPayment {
|
|||||||
*/
|
*/
|
||||||
items: Array<PayPalItem>;
|
items: Array<PayPalItem>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional payee email, if your app is paying a third-party merchant.
|
||||||
|
* The payee's email. It must be a valid PayPal email address.
|
||||||
|
*/
|
||||||
|
payeeEmail: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional customer shipping address, if your app wishes to provide this to the SDK.
|
* Optional customer shipping address, if your app wishes to provide this to the SDK.
|
||||||
*/
|
*/
|
||||||
|
@ -87,7 +87,7 @@ export interface LocalNotificationOptions {
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Phonegap Local Notifications',
|
pluginName: 'Phonegap Local Notifications',
|
||||||
plugin: 'phonegap-local-notifications',
|
plugin: 'phonegap-plugin-local-notification',
|
||||||
pluginRef: 'Notification',
|
pluginRef: 'Notification',
|
||||||
repo: 'https://github.com/phonegap/phonegap-plugin-local-notification',
|
repo: 'https://github.com/phonegap/phonegap-plugin-local-notification',
|
||||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||||
|
@ -31,8 +31,8 @@ import { Injectable } from '@angular/core';
|
|||||||
* console.log(libraryItem.albumIds); // array of ids of appropriate AlbumItem, only of includeAlbumsData was used
|
* console.log(libraryItem.albumIds); // array of ids of appropriate AlbumItem, only of includeAlbumsData was used
|
||||||
* });
|
* });
|
||||||
* },
|
* },
|
||||||
* error: err => {},
|
* error: err => { console.log('could not get photos'); },
|
||||||
* complete: () => { console.log('could not get photos'); }
|
* complete: () => { console.log('done getting photos'); }
|
||||||
* });
|
* });
|
||||||
* })
|
* })
|
||||||
* .catch(err => console.log('permissions weren\'t granted'));
|
* .catch(err => console.log('permissions weren\'t granted'));
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface PhotoViewerOptions {
|
||||||
|
/**
|
||||||
|
* Set to false to disable the share button (Android only). Default: true
|
||||||
|
*/
|
||||||
|
share?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Photo Viewer
|
* @name Photo Viewer
|
||||||
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
|
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
|
||||||
@ -29,8 +37,8 @@ export class PhotoViewer extends IonicNativePlugin {
|
|||||||
* Shows an image in full screen
|
* Shows an image in full screen
|
||||||
* @param url {string} URL or path to image
|
* @param url {string} URL or path to image
|
||||||
* @param title {string}
|
* @param title {string}
|
||||||
* @param options {any}
|
* @param options {PhotoViewerOptions}
|
||||||
*/
|
*/
|
||||||
@Cordova({sync: true})
|
@Cordova({sync: true})
|
||||||
show(url: string, title?: string, options?: {share?: boolean}): void { }
|
show(url: string, title?: string, options?: PhotoViewerOptions): void { }
|
||||||
}
|
}
|
||||||
|
170
src/@ionic-native/plugins/pro/index.ts
Normal file
170
src/@ionic-native/plugins/pro/index.ts
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about the currently running app
|
||||||
|
*/
|
||||||
|
export interface AppInfo {
|
||||||
|
platform: string;
|
||||||
|
platformVersion: string;
|
||||||
|
version: string;
|
||||||
|
bundleName: string;
|
||||||
|
bundleVersion: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about the current live update
|
||||||
|
*/
|
||||||
|
export interface DeployInfo {
|
||||||
|
deploy_uuid: string;
|
||||||
|
channel: string;
|
||||||
|
binary_version: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
export class ProDeploy {
|
||||||
|
|
||||||
|
constructor(private _objectInstance: any) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
* @param host An Ionic Pro live update API
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
init(appId: string, host: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
@CordovaInstance()
|
||||||
|
debug(): Promise<any> { return; }
|
||||||
|
|
||||||
|
@CordovaInstance()
|
||||||
|
clearDebug(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check a channel for an available update
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
* @param channelName An Ionic Pro channel name
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
check(appId: string, channelName: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download an available version
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
download(appId: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unzip the latest downloaded version
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
extract(appId: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload app with the deployed version
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
redirect(appId: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get info about the version running on the device
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
info(appId: string): Promise<DeployInfo> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List versions stored on the device
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
getVersions(appId: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a version stored on the device by UUID
|
||||||
|
* @param appId An Ionic Pro app ID
|
||||||
|
* @param version A version UUID
|
||||||
|
*/
|
||||||
|
@CordovaInstance()
|
||||||
|
deleteVersion(appId: string, version: string): Promise<any> { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Pro
|
||||||
|
* @description
|
||||||
|
* This plugin enables Ionic Pro services like live updates and error monitoring
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { Pro, AppInfo, DeployInfo } from '@ionic-native/pro';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private pro: Pro) { }
|
||||||
|
*
|
||||||
|
* // Get app info
|
||||||
|
* this.pro.getAppInfo().then((res: AppInfo) => {
|
||||||
|
* console.log(res)
|
||||||
|
* })
|
||||||
|
*
|
||||||
|
* // Get live update info
|
||||||
|
* this.pro.deploy.info().then((res: DeployInfo) => {
|
||||||
|
* console.log(res)
|
||||||
|
* })
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'Pro',
|
||||||
|
plugin: 'cordova-plugin-ionic',
|
||||||
|
pluginRef: 'IonicCordova',
|
||||||
|
repo: 'https://github.com/ionic-team/cordova-plugin-ionic',
|
||||||
|
platforms: ['Android', 'iOS'],
|
||||||
|
install: 'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class Pro extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* Ionic Pro Deploy .js API.
|
||||||
|
*/
|
||||||
|
deploy: ProDeploy = new ProDeploy(Pro.getPlugin().deploy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not yet implemented
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
enableCrashLogging(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not yet implemented
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
checkForPendingCrash(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not yet implemented
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
loadPendingCrash(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not yet implemented
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
forceCrash(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get information about the currently running app
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves with current app info
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getAppInfo(): Promise<AppInfo> { return; }
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
|
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
|
||||||
|
|
||||||
@ -62,16 +62,10 @@ export interface NotificationEventAdditionalData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IOSPushOptions {
|
export interface IOSPushOptions {
|
||||||
/**
|
|
||||||
* Maps to the project number in the Google Developer Console. Setting this
|
|
||||||
* uses GCM for notifications instead of native.
|
|
||||||
*/
|
|
||||||
senderID?: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use prod or sandbox GCM setting.
|
* Whether to use prod or sandbox GCM setting.
|
||||||
*/
|
*/
|
||||||
gcmSandbox?: boolean | string;
|
fcmSandbox?: boolean | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true the device shows an alert on receipt of notification.
|
* If true the device shows an alert on receipt of notification.
|
||||||
@ -137,11 +131,6 @@ export interface CategoryActionData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AndroidPushOptions {
|
export interface AndroidPushOptions {
|
||||||
/**
|
|
||||||
* Maps to the project number in the Google Developer Console.
|
|
||||||
*/
|
|
||||||
senderID: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of a drawable resource to use as the small-icon. The name should
|
* The name of a drawable resource to use as the small-icon. The name should
|
||||||
* not include the extension.
|
* not include the extension.
|
||||||
@ -186,12 +175,37 @@ export interface AndroidPushOptions {
|
|||||||
* subscribe to a GcmPubSub topic.
|
* subscribe to a GcmPubSub topic.
|
||||||
*/
|
*/
|
||||||
topics?: string[];
|
topics?: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The key to search for text of notification.
|
||||||
|
*/
|
||||||
|
messageKey?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The key to search for title of notification.
|
||||||
|
*/
|
||||||
|
titleKey?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BrowserPushOptions {
|
||||||
|
/**
|
||||||
|
* Optional. Your GCM API key if you are using VAPID keys.
|
||||||
|
*/
|
||||||
|
applicationServerKey?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL for the push server you want to use.
|
||||||
|
* Default: http://push.api.phonegap.com/v1/push Optional.
|
||||||
|
*/
|
||||||
|
pushServiceURL?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PushOptions {
|
export interface PushOptions {
|
||||||
ios?: IOSPushOptions;
|
ios?: IOSPushOptions;
|
||||||
android?: AndroidPushOptions;
|
android?: AndroidPushOptions;
|
||||||
windows?: any;
|
windows?: any;
|
||||||
|
browser?: BrowserPushOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PushEvent = 'registration' | 'error' | 'notification';
|
export type PushEvent = 'registration' | 'error' | 'notification';
|
||||||
@ -229,15 +243,16 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
|||||||
* // to initialize push notifications
|
* // to initialize push notifications
|
||||||
*
|
*
|
||||||
* const options: PushOptions = {
|
* const options: PushOptions = {
|
||||||
* android: {
|
* android: {},
|
||||||
* senderID: '12345679'
|
|
||||||
* },
|
|
||||||
* ios: {
|
* ios: {
|
||||||
* alert: 'true',
|
* alert: 'true',
|
||||||
* badge: true,
|
* badge: true,
|
||||||
* sound: 'false'
|
* sound: 'false'
|
||||||
* },
|
* },
|
||||||
* windows: {}
|
* windows: {},
|
||||||
|
* browser: {
|
||||||
|
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
|
||||||
|
* }
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* const pushObject: PushObject = this.push.init(options);
|
* const pushObject: PushObject = this.push.init(options);
|
||||||
@ -257,6 +272,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
|||||||
* NotificationEventAdditionalData
|
* NotificationEventAdditionalData
|
||||||
* IOSPushOptions
|
* IOSPushOptions
|
||||||
* AndroidPushOptions
|
* AndroidPushOptions
|
||||||
|
* BrowserPushOptions
|
||||||
* PushOptions
|
* PushOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
@ -264,8 +280,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
|||||||
plugin: 'phonegap-plugin-push',
|
plugin: 'phonegap-plugin-push',
|
||||||
pluginRef: 'PushNotification',
|
pluginRef: 'PushNotification',
|
||||||
repo: 'https://github.com/phonegap/phonegap-plugin-push',
|
repo: 'https://github.com/phonegap/phonegap-plugin-push',
|
||||||
install: 'ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX',
|
install: 'ionic cordova plugin add phonegap-plugin-push',
|
||||||
installVariables: ['SENDER_ID'],
|
|
||||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -159,6 +159,13 @@ export class QRScanner extends IonicNativePlugin {
|
|||||||
})
|
})
|
||||||
enableLight(): Promise<QRScannerStatus> { return; }
|
enableLight(): Promise<QRScannerStatus> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy the scanner instance.
|
||||||
|
* @returns {Promise<QRScannerStatus>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
destroy(): Promise<QRScannerStatus> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable the device's light.
|
* Disable the device's light.
|
||||||
* @return {Promise<QRScannerStatus>}
|
* @return {Promise<QRScannerStatus>}
|
||||||
|
46
src/@ionic-native/plugins/regula-document-reader/index.ts
Normal file
46
src/@ionic-native/plugins/regula-document-reader/index.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @paid
|
||||||
|
* @beta
|
||||||
|
* @name Regula Document Reader
|
||||||
|
* @description
|
||||||
|
* Plugin for reading and validation of identification documents.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
|
||||||
|
*
|
||||||
|
* let license; // read regula.license file
|
||||||
|
* RegulaDocumentReader.initReader(license); // initialize reader
|
||||||
|
* RegulaDocumentReader.scanDocument().then((result) => {
|
||||||
|
* // read result
|
||||||
|
* })
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'Regula Document Reader',
|
||||||
|
plugin: 'cordova-plugin-documentreader',
|
||||||
|
pluginRef: 'DocumentReader',
|
||||||
|
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
|
||||||
|
platforms: ['iOS', 'Android'],
|
||||||
|
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class RegulaDocumentReader extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the scanner
|
||||||
|
* @param license {any} License data
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
initReader(license: any): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the scanner
|
||||||
|
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
scanDocument(): Promise<string[]> { return; }
|
||||||
|
}
|
@ -38,7 +38,7 @@ export interface SafariViewControllerOptions {
|
|||||||
* enterReaderModeIfAvailable: true,
|
* enterReaderModeIfAvailable: true,
|
||||||
* tintColor: '#ff0000'
|
* tintColor: '#ff0000'
|
||||||
* })
|
* })
|
||||||
* .then((result: any) => {
|
* .subscribe((result: any) => {
|
||||||
* if(result.event === 'opened') console.log('Opened');
|
* if(result.event === 'opened') console.log('Opened');
|
||||||
* else if(result.event === 'loaded') console.log('Loaded');
|
* else if(result.event === 'loaded') console.log('Loaded');
|
||||||
* else if(result.event === 'closed') console.log('Closed');
|
* else if(result.event === 'closed') console.log('Closed');
|
||||||
|
@ -12,6 +12,12 @@ export interface SerialPermissionOptions {
|
|||||||
|
|
||||||
export interface SerialOpenOptions {
|
export interface SerialOpenOptions {
|
||||||
baudRate: number;
|
baudRate: number;
|
||||||
|
dataBits: number;
|
||||||
|
stopBits: number;
|
||||||
|
parity: number;
|
||||||
|
dtr: boolean;
|
||||||
|
rts: boolean;
|
||||||
|
sleepOnPause: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,7 +35,13 @@ export interface SerialOpenOptions {
|
|||||||
*
|
*
|
||||||
* this.serial.requestPermission().then(() => {
|
* this.serial.requestPermission().then(() => {
|
||||||
* this.serial.open({
|
* this.serial.open({
|
||||||
* baudRate: 9800
|
* baudRate: 9800,
|
||||||
|
* dataBits: 4,
|
||||||
|
* stopBits: 1,
|
||||||
|
* parity: 0,
|
||||||
|
* dtr: true,
|
||||||
|
* rts: true,
|
||||||
|
* sleepOnPause: false
|
||||||
* }).then(() => {
|
* }).then(() => {
|
||||||
* console.log('Serial connection opened');
|
* console.log('Serial connection opened');
|
||||||
* });
|
* });
|
||||||
|
@ -49,7 +49,10 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
* @param url {string} A URL to share
|
* @param url {string} A URL to share
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
successIndex: 4,
|
||||||
|
errorIndex: 5
|
||||||
|
})
|
||||||
share(message?: string, subject?: string, file?: string | string[], url?: string): Promise<any> { return; }
|
share(message?: string, subject?: string, file?: string | string[], url?: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ export interface SpinnerDialogIOSOptions {
|
|||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'SpinnerDialog',
|
pluginName: 'SpinnerDialog',
|
||||||
plugin: 'cordova-plugin-native-spinner',
|
plugin: 'cordova-plugin-native-spinner',
|
||||||
pluginRef: 'window.plugins.spinnerDialog',
|
pluginRef: 'SpinnerDialog',
|
||||||
repo: 'https://github.com/greybax/cordova-plugin-native-spinner',
|
repo: 'https://github.com/greybax/cordova-plugin-native-spinner',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows']
|
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows']
|
||||||
})
|
})
|
||||||
|
@ -20,6 +20,10 @@ export interface SQLiteDatabaseConfig {
|
|||||||
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
|
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
|
||||||
*/
|
*/
|
||||||
createFromLocation?: number;
|
createFromLocation?: number;
|
||||||
|
/**
|
||||||
|
* support encrypted databases with https://github.com/litehelpers/Cordova-sqlcipher-adapter
|
||||||
|
*/
|
||||||
|
key?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,6 +79,31 @@ export interface StripeBankAccountParams {
|
|||||||
account_holder_type?: string;
|
account_holder_type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StripeCardTokenRes {
|
||||||
|
/**
|
||||||
|
* Card Object.
|
||||||
|
*/
|
||||||
|
card: {
|
||||||
|
brand: string,
|
||||||
|
exp_month: number,
|
||||||
|
exp_year: number,
|
||||||
|
funding: string,
|
||||||
|
last4: string
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Token Request Date Time.
|
||||||
|
*/
|
||||||
|
created: string;
|
||||||
|
/**
|
||||||
|
* Card Token.
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* Source Type (card or account).
|
||||||
|
*/
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Stripe
|
* @name Stripe
|
||||||
* @description
|
* @description
|
||||||
@ -102,7 +127,7 @@ export interface StripeBankAccountParams {
|
|||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* this.stripe.createCardToken(card)
|
* this.stripe.createCardToken(card)
|
||||||
* .then(token => console.log(token))
|
* .then(token => console.log(token.id))
|
||||||
* .catch(error => console.error(error));
|
* .catch(error => console.error(error));
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
@ -131,10 +156,10 @@ export class Stripe extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Create Credit Card Token
|
* Create Credit Card Token
|
||||||
* @param params {StripeCardTokenParams} Credit card information
|
* @param params {StripeCardTokenParams} Credit card information
|
||||||
* @return {Promise<string>} returns a promise that resolves with the token, or rejects with an error
|
* @return {Promise<StripeCardTokenRes>} returns a promise that resolves with the token object, or rejects with an error
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
createCardToken(params: StripeCardTokenParams): Promise<string> { return; }
|
createCardToken(params: StripeCardTokenParams): Promise<StripeCardTokenRes> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a bank account token
|
* Create a bank account token
|
||||||
|
@ -55,9 +55,9 @@ export interface TwitterConnectResponse {
|
|||||||
pluginName: 'TwitterConnect',
|
pluginName: 'TwitterConnect',
|
||||||
plugin: 'twitter-connect-plugin',
|
plugin: 'twitter-connect-plugin',
|
||||||
pluginRef: 'TwitterConnect',
|
pluginRef: 'TwitterConnect',
|
||||||
repo: 'https://github.com/ManifestWebDesign/twitter-connect-plugin',
|
repo: 'https://github.com/chroa/twitter-connect-plugin',
|
||||||
install: 'ionic cordova plugin add twitter-connect-plugin --variable FABRIC_KEY=fabric_API_key',
|
install: 'ionic cordova plugin add https://github.com/chroa/twitter-connect-plugin --variable FABRIC_KEY=<Fabric API Key> --variable TWITTER_KEY=<Twitter Consumer Key> --variable TWITTER_SECRET=<Twitter Consumer Secret>',
|
||||||
installVariables: ['FABRIC_KEY'],
|
installVariables: ['FABRIC_KEY', 'TWITTER_KEY', 'TWITTER_SECRET'],
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
69
src/@ionic-native/plugins/uid/index.ts
Normal file
69
src/@ionic-native/plugins/uid/index.ts
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Uid
|
||||||
|
* @description
|
||||||
|
* Get unique identifiers: UUID, IMEI, IMSI, ICCID and MAC.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { Uid } from '@ionic-native/uid';
|
||||||
|
* import { AndroidPermissions } from '@ionic-native/android-permissions';
|
||||||
|
*
|
||||||
|
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* async getImei() {
|
||||||
|
* const { hasPermission } = await this.androidPermissions.checkPermission(
|
||||||
|
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||||
|
* );
|
||||||
|
*
|
||||||
|
* if (!hasPermission) {
|
||||||
|
* const result = await this.androidPermissions.requestPermission(
|
||||||
|
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||||
|
* );
|
||||||
|
*
|
||||||
|
* if (!result.hasPermission) {
|
||||||
|
* throw new Error('Permissions required');
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* // ok, a user gave us permission, we can get him identifiers after restart app
|
||||||
|
* return;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* return this.uid.IMEI
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'Uid',
|
||||||
|
plugin: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
||||||
|
pluginRef: 'cordova.plugins.uid',
|
||||||
|
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class Uid extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/** Get the device Universally Unique Identifier (UUID). */
|
||||||
|
@CordovaProperty
|
||||||
|
UUID: string;
|
||||||
|
|
||||||
|
/** Get the device International Mobile Station Equipment Identity (IMEI). */
|
||||||
|
@CordovaProperty
|
||||||
|
IMEI: string;
|
||||||
|
|
||||||
|
/** Get the device International mobile Subscriber Identity (IMSI). */
|
||||||
|
@CordovaProperty
|
||||||
|
IMSI: string;
|
||||||
|
|
||||||
|
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
|
||||||
|
@CordovaProperty
|
||||||
|
ICCID: string;
|
||||||
|
|
||||||
|
/** Get the Media Access Control address (MAC). */
|
||||||
|
@CordovaProperty
|
||||||
|
MAC: string;
|
||||||
|
|
||||||
|
}
|
@ -11,7 +11,7 @@ export interface VideoOptions {
|
|||||||
*/
|
*/
|
||||||
volume?: number;
|
volume?: number;
|
||||||
/**
|
/**
|
||||||
* There are to options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
|
* There are two options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
|
||||||
* These strings are the only ones which can be passed as option.
|
* These strings are the only ones which can be passed as option.
|
||||||
*/
|
*/
|
||||||
scalingMode?: number;
|
scalingMode?: number;
|
||||||
|
@ -14,7 +14,7 @@ export interface ZeroconfService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ZeroconfResult {
|
export interface ZeroconfResult {
|
||||||
action: 'registered' | 'added' | 'removed';
|
action: 'registered' | 'added' | 'removed' | 'resolved';
|
||||||
service: ZeroconfService;
|
service: ZeroconfService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user