mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f95003cbe1 | ||
|
|
8e5f2e5ab3 | ||
|
|
307477da78 | ||
|
|
f691883a29 | ||
|
|
0d5d4f30a9 | ||
|
|
1457a1698b | ||
|
|
bfd46eed16 | ||
|
|
3eff280127 | ||
|
|
8116ddd139 | ||
|
|
a6bcc9affd | ||
|
|
c0d8c99e8d | ||
|
|
fe9655ed84 | ||
|
|
41c034cc19 | ||
|
|
89631a9fa6 | ||
|
|
04db233b33 | ||
|
|
10d222dcea | ||
|
|
640da1b618 | ||
|
|
aecb0f9460 | ||
|
|
d077c48205 | ||
|
|
49d27e816c | ||
|
|
3699fa9b50 | ||
|
|
ab4f1f5bbe | ||
|
|
51006a76a0 | ||
|
|
8bab32173a | ||
|
|
3ef9593704 | ||
|
|
ffae843c0f | ||
|
|
33e4392b63 | ||
|
|
9acbb9fcd6 | ||
|
|
c1e1c5cb79 | ||
|
|
0c7cfeeeb8 | ||
|
|
a7830693af | ||
|
|
b60d5d4851 | ||
|
|
0c4aeddd1b | ||
|
|
667de5ba26 | ||
|
|
2dc7ee8916 | ||
|
|
2c2c1e482c | ||
|
|
7c419b48ad | ||
|
|
0b9717636c | ||
|
|
10ac9ff9de | ||
|
|
90d75af9d1 | ||
|
|
3b3f942ed5 | ||
|
|
9601a64227 | ||
|
|
22fd49b5d3 | ||
|
|
890129bfda | ||
|
|
6a9a871758 | ||
|
|
ac467c50ac | ||
|
|
267149b16f | ||
|
|
7047920a2a | ||
|
|
aad814fcf1 | ||
|
|
03d6b2373c | ||
|
|
d82e675442 | ||
|
|
1e84e23fd9 | ||
|
|
f3f12cb306 | ||
|
|
b3bd0a83c7 | ||
|
|
03e4f0e439 | ||
|
|
a73146648f | ||
|
|
d90724ef70 | ||
|
|
be0dc3dac4 | ||
|
|
a0a64da518 | ||
|
|
591ee87e05 | ||
|
|
8db1dbef71 | ||
|
|
73ae92d77c | ||
|
|
3c2753df64 | ||
|
|
9035476833 | ||
|
|
5f5e605e66 | ||
|
|
ea6746d134 | ||
|
|
753fa4a7a4 | ||
|
|
ff784a4377 | ||
|
|
0764e28408 | ||
|
|
0197c88a03 | ||
|
|
5825932e03 | ||
|
|
bccc8ac379 | ||
|
|
3eb382d438 | ||
|
|
ca9a702808 | ||
|
|
3f415f9bef | ||
|
|
0c6d1eabe2 | ||
|
|
61fecf511b | ||
|
|
2ac52822b8 | ||
|
|
229b62c10b | ||
|
|
9b4fd02fa5 | ||
|
|
d10777a33b | ||
|
|
4f26069ca6 | ||
|
|
40571e5c99 | ||
|
|
83194f616b | ||
|
|
b1f4df530a | ||
|
|
4297c3d43e | ||
|
|
95d495b468 | ||
|
|
f0989d1b96 | ||
|
|
c113417878 | ||
|
|
cedd6df423 | ||
|
|
4b14ce2eec | ||
|
|
27d380ef4b | ||
|
|
bd5bd7ea9d | ||
|
|
c6713862c5 | ||
|
|
3b32e19bf1 | ||
|
|
4092831754 | ||
|
|
c2fe5f8336 | ||
|
|
3f9067d090 | ||
|
|
36a4e81fe4 | ||
|
|
79cb478c26 | ||
|
|
b635ba99ea |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ node_modules/
|
||||
aot/
|
||||
scripts/ionic-native-bower
|
||||
dist/
|
||||
|
||||
|
||||
152
CHANGELOG.md
152
CHANGELOG.md
@@ -1,12 +1,158 @@
|
||||
<a name="4.10.0"></a>
|
||||
# [4.10.0](https://github.com/ionic-team/ionic-native/compare/v4.9.2...v4.10.0) (2018-07-18)
|
||||
<a name="4.15.0"></a>
|
||||
# [4.15.0](https://github.com/ionic-team/ionic-native/compare/v4.14.0...v4.15.0) (2018-09-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **keyboard:** use cordova-plugin-ionic-keyboard ([#2743](https://github.com/ionic-team/ionic-native/issues/2743)) ([1457a16](https://github.com/ionic-team/ionic-native/commit/1457a16)), closes [#2306](https://github.com/ionic-team/ionic-native/issues/2306)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **plugins:** add AppleWallet ([#2740](https://github.com/ionic-team/ionic-native/issues/2740)) ([307477d](https://github.com/ionic-team/ionic-native/commit/307477d))
|
||||
* **plugins:** add web-server plugin ([#2726](https://github.com/ionic-team/ionic-native/issues/2726)) ([8116ddd](https://github.com/ionic-team/ionic-native/commit/8116ddd))
|
||||
* **siri-shortcuts:** Add clear option for the activated shortcut ([#2734](https://github.com/ionic-team/ionic-native/issues/2734)) ([3eff280](https://github.com/ionic-team/ionic-native/commit/3eff280))
|
||||
* **taptic-engine:** add missing functions and types ([a6bcc9a](https://github.com/ionic-team/ionic-native/commit/a6bcc9a))
|
||||
|
||||
|
||||
|
||||
<a name="4.14.0"></a>
|
||||
# [4.14.0](https://github.com/ionic-team/ionic-native/compare/v4.13.0...v4.14.0) (2018-09-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mobile-accessibility:** add correct pluginRef ([3699fa9](https://github.com/ionic-team/ionic-native/commit/3699fa9)), closes [#1860](https://github.com/ionic-team/ionic-native/issues/1860)
|
||||
* **onesignal:** add missing setLocationShared method ([#2723](https://github.com/ionic-team/ionic-native/issues/2723)) ([8bab321](https://github.com/ionic-team/ionic-native/commit/8bab321))
|
||||
* **push:** add missing Chanel options ([3ef9593](https://github.com/ionic-team/ionic-native/commit/3ef9593)), closes [#2712](https://github.com/ionic-team/ionic-native/issues/2712)
|
||||
* **web-intent:** add missing properties ([d077c48](https://github.com/ionic-team/ionic-native/commit/d077c48)), closes [#2701](https://github.com/ionic-team/ionic-native/issues/2701)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **chooster:** add plugin ([04db233](https://github.com/ionic-team/ionic-native/commit/04db233)), closes [#2612](https://github.com/ionic-team/ionic-native/issues/2612)
|
||||
* **local-notifications:** add missing functions ([10d222d](https://github.com/ionic-team/ionic-native/commit/10d222d))
|
||||
* **onesignal:** add missing functions ([51006a7](https://github.com/ionic-team/ionic-native/commit/51006a7)), closes [#2504](https://github.com/ionic-team/ionic-native/issues/2504)
|
||||
|
||||
|
||||
|
||||
<a name="4.13.0"></a>
|
||||
# [4.13.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.17...v4.13.0) (2018-09-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bluetooth-le:** Various methods fixes ([#2707](https://github.com/ionic-team/ionic-native/issues/2707)) ([7047920](https://github.com/ionic-team/ionic-native/commit/7047920))
|
||||
* **in-app-review:** Transfer Plugin to the correct folder ([#2688](https://github.com/ionic-team/ionic-native/issues/2688)) ([22fd49b](https://github.com/ionic-team/ionic-native/commit/22fd49b))
|
||||
* **ms-adal:** Update createAuthenticationContext ([#2705](https://github.com/ionic-team/ionic-native/issues/2705)) ([890129b](https://github.com/ionic-team/ionic-native/commit/890129b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **appsflyer:** Added Appsflyer Cordova SDK as ionic native plugin ([#2690](https://github.com/ionic-team/ionic-native/issues/2690)) ([3b3f942](https://github.com/ionic-team/ionic-native/commit/3b3f942))
|
||||
* **branch-io:** Add branch.io attribution and invitation plugin ([#2691](https://github.com/ionic-team/ionic-native/issues/2691)) ([90d75af](https://github.com/ionic-team/ionic-native/commit/90d75af))
|
||||
* **calldirectory:** add log function ([#2708](https://github.com/ionic-team/ionic-native/issues/2708)) ([9601a64](https://github.com/ionic-team/ionic-native/commit/9601a64))
|
||||
* **janalytics:** add plugin ([#2711](https://github.com/ionic-team/ionic-native/issues/2711)) ([0b97176](https://github.com/ionic-team/ionic-native/commit/0b97176))
|
||||
* **local-notifications:** Added local additional local notification action fields ([#2713](https://github.com/ionic-team/ionic-native/issues/2713)) ([267149b](https://github.com/ionic-team/ionic-native/commit/267149b))
|
||||
* **mixpanel:** Update/add functions ([#2697](https://github.com/ionic-team/ionic-native/issues/2697)) ([ac467c5](https://github.com/ionic-team/ionic-native/commit/ac467c5))
|
||||
* **wechat:** add plugin ([#2716](https://github.com/ionic-team/ionic-native/issues/2716)) ([10ac9ff](https://github.com/ionic-team/ionic-native/commit/10ac9ff))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.17"></a>
|
||||
# [5.0.0-beta.17](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.16...v5.0.0-beta.17) (2018-08-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **in-app-browser:** fix mandatory options ([#2684](https://github.com/ionic-team/ionic-native/issues/2684)) ([d82e675](https://github.com/ionic-team/ionic-native/commit/d82e675))
|
||||
|
||||
|
||||
|
||||
<a name="4.12.1"></a>
|
||||
## [4.12.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.15...v4.12.1) (2018-08-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **open-native-settings:** allow supported input ([#2666](https://github.com/ionic-team/ionic-native/issues/2666)) ([be0dc3d](https://github.com/ionic-team/ionic-native/commit/be0dc3d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **aes256:** Added new utility methods to generate secure key and secure IV ([#2675](https://github.com/ionic-team/ionic-native/issues/2675)) ([a731466](https://github.com/ionic-team/ionic-native/commit/a731466))
|
||||
* **in-app-browser:** Add missing InAppBrowserOptions-properties ([#2669](https://github.com/ionic-team/ionic-native/issues/2669)) ([d90724e](https://github.com/ionic-team/ionic-native/commit/d90724e))
|
||||
* **push:** Added voip property to IOSPushOptions ([#2681](https://github.com/ionic-team/ionic-native/issues/2681)) ([03e4f0e](https://github.com/ionic-team/ionic-native/commit/03e4f0e))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.15"></a>
|
||||
# [5.0.0-beta.15](https://github.com/ionic-team/ionic-native/compare/v4.12.0...v5.0.0-beta.15) (2018-08-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bluetooth-le:** add bluetooth-le plugin ([#2651](https://github.com/ionic-team/ionic-native/issues/2651)) ([591ee87](https://github.com/ionic-team/ionic-native/commit/591ee87))
|
||||
* **http:** add setSSLCertMode function ([8db1dbe](https://github.com/ionic-team/ionic-native/commit/8db1dbe))
|
||||
|
||||
|
||||
|
||||
<a name="4.12.0"></a>
|
||||
# [4.12.0](https://github.com/ionic-team/ionic-native/compare/v4.11.0...v4.12.0) (2018-08-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extended-device-information:** Fixed Memory Display Bug ([#2641](https://github.com/ionic-team/ionic-native/issues/2641)) ([2ac5282](https://github.com/ionic-team/ionic-native/commit/2ac5282))
|
||||
* **network:** bind listener to document instead of window ([#2622](https://github.com/ionic-team/ionic-native/issues/2622)) ([d10777a](https://github.com/ionic-team/ionic-native/commit/d10777a))
|
||||
* **photo-library:** interface missing includeVideos ([3f415f9](https://github.com/ionic-team/ionic-native/commit/3f415f9)), closes [#2624](https://github.com/ionic-team/ionic-native/issues/2624)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **fabric:** add fabric plugin ([#2618](https://github.com/ionic-team/ionic-native/issues/2618)) ([9b4fd02](https://github.com/ionic-team/ionic-native/commit/9b4fd02))
|
||||
* **local-notifications:** add new foreground property ([#2633](https://github.com/ionic-team/ionic-native/issues/2633)) ([229b62c](https://github.com/ionic-team/ionic-native/commit/229b62c))
|
||||
* **webengage:** add optional config with initialization ([#2637](https://github.com/ionic-team/ionic-native/issues/2637)) ([ca9a702](https://github.com/ionic-team/ionic-native/commit/ca9a702))
|
||||
|
||||
|
||||
|
||||
<a name="4.11.0"></a>
|
||||
# [4.11.0](https://github.com/ionic-team/ionic-native/compare/v4.10.1...v4.11.0) (2018-07-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **http:** add correct return types for downloadFile and uploadFile ([4092831](https://github.com/ionic-team/ionic-native/commit/4092831)), closes [#2615](https://github.com/ionic-team/ionic-native/issues/2615)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **clevertap:** add CleverTap plugin ([#2609](https://github.com/ionic-team/ionic-native/issues/2609)) ([27d380e](https://github.com/ionic-team/ionic-native/commit/27d380e))
|
||||
* **facebook:** add getDeferredApplink function ([3b32e19](https://github.com/ionic-team/ionic-native/commit/3b32e19)), closes [#2510](https://github.com/ionic-team/ionic-native/issues/2510)
|
||||
* **webengage:** add webengage plugin ([#2604](https://github.com/ionic-team/ionic-native/issues/2604)) ([bd5bd7e](https://github.com/ionic-team/ionic-native/commit/bd5bd7e))
|
||||
|
||||
|
||||
|
||||
<a name="4.10.1"></a>
|
||||
## [4.10.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v4.10.1) (2018-07-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **nfs:** Optional arguments for records like textRecord ([#2605](https://github.com/ionic-team/ionic-native/issues/2605)) ([b635ba9](https://github.com/ionic-team/ionic-native/commit/b635ba9))
|
||||
* **user-agent:** Plugin not installed ([#2607](https://github.com/ionic-team/ionic-native/issues/2607)) ([79cb478](https://github.com/ionic-team/ionic-native/commit/79cb478))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.14"></a>
|
||||
# [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **abbyy-rtr:** add ABBYY Real-Time Recognition plugin ([#2580](https://github.com/ionic-team/ionic-native/issues/2580)) ([ecc698e](https://github.com/ionic-team/ionic-native/commit/ecc698e))
|
||||
* **alipay:** replace plugin ([#2591](https://github.com/ionic-team/ionic-native/issues/2591)) ([e640983](https://github.com/ionic-team/ionic-native/commit/e640983))
|
||||
* **fcm:** replace plugin source ([#2601](https://github.com/ionic-team/ionic-native/issues/2601)) ([b581a5b](https://github.com/ionic-team/ionic-native/commit/b581a5b))
|
||||
* **ccm:** replace plugin source ([#2601](https://github.com/ionic-team/ionic-native/issues/2601)) ([b581a5b](https://github.com/ionic-team/ionic-native/commit/b581a5b))
|
||||
* **classkit:** add ClassKit plugin ([#2590](https://github.com/ionic-team/ionic-native/issues/2590)) ([a6c8045](https://github.com/ionic-team/ionic-native/commit/a6c8045))
|
||||
|
||||
|
||||
|
||||
35
README.md
35
README.md
@@ -1,6 +1,5 @@
|
||||
[](https://circleci.com/gh/ionic-team/ionic-native) [](http://commitizen.github.io/cz-cli/) 
|
||||
|
||||
|
||||
# Ionic Native
|
||||
|
||||
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](https://ionicframework.com/) mobile app easy.
|
||||
@@ -10,8 +9,9 @@ Ionic Native wraps plugin callbacks in a Promise or Observable, providing a comm
|
||||
## Installation
|
||||
|
||||
Run following command to install Ionic Native in your project.
|
||||
|
||||
```bash
|
||||
npm install @ionic-native/core --save
|
||||
npm install @ionic-native/core
|
||||
```
|
||||
|
||||
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
|
||||
@@ -68,9 +68,9 @@ export class MyComponent {
|
||||
// to stop watching
|
||||
watch.unsubscribe();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@@ -92,8 +92,8 @@ Then create a new class that extends the `Camera` class with a mock implementati
|
||||
class CameraMock extends Camera {
|
||||
getPicture(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve("BASE_64_ENCODED_DATA_GOES_HERE");
|
||||
})
|
||||
resolve('BASE_64_ENCODED_DATA_GOES_HERE');
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -101,9 +101,7 @@ class CameraMock extends Camera {
|
||||
Finally, override the previous `Camera` class in your `providers` for this module:
|
||||
|
||||
```typescript
|
||||
providers: [
|
||||
{ provide: Camera, useClass: CameraMock }
|
||||
]
|
||||
providers: [{ provide: Camera, useClass: CameraMock }];
|
||||
```
|
||||
|
||||
Here's the full example:
|
||||
@@ -126,37 +124,26 @@ class CameraMock extends Camera {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
MyApp,
|
||||
HomePage
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(MyApp)
|
||||
],
|
||||
declarations: [MyApp, HomePage],
|
||||
imports: [BrowserModule, IonicModule.forRoot(MyApp)],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
MyApp,
|
||||
HomePage
|
||||
],
|
||||
entryComponents: [MyApp, HomePage],
|
||||
providers: [
|
||||
{ provide: ErrorHandler, useClass: IonicErrorHandler },
|
||||
{ provide: Camera, useClass: CameraMock }
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Runtime Diagnostics
|
||||
|
||||
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
|
||||
|
||||

|
||||
|
||||
|
||||
## Plugin Missing?
|
||||
|
||||
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
||||
|
||||
## Ionic v1 (AngularJS, Angular 1.x) support
|
||||
|
||||
33
gulpfile.js
33
gulpfile.js
@@ -1,8 +1,8 @@
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
const gulp = require('gulp'),
|
||||
minimist = require('minimist'),
|
||||
rename = require("gulp-rename"),
|
||||
rename = require('gulp-rename'),
|
||||
tslint = require('gulp-tslint'),
|
||||
replace = require('gulp-replace'),
|
||||
_ = require('lodash');
|
||||
@@ -10,41 +10,44 @@ const gulp = require('gulp'),
|
||||
const flagConfig = {
|
||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||
boolean: ['dry-run'],
|
||||
alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'},
|
||||
alias: { p: 'port', v: 'version', a: 'ngVersion' },
|
||||
default: { port: 8000 }
|
||||
},
|
||||
|
||||
flags = minimist(process.argv.slice(2), flagConfig);
|
||||
|
||||
/* Docs tasks */
|
||||
require('./scripts/docs/gulp-tasks')(gulp, flags);
|
||||
|
||||
gulp.task('lint', () => {
|
||||
return gulp.src('src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: "verbose",
|
||||
configuration: 'tslint.json'
|
||||
}))
|
||||
return gulp
|
||||
.src('src/**/*.ts')
|
||||
.pipe(
|
||||
tslint({
|
||||
formatter: 'verbose',
|
||||
configuration: 'tslint.json'
|
||||
})
|
||||
)
|
||||
.pipe(tslint.report());
|
||||
});
|
||||
|
||||
gulp.task('plugin:create', () => {
|
||||
if (flags.n && flags.n !== ''){
|
||||
|
||||
const src = flags.m ? './scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl',
|
||||
if (flags.n && flags.n !== '') {
|
||||
const src = flags.m
|
||||
? './scripts/templates/wrap-min.tmpl'
|
||||
: './scripts/templates/wrap.tmpl',
|
||||
pluginName = flags.n,
|
||||
spaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1'),
|
||||
kebabCase = _.kebabCase(pluginName);
|
||||
|
||||
return gulp.src(src)
|
||||
return gulp
|
||||
.src(src)
|
||||
.pipe(replace('{{ PluginName }}', pluginName))
|
||||
.pipe(replace('{{ Plugin_Name }}', spaced))
|
||||
.pipe(replace('{{ pluginName }}', _.lowerFirst(pluginName)))
|
||||
.pipe(replace('{{ plugin-name }}', kebabCase))
|
||||
.pipe(rename('index.ts'))
|
||||
.pipe(gulp.dest('./src/@ionic-native/plugins/' + kebabCase));
|
||||
|
||||
} else {
|
||||
console.log("Usage is: gulp plugin:create -n PluginName");
|
||||
console.log('Usage is: gulp plugin:create -n PluginName');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
module.exports = config => {
|
||||
|
||||
const conf = {
|
||||
frameworks: [
|
||||
'jasmine',
|
||||
'karma-typescript'
|
||||
],
|
||||
frameworks: ['jasmine', 'karma-typescript'],
|
||||
|
||||
plugins: [
|
||||
'karma-typescript',
|
||||
'karma-jasmine',
|
||||
'karma-phantomjs-launcher'
|
||||
],
|
||||
plugins: ['karma-typescript', 'karma-jasmine', 'karma-phantomjs-launcher'],
|
||||
|
||||
preprocessors: {
|
||||
'src/**/*.ts': ['karma-typescript']
|
||||
@@ -21,22 +13,18 @@ module.exports = config => {
|
||||
karmaTypescriptConfig: {
|
||||
bundlerOptions: {
|
||||
entrypoints: /\.spec\.ts$/,
|
||||
transforms: [
|
||||
require("karma-typescript-es6-transform")()
|
||||
]
|
||||
transforms: [require('karma-typescript-es6-transform')()]
|
||||
},
|
||||
compilerOptions: {
|
||||
lib: ['es2015', 'dom'],
|
||||
paths: {
|
||||
"@ionic-native/core": ["./src/@ionic-native/core"]
|
||||
'@ionic-native/core': ['./src/@ionic-native/core']
|
||||
},
|
||||
baseUrl: '.'
|
||||
}
|
||||
},
|
||||
|
||||
files: [
|
||||
{ pattern: 'src/**/*.ts', included: true, watched: true }
|
||||
],
|
||||
files: [{ pattern: 'src/**/*.ts', included: true, watched: true }],
|
||||
|
||||
reporters: ['progress'],
|
||||
|
||||
@@ -44,12 +32,9 @@ module.exports = config => {
|
||||
colors: true,
|
||||
logLevel: config.INFO,
|
||||
autoWatch: true,
|
||||
browsers: [
|
||||
'PhantomJS'
|
||||
],
|
||||
browsers: ['PhantomJS'],
|
||||
singleRun: false
|
||||
};
|
||||
|
||||
config.set(conf);
|
||||
|
||||
};
|
||||
|
||||
5061
package-lock.json
generated
5061
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -1,47 +1,45 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "4.10.0",
|
||||
"version": "4.15.0",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@angular/compiler": "^5.2.11",
|
||||
"@angular/compiler-cli": "^5.2.11",
|
||||
"@angular/core": "^5.2.11",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.8.8",
|
||||
"@types/node": "^8.10.20",
|
||||
"@types/node": "8.10.20",
|
||||
"canonical-path": "0.0.2",
|
||||
"child-process-promise": "2.2.1",
|
||||
"conventional-changelog-cli": "1.3.4",
|
||||
"cpr": "2.0.0",
|
||||
"cz-conventional-changelog": "2.0.0",
|
||||
"dgeni": "0.4.7",
|
||||
"conventional-changelog-cli": "^2.0.5",
|
||||
"cz-conventional-changelog": "^2.1.0",
|
||||
"dgeni": "^0.4.10",
|
||||
"dgeni-packages": "0.16.10",
|
||||
"fs-extra": "2.0.0",
|
||||
"fs-extra-promise": "0.4.1",
|
||||
"fs-extra": "^7.0.0",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-rename": "1.2.2",
|
||||
"gulp-replace": "0.5.4",
|
||||
"gulp-tslint": "6.1.2",
|
||||
"jasmine-core": "^2.99.1",
|
||||
"karma": "^1.7.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-tslint": "^8.1.3",
|
||||
"jasmine-core": "^3.2.1",
|
||||
"karma": "^2.0.5",
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-jasmine": "^1.1.2",
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"karma-typescript": "^3.0.12",
|
||||
"karma-typescript": "^3.0.13",
|
||||
"karma-typescript-es6-transform": "^1.0.4",
|
||||
"lodash": "4.17.4",
|
||||
"lodash": "^4.17.11",
|
||||
"minimist": "1.2.0",
|
||||
"node-html-encoder": "0.0.2",
|
||||
"q": "1.5.0",
|
||||
"queue": "4.2.1",
|
||||
"rimraf": "2.6.1",
|
||||
"rxjs": "^5.5.11",
|
||||
"semver": "5.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"q": "^1.5.1",
|
||||
"queue": "^4.5.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"rxjs": "^5.5.12",
|
||||
"semver": "^5.5.1",
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-ionic-rules": "0.0.19",
|
||||
"typescript": "~2.4.2",
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
'use strict';
|
||||
// Node module dependencies
|
||||
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
|
||||
const fs = require('fs-extra'),
|
||||
queue = require('queue'),
|
||||
path = require('path'),
|
||||
exec = require('child_process').exec;
|
||||
@@ -15,22 +15,21 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
|
||||
BUILD_DIST_ROOT = path.resolve(ROOT, 'dist/@ionic-native'), // dist directory root path
|
||||
BUILD_CORE_DIST = path.resolve(BUILD_DIST_ROOT, 'core'); // core dist directory path
|
||||
|
||||
|
||||
// dependency versions
|
||||
const ANGULAR_VERSION = '*',
|
||||
RXJS_VERSION = '^5.0.1',
|
||||
MIN_CORE_VERSION = '^4.2.0',
|
||||
RXJS_VERSION = '^5.5.11',
|
||||
MIN_CORE_VERSION = '^4.11.0',
|
||||
IONIC_NATIVE_VERSION = require(path.resolve(ROOT, 'package.json')).version;
|
||||
|
||||
// package dependencies
|
||||
const CORE_PEER_DEPS = {
|
||||
'rxjs': RXJS_VERSION
|
||||
rxjs: RXJS_VERSION
|
||||
};
|
||||
|
||||
const PLUGIN_PEER_DEPS = {
|
||||
'@ionic-native/core': MIN_CORE_VERSION,
|
||||
'@angular/core': ANGULAR_VERSION,
|
||||
'rxjs': RXJS_VERSION
|
||||
rxjs: RXJS_VERSION
|
||||
};
|
||||
|
||||
// set peer dependencies for all plugins
|
||||
@@ -44,8 +43,10 @@ fs.mkdirpSync(BUILD_TMP);
|
||||
console.log('Preparing core module package.json');
|
||||
CORE_PACKAGE_JSON.version = IONIC_NATIVE_VERSION;
|
||||
CORE_PACKAGE_JSON.peerDependencies = CORE_PEER_DEPS;
|
||||
fs.writeJsonSync(path.resolve(BUILD_CORE_DIST, 'package.json'), CORE_PACKAGE_JSON);
|
||||
|
||||
fs.writeJsonSync(
|
||||
path.resolve(BUILD_CORE_DIST, 'package.json'),
|
||||
CORE_PACKAGE_JSON
|
||||
);
|
||||
|
||||
// Fetch a list of the plugins
|
||||
const PLUGINS = fs.readdirSync(PLUGINS_PATH);
|
||||
@@ -59,7 +60,9 @@ const index = pluginsToBuild.indexOf('ignore-errors');
|
||||
if (index > -1) {
|
||||
ignoreErrors = true;
|
||||
pluginsToBuild.splice(index, 1);
|
||||
console.log('Build will continue even if errors were thrown. Errors will be printed when build finishes.');
|
||||
console.log(
|
||||
'Build will continue even if errors were thrown. Errors will be printed when build finishes.'
|
||||
);
|
||||
}
|
||||
|
||||
if (!pluginsToBuild.length) {
|
||||
@@ -71,12 +74,9 @@ const QUEUE = queue({
|
||||
concurrency: require('os').cpus().length
|
||||
});
|
||||
|
||||
|
||||
// Function to process a single plugin
|
||||
const addPluginToQueue = pluginName => {
|
||||
|
||||
QUEUE.push((callback) => {
|
||||
|
||||
QUEUE.push(callback => {
|
||||
console.log(`Building plugin: ${pluginName}`);
|
||||
|
||||
const PLUGIN_BUILD_DIR = path.resolve(BUILD_TMP, 'plugins', pluginName),
|
||||
@@ -84,10 +84,9 @@ const addPluginToQueue = pluginName => {
|
||||
|
||||
let tsConfigPath;
|
||||
|
||||
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
|
||||
.then(() => fs.mkdirpAsync(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
|
||||
fs.mkdirp(PLUGIN_BUILD_DIR) // create tmp build dir
|
||||
.then(() => fs.mkdirp(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
|
||||
.then(() => {
|
||||
|
||||
// Write tsconfig.json
|
||||
const tsConfig = JSON.parse(JSON.stringify(PLUGIN_TS_CONFIG));
|
||||
tsConfig.files = [PLUGIN_SRC_PATH];
|
||||
@@ -95,7 +94,7 @@ const addPluginToQueue = pluginName => {
|
||||
|
||||
tsConfigPath = path.resolve(PLUGIN_BUILD_DIR, 'tsconfig.json');
|
||||
|
||||
return fs.writeJsonAsync(tsConfigPath, tsConfig);
|
||||
return fs.writeJson(tsConfigPath, tsConfig);
|
||||
})
|
||||
.then(() => {
|
||||
// clone package.json
|
||||
@@ -104,42 +103,39 @@ const addPluginToQueue = pluginName => {
|
||||
packageJson.name = `@ionic-native/${pluginName}`;
|
||||
packageJson.version = IONIC_NATIVE_VERSION;
|
||||
|
||||
return fs.writeJsonAsync(path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'), packageJson);
|
||||
return fs.writeJson(
|
||||
path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'),
|
||||
packageJson
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
// compile the plugin
|
||||
exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => {
|
||||
|
||||
if (err) {
|
||||
|
||||
if (!ignoreErrors) {
|
||||
// oops! something went wrong.
|
||||
console.log(err);
|
||||
callback(`\n\nBuilding ${pluginName} failed.`);
|
||||
return;
|
||||
} else {
|
||||
errors.push(err);
|
||||
exec(
|
||||
`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`,
|
||||
(err, stdout, stderr) => {
|
||||
if (err) {
|
||||
if (!ignoreErrors) {
|
||||
// oops! something went wrong.
|
||||
console.log(err);
|
||||
callback(`\n\nBuilding ${pluginName} failed.`);
|
||||
return;
|
||||
} else {
|
||||
errors.push(err);
|
||||
}
|
||||
}
|
||||
|
||||
// we're done with this plugin!
|
||||
callback();
|
||||
}
|
||||
|
||||
// we're done with this plugin!
|
||||
callback();
|
||||
|
||||
});
|
||||
|
||||
);
|
||||
})
|
||||
.catch(callback);
|
||||
|
||||
}); // QUEUE.push end
|
||||
|
||||
};
|
||||
|
||||
pluginsToBuild.forEach(addPluginToQueue);
|
||||
|
||||
QUEUE.start((err) => {
|
||||
|
||||
QUEUE.start(err => {
|
||||
if (err) {
|
||||
console.log('Error building plugins.');
|
||||
console.log(err);
|
||||
@@ -155,5 +151,4 @@ QUEUE.start((err) => {
|
||||
} else {
|
||||
console.log('Done processing plugins!');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
"use strict";
|
||||
'use strict';
|
||||
// Node module dependencies
|
||||
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
|
||||
const fs = require('fs-extra'),
|
||||
queue = require('queue'),
|
||||
path = require('path'),
|
||||
exec = require('child-process-promise').exec;
|
||||
|
||||
|
||||
const ROOT = path.resolve(path.join(__dirname, '../../')),
|
||||
DIST = path.resolve(ROOT, 'dist', '@ionic-native');
|
||||
|
||||
@@ -20,15 +19,16 @@ const QUEUE = queue({
|
||||
});
|
||||
|
||||
PACKAGES.forEach(packageName => {
|
||||
|
||||
QUEUE.push(done => {
|
||||
|
||||
console.log(`Publishing @ionic-native/${packageName}`);
|
||||
const packagePath = path.resolve(DIST, packageName);
|
||||
exec(`npm publish ${packagePath} ${FLAGS}`)
|
||||
.then(() => done())
|
||||
.catch((e) => {
|
||||
if (e.stderr && e.stderr.indexOf('previously published version') === -1) {
|
||||
.catch(e => {
|
||||
if (
|
||||
e.stderr &&
|
||||
e.stderr.indexOf('previously published version') === -1
|
||||
) {
|
||||
failedPackages.push({
|
||||
cmd: e.cmd,
|
||||
stderr: e.stderr
|
||||
@@ -36,13 +36,10 @@ PACKAGES.forEach(packageName => {
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
QUEUE.start((err) => {
|
||||
|
||||
QUEUE.start(err => {
|
||||
if (err) {
|
||||
console.log('Error publishing ionic-native. ', err);
|
||||
} else if (failedPackages.length > 0) {
|
||||
@@ -51,8 +48,4 @@ QUEUE.start((err) => {
|
||||
} else {
|
||||
console.log('Done publishing ionic-native!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -9,37 +9,41 @@ exec(`git branch | grep \\* | cut -d ' ' -f2`)
|
||||
const branch = output.stdout.trim();
|
||||
|
||||
if (branch !== 'master') {
|
||||
|
||||
console.log('Merging master branch in ...');
|
||||
// not on master branch
|
||||
// let's test the changes that were made
|
||||
return exec(`git merge origin master`);
|
||||
}
|
||||
})
|
||||
.then((output) => {
|
||||
.then(output => {
|
||||
if (output && output.stderr) {
|
||||
return Promise.reject(output.stderr);
|
||||
}
|
||||
console.log('Checking for differences ...');
|
||||
return exec(`git diff --name-status origin master`)
|
||||
return exec(`git diff --name-status origin master`);
|
||||
})
|
||||
.then((output) => {
|
||||
.then(output => {
|
||||
if (output && output.stderr) {
|
||||
return Promise.reject(output.stderr);
|
||||
}
|
||||
|
||||
diff = output.stdout;
|
||||
diff = diff.replace(/A\s+/g, '');
|
||||
diff = diff.match(/src\/@ionic-native\/plugins\/([a-zA-Z0-9\-]+)\/index\.ts/g);
|
||||
diff = diff.match(
|
||||
/src\/@ionic-native\/plugins\/([a-zA-Z0-9\-]+)\/index\.ts/g
|
||||
);
|
||||
|
||||
if (!diff) process.exit();
|
||||
|
||||
console.log(`${ diff.length } plugins were modified. We will now build them to verify they still work.`);
|
||||
console.log(
|
||||
`${
|
||||
diff.length
|
||||
} plugins were modified. We will now build them to verify they still work.`
|
||||
);
|
||||
|
||||
return exec('npm run build:core --silent');
|
||||
})
|
||||
.then((output) => {
|
||||
|
||||
.then(output => {
|
||||
if (output && output.stderr) {
|
||||
return Promise.reject(output.stderr);
|
||||
}
|
||||
@@ -47,11 +51,13 @@ exec(`git branch | grep \\* | cut -d ' ' -f2`)
|
||||
console.log('Built core library successfully ...');
|
||||
console.log('Building plugins ...');
|
||||
|
||||
diff = diff.map(text => text.replace('src/@ionic-native/plugins/', '').replace('/index.ts', ''));
|
||||
diff = diff.map(text =>
|
||||
text.replace('src/@ionic-native/plugins/', '').replace('/index.ts', '')
|
||||
);
|
||||
|
||||
return exec(`npm run build:modules ${diff.join(' ')} --silent`);
|
||||
})
|
||||
.then((output) => {
|
||||
.then(output => {
|
||||
if (output && output.stderr) {
|
||||
console.log(output.stderr);
|
||||
process.exit(1);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const config = require('../config.json'),
|
||||
projectPackage = require('../../package.json'),
|
||||
path = require('path'),
|
||||
fs = require('fs-extra-promise').useFs(require('fs-extra')),
|
||||
fs = require('fs-extra'),
|
||||
Dgeni = require('dgeni');
|
||||
|
||||
module.exports = gulp => {
|
||||
|
||||
@@ -2,14 +2,7 @@ import 'core-js';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import {
|
||||
Cordova,
|
||||
CordovaCheck,
|
||||
CordovaInstance,
|
||||
CordovaProperty,
|
||||
InstanceProperty,
|
||||
Plugin
|
||||
} from './decorators';
|
||||
import { Cordova, CordovaCheck, CordovaInstance, CordovaProperty, InstanceProperty, Plugin } from './decorators';
|
||||
import { IonicNativePlugin } from './ionic-native-plugin';
|
||||
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
|
||||
|
||||
@@ -140,7 +133,7 @@ describe('Regular Decorators', () => {
|
||||
delete window.testPlugin;
|
||||
window.cordova = true;
|
||||
|
||||
expect(<any>plugin.pingSync()).toEqual(ERR_PLUGIN_NOT_INSTALLED);
|
||||
expect(plugin.pingSync() as any).toEqual(ERR_PLUGIN_NOT_INSTALLED);
|
||||
|
||||
plugin.ping().catch(e => {
|
||||
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
|
||||
@@ -149,10 +142,10 @@ describe('Regular Decorators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw cordova_not_available error', (done: Function) => {
|
||||
xit('should throw cordova_not_available error', (done: Function) => {
|
||||
delete window.testPlugin;
|
||||
|
||||
expect(<any>plugin.pingSync()).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
|
||||
expect(plugin.pingSync() as any).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
|
||||
|
||||
plugin.ping().catch(e => {
|
||||
expect(e).toEqual(ERR_CORDOVA_NOT_AVAILABLE.error);
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { _throw } from 'rxjs/observable/throw';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import {
|
||||
checkAvailability,
|
||||
instanceAvailability,
|
||||
overrideFunction,
|
||||
wrap,
|
||||
wrapInstance
|
||||
} from './plugin';
|
||||
import { checkAvailability, instanceAvailability, overrideFunction, wrap, wrapInstance } from './plugin';
|
||||
import { getPlugin, getPromise } from './util';
|
||||
|
||||
export interface PluginConfig {
|
||||
@@ -123,7 +116,7 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
): TypedPropertyDescriptor<any> => {
|
||||
return {
|
||||
value: function(...args: any[]): any {
|
||||
value(...args: any[]): any {
|
||||
if (instanceAvailability(this)) {
|
||||
return descriptor.value.apply(this, args);
|
||||
} else {
|
||||
@@ -152,7 +145,7 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
): TypedPropertyDescriptor<any> => {
|
||||
return {
|
||||
value: function(...args: any[]): any {
|
||||
value(...args: any[]): any {
|
||||
const check = checkAvailability(pluginObj);
|
||||
if (check === true) {
|
||||
return descriptor.value.apply(this, args);
|
||||
@@ -190,41 +183,41 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
* ```
|
||||
*/
|
||||
export function Plugin(config: PluginConfig): ClassDecorator {
|
||||
return function(cls: any) {
|
||||
return (cls: any) => {
|
||||
// Add these fields to the class
|
||||
for (let prop in config) {
|
||||
for (const prop in config) {
|
||||
cls[prop] = config[prop];
|
||||
}
|
||||
|
||||
cls['installed'] = function(printWarning?: boolean) {
|
||||
cls['installed'] = (printWarning?: boolean) => {
|
||||
return !!getPlugin(config.pluginRef);
|
||||
};
|
||||
|
||||
cls['getPlugin'] = function() {
|
||||
cls['getPlugin'] = () => {
|
||||
return getPlugin(config.pluginRef);
|
||||
};
|
||||
|
||||
cls['checkInstall'] = function() {
|
||||
cls['checkInstall'] = () => {
|
||||
return checkAvailability(cls) === true;
|
||||
};
|
||||
|
||||
cls['getPluginName'] = function() {
|
||||
cls['getPluginName'] = () => {
|
||||
return config.pluginName;
|
||||
};
|
||||
|
||||
cls['getPluginRef'] = function() {
|
||||
cls['getPluginRef'] = () => {
|
||||
return config.pluginRef;
|
||||
};
|
||||
|
||||
cls['getPluginInstallName'] = function() {
|
||||
cls['getPluginInstallName'] = () => {
|
||||
return config.plugin;
|
||||
};
|
||||
|
||||
cls['getPluginRepo'] = function() {
|
||||
cls['getPluginRepo'] = () => {
|
||||
return config.repo;
|
||||
};
|
||||
|
||||
cls['getSupportedPlatforms'] = function() {
|
||||
cls['getSupportedPlatforms'] = () => {
|
||||
return config.platforms;
|
||||
};
|
||||
|
||||
@@ -245,7 +238,7 @@ export function Cordova(opts: CordovaOptions = {}) {
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
value(...args: any[]) {
|
||||
return wrap(this, methodName, opts).apply(this, args);
|
||||
},
|
||||
enumerable: true
|
||||
@@ -261,7 +254,7 @@ export function Cordova(opts: CordovaOptions = {}) {
|
||||
export function CordovaInstance(opts: CordovaOptions = {}) {
|
||||
return (target: Object, methodName: string) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
value(...args: any[]) {
|
||||
return wrapInstance(this, methodName, opts).apply(this, args);
|
||||
},
|
||||
enumerable: true
|
||||
@@ -302,10 +295,10 @@ export function CordovaProperty(target: any, key: string) {
|
||||
export function InstanceProperty(target: any, key: string) {
|
||||
Object.defineProperty(target, key, {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
get() {
|
||||
return this._objectInstance[key];
|
||||
},
|
||||
set: function(value) {
|
||||
set(value) {
|
||||
this._objectInstance[key] = value;
|
||||
}
|
||||
});
|
||||
@@ -324,7 +317,7 @@ export function CordovaFunctionOverride(opts: any = {}) {
|
||||
descriptor: TypedPropertyDescriptor<any>
|
||||
) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
value(...args: any[]) {
|
||||
return overrideFunction(this, methodName, opts);
|
||||
},
|
||||
enumerable: true
|
||||
|
||||
@@ -105,7 +105,7 @@ function setIndex(
|
||||
opts.successName &&
|
||||
opts.errorName
|
||||
) {
|
||||
let obj: any = {};
|
||||
const obj: any = {};
|
||||
obj[opts.successName] = resolve;
|
||||
obj[opts.errorName] = reject;
|
||||
args.push(obj);
|
||||
@@ -355,11 +355,11 @@ export function overrideFunction(
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export const wrap = function(
|
||||
export const wrap = (
|
||||
pluginObj: any,
|
||||
methodName: string,
|
||||
opts: CordovaOptions = {}
|
||||
) {
|
||||
) => {
|
||||
return (...args: any[]) => {
|
||||
if (opts.sync) {
|
||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||
|
||||
@@ -6,7 +6,7 @@ declare const window: any;
|
||||
export const get = (element: Element | Window, path: string): any => {
|
||||
const paths: string[] = path.split('.');
|
||||
let obj: any = element;
|
||||
for (let i: number = 0; i < paths.length; i++) {
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
if (!obj) {
|
||||
return null;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export const pluginWarn = (
|
||||
): void => {
|
||||
if (method) {
|
||||
console.warn(
|
||||
'Native: tried calling ' +
|
||||
'Ionic Native: tried calling ' +
|
||||
pluginName +
|
||||
'.' +
|
||||
method +
|
||||
@@ -63,12 +63,12 @@ export const pluginWarn = (
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
`'Native: tried accessing the ${pluginName} plugin but it's not installed.`
|
||||
`'Ionic Native: tried accessing the ${pluginName} plugin but it's not installed.`
|
||||
);
|
||||
}
|
||||
if (plugin) {
|
||||
console.warn(
|
||||
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
|
||||
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -81,17 +81,17 @@ export const pluginWarn = (
|
||||
export const cordovaWarn = (pluginName: string, method?: string): void => {
|
||||
if (method) {
|
||||
console.warn(
|
||||
'Native: tried calling ' +
|
||||
'Ionic Native: tried calling ' +
|
||||
pluginName +
|
||||
'.' +
|
||||
method +
|
||||
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
|
||||
', but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
'Native: tried accessing the ' +
|
||||
pluginName +
|
||||
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
|
||||
' plugin but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,12 +21,12 @@ export interface TextCaptureOptions {
|
||||
* for example: ["English", "French", "German"]. Empty array
|
||||
* disables language selection.
|
||||
*/
|
||||
selectableRecognitionLanguages?: Array<string>;
|
||||
selectableRecognitionLanguages?: string[];
|
||||
|
||||
/**
|
||||
* Recognition language selected by default.
|
||||
*/
|
||||
recognitionLanguages?: Array<string>;
|
||||
recognitionLanguages?: string[];
|
||||
|
||||
/**
|
||||
* Width and height of the recognition area, separated by a
|
||||
@@ -75,7 +75,7 @@ export interface TextCaptureResult {
|
||||
* · rect (string): position and size of the bounding rectangle,
|
||||
* a string of 4 integers separated with whitespaces ("x y width height").
|
||||
*/
|
||||
textLines: Array<{ text: string, quadrangle: string, rect?: string }>;
|
||||
textLines: { text: string, quadrangle: string, rect?: string }[];
|
||||
|
||||
/**
|
||||
* Additional information. This object has the following keys:
|
||||
@@ -94,7 +94,7 @@ export interface TextCaptureResult {
|
||||
stabilityStatus: string,
|
||||
userAction: string,
|
||||
frameSize: string,
|
||||
recognitionLanguages: Array<string>
|
||||
recognitionLanguages: string[]
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -136,8 +136,8 @@ export interface DataCaptureOptions {
|
||||
customDataCaptureScenario?: {
|
||||
name: string,
|
||||
description: string,
|
||||
recognitionLanguages: Array<string>,
|
||||
fields: Array<{ regEx: string }>
|
||||
recognitionLanguages: string[],
|
||||
fields: { regEx: string }[]
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,7 +68,7 @@ export interface AdMobFreeRewardVideoConfig {
|
||||
* @name AdMob Free
|
||||
* @description
|
||||
* A free, no ad-sharing version of Google AdMob plugin for Cordova.
|
||||
*
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-admob-free`. For more info, please see the [AdMob Free plugin docs](https://github.com/ratson/cordova-plugin-admob-free).
|
||||
*
|
||||
* @usage
|
||||
|
||||
@@ -12,20 +12,38 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
* ```typescript
|
||||
* import { AES256 } from '@ionic-native/aes-256';
|
||||
*
|
||||
* private secureKey: string;
|
||||
* private secureIV: string;
|
||||
*
|
||||
* constructor(private aES256: AES256) { }
|
||||
* constructor(private aes256: AES256) {
|
||||
* this.generateSecureKeyAndIV(); // To generate the random secureKey and secureIV
|
||||
* }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* async generateSecureKeyAndIV() {
|
||||
* this.secureKey = await this.aes256.generateSecureKey('random password 12345'); // Returns a 32 bytes string
|
||||
* this.secureIV = await this.aes256.generateSecureIV('random password 12345'); // Returns a 16 bytes string
|
||||
* }
|
||||
*
|
||||
* this.aES256.encrypt('12345678123456781234567812345678', '1234567812345678', 'testdata')
|
||||
* this.aes256.encrypt(this.secureKey, this.secureIV, 'testdata')
|
||||
* .then(res => console.log('Encrypted Data: ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.aES256.decrypt('12345678123456781234567812345678', '1234567812345678', 'encryptedData')
|
||||
* this.aes256.decrypt(this.secureKey, this.secureIV, 'encryptedData')
|
||||
* .then(res => console.log('Decrypted Data : ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
*
|
||||
* * this.aes256.generateSecureKey('random password 12345')
|
||||
* .then(res => console.log('Secure Key : ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
*
|
||||
* * this.aes256.generateSecureIV('random password 12345')
|
||||
* .then(res => console.log('Secure IV : ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -63,4 +81,26 @@ export class AES256 extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to generate a secure key based on an password. Perfect if you want to delegate the key generation for encryption to the plugin.
|
||||
* Make sure to save the return value of this function somewhere so your encrypted data can be decrypted in the future.
|
||||
* @param {string} password A random string, which will be used as input for a PBKDF2 function
|
||||
* @return {Promise<string>} Returns a promise that resolves when key is generated.
|
||||
*/
|
||||
@Cordova()
|
||||
generateSecureKey(password: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to generate a secure IV based on an password. Perfect if you want to delegate the IV generation for encryption to the plugin.
|
||||
* Make sure to save the return value of this function somewhere so your encrypted data can be decrypted in the future.
|
||||
* @param {string} password A random string, which will be used as input for a PBKDF2 function
|
||||
* @return {Promise<string>} Returns a promise that resolves when IV is generated.
|
||||
*/
|
||||
@Cordova()
|
||||
generateSecureIV(password: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* Bit flag values for setSystemUiVisibility()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name App Availability
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export interface AppRateCustomLocale {
|
||||
/** No button label */
|
||||
noButtonLabel?: string;
|
||||
|
||||
/** App rate promt title */
|
||||
/** App rate prompt title */
|
||||
appRatePromptTitle?: string;
|
||||
|
||||
/** Feedback prompt title */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export type IMakePayments =
|
||||
| 'This device can make payments and has a supported card'
|
||||
|
||||
116
src/@ionic-native/plugins/apple-wallet/index.ts
Normal file
116
src/@ionic-native/plugins/apple-wallet/index.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface EncryptedCardData {
|
||||
activationData: string;
|
||||
encryptedPassData: string;
|
||||
wrappedKey: string;
|
||||
}
|
||||
|
||||
export interface CardData {
|
||||
cardholderName: string;
|
||||
primaryAccountNumberSuffix: string;
|
||||
localizedDescription?: string;
|
||||
paymentNetwork: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Apple Wallet
|
||||
* @description
|
||||
* A Cordova plugin that enables users from Add Payment Cards to their Apple Wallet.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AppleWallet } from '@ionic-native/apple-wallet';
|
||||
*
|
||||
*
|
||||
* constructor(private appleWallet: AppleWallet) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.appleWallet.available()
|
||||
* .then((res) => {
|
||||
* // res is a boolean value, either true or false
|
||||
* console.log("Is Apple Wallet available? ", res);
|
||||
* })
|
||||
* .catch((message) => {
|
||||
* console.error("ERROR AVAILBLE>> ", message);
|
||||
* });
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let data: cardData = {
|
||||
* cardholderName: 'Test User',
|
||||
* primaryAccountNumberSuffix: '1234',
|
||||
* localizedDescription: 'Description of payment card',
|
||||
* paymentNetwork: 'VISA'
|
||||
* }
|
||||
*
|
||||
* this.appleWallet.startAddPaymentPass(data: cardData)
|
||||
* .then((res) => {
|
||||
* console.log("startAddPaymentPass success response ", res);
|
||||
* })
|
||||
* .catch((err) => {
|
||||
* console.error("startAddPaymentPass ERROR response", err);
|
||||
* });
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let data: encryptedCardData = {
|
||||
* activationData: 'encoded Base64 activationData from your server',
|
||||
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
|
||||
* wrappedKey: 'encoded Base64 wrappedKey from your server',
|
||||
* }
|
||||
*
|
||||
* this.appleWallet.encryptedCardData(data: encryptedCardData)
|
||||
* .then((res) => {
|
||||
* console.log("completeAddCardToAppleWallet success response ", res);
|
||||
* })
|
||||
* .catch((err) => {
|
||||
* console.error("completeAddCardToAppleWallet ERROR response", err);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @Interfaces
|
||||
* EncryptedCardData
|
||||
* CardData
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppleWallet',
|
||||
plugin: 'cordova-apple-wallet',
|
||||
pluginRef: 'AppleWallet',
|
||||
repo: 'https://github.com/tomavic/cordova-apple-wallet',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class AppleWallet extends IonicNativePlugin {
|
||||
/**
|
||||
* Detects if the current device supports Apple Wallet
|
||||
* @return {Promise<boolean>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
available(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
|
||||
* @param {cardData} data
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
startAddPaymentPass(data: CardData): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple call contains the card data needed to add a card to Apple Pay.
|
||||
* @param {encryptedCardData} data
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
completeAddPaymentPass(data: EncryptedCardData): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
188
src/@ionic-native/plugins/appsflyer/index.ts
Normal file
188
src/@ionic-native/plugins/appsflyer/index.ts
Normal file
@@ -0,0 +1,188 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface AppsflyerOptions {
|
||||
/**
|
||||
* Appsflyer Dev key
|
||||
*/
|
||||
devKey: string;
|
||||
|
||||
/**
|
||||
* Apple Application ID(for iOS only)
|
||||
*/
|
||||
appId?: string;
|
||||
|
||||
/**
|
||||
* debug mode
|
||||
*/
|
||||
isDebug?: boolean;
|
||||
|
||||
/**
|
||||
* optout of collection of IMEI
|
||||
*/
|
||||
collectIMEI?: boolean;
|
||||
|
||||
/**
|
||||
* optout of collection of collectAndroidID
|
||||
*/
|
||||
collectAndroidID?: boolean;
|
||||
|
||||
/**
|
||||
* default false Accessing AppsFlyer Attribution / Conversion Data from the SDK (Deferred Deeplinking). Read more: Android, iOS. AppsFlyer plugin will return attribution data in onSuccess callback.
|
||||
*/
|
||||
onInstallConversionDataListener?: boolean;
|
||||
}
|
||||
|
||||
export interface AppsflyerEvent {
|
||||
[x: string]: any;
|
||||
}
|
||||
|
||||
export interface AppsflyerInviteOptions {
|
||||
channel?: string;
|
||||
campaign?: string;
|
||||
userParams?: {
|
||||
[x: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Appsflyer
|
||||
* @description
|
||||
* Appsflyer Cordova SDK support for Attribution
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Appsflyer } from '@ionic-native/appsflyer';
|
||||
*
|
||||
*
|
||||
* constructor(private appsflyer: Appsflyer) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.appsflyer.initSdk(options);
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AppsflyerOptions
|
||||
* AppsflyerEvent
|
||||
* AppsflyerInviteOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Appsflyer',
|
||||
plugin: 'cordova-plugin-appsflyer-sdk',
|
||||
pluginRef: 'window.plugins.appsFlyer',
|
||||
repo: 'https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk',
|
||||
platforms: ['iOS', 'Android'],
|
||||
install: 'Add to config.xml like stated on github and then start'
|
||||
})
|
||||
@Injectable()
|
||||
export class Appsflyer extends IonicNativePlugin {
|
||||
/**
|
||||
* initialize the SDK
|
||||
* @param {AppsflyerOptions} options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
initSdk(options: AppsflyerOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* These in-app events help you track how loyal users discover your app, and attribute them to specific campaigns/media-sources. Please take the time define the event/s you want to measure to allow you to track ROI (Return on Investment) and LTV (Lifetime Value).
|
||||
* @param {string} eventName custom event name, is presented in your dashboard
|
||||
* @param {AppsflyerEvent} eventValues event details
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
trackEvent(eventName: string, eventValues: AppsflyerEvent): void {}
|
||||
|
||||
/**
|
||||
* Setting your own Custom ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with postbacks APIs for cross-referencing with you internal IDs.
|
||||
* @param {string} customerUserId user id
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setAppUserId(customerUserId: string): void {}
|
||||
|
||||
/**
|
||||
* Setting your own Custom ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with postbacks APIs for cross-referencing with you internal IDs.
|
||||
* @param {boolean} customerUserId In some extreme cases you might want to shut down all SDK tracking due to legal and privacy compliance. This can be achieved with the isStopTracking API. Once this API is invoked, our SDK will no longer communicate with our servers and stop functioning.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
stopTracking(isStopTracking: boolean): void {}
|
||||
|
||||
/**
|
||||
* Get the data from Attribution
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
registerOnAppOpenAttribution(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables app uninstall tracking
|
||||
* @param {string} token GCM/FCM ProjectNumber
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
enableUninstallTracking(token: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to pass GCM/FCM Tokens that where collected by third party plugins to the AppsFlyer server. Can be used for Uninstall Tracking.
|
||||
* @param {string} token GCM/FCM ProjectNumber
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
updateServerUninstallToken(token: string): void {}
|
||||
|
||||
/**
|
||||
* Get AppsFlyer’s proprietary Device ID. The AppsFlyer Device ID is the main ID used by AppsFlyer in Reports and APIs.
|
||||
*/
|
||||
@Cordova()
|
||||
getAppsFlyerUID(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* End User Opt-Out (Optional) AppsFlyer provides you a method to opt‐out specific users from AppsFlyer analytics. This method complies with the latest privacy requirements and complies with Facebook data and privacy policies. Default is FALSE, meaning tracking is enabled by default.
|
||||
* @param {boolean} disable Set to true to opt-out user from tracking
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
deviceTrackingDisabled(disable: boolean): void {}
|
||||
|
||||
/**
|
||||
* Set AppsFlyer’s OneLink ID. Setting a valid OneLink ID will result in shortened User Invite links, when one is generated. The OneLink ID can be obtained on the AppsFlyer Dashboard.
|
||||
* @param {string} oneLinkId OneLink ID
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setAppInviteOneLinkID(oneLinkId: string): void {}
|
||||
|
||||
/**
|
||||
* Allowing your existing users to invite their friends and contacts as new users to your app can be a key growth factor for your app. AppsFlyer allows you to track and attribute new installs originating from user invites within your app.
|
||||
* @param {AppsflyerInviteOptions} options Parameters for Invite link
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
generateInviteLink(options: AppsflyerInviteOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this call to track an impression use the following API call. Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
|
||||
* @param {string} appId Promoted Application ID
|
||||
* @param {string} campaign Promoted Campaign
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
trackCrossPromotionImpression(appId: string, campaign: string): void {}
|
||||
|
||||
/**
|
||||
* Use this call to track the click and launch the app store's app page (via Browser)
|
||||
* @param {string} appId Promoted Application ID
|
||||
* @param {string} campaign Promoted Campaign
|
||||
* @param {Object} options Additional Parameters to track
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
trackAndOpenStore(appId: string, campaign: string, options: Object): void {}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Autostart
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface BackgroundFetchConfig {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface BackgroundGeolocationResponse {
|
||||
|
||||
/**
|
||||
* ID of location as stored in DB (or null)
|
||||
*/
|
||||
@@ -50,8 +49,8 @@ export interface BackgroundGeolocationResponse {
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
@@ -71,7 +70,6 @@ export interface BackgroundGeolocationResponse {
|
||||
}
|
||||
|
||||
export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
|
||||
* the number, the more power devoted to GeoLocation resulting in higher
|
||||
@@ -108,19 +106,19 @@ export interface BackgroundGeolocationConfig {
|
||||
*/
|
||||
stopOnTerminate?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Start background service on device boot.
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Start background service on device boot.
|
||||
*
|
||||
* Defaults to false
|
||||
* Defaults to false
|
||||
*/
|
||||
startOnBoot?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If false location service will not be started in foreground and no notification will be shown.
|
||||
*
|
||||
* Defaults to true
|
||||
* Defaults to true
|
||||
*/
|
||||
startForeground?: boolean;
|
||||
|
||||
@@ -155,17 +153,17 @@ export interface BackgroundGeolocationConfig {
|
||||
*/
|
||||
notificationIconColor?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
*/
|
||||
notificationIconLarge?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
*/
|
||||
notificationIconSmall?: string;
|
||||
|
||||
@@ -183,50 +181,50 @@ export interface BackgroundGeolocationConfig {
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Pauses location updates when app is paused
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Pauses location updates when app is paused
|
||||
*
|
||||
* Defaults to true
|
||||
* Defaults to true
|
||||
*/
|
||||
pauseLocationUpdates?: boolean;
|
||||
|
||||
/**
|
||||
* Server url where to send HTTP POST with recorded locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
/**
|
||||
* Server url where to send HTTP POST with recorded locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
*/
|
||||
url?: string;
|
||||
|
||||
/**
|
||||
* Server url where to send fail to post locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
/**
|
||||
* Server url where to send fail to post locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
*/
|
||||
syncUrl?: string;
|
||||
|
||||
/**
|
||||
* Specifies how many previously failed locations will be sent to server at once
|
||||
* Specifies how many previously failed locations will be sent to server at once
|
||||
*
|
||||
* Defaults to 100
|
||||
* Defaults to 100
|
||||
*/
|
||||
syncThreshold?: number;
|
||||
|
||||
/**
|
||||
* Optional HTTP headers sent along in HTTP request
|
||||
/**
|
||||
* Optional HTTP headers sent along in HTTP request
|
||||
*/
|
||||
httpHeaders?: any;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* IOS ONLY
|
||||
* Switch to less accurate significant changes and region monitory when in background (default)
|
||||
*
|
||||
* Defaults to 100
|
||||
* Defaults to 100
|
||||
*/
|
||||
saveBatteryOnBackground?: boolean;
|
||||
|
||||
/**
|
||||
* Limit maximum number of locations stored into db
|
||||
/**
|
||||
* Limit maximum number of locations stored into db
|
||||
*
|
||||
* Defaults to 10000
|
||||
* Defaults to 10000
|
||||
*/
|
||||
maxLocations?: number;
|
||||
|
||||
@@ -310,15 +308,14 @@ export interface BackgroundGeolocationConfig {
|
||||
})
|
||||
@Injectable()
|
||||
export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers
|
||||
/**
|
||||
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers
|
||||
*
|
||||
* Possible values:
|
||||
* ANDROID_DISTANCE_FILTER_PROVIDER: 0,
|
||||
* ANDROID_ACTIVITY_PROVIDER: 1
|
||||
* ANDROID_DISTANCE_FILTER_PROVIDER: 0,
|
||||
* ANDROID_ACTIVITY_PROVIDER: 1
|
||||
*
|
||||
* @enum {number}
|
||||
* @enum {number}
|
||||
*/
|
||||
LocationProvider: any = {
|
||||
ANDROID_DISTANCE_FILTER_PROVIDER: 0,
|
||||
@@ -326,17 +323,17 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
};
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000].
|
||||
* The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings.
|
||||
* 1000 results in lowest power drain and least accurate readings.
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000].
|
||||
* The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings.
|
||||
* 1000 results in lowest power drain and least accurate readings.
|
||||
*
|
||||
* Possible values:
|
||||
* HIGH: 0
|
||||
* MEDIUM: 10
|
||||
* LOW: 100
|
||||
* HIGH: 0
|
||||
* MEDIUM: 10
|
||||
* LOW: 100
|
||||
* PASSIVE: 1000
|
||||
*
|
||||
* enum {number}
|
||||
* enum {number}
|
||||
*/
|
||||
Accuracy: any = {
|
||||
HIGH: 0,
|
||||
@@ -345,14 +342,14 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
PASSIVE: 1000
|
||||
};
|
||||
|
||||
/**
|
||||
* Used in the switchMode function
|
||||
/**
|
||||
* Used in the switchMode function
|
||||
*
|
||||
* Possible values:
|
||||
* BACKGROUND: 0
|
||||
* FOREGROUND: 1
|
||||
* FOREGROUND: 1
|
||||
*
|
||||
* @enum {number}
|
||||
* @enum {number}
|
||||
*/
|
||||
Mode: any = {
|
||||
BACKGROUND: 0,
|
||||
@@ -369,7 +366,11 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
callbackOrder: 'reverse',
|
||||
observable: true
|
||||
})
|
||||
configure(options: BackgroundGeolocationConfig): Observable<BackgroundGeolocationResponse> { return; }
|
||||
configure(
|
||||
options: BackgroundGeolocationConfig
|
||||
): Observable<BackgroundGeolocationResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn ON the background-geolocation system.
|
||||
@@ -377,14 +378,18 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
start(): Promise<any> { return; }
|
||||
start(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn OFF background-tracking
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<any> { return; }
|
||||
stop(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform the native plugin that you're finished, the background-task may be completed
|
||||
@@ -393,7 +398,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
finish(): Promise<any> { return; }
|
||||
finish(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the plugin to enter "moving" or "stationary" state
|
||||
@@ -403,7 +410,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
changePace(isMoving: boolean): Promise<any> { return; }
|
||||
changePace(isMoving: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup configuration
|
||||
@@ -413,7 +422,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
setConfig(options: BackgroundGeolocationConfig): Promise<any> { return; }
|
||||
setConfig(options: BackgroundGeolocationConfig): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current stationaryLocation if available. null if not
|
||||
@@ -422,7 +433,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
||||
getStationaryLocation(): Promise<BackgroundGeolocationResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
|
||||
@@ -432,7 +445,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
onStationary(): Promise<any> { return; }
|
||||
onStationary(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if location is enabled on the device
|
||||
@@ -441,19 +456,21 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
isLocationEnabled(): Promise<number> { return; }
|
||||
isLocationEnabled(): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display app settings to change permissions
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
showAppSettings(): void { }
|
||||
showAppSettings(): void {}
|
||||
|
||||
/**
|
||||
* Display device location settings
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
showLocationSettings(): void { }
|
||||
showLocationSettings(): void {}
|
||||
|
||||
/**
|
||||
* Method can be used to detect user changes in location services settings.
|
||||
@@ -465,7 +482,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
observable: true
|
||||
})
|
||||
watchLocationMode(): Observable<number> { return; }
|
||||
watchLocationMode(): Observable<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop watching for location mode changes.
|
||||
@@ -474,7 +493,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
stopWatchingLocationMode(): Promise<any> { return; }
|
||||
stopWatchingLocationMode(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method will return all stored locations.
|
||||
@@ -488,14 +509,18 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
getLocations(): Promise<any> { return; }
|
||||
getLocations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
|
||||
/**
|
||||
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getValidLocations(): Promise<any> { return; }
|
||||
getValidLocations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete stored location by given locationId.
|
||||
@@ -505,7 +530,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
deleteLocation(locationId: number): Promise<any> { return; }
|
||||
deleteLocation(locationId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all stored locations.
|
||||
@@ -514,34 +541,39 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
deleteAllLocations(): Promise<any> { return; }
|
||||
deleteAllLocations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normally plugin will handle switching between BACKGROUND and FOREGROUND mode itself.
|
||||
* Calling switchMode you can override plugin behavior and force plugin to switch into other mode.
|
||||
*
|
||||
* In FOREGROUND mode plugin uses iOS local manager to receive locations and behavior is affected by option.desiredAccuracy and option.distanceFilter.
|
||||
* In BACKGROUND mode plugin uses significant changes and region monitoring to receive locations and uses option.stationaryRadius only.
|
||||
* In BACKGROUND mode plugin uses significant changes and region monitoring to receive locations and uses option.stationaryRadius only.
|
||||
*
|
||||
* BackgroundGeolocation.Mode.FOREGROUND
|
||||
* BackgroundGeolocation.Mode.BACKGROUND
|
||||
**
|
||||
* BackgroundGeolocation.Mode.BACKGROUND
|
||||
*
|
||||
* @param modeId {number}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
switchMode(modeId: number): Promise<any> { return; }
|
||||
switchMode(modeId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all logged events. Useful for plugin debugging. Parameter limit limits number of returned entries.
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
|
||||
/**
|
||||
* Return all logged events. Useful for plugin debugging. Parameter limit limits number of returned entries.
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
|
||||
*
|
||||
* @param limit {number} Limits the number of entries
|
||||
* @param limit {number} Limits the number of entries
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getLogEntries(limit: number): Promise<any> { return; }
|
||||
|
||||
getLogEntries(limit: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface BackgroundModeConfiguration {
|
||||
* @description
|
||||
* 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, visit: https://github.com/katzer/cordova-plugin-background-mode
|
||||
*@usage
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { BackgroundMode } from '@ionic-native/background-mode';
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Badge
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
|
||||
@@ -589,7 +589,6 @@ export class BLE extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a list of the peripherals (containing any of the specified services)
|
||||
* currently connected to the system. The peripheral list is sent to the success callback.
|
||||
@@ -599,7 +598,7 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
connectedPeripheralsWithServices (services: string[]): Promise<any[]> {
|
||||
connectedPeripheralsWithServices(services: string[]): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -611,7 +610,7 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
peripheralsWithIdentifiers (uuids: string[]): Promise<any[]> {
|
||||
peripheralsWithIdentifiers(uuids: string[]): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -622,7 +621,7 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
bondedDevices (): Promise<any[]> {
|
||||
bondedDevices(): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
|
||||
1075
src/@ionic-native/plugins/bluetooth-le/index.ts
Normal file
1075
src/@ionic-native/plugins/bluetooth-le/index.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
|
||||
235
src/@ionic-native/plugins/branch-io/index.ts
Normal file
235
src/@ionic-native/plugins/branch-io/index.ts
Normal file
@@ -0,0 +1,235 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface BranchIoPromise {
|
||||
$identity_id?: number;
|
||||
$one_time_use?: boolean;
|
||||
'+click_timestamp'?: number;
|
||||
'+clicked_branch_link'?: boolean;
|
||||
'+is_first_session'?: boolean;
|
||||
'+match_guaranteed'?: boolean;
|
||||
contentMetadata?: string;
|
||||
source?: string;
|
||||
'~campaign'?: string;
|
||||
'~channel'?: string;
|
||||
'~creation_source'?: string;
|
||||
'~feature'?: string;
|
||||
'~id'?: number;
|
||||
'~referring_link:'?: string;
|
||||
[x: string]: any;
|
||||
}
|
||||
|
||||
export interface BranchIoAnalytics {
|
||||
channel?: string;
|
||||
feature?: string;
|
||||
campaign?: string;
|
||||
stage?: string;
|
||||
tags?: string[];
|
||||
[x: string]: any;
|
||||
}
|
||||
|
||||
export interface BranchIoProperties {
|
||||
contentMetadata?: {
|
||||
[x: string]: any;
|
||||
};
|
||||
[x: string]: any;
|
||||
}
|
||||
|
||||
export interface BranchUniversalObject {
|
||||
generateShortUrl(
|
||||
analytics: BranchIoAnalytics,
|
||||
properties: BranchIoProperties
|
||||
): Promise<any>;
|
||||
registerView(): Promise<any>;
|
||||
showShareSheet(
|
||||
analytics: BranchIoAnalytics,
|
||||
properties: BranchIoProperties,
|
||||
shareText: string
|
||||
): Promise<any>;
|
||||
onShareSheetLaunched(callback: any): void;
|
||||
onShareSheetDismissed(callback: any): void;
|
||||
onLinkShareResponse(callback: any): void;
|
||||
onChannelSelected(callback: any): void;
|
||||
listOnSpotlight(): Promise<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name BranchIo
|
||||
* @description
|
||||
* Branch.io is an attribution service for deeplinking and invitation links
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { BranchIo } from '@ionic-native/branch-io';
|
||||
*
|
||||
*
|
||||
* constructor(private branch: BranchIo) { }
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* BranchIoPromise
|
||||
* BranchIoAnalytics
|
||||
* BranchIoProperties
|
||||
* BranchUniversalObject
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BranchIo',
|
||||
plugin: 'branch-cordova-sdk',
|
||||
pluginRef: 'Branch',
|
||||
repo:
|
||||
'https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class BranchIo extends IonicNativePlugin {
|
||||
/**
|
||||
* for development and debugging only
|
||||
* @param {boolean} enable Enable debug
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
setDebug(enable: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable tracking
|
||||
* @param {boolean} disable disable tracking
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
disableTracking(disable: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes Branch
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
initSession(): Promise<BranchIoPromise> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Request Metadata
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
setRequestMetadata(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* for better Android matching
|
||||
* @param {string} linkDomain LinkDomain at branch
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
setCookieBasedMatching(linkDomain: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* First data
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getFirstReferringParams(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest data
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getLatestReferringParams(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set identy of user
|
||||
* @param {string} userId
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
setIdentity(userId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout user
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
logout(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a custom event
|
||||
* @param {string} eventName
|
||||
* @param {any} metaData
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
userCompletedAction(eventName: string, metaData: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Commerce Event
|
||||
* @param {string} event
|
||||
* @param {any} metaData
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
sendCommerceEvent(event: string, metaData: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* create a branchUniversalObj variable to reference with other Branch methods
|
||||
* @param {BranchIoProperties} properties
|
||||
* @return {Promise<BranchUniversalObject>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
createBranchUniversalObject(
|
||||
properties: BranchIoProperties
|
||||
): Promise<BranchUniversalObject> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load credits
|
||||
* @param {any} bucket
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
loadRewards(bucket: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redeem Rewards
|
||||
* @param {string} value
|
||||
* @param {any} bucket
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
redeemRewards(value: string, bucket: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show credit history
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
creditHistory(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ export interface CallDirectoryItem {
|
||||
number: string;
|
||||
}
|
||||
|
||||
export interface CallDirectoryLog {
|
||||
plugin: string[];
|
||||
extension: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Call Directory
|
||||
* @description
|
||||
@@ -29,6 +34,10 @@ export interface CallDirectoryItem {
|
||||
* .then(res: string) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* ```
|
||||
*
|
||||
* @Interfaces
|
||||
* CallDirectoryItem
|
||||
* CallDirectoryLog
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CallDirectory',
|
||||
@@ -57,7 +66,7 @@ export class CallDirectory extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Returns a promise that resolves when numbers are added
|
||||
*/
|
||||
@Cordova()
|
||||
addIdentification(items: Array<CallDirectoryItem>): Promise<any> {
|
||||
addIdentification(items: CallDirectoryItem[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +76,7 @@ export class CallDirectory extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Returns a promise that resolves when numbers are removed
|
||||
*/
|
||||
@Cordova()
|
||||
removeIdentification(items: Array<CallDirectoryItem>): Promise<any> {
|
||||
removeIdentification(items: CallDirectoryItem[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +94,7 @@ export class CallDirectory extends IonicNativePlugin {
|
||||
* @return {Array<CallDirectoryItem>} Returns a promise that resolves with an array of all items
|
||||
*/
|
||||
@Cordova()
|
||||
getAllItems(): Promise<Array<CallDirectoryItem>> {
|
||||
getAllItems(): Promise<CallDirectoryItem[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,4 +106,13 @@ export class CallDirectory extends IonicNativePlugin {
|
||||
reloadExtension(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get log from plugin and call directory extension
|
||||
* @return {Promise<CallDirectoryLog>} Returns a promise with an object of log messages
|
||||
*/
|
||||
@Cordova()
|
||||
getLog(): Promise<CallDirectoryLog> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CallLogObject {
|
||||
name: string;
|
||||
value: string | Array<string>;
|
||||
value: string | string[];
|
||||
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CameraOptions {
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
@@ -33,7 +33,7 @@ export interface CameraOptions {
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
@@ -165,7 +165,6 @@ export enum Direction {
|
||||
})
|
||||
@Injectable()
|
||||
export class Camera extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Constant for possible destination types
|
||||
*/
|
||||
@@ -200,7 +199,6 @@ export class Camera extends IonicNativePlugin {
|
||||
ALLMEDIA: 2
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Convenience constant
|
||||
*/
|
||||
@@ -213,7 +211,6 @@ export class Camera extends IonicNativePlugin {
|
||||
SAVEDPHOTOALBUM: 2
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Convenience constant
|
||||
*/
|
||||
@@ -243,7 +240,9 @@ export class Camera extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getPicture(options?: CameraOptions): Promise<any> { return; }
|
||||
getPicture(options?: CameraOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
@@ -253,6 +252,7 @@ export class Camera extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
cleanup(): Promise<any> { return; };
|
||||
|
||||
cleanup(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,16 +130,16 @@ export interface CardIOResponse {
|
||||
* @description
|
||||
* @usage
|
||||
* This plug-in exposes card.io credit card scanning.
|
||||
*
|
||||
*
|
||||
* **NOTE**: If you would like to actually process a credit card charge, you might be interested in the [PayPal Cordova Plug-in](https://github.com/paypal/PayPal-Cordova-Plugin).
|
||||
*
|
||||
*
|
||||
* Requires Cordova plugin: `card.io.cordova.mobilesdk`. For more info, please see the [Card IO plugin docs](https://github.com/card-io/card.io-Cordova-Plugin).
|
||||
*
|
||||
*
|
||||
* 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>
|
||||
*```
|
||||
* <key>NSCameraUsageDescription</key>
|
||||
* <string>To scan credit cards.</string>
|
||||
* ```
|
||||
* ```typescript
|
||||
* import { CardIO } from '@ionic-native/card-io';
|
||||
*
|
||||
|
||||
67
src/@ionic-native/plugins/chooser/index.ts
Normal file
67
src/@ionic-native/plugins/chooser/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface ChooserResult {
|
||||
data: Uint8Array;
|
||||
dataURI: string;
|
||||
mediaType: string;
|
||||
name: string;
|
||||
uri: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Chooser
|
||||
* @description
|
||||
* File chooser plugin for Cordova.
|
||||
*
|
||||
* The following must be added to config.xml to prevent crashing when selecting large files on Android:
|
||||
* ```xml
|
||||
* <platform name="android">
|
||||
* <edit-config
|
||||
* file="app/src/main/AndroidManifest.xml"
|
||||
* mode="merge"
|
||||
* target="/manifest/application">
|
||||
* <application android:largeHeap="true" />
|
||||
* </edit-config>
|
||||
* </platform>
|
||||
* ```
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Chooser } from '@ionic-native/chooser';
|
||||
*
|
||||
*
|
||||
* constructor(private chooser: Chooser) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.chooser.getFile()
|
||||
* .then(file => console.log(file ? file.name : 'canceled'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ChooserResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Chooser',
|
||||
plugin: 'cordova-plugin-chooser',
|
||||
pluginRef: 'chooser',
|
||||
repo: 'https://github.com/cyph/cordova-plugin-chooser',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Chooser extends IonicNativePlugin {
|
||||
/**
|
||||
* Displays native prompt for user to select a file.
|
||||
* @param {string} [accept] Optional MIME type filter (e.g. 'image/gif,video/*').
|
||||
* @return {Promise<any>} Promise containing selected file's raw binary data,
|
||||
* base64-encoded data: URI, MIME type, display name, and original URI.
|
||||
*/
|
||||
@Cordova()
|
||||
getFile(accept: string): Promise<ChooserResult | undefined> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
592
src/@ionic-native/plugins/clevertap/index.ts
Normal file
592
src/@ionic-native/plugins/clevertap/index.ts
Normal file
@@ -0,0 +1,592 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
declare var clevertap: any;
|
||||
|
||||
/**
|
||||
* @name CleverTap
|
||||
* @description
|
||||
* Cordova Plugin that wraps CleverTap SDK for Android and iOS
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CleverTap } from '@ionic-native/clevertap';
|
||||
*
|
||||
* constructor(private clevertap: CleverTap) { }
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CleverTap',
|
||||
plugin: 'clevertap-cordova',
|
||||
pluginRef: 'CleverTap',
|
||||
repo: 'https://github.com/CleverTap/clevertap-cordova',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CleverTap extends IonicNativePlugin {
|
||||
/**
|
||||
* notify device ready
|
||||
* NOTE: in iOS use to be notified of launch Push Notification or Deep Link
|
||||
* in Android use only in android phonegap build projects
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
notifyDeviceReady(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Personalization
|
||||
******************/
|
||||
|
||||
/**
|
||||
* Personalization
|
||||
* Enables the Personalization API
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
enablePersonalization(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables tracking opt out for the currently active user.
|
||||
* @param optOut {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setOptOut(optOut: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
|
||||
* @param enable {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
enableDeviceNetworkInfoReporting(enable: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Push
|
||||
******************/
|
||||
|
||||
/**
|
||||
* Registers for push notifications
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
registerPush(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the device's push token
|
||||
* @param token {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setPushToken(token: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification Channel for Android O+
|
||||
* @param channelID {string}
|
||||
* @param channelName {string}
|
||||
* @param channelDescription {string}
|
||||
* @param importance {number}
|
||||
* @param showBadge {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
createNotificationChannel(
|
||||
channelID: string,
|
||||
channelName: string,
|
||||
channelDescription: string,
|
||||
importance: number,
|
||||
showBadge: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification Channel for Android O+
|
||||
* @param channelID {string}
|
||||
* @param channelName {string}
|
||||
* @param channelDescription {string}
|
||||
* @param importance {number}
|
||||
* @param showBadge {boolean}
|
||||
* @param sound {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
createNotificationChannelWithSound(
|
||||
channelID: string,
|
||||
channelName: string,
|
||||
channelDescription: string,
|
||||
importance: number,
|
||||
showBadge: boolean,
|
||||
sound: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification Channel with Group ID for Android O+
|
||||
* @param channelID {string}
|
||||
* @param channelName {string}
|
||||
* @param channelDescription {string}
|
||||
* @param importance {number}
|
||||
* @param groupId {string}
|
||||
* @param showBadge {boolean}
|
||||
* @param sound {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
createNotificationChannelWithGroupId(
|
||||
channelID: string,
|
||||
channelName: string,
|
||||
channelDescription: string,
|
||||
importance: number,
|
||||
groupId: string,
|
||||
showBadge: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification Channel with Group ID for Android O+
|
||||
* @param channelID {string}
|
||||
* @param channelName {string}
|
||||
* @param channelDescription {string}
|
||||
* @param importance {number}
|
||||
* @param groupId {string}
|
||||
* @param showBadge {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
createNotificationChannelWithGroupIdAndSound(
|
||||
channelID: string,
|
||||
channelName: string,
|
||||
channelDescription: string,
|
||||
importance: number,
|
||||
groupId: string,
|
||||
showBadge: boolean,
|
||||
sound: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification Channel Group for Android O+
|
||||
* @param groupID {string}
|
||||
* @param groupName {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
createNotificationChannelGroup(
|
||||
groupID: string,
|
||||
groupName: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Notification Channel for Android O+
|
||||
* @param channelID {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteNotificationChannel(channelID: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Notification Group for Android O+
|
||||
* @param groupID {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteNotificationChannelGroup(groupID: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Events
|
||||
******************/
|
||||
|
||||
/**
|
||||
* Record Screen View
|
||||
* @param screenName {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
recordScreenView(screenName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Record Event with Name
|
||||
* @param eventName {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
recordEventWithName(eventName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Record Event with Name and Event properties
|
||||
* @param eventName {string}
|
||||
* @param eventProps {any}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
recordEventWithNameAndProps(
|
||||
eventName: string,
|
||||
eventProps: any
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Record Charged Event with Details and Items
|
||||
* @param details {any} object with transaction details
|
||||
* @param items {any} array of items purchased
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
recordChargedEventWithDetailsAndItems(
|
||||
details: any,
|
||||
items: any
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Event First Time
|
||||
* @param eventName {string}
|
||||
* callback returns epoch seconds or -1
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
eventGetFirstTime(eventName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Event Last Time
|
||||
* @param eventName {string}
|
||||
* callback returns epoch seconds or -1
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
eventGetLastTime(eventName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Event Number of Occurrences
|
||||
* @param eventName {string}
|
||||
* calls back with int or -1
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
eventGetOccurrences(eventName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Event Details
|
||||
* @param eventName {string}
|
||||
* calls back with object {"eventName": <string>, "firstTime":<epoch seconds>, "lastTime": <epoch seconds>, "count": <int>} or empty object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
eventGetDetails(eventName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Event History
|
||||
* calls back with object {"eventName1":<event1 details object>, "eventName2":<event2 details object>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getEventHistory(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Profiles
|
||||
******************/
|
||||
|
||||
/**
|
||||
* Get the device location if available.
|
||||
* On iOS:
|
||||
* Calling this will prompt the user location permissions dialog.
|
||||
* Please be sure to include the NSLocationWhenInUseUsageDescription key in your Info.plist.
|
||||
* Uses desired accuracy of kCLLocationAccuracyHundredMeters.
|
||||
* If you need background location updates or finer accuracy please implement your own location handling.
|
||||
* On Android:
|
||||
* Requires Location Permission in AndroidManifest e.g. "android.permission.ACCESS_COARSE_LOCATION"
|
||||
* You can use location to pass it to CleverTap via the setLocation API
|
||||
* for, among other things, more fine-grained geo-targeting and segmentation purposes.
|
||||
* Note: on iOS the call to CleverTapSDK must be made on the main thread due to LocationManager restrictions, but the CleverTapSDK method itself is non-blocking.
|
||||
* calls back with {lat:lat, lon:lon} lat and lon are floats
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getLocation(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set location
|
||||
* @param lat {number}
|
||||
* @param lon {number}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setLocation(lat: number, lon: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a separate and distinct user profile identified by one or more of Identity, Email, FBID or GPID values,
|
||||
* and populated with the key-values included in the profile dictionary.
|
||||
* If your app is used by multiple users, you can use this method to assign them each a unique profile to track them separately.
|
||||
* If instead you wish to assign multiple Identity, Email, FBID and/or GPID values to the same user profile,
|
||||
* use profileSet rather than this method.
|
||||
* If none of Identity, Email, FBID or GPID is included in the profile dictionary,
|
||||
* all properties values will be associated with the current user profile.
|
||||
* When initially installed on this device, your app is assigned an "anonymous" profile.
|
||||
* The first time you identify a user on this device (whether via onUserLogin or profileSet),
|
||||
* the "anonymous" history on the device will be associated with the newly identified user.
|
||||
* Then, use this method to switch between subsequent separate identified users.
|
||||
* Please note that switching from one identified user to another is a costly operation
|
||||
* in that the current session for the previous user is automatically closed
|
||||
* and data relating to the old user removed, and a new session is started
|
||||
* for the new user and data for that user refreshed via a network call to CleverTap.
|
||||
* In addition, any global frequency caps are reset as part of the switch.
|
||||
* @param profile {any} object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
onUserLogin(profile: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set profile attributes
|
||||
* @param profile {any} object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileSet(profile: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set profile attributes from facebook user
|
||||
* @param profile {any} facebook graph user object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileSetGraphUser(profile: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set profile attributes rom google plus user
|
||||
* @param profile {any} google plus user object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileGooglePlusUser(profile: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Profile Property
|
||||
* @param propertyName {string}
|
||||
* calls back with value of propertyName or false
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileGetProperty(propertyName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a unique CleverTap identifier suitable for use with install attribution providers.
|
||||
* calls back with unique CleverTap attribution identifier
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileGetCleverTapAttributionIdentifier(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Profile CleverTapID
|
||||
* calls back with CleverTapID or false
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileGetCleverTapID(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the property specified by key from the user profile
|
||||
* @param key {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileRemoveValueForKey(key: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for setting a multi-value user profile property
|
||||
* @param key {string}
|
||||
* @param values {any} array of strings
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileSetMultiValues(key: string, values: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for adding a value to a multi-value user profile property
|
||||
* @param key {string}
|
||||
* @param value {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileAddMultiValue(key: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for adding values to a multi-value user profile property
|
||||
* @param key {string}
|
||||
* @param values {any} array of strings
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileAddMultiValues(key: string, values: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for removing a value from a multi-value user profile property
|
||||
* @param key {string}
|
||||
* @param value {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileRemoveMultiValue(key: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for removing a value from a multi-value user profile property
|
||||
* @param key {string}
|
||||
* @param values {any} array of strings
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
profileRemoveMultiValues(key: string, values: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Session
|
||||
******************/
|
||||
|
||||
/**
|
||||
* Get Session Elapsed Time
|
||||
* calls back with seconds
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sessionGetTimeElapsed(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Session Total Visits
|
||||
* calls back with with int or -1
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sessionGetTotalVisits(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Session Screen Count
|
||||
* calls back with with int
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sessionGetScreenCount(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Session Previous Visit Time
|
||||
* calls back with with epoch seconds or -1
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sessionGetPreviousVisitTime(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sesssion Referrer UTM details
|
||||
* object {"source": <string>, "medium": <string>, "campaign": <string>} or empty object
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sessionGetUTMDetails(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to manually track the utm details for an incoming install referrer
|
||||
* @param source {string}
|
||||
* @param medium {string}
|
||||
* @param campaign {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
pushInstallReferrer(
|
||||
source: string,
|
||||
medium: string,
|
||||
campaign: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Developer Options
|
||||
******************/
|
||||
/**
|
||||
* 0 is off, 1 is info, 2 is debug, default is 1
|
||||
* @param level {number}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setDebugLevel(level: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
/**
|
||||
* @name Clipboard
|
||||
* @description
|
||||
@@ -25,7 +25,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* alert('Error: ' + reject);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
*
|
||||
* this.clipboard.clear();
|
||||
* ```
|
||||
*/
|
||||
@@ -38,27 +38,31 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class Clipboard extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Copies the given text
|
||||
* @param {string} text Text that gets copied on the system clipboard
|
||||
* @returns {Promise<any>} Returns a promise after the text has been copied
|
||||
*/
|
||||
@Cordova()
|
||||
copy(text: string): Promise<any> { return; }
|
||||
copy(text: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pastes the text stored in clipboard
|
||||
* @returns {Promise<any>} Returns a promise after the text has been pasted
|
||||
*/
|
||||
@Cordova()
|
||||
paste(): Promise<any> { return; }
|
||||
paste(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the text stored in clipboard
|
||||
* @returns {Promise<any>} Returns a promise after the text has been cleaned
|
||||
*/
|
||||
@Cordova()
|
||||
clear(): Promise<any> { return; }
|
||||
|
||||
clear(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,15 +152,9 @@ interface NativeUpdateNotification {
|
||||
appVersion: string;
|
||||
}
|
||||
|
||||
export interface Callback<T> {
|
||||
(error: Error, parameter: T): void;
|
||||
}
|
||||
export interface SuccessCallback<T> {
|
||||
(result?: T): void;
|
||||
}
|
||||
export interface ErrorCallback {
|
||||
(error?: Error): void;
|
||||
}
|
||||
export type Callback<T> = (error: Error, parameter: T) => void;
|
||||
export type SuccessCallback<T> = (result?: T) => void;
|
||||
export type ErrorCallback = (error?: Error) => void;
|
||||
|
||||
interface Configuration {
|
||||
appVersion: string;
|
||||
@@ -177,18 +171,18 @@ declare class AcquisitionStatus {
|
||||
|
||||
declare class AcquisitionManager {
|
||||
constructor(httpRequester: Http.Requester, configuration: Configuration);
|
||||
public queryUpdateWithCurrentPackage(
|
||||
queryUpdateWithCurrentPackage(
|
||||
currentPackage: IPackage,
|
||||
callback?: Callback<IRemotePackage | NativeUpdateNotification>
|
||||
): void;
|
||||
public reportStatusDeploy(
|
||||
reportStatusDeploy(
|
||||
pkg?: IPackage,
|
||||
status?: string,
|
||||
previousLabelOrAppVersion?: string,
|
||||
previousDeploymentKey?: string,
|
||||
callback?: Callback<void>
|
||||
): void;
|
||||
public reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
|
||||
reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
|
||||
}
|
||||
|
||||
interface CodePushCordovaPlugin {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import {
|
||||
checkAvailability,
|
||||
CordovaCheck,
|
||||
CordovaInstance,
|
||||
getPromise,
|
||||
InstanceCheck,
|
||||
InstanceProperty,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
Plugin,
|
||||
checkAvailability,
|
||||
getPromise
|
||||
} from '@ionic-native/core';
|
||||
|
||||
declare const window: any, navigator: any;
|
||||
@@ -117,8 +117,8 @@ export class Contact implements IContactProperties {
|
||||
|
||||
@InstanceCheck()
|
||||
clone(): Contact {
|
||||
let newContact: any = new Contact();
|
||||
for (let prop in this) {
|
||||
const newContact: any = new Contact();
|
||||
for (const prop in this) {
|
||||
if (prop === 'id') return;
|
||||
newContact[prop] = this[prop];
|
||||
}
|
||||
@@ -306,6 +306,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* @description
|
||||
* Access and manage Contacts on the device.
|
||||
*
|
||||
* @deprecated
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
@@ -402,8 +403,8 @@ export class Contacts extends IonicNativePlugin {
|
||||
* @hidden
|
||||
*/
|
||||
function processContact(contact: any) {
|
||||
let newContact = new Contact();
|
||||
for (let prop in contact) {
|
||||
const newContact = new Contact();
|
||||
for (const prop in contact) {
|
||||
if (typeof contact[prop] === 'function') continue;
|
||||
newContact[prop] = contact[prop];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
|
||||
/**
|
||||
* @name Couchbase Lite
|
||||
* @description
|
||||
@@ -66,8 +65,8 @@ import { Injectable } from '@angular/core';
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* createDocument(database_name:string,document){
|
||||
* }
|
||||
* createDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name;
|
||||
* return this._http
|
||||
@@ -84,9 +83,9 @@ import { Injectable } from '@angular/core';
|
||||
* createDocument('justbe', document);
|
||||
* // successful response
|
||||
* { "id": "string","rev": "string","ok": true }
|
||||
* updateDocument(database_name:string,document){
|
||||
* updateDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name + '/' + document._id;
|
||||
* url = url + database_name + '/' + document._id;
|
||||
* return this._http
|
||||
* .put(url,document)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
@@ -121,7 +120,6 @@ import { Injectable } from '@angular/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class CouchbaseLite extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the database url
|
||||
* @return {Promise<any>} Returns a promise that resolves with the local database url
|
||||
@@ -129,6 +127,7 @@ export class CouchbaseLite extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
getURL(): Promise<any> { return; }
|
||||
|
||||
getURL(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CropOptions {
|
||||
quality?: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface DeeplinkMatch {
|
||||
@@ -123,7 +123,7 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
*
|
||||
* @param {Object} paths
|
||||
*
|
||||
*
|
||||
* @param {DeeplinkOptions} options
|
||||
*
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface DeviceMotionAccelerationData {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
declare const window: any;
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaProperty,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Diagnostic
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface DialogsPromptCallback {
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name iOS DocumentPicker
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface DocumentViewerOptions {
|
||||
|
||||
@@ -15,17 +15,17 @@ export interface EmailComposerOptions {
|
||||
/**
|
||||
* Email address(es) for To field
|
||||
*/
|
||||
to?: string | Array<string>;
|
||||
to?: string | string[];
|
||||
|
||||
/**
|
||||
* Email address(es) for CC field
|
||||
*/
|
||||
cc?: string | Array<string>;
|
||||
cc?: string | string[];
|
||||
|
||||
/**
|
||||
* Email address(es) for BCC field
|
||||
*/
|
||||
bcc?: string | Array<string>;
|
||||
bcc?: string | string[];
|
||||
|
||||
/**
|
||||
* File paths or base64 data streams
|
||||
@@ -117,6 +117,30 @@ export interface EmailComposerOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class EmailComposer extends IonicNativePlugin {
|
||||
/**
|
||||
* Checks if the app has a permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
hasPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
requestPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if sending emails is supported on the device.
|
||||
*
|
||||
@@ -146,39 +170,6 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
requestPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the app has a permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
hasPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new mail app alias.
|
||||
*
|
||||
* @param {string} alias The alias name
|
||||
* @param {string} packageName The package name
|
||||
*/
|
||||
@Cordova()
|
||||
addAlias(alias: string, packageName: string): void {}
|
||||
|
||||
/**
|
||||
* Displays the email composer pre-filled with data.
|
||||
*
|
||||
@@ -193,4 +184,13 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
open(options: EmailComposerOptions, scope?: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new mail app alias.
|
||||
*
|
||||
* @param {string} alias The alias name
|
||||
* @param {string} packageName The package name
|
||||
*/
|
||||
@Cordova()
|
||||
addAlias(alias: string, packageName: string): void {}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Extended Device Information
|
||||
* @description
|
||||
* Retrieves additional device information that is not provided by other plugins
|
||||
* Retrieves additional device information from the Device Hardware
|
||||
* - memory
|
||||
* - cpumhz
|
||||
* - totalstorage
|
||||
* - freestorage
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -22,23 +26,23 @@ import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
pluginName: 'ExtendedDeviceInformation',
|
||||
plugin: 'cordova-plugin-extended-device-information',
|
||||
pluginRef: 'extended-device-information',
|
||||
repo: 'https://github.com/danielehrhardt/cordova-plugin-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;
|
||||
memory: string;
|
||||
|
||||
/**
|
||||
* Get the device's CPU mhz
|
||||
*/
|
||||
@CordovaProperty
|
||||
cpumhz: string;
|
||||
cpumhz: number;
|
||||
|
||||
/**
|
||||
* Get the total storage
|
||||
@@ -46,4 +50,9 @@ export class ExtendedDeviceInformation extends IonicNativePlugin {
|
||||
@CordovaProperty
|
||||
totalstorage: string;
|
||||
|
||||
/**
|
||||
* Get the total storage
|
||||
*/
|
||||
@CordovaProperty
|
||||
freestorage: number;
|
||||
}
|
||||
|
||||
425
src/@ionic-native/plugins/fabric/index.ts
Normal file
425
src/@ionic-native/plugins/fabric/index.ts
Normal file
@@ -0,0 +1,425 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface Attributes {
|
||||
[index: string]: String;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Crashlytics
|
||||
* @description
|
||||
* API for interacting with the Crashlytics kit.
|
||||
*
|
||||
* https://docs.fabric.io/crashlytics/index.html
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Crashlytics } from '@ionic-native/fabric';
|
||||
*
|
||||
*
|
||||
* constructor(private crashlytics: Crashlytics) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* try {
|
||||
* await this.loadData();
|
||||
* } catch (e) {
|
||||
* this.crashlytics.addLog("Error while loading data");
|
||||
* this.crashlytics.sendNonFatalCrash(e.message || e);
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Crashlytics',
|
||||
plugin: 'cordova-fabric-plugin',
|
||||
pluginRef: 'window.fabric.Crashlytics',
|
||||
repo: 'https://www.npmjs.com/package/cordova-fabric-plugin',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx',
|
||||
installVariables: ['FABRIC_API_KEY', 'FABRIC_API_SECRET'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Crashlytics extends IonicNativePlugin {
|
||||
/**
|
||||
* Add logging that will be sent with your crash data. This logging will not show up
|
||||
* in the system.log and will only be visible in your Crashlytics dashboard.
|
||||
* @param message {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
addLog(message: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to simulate a native platform crash (useful for testing Crashlytics logging).
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendCrash(): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to log a non-fatal error message (Android only).
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendNonFatalCrash(message: string, stacktrace?: any): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to record a non-fatal error message (iOS only).
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
recordError(message: string, code: number): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user's identifier for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setUserIdentifier(userId: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user's name for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setUserName(userName: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user's email address for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setUserEmail(email: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom key/value pair for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setStringValueForKey(value: string, key: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom key/value pair for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setIntValueForKey(value: number, key: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom key/value pair for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setBoolValueForKey(value: boolean, key: string): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom key/value pair for logging to Crashlytics backend.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setFloatValueForKey(value: number, key: string): void {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Answers
|
||||
* @description
|
||||
* API for interacting with the Answers kit.
|
||||
*
|
||||
* https://docs.fabric.io/crashlytics/index.html
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Answers } from '@ionic-native/fabric';
|
||||
*
|
||||
*
|
||||
* constructor(private answers: Answers) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.answers.sendCustomEvent('SomeCustomEvent', { some: "attributes" })
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Answers',
|
||||
plugin: 'cordova-fabric-plugin',
|
||||
pluginRef: 'window.fabric.Answers',
|
||||
repo: 'https://www.npmjs.com/package/cordova-fabric-plugin',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx',
|
||||
installVariables: ['FABRIC_API_KEY', 'FABRIC_API_SECRET'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Answers extends IonicNativePlugin {
|
||||
/**
|
||||
* Sends the Purchase tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#purchase
|
||||
*
|
||||
* @param itemPrice The item's amount in the currency specified.
|
||||
* @param currency The ISO4217 currency code.
|
||||
* @param success Was the purchase completed succesfully?
|
||||
* @param itemName The human-readable name for the item.
|
||||
* @param itemType The category the item falls under.
|
||||
* @param itemId A unique identifier used to track the item.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendPurchase(
|
||||
itemPrice?: number,
|
||||
currency?: string,
|
||||
success?: boolean,
|
||||
itemName?: string,
|
||||
itemType?: string,
|
||||
itemId?: string,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Add To Cart tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#add-to-cart
|
||||
*
|
||||
* @param itemPrice The item's amount in the currency specified.
|
||||
* @param currency The ISO4217 currency code.
|
||||
* @param itemName The human-readable name for the item.
|
||||
* @param itemType The category the item falls under.
|
||||
* @param itemId A unique identifier used to track the item.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendAddToCart(
|
||||
itemPrice?: number,
|
||||
currency?: string,
|
||||
itemName?: string,
|
||||
itemType?: string,
|
||||
itemId?: string,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Start Checkout tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#start-checkout
|
||||
*
|
||||
* @param totalPrice The total price of all items in cart in the currency specified.
|
||||
* @param currency The ISO4217 currency code.
|
||||
* @param itemCount The count of items in cart.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendStartCheckout(
|
||||
totalPrice?: number,
|
||||
currency?: string,
|
||||
itemCount?: number,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Search tracking event.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#search
|
||||
*
|
||||
* @param query What the user is searching for.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendSearch(query: string, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Share tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#share
|
||||
*
|
||||
* @param method The method used to share content.
|
||||
* @param contentName The description of the content.
|
||||
* @param contentType The type or genre of content.
|
||||
* @param contentId A unique key identifying the content.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendShare(
|
||||
method?: string,
|
||||
contentName?: string,
|
||||
contentType?: string,
|
||||
contentId?: string,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Rated Content tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#rated-content
|
||||
*
|
||||
* @param rating An integer rating of the content.
|
||||
* @param contentName The human-readable name of content.
|
||||
* @param contentType The category your item falls under.
|
||||
* @param contentId A unique identifier used to track the item.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendRatedContent(
|
||||
rating?: number,
|
||||
contentName?: string,
|
||||
contentType?: string,
|
||||
contentId?: string,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Sign Up tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#sign-up
|
||||
*
|
||||
* @param method An optional description of the sign up method (Twitter, Facebook, etc.); defaults to "Direct".
|
||||
* @param success An optional flag that indicates sign up success; defaults to true.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendSignUp(
|
||||
method?: string,
|
||||
success?: boolean,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Log In tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#log-in
|
||||
*
|
||||
* @param method An optional description of the sign in method (Twitter, Facebook, etc.); defaults to "Direct".
|
||||
* @param success An optional flag that indicates sign in success; defaults to true.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendLogIn(method?: string, success?: boolean, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Invite tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#invite
|
||||
*
|
||||
* @param method An optional description of the sign in method (Twitter, Facebook, etc.); defaults to "Direct".
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendInvite(method?: string, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Level Start tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#level-start
|
||||
*
|
||||
* @param levelName String key describing the level.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendLevelStart(levelName?: string, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Level End tracking event.
|
||||
*
|
||||
* All parameters are optional.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#level-end
|
||||
*
|
||||
* @param levelName String key describing the level.
|
||||
* @param score The score for this level.
|
||||
* @param success Completed the level or failed trying.
|
||||
* @param attributes Any additional user-defined attributes to be logged.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendLevelEnd(
|
||||
levelName?: string,
|
||||
score?: number,
|
||||
success?: boolean,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the Content View tracking event.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#content-view
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendContentView(
|
||||
name: string,
|
||||
type?: string,
|
||||
id?: string,
|
||||
attributes?: Attributes
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for sendContentView(...) using type of "Screen".
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendScreenView(name: string, id: string, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a custom tracking event with the given name.
|
||||
*
|
||||
* https://docs.fabric.io/android/answers/answers-events.html#custom-event
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendCustomEvent(name: string, attributes?: Attributes): void {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
|
||||
status: string;
|
||||
|
||||
authResponse: {
|
||||
|
||||
session_key: boolean;
|
||||
|
||||
accessToken: string;
|
||||
@@ -18,9 +16,7 @@ export interface FacebookLoginResponse {
|
||||
secret: string;
|
||||
|
||||
userID: string;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,46 +110,46 @@ export interface FacebookLoginResponse {
|
||||
plugin: 'cordova-plugin-facebook4',
|
||||
pluginRef: 'facebookConnectPlugin',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
|
||||
install: 'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
|
||||
installVariables: ['APP_ID', 'APP_NAME'],
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
@Injectable()
|
||||
export class Facebook extends IonicNativePlugin {
|
||||
|
||||
EVENTS: {
|
||||
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app',
|
||||
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app',
|
||||
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions',
|
||||
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions',
|
||||
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration',
|
||||
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view',
|
||||
EVENT_NAME_SEARCHED: 'fb_mobile_search',
|
||||
EVENT_NAME_RATED: 'fb_mobile_rate',
|
||||
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion',
|
||||
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token',
|
||||
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart',
|
||||
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist',
|
||||
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout',
|
||||
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info',
|
||||
EVENT_NAME_PURCHASED: 'fb_mobile_purchase',
|
||||
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved',
|
||||
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked',
|
||||
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits',
|
||||
EVENT_PARAM_CURRENCY: 'fb_currency',
|
||||
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method',
|
||||
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type',
|
||||
EVENT_PARAM_CONTENT_ID: 'fb_content_id',
|
||||
EVENT_PARAM_SEARCH_STRING: 'fb_search_string',
|
||||
EVENT_PARAM_SUCCESS: 'fb_success',
|
||||
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value',
|
||||
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available',
|
||||
EVENT_PARAM_NUM_ITEMS: 'fb_num_items',
|
||||
EVENT_PARAM_LEVEL: 'fb_level',
|
||||
EVENT_PARAM_DESCRIPTION: 'fb_description',
|
||||
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source',
|
||||
EVENT_PARAM_VALUE_YES: '1',
|
||||
EVENT_PARAM_VALUE_NO: '0'
|
||||
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app';
|
||||
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app';
|
||||
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions';
|
||||
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions';
|
||||
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration';
|
||||
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view';
|
||||
EVENT_NAME_SEARCHED: 'fb_mobile_search';
|
||||
EVENT_NAME_RATED: 'fb_mobile_rate';
|
||||
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion';
|
||||
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token';
|
||||
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart';
|
||||
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist';
|
||||
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout';
|
||||
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info';
|
||||
EVENT_NAME_PURCHASED: 'fb_mobile_purchase';
|
||||
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved';
|
||||
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked';
|
||||
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits';
|
||||
EVENT_PARAM_CURRENCY: 'fb_currency';
|
||||
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method';
|
||||
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type';
|
||||
EVENT_PARAM_CONTENT_ID: 'fb_content_id';
|
||||
EVENT_PARAM_SEARCH_STRING: 'fb_search_string';
|
||||
EVENT_PARAM_SUCCESS: 'fb_success';
|
||||
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value';
|
||||
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available';
|
||||
EVENT_PARAM_NUM_ITEMS: 'fb_num_items';
|
||||
EVENT_PARAM_LEVEL: 'fb_level';
|
||||
EVENT_PARAM_DESCRIPTION: 'fb_description';
|
||||
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source';
|
||||
EVENT_PARAM_VALUE_YES: '1';
|
||||
EVENT_PARAM_VALUE_NO: '0';
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -178,7 +174,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
*/
|
||||
@Cordova()
|
||||
login(permissions: string[]): Promise<FacebookLoginResponse> { return; }
|
||||
login(permissions: string[]): Promise<FacebookLoginResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout of Facebook.
|
||||
@@ -187,7 +185,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
*/
|
||||
@Cordova()
|
||||
logout(): Promise<any> { return; }
|
||||
logout(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
|
||||
@@ -216,7 +216,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a status, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
getLoginStatus(): Promise<any> { return; }
|
||||
getLoginStatus(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Facebook access token for using Facebook services.
|
||||
@@ -224,7 +226,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<string>} Returns a Promise that resolves with an access token, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
getAccessToken(): Promise<string> { return; }
|
||||
getAccessToken(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show one of various Facebook dialogs. Example of options for a Share dialog:
|
||||
@@ -244,7 +248,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with success data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
showDialog(options: any): Promise<any> { return; }
|
||||
showDialog(options: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
|
||||
@@ -260,7 +266,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
api(requestPath: string, permissions: string[]): Promise<any> { return; }
|
||||
api(requestPath: string, permissions: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event. For more information see the Events section above.
|
||||
@@ -274,7 +282,9 @@ export class Facebook extends IonicNativePlugin {
|
||||
successIndex: 3,
|
||||
errorIndex: 4
|
||||
})
|
||||
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> { return; }
|
||||
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a purchase. For more information see the Events section above.
|
||||
@@ -284,6 +294,16 @@ export class Facebook extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logPurchase(value: number, currency: string): Promise<any> { return; }
|
||||
logPurchase(value: number, currency: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the deferred app link
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getDeferredApplink(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name File Chooser
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface IOSFilePickerPosition {
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name iOS File Picker
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
checkAvailability,
|
||||
CordovaInstance,
|
||||
InstanceCheck,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
Plugin,
|
||||
checkAvailability
|
||||
} from '@ionic-native/core';
|
||||
|
||||
export interface FileUploadOptions {
|
||||
@@ -152,7 +152,7 @@ export interface FileTransferError {
|
||||
* // error
|
||||
* })
|
||||
* }
|
||||
**
|
||||
*
|
||||
* download() {
|
||||
* const url = 'http://www.example.com/file.pdf';
|
||||
* fileTransfer.download(url, this.file.dataDirectory + 'file.pdf').then((entry) => {
|
||||
|
||||
@@ -371,84 +371,52 @@ export interface FileEntry extends Entry {
|
||||
/**
|
||||
* When requestFileSystem() succeeds, the following callback is made.
|
||||
*/
|
||||
export interface FileSystemCallback {
|
||||
/**
|
||||
* @param filesystem The file systems to which the app is granted access.
|
||||
*/
|
||||
(filesystem: FileSystem): void;
|
||||
}
|
||||
export type FileSystemCallback = (filesystem: FileSystem) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to look up Entry objects.
|
||||
*/
|
||||
export interface EntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry: Entry): void;
|
||||
}
|
||||
export type EntryCallback = (entry: Entry) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to look up FileEntry objects.
|
||||
*/
|
||||
export interface FileEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry: FileEntry): void;
|
||||
}
|
||||
export type FileEntryCallback = (entry: FileEntry) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to look up DirectoryEntry objects.
|
||||
*/
|
||||
export interface DirectoryEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry: DirectoryEntry): void;
|
||||
}
|
||||
export type DirectoryEntryCallback = (entry: DirectoryEntry) => void;
|
||||
|
||||
/**
|
||||
* When readEntries() succeeds, the following callback is made.
|
||||
*/
|
||||
export interface EntriesCallback {
|
||||
(entries: Entry[]): void;
|
||||
}
|
||||
export type EntriesCallback = (entries: Entry[]) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to look up file and directory metadata.
|
||||
*/
|
||||
export interface MetadataCallback {
|
||||
(metadata: Metadata): void;
|
||||
}
|
||||
export type MetadataCallback = (metadata: Metadata) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to create a FileWriter.
|
||||
*/
|
||||
export interface FileWriterCallback {
|
||||
(fileWriter: FileWriter): void;
|
||||
}
|
||||
export type FileWriterCallback = (fileWriter: FileWriter) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the callback used to obtain a File.
|
||||
*/
|
||||
export interface FileCallback {
|
||||
(file: IFile): void;
|
||||
}
|
||||
export type FileCallback = (file: IFile) => void;
|
||||
|
||||
/**
|
||||
* This export interface is the generic callback used to indicate success of an asynchronous method.
|
||||
*/
|
||||
export interface VoidCallback {
|
||||
(): void;
|
||||
}
|
||||
export type VoidCallback = () => void;
|
||||
|
||||
/**
|
||||
* When an error occurs, the following callback is made.
|
||||
*/
|
||||
export interface ErrorCallback {
|
||||
(err: FileError): void;
|
||||
}
|
||||
export type ErrorCallback = (err: FileError) => void;
|
||||
|
||||
export interface RemoveResult {
|
||||
success: boolean;
|
||||
@@ -681,63 +649,75 @@ export class File extends IonicNativePlugin {
|
||||
/**
|
||||
* Read-only directory where the application is installed.
|
||||
*/
|
||||
@CordovaProperty applicationDirectory: string;
|
||||
@CordovaProperty
|
||||
applicationDirectory: string;
|
||||
|
||||
/**
|
||||
* Read-only directory where the application is installed.
|
||||
*/
|
||||
@CordovaProperty applicationStorageDirectory: string;
|
||||
@CordovaProperty
|
||||
applicationStorageDirectory: string;
|
||||
|
||||
/**
|
||||
* Where to put app-specific data files.
|
||||
*/
|
||||
@CordovaProperty dataDirectory: string;
|
||||
@CordovaProperty
|
||||
dataDirectory: string;
|
||||
|
||||
/**
|
||||
* Cached files that should survive app restarts.
|
||||
* Apps should not rely on the OS to delete files in here.
|
||||
*/
|
||||
@CordovaProperty cacheDirectory: string;
|
||||
@CordovaProperty
|
||||
cacheDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the application space on external storage.
|
||||
*/
|
||||
@CordovaProperty externalApplicationStorageDirectory: string;
|
||||
@CordovaProperty
|
||||
externalApplicationStorageDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: Where to put app-specific data files on external storage.
|
||||
*/
|
||||
@CordovaProperty externalDataDirectory: string;
|
||||
@CordovaProperty
|
||||
externalDataDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the application cache on external storage.
|
||||
*/
|
||||
@CordovaProperty externalCacheDirectory: string;
|
||||
@CordovaProperty
|
||||
externalCacheDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the external storage (SD card) root.
|
||||
*/
|
||||
@CordovaProperty externalRootDirectory: string;
|
||||
@CordovaProperty
|
||||
externalRootDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Temp directory that the OS can clear at will.
|
||||
*/
|
||||
@CordovaProperty tempDirectory: string;
|
||||
@CordovaProperty
|
||||
tempDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Holds app-specific files that should be synced (e.g. to iCloud).
|
||||
*/
|
||||
@CordovaProperty syncedDataDirectory: string;
|
||||
@CordovaProperty
|
||||
syncedDataDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
|
||||
*/
|
||||
@CordovaProperty documentsDirectory: string;
|
||||
@CordovaProperty
|
||||
documentsDirectory: string;
|
||||
|
||||
/**
|
||||
* BlackBerry10: Files globally available to all apps
|
||||
*/
|
||||
@CordovaProperty sharedDirectory: string;
|
||||
@CordovaProperty
|
||||
sharedDirectory: string;
|
||||
|
||||
cordovaFileError: any = {
|
||||
1: 'NOT_FOUND_ERR',
|
||||
@@ -777,7 +757,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
checkDir(path: string, dir: string): Promise<boolean> {
|
||||
if (/^\//.test(dir)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -805,12 +785,12 @@ export class File extends IonicNativePlugin {
|
||||
replace: boolean
|
||||
): Promise<DirectoryEntry> {
|
||||
if (/^\//.test(dirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
let options: Flags = {
|
||||
const options: Flags = {
|
||||
create: true
|
||||
};
|
||||
|
||||
@@ -833,7 +813,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
removeDir(path: string, dirName: string): Promise<RemoveResult> {
|
||||
if (/^\//.test(dirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -866,7 +846,7 @@ export class File extends IonicNativePlugin {
|
||||
newDirName = newDirName || dirName;
|
||||
|
||||
if (/^\//.test(newDirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -899,7 +879,7 @@ export class File extends IonicNativePlugin {
|
||||
newDirName: string
|
||||
): Promise<Entry> {
|
||||
if (/^\//.test(newDirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -925,7 +905,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
listDir(path: string, dirName: string): Promise<Entry[]> {
|
||||
if (/^\//.test(dirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<Entry[]>(err);
|
||||
}
|
||||
@@ -938,7 +918,7 @@ export class File extends IonicNativePlugin {
|
||||
});
|
||||
})
|
||||
.then(de => {
|
||||
let reader = de.createReader();
|
||||
const reader = de.createReader();
|
||||
return this.readEntries(reader);
|
||||
});
|
||||
}
|
||||
@@ -953,7 +933,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
removeRecursively(path: string, dirName: string): Promise<RemoveResult> {
|
||||
if (/^\//.test(dirName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'directory cannot start with /';
|
||||
return Promise.reject<RemoveResult>(err);
|
||||
}
|
||||
@@ -977,7 +957,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
checkFile(path: string, file: string): Promise<boolean> {
|
||||
if (/^\//.test(file)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -986,7 +966,7 @@ export class File extends IonicNativePlugin {
|
||||
if (fse.isFile) {
|
||||
return true;
|
||||
} else {
|
||||
let err = new FileError(13);
|
||||
const err = new FileError(13);
|
||||
err.message = 'input is not a file';
|
||||
return Promise.reject<boolean>(err);
|
||||
}
|
||||
@@ -1010,12 +990,12 @@ export class File extends IonicNativePlugin {
|
||||
replace: boolean
|
||||
): Promise<FileEntry> {
|
||||
if (/^\//.test(fileName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file-name cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
let options: Flags = {
|
||||
const options: Flags = {
|
||||
create: true
|
||||
};
|
||||
|
||||
@@ -1038,7 +1018,7 @@ export class File extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
removeFile(path: string, fileName: string): Promise<RemoveResult> {
|
||||
if (/^\//.test(fileName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file-name cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -1052,8 +1032,8 @@ export class File extends IonicNativePlugin {
|
||||
});
|
||||
}
|
||||
|
||||
/** Write a new file to the desired location.
|
||||
*
|
||||
/**
|
||||
* Write a new file to the desired location.
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
|
||||
* @param {string} fileName path relative to base path
|
||||
* @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
|
||||
@@ -1087,8 +1067,8 @@ export class File extends IonicNativePlugin {
|
||||
});
|
||||
}
|
||||
|
||||
/** Write content to FileEntry.
|
||||
*
|
||||
/**
|
||||
* Write content to FileEntry.
|
||||
* @hidden
|
||||
* @param {FileEntry} fe file entry object
|
||||
* @param {string | Blob} text content or blob to write
|
||||
@@ -1115,8 +1095,8 @@ export class File extends IonicNativePlugin {
|
||||
.then(() => fe);
|
||||
}
|
||||
|
||||
/** Write to an existing file.
|
||||
*
|
||||
/**
|
||||
* Write to an existing file.
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
|
||||
* @param {string} fileName path relative to base path
|
||||
* @param {string | Blob} text content or blob to write
|
||||
@@ -1147,7 +1127,7 @@ export class File extends IonicNativePlugin {
|
||||
* Read file and return data as a base64 encoded data url.
|
||||
* A data url is of the form:
|
||||
* data: [<mediatype>][;base64],<data>
|
||||
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
|
||||
* @param {string} file Name of file, relative to path.
|
||||
* @returns {Promise<string>} Returns a Promise that resolves with the contents of the file as data URL or rejects with an error.
|
||||
@@ -1185,7 +1165,7 @@ export class File extends IonicNativePlugin {
|
||||
readAs: 'ArrayBuffer' | 'BinaryString' | 'DataURL' | 'Text'
|
||||
): Promise<T> {
|
||||
if (/^\//.test(file)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file-name cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -1199,7 +1179,7 @@ export class File extends IonicNativePlugin {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
reader.onloadend = () => {
|
||||
if (reader.result !== undefined || reader.result !== null) {
|
||||
resolve(<T>(<any>reader.result));
|
||||
resolve((reader.result as any) as T);
|
||||
} else if (reader.error !== undefined || reader.error !== null) {
|
||||
reject(reader.error);
|
||||
} else {
|
||||
@@ -1238,7 +1218,7 @@ export class File extends IonicNativePlugin {
|
||||
newFileName = newFileName || fileName;
|
||||
|
||||
if (/^\//.test(newFileName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file name cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -1273,7 +1253,7 @@ export class File extends IonicNativePlugin {
|
||||
newFileName = newFileName || fileName;
|
||||
|
||||
if (/^\//.test(newFileName)) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file name cannot start with /';
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
@@ -1333,7 +1313,7 @@ export class File extends IonicNativePlugin {
|
||||
resolveDirectoryUrl(directoryUrl: string): Promise<DirectoryEntry> {
|
||||
return this.resolveLocalFilesystemUrl(directoryUrl).then(de => {
|
||||
if (de.isDirectory) {
|
||||
return <DirectoryEntry>de;
|
||||
return de as DirectoryEntry;
|
||||
} else {
|
||||
const err = new FileError(13);
|
||||
err.message = 'input is not a directory';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IDynamicLink {
|
||||
@@ -21,7 +21,7 @@ export interface IDynamicLink {
|
||||
* Preferences GoogleIOSClientId and GoogleAndroidClientId are used to setup dynamic links when you have an app for several platforms.
|
||||
* You can find values at your GoogleService-Info.plist (key ANDROID_CLIENT_ID) and google-services.json (key client[0].oauth_client[0].client_id).
|
||||
*
|
||||
*config.xml:
|
||||
* config.xml:
|
||||
* ```xml
|
||||
* <platform name="ios">
|
||||
* <preference name="GoogleIOSClientId" value="..." />
|
||||
@@ -38,10 +38,9 @@ export interface IDynamicLink {
|
||||
* constructor(private firebaseDynamicLinks: FirebaseDynamicLinks) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Handle the logic here after opening the app with the Dynamic link
|
||||
* this.firebaseDynamicLinks.onDynamicLink()
|
||||
* .then((res: any) => console.log(res)) //Handle the logic here after opening the app with the Dynamic link
|
||||
* .catch((error:any) => console.log(error));
|
||||
* .subscribe((res: any) => console.log(res), (error:any) => console.log(error));
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
|
||||
@@ -320,7 +320,7 @@ export class Firebase extends IonicNativePlugin {
|
||||
})
|
||||
verifyPhoneNumber(
|
||||
phoneNumber: string,
|
||||
timeoutDuration: number = 0
|
||||
timeoutDuration = 0
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Flashlight
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
checkAvailability,
|
||||
CordovaInstance,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
Plugin,
|
||||
checkAvailability
|
||||
} from '@ionic-native/core';
|
||||
|
||||
export interface FlurryAnalyticsOptions {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const window: any;
|
||||
@@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onTransitionReceived(): Observable<any> { return; };
|
||||
onTransitionReceived(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||
@@ -104,7 +104,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
initialize(): Promise<void> { return; };
|
||||
initialize(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Adds a new geofence or array of geofences. For geofence object, see above.
|
||||
@@ -112,7 +112,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
|
||||
addOrUpdate(geofences: Object | Object[]): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
|
||||
@@ -121,7 +121,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
remove(geofenceId: string | Array<string>): Promise<void> { return; };
|
||||
remove(geofenceId: string | string[]): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Removes all geofences.
|
||||
@@ -129,7 +129,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
removeAll(): Promise<void> { return; };
|
||||
removeAll(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Returns an array of geofences currently being monitored.
|
||||
@@ -137,7 +137,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @returns {Promise<Array<string>>}
|
||||
*/
|
||||
@Cordova()
|
||||
getWatched(): Promise<string> { return; };
|
||||
getWatched(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const navigator: any;
|
||||
|
||||
export interface Coordinates {
|
||||
|
||||
/**
|
||||
* a double representing the position's latitude in decimal degrees.
|
||||
*/
|
||||
@@ -49,7 +48,6 @@ export interface Coordinates {
|
||||
* This value can be null.
|
||||
*/
|
||||
speed: number;
|
||||
|
||||
}
|
||||
|
||||
export interface Geoposition {
|
||||
@@ -65,7 +63,6 @@ export interface Geoposition {
|
||||
}
|
||||
|
||||
export interface PositionError {
|
||||
|
||||
/**
|
||||
* A code that indicates the error that occurred
|
||||
*/
|
||||
@@ -75,11 +72,9 @@ export interface PositionError {
|
||||
* A message that can describe the error that occurred
|
||||
*/
|
||||
message: string;
|
||||
|
||||
}
|
||||
|
||||
export interface GeolocationOptions {
|
||||
|
||||
/**
|
||||
* Is a positive long value indicating the maximum age in milliseconds of a
|
||||
* possible cached position that is acceptable to return. If set to 0, it
|
||||
@@ -107,7 +102,6 @@ export interface GeolocationOptions {
|
||||
* @type {boolean}
|
||||
*/
|
||||
enableHighAccuracy?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,13 +155,13 @@ export interface GeolocationOptions {
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
|
||||
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Geolocation extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
@@ -177,7 +171,9 @@ export class Geolocation extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return; }
|
||||
getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch the current device's position. Clear the watch by unsubscribing from
|
||||
@@ -198,12 +194,13 @@ export class Geolocation extends IonicNativePlugin {
|
||||
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||
return new Observable<Geoposition>(
|
||||
(observer: any) => {
|
||||
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
return () => navigator.geolocation.clearWatch(watchId);
|
||||
}
|
||||
);
|
||||
return new Observable<Geoposition>((observer: any) => {
|
||||
const watchId = navigator.geolocation.watchPosition(
|
||||
observer.next.bind(observer),
|
||||
observer.next.bind(observer),
|
||||
options
|
||||
);
|
||||
return () => navigator.geolocation.clearWatch(watchId);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface GlobalizationOptions {
|
||||
formatLength: string;
|
||||
@@ -134,7 +134,7 @@ export class Globalization extends IonicNativePlugin {
|
||||
getDateNames(options: {
|
||||
type: string;
|
||||
item: string;
|
||||
}): Promise<{ value: Array<string> }> {
|
||||
}): Promise<{ value: string[] }> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Google Analytics
|
||||
@@ -20,7 +20,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* this.ga.startTrackerWithId('YOUR_TRACKER_ID')
|
||||
* .then(() => {
|
||||
* console.log('Google analytics is ready now');
|
||||
this.ga.trackView('test');
|
||||
* this.ga.trackView('test');
|
||||
* // Tracker is ready
|
||||
* // You can now track pages or set additional information such as AppVersion or UserId
|
||||
* })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* this.googleNearby.publish('Hello')
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
*
|
||||
* this.googleNearby.subscribe()
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
@@ -28,13 +28,13 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: 'cordova-plugin-google-nearby',
|
||||
pluginRef: 'window.nearby',
|
||||
repo: 'https://github.com/hahahannes/cordova-plugin-google-nearby',
|
||||
install: 'ionic cordova plugin add cordova-plugin-google-nearby --variable API_KEY="123456789"',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-google-nearby --variable API_KEY="123456789"',
|
||||
installVariables: ['API_KEY'],
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class GoogleNearby extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Publish a message
|
||||
* @param message {string} Message to publish
|
||||
@@ -45,9 +45,9 @@ export class GoogleNearby extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to recieve messages
|
||||
* @return {Observable<any>} Returns an observable that emits recieved messages
|
||||
/**
|
||||
* Subscribe to receive messages
|
||||
* @return {Observable<any>} Returns an observable that emits received messages
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface ScoreData {
|
||||
|
||||
@@ -67,10 +67,10 @@ export interface Player {
|
||||
* The title of the player based on their gameplay activity. Not
|
||||
* all players have this and it may change over time.
|
||||
*/
|
||||
title: string|null;
|
||||
title: string | null;
|
||||
|
||||
/**
|
||||
* Retrieves the URI for loading this player's icon-size profile image.
|
||||
* Retrieves the URI for loading this player's icon-size profile image.
|
||||
* Returns null if the player has no profile image.
|
||||
*/
|
||||
iconImageUrl: string;
|
||||
@@ -101,12 +101,12 @@ export interface Player {
|
||||
* this.googlePlayGamesServices.auth()
|
||||
* .then(() => console.log('Logged in to Play Games Services'))
|
||||
* .catch(e) => console.log('Error logging in Play Games Services', e);
|
||||
*
|
||||
*
|
||||
* // Sign out of Play Games Services.
|
||||
* this.googlePlayGamesServices.signOut()
|
||||
* .then(() => console.log('Logged out of Play Games Services'))
|
||||
* .catch(e => console.log('Error logging out of Play Games Services', e);
|
||||
*
|
||||
*
|
||||
* // Check auth status.
|
||||
* this.googlePlayGamesServices.isSignedIn()
|
||||
* .then((signedIn: SignedInResponse) => {
|
||||
@@ -114,38 +114,38 @@ export interface Player {
|
||||
* hideLoginButton();
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Fetch currently authenticated user's data.
|
||||
* this.googlePlayGamesServices.showPlayer().then((data: Player) => {
|
||||
* console.log('Player data', data);
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Submit a score.
|
||||
* this.googlePlayGamesServices.submitScore({
|
||||
* score: 100,
|
||||
* leaderboardId: 'SomeLeaderboardId'
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Show the native leaderboards window.
|
||||
* this.googlePlayGamesServices.showAllLeaderboards()
|
||||
* .then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
*
|
||||
* // Show a signle native leaderboard window.
|
||||
* this.googlePlayGamesServices.showLeaderboard({
|
||||
* leaderboardId: 'SomeLeaderBoardId'
|
||||
* }).then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
*
|
||||
* // Unlock an achievement.
|
||||
* this.googlePlayGamesServices.unlockAchievement({
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement unlocked'));
|
||||
*
|
||||
*
|
||||
* // Incremement an achievement.
|
||||
* this.googlePlayGamesServices.incrementAchievement({
|
||||
* step: 1,
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement incremented'));
|
||||
*
|
||||
*
|
||||
* // Show the native achievements window.
|
||||
* this.googlePlayGamesServices.showAchivements()
|
||||
* .then(() => console.log('The achievements window is visible.'));
|
||||
@@ -165,7 +165,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Initialise native Play Games Service login procedure.
|
||||
*
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the player
|
||||
* is authenticated with Play Games Services.
|
||||
*/
|
||||
@@ -174,7 +174,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Sign out of Google Play Games Services.
|
||||
*
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolve when the player
|
||||
* successfully signs out.
|
||||
*/
|
||||
@@ -183,7 +183,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check if the user is signed in.
|
||||
*
|
||||
*
|
||||
* @return {Promise<SignedInResponse>} Returns a promise that resolves with
|
||||
* the signed in response.
|
||||
*/
|
||||
@@ -192,8 +192,8 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Show the currently authenticated player.
|
||||
*
|
||||
* @return {Promise<Player>} Returns a promise that resolves when Play
|
||||
*
|
||||
* @return {Promise<Player>} Returns a promise that resolves when Play
|
||||
* Games Services returns the authenticated player.
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -202,7 +202,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
/**
|
||||
* Submit a score to a leaderboard. You should ensure that you have a
|
||||
* successful return from auth() before submitting a score.
|
||||
*
|
||||
*
|
||||
* @param data {ScoreData} The score data you want to submit.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* score is submitted.
|
||||
@@ -213,7 +213,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controller to show all the
|
||||
* leaderboards.
|
||||
*
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboards window opens.
|
||||
*/
|
||||
@@ -223,7 +223,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controll to show the
|
||||
* specified leaderboard.
|
||||
*
|
||||
*
|
||||
* @param data {LeaderboardData} The leaderboard you want to show.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboard window opens.
|
||||
@@ -233,7 +233,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Unlock an achievement.
|
||||
*
|
||||
*
|
||||
* @param data {AchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is unlocked.
|
||||
@@ -243,7 +243,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Increment an achievement.
|
||||
*
|
||||
*
|
||||
* @param data {IncrementableAchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is incremented.
|
||||
@@ -254,7 +254,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
/**
|
||||
* Lauches the native Play Games achievements view controller to show
|
||||
* achievements.
|
||||
*
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement window opens.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@@ -91,7 +91,7 @@ export class Gyroscope extends IonicNativePlugin {
|
||||
watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
|
||||
return new Observable<GyroscopeOrientation>(
|
||||
(observer: any) => {
|
||||
let watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
return () => navigator.gyroscope.clearWatch(watchId);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name hce
|
||||
@@ -45,7 +45,7 @@ export class HCE extends IonicNativePlugin {
|
||||
* Registers command receiver.
|
||||
* @param onCommand {HCECommandEvent} The event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerCommandCallback(onCommand: HCECommandEvent, fail?: Function): void {
|
||||
@@ -55,7 +55,7 @@ export class HCE extends IonicNativePlugin {
|
||||
* Registers Deactivated receiver.
|
||||
* @param ok {HCEDeactivatedEvent} Success event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerDeactivatedCallback(ok: HCEDeactivatedEvent, fail?: Function): void {
|
||||
@@ -68,7 +68,7 @@ export class HCE extends IonicNativePlugin {
|
||||
* @param response {Uint8Array} Response
|
||||
* @param success {string} Success Callback.
|
||||
* @param success {string} Failure Callback.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
sendResponse(response: Uint8Array, success?: Function, failure?: Function): void {
|
||||
@@ -76,5 +76,5 @@ export class HCE extends IonicNativePlugin {
|
||||
}
|
||||
}
|
||||
|
||||
export interface HCECommandEvent { (command: Uint8Array): void; }
|
||||
export interface HCEDeactivatedEvent { (command: number): void; }
|
||||
export type HCECommandEvent = (command: Uint8Array) => void;
|
||||
export type HCEDeactivatedEvent = (command: number) => void;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Header Color
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
@@ -6,13 +6,13 @@ import { Injectable } from '@angular/core';
|
||||
*/
|
||||
export interface HealthDataType {
|
||||
/**
|
||||
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
read?: string[];
|
||||
|
||||
/**
|
||||
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
write?: string[];
|
||||
}
|
||||
|
||||
@@ -207,7 +207,6 @@ export interface HealthData {
|
||||
})
|
||||
@Injectable()
|
||||
export class Health extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Tells if either Google Fit or HealthKit are available.
|
||||
*
|
||||
@@ -216,7 +215,9 @@ export class Health extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
isAvailable(): Promise<boolean> { return; }
|
||||
isAvailable(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if recent Google Play Services and Google Fit are installed. If the play services are not installed,
|
||||
@@ -232,7 +233,9 @@ export class Health extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
promptInstallFit(): Promise<any> { return; }
|
||||
promptInstallFit(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
|
||||
@@ -254,7 +257,9 @@ export class Health extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
|
||||
requestAuthorization(datatypes: (string | HealthDataType)[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the app has authorization to read/write a set of datatypes.
|
||||
@@ -268,7 +273,9 @@ export class Health extends IonicNativePlugin {
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
|
||||
*/
|
||||
@Cordova()
|
||||
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
|
||||
isAuthorized(datatypes: (string | HealthDataType)[]): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the data points of a certain data type within a certain time window.
|
||||
@@ -302,7 +309,9 @@ export class Health extends IonicNativePlugin {
|
||||
* @return {Promise<HealthData[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
query(queryOptions: HealthQueryOptions): Promise<HealthData[]> { return; }
|
||||
query(queryOptions: HealthQueryOptions): Promise<HealthData[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity.
|
||||
@@ -326,7 +335,11 @@ export class Health extends IonicNativePlugin {
|
||||
* @return {Promise<HealthData[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise<HealthData[]> { return; }
|
||||
queryAggregated(
|
||||
queryOptionsAggregated: HealthQueryOptionsAggregated
|
||||
): Promise<HealthData[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores a data point.
|
||||
@@ -343,6 +356,7 @@ export class Health extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
store(storeOptions: HealthStoreOptions): Promise<any> { return; }
|
||||
|
||||
store(storeOptions: HealthStoreOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin, CordovaCheck } from '@ionic-native/core';
|
||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var chcp: any;
|
||||
@@ -85,7 +85,7 @@ export interface HotCodePushEventData {
|
||||
details?: {
|
||||
error?: HotCodePushError;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Hot Code Push
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface HotspotConnectionInfo {
|
||||
|
||||
@@ -203,7 +203,7 @@ export class Hotspot extends IonicNativePlugin {
|
||||
* @returns {Promise<Array<HotspotDevice>>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
|
||||
getAllHotspotDevices(): Promise<HotspotDevice[]> { return; }
|
||||
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
@@ -235,7 +235,7 @@ export class Hotspot extends IonicNativePlugin {
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> { return; }
|
||||
connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: string[]): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Add a WiFi network
|
||||
@@ -299,13 +299,13 @@ export class Hotspot extends IonicNativePlugin {
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
scanWifi(): Promise<Array<HotspotNetwork>> { return; }
|
||||
scanWifi(): Promise<HotspotNetwork[]> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
|
||||
scanWifiByLevel(): Promise<HotspotNetwork[]> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
|
||||
@@ -74,7 +74,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* This returns an object representing a basic HTTP Authorization header of the form.
|
||||
* @param username {string} Username
|
||||
* @param password {string} Password
|
||||
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
|
||||
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBasicAuthHeader(
|
||||
@@ -154,7 +154,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getCookieString(url: string): string { return; }
|
||||
getCookieString(url: string): string {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get global request timeout value in seconds.
|
||||
@@ -173,26 +175,15 @@ export class HTTP extends IonicNativePlugin {
|
||||
setRequestTimeout(timeout: number): void {}
|
||||
|
||||
/**
|
||||
* Enable or disable SSL Pinning. This defaults to false.
|
||||
*
|
||||
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this [stackoverflow answer](https://stackoverflow.com/questions/16583428/how-to-convert-an-ssl-certificate-in-linux/16583429#16583429). You want to convert it to a DER encoded certificate with a .cer extension.
|
||||
*
|
||||
* As an alternative, you can store your .cer files in the www/certificates folder.
|
||||
* @param enable {boolean} Set to true to enable
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
* Set SSL Cert handling mode, being one of the following values
|
||||
* default: default SSL cert handling using system's CA certs
|
||||
* nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes)
|
||||
* pinned: trust only provided certs
|
||||
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode
|
||||
* @param {'default' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
|
||||
*/
|
||||
@Cordova()
|
||||
enableSSLPinning(enable: boolean): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept all SSL certificates. Or disabled accepting all certificates. Defaults to false.
|
||||
* @param accept {boolean} Set to true to accept
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
acceptAllCerts(accept: boolean): Promise<void> {
|
||||
setSSLCertMode(mode: 'default' | 'nocheck' | 'pinned'): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -202,7 +193,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
disableRedirect(disable: boolean): Promise<void> { return; }
|
||||
disableRedirect(disable: boolean): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a POST request
|
||||
@@ -283,7 +276,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The local path of the file to upload
|
||||
* @param name {string} The name of the parameter to pass the file along as
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
uploadFile(
|
||||
@@ -292,7 +285,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
headers: any,
|
||||
filePath: string,
|
||||
name: string
|
||||
): Promise<HTTPResponse> {
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -301,8 +294,8 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @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
|
||||
* @param filePath {string} The path to donwload the file to, including the file name.
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @param filePath {string} The path to download the file to, including the file name.
|
||||
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
downloadFile(
|
||||
@@ -310,7 +303,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
body: any,
|
||||
headers: any,
|
||||
filePath: string
|
||||
): Promise<HTTPResponse> {
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface HttpdOptions {
|
||||
@@ -56,7 +56,6 @@ export interface HttpdOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class Httpd extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Starts a web server.
|
||||
* @param options {HttpdOptions}
|
||||
@@ -66,20 +65,25 @@ export class Httpd extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
startServer(options?: HttpdOptions): Observable<string> { return; }
|
||||
startServer(options?: HttpdOptions): Observable<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
getUrl(): Promise<string> { return; }
|
||||
getUrl(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the local path of the running webserver
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
|
||||
*/
|
||||
*/
|
||||
@Cordova()
|
||||
getLocalPath(): Promise<string> { return; }
|
||||
|
||||
getLocalPath(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
@@ -56,8 +56,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* this.hyperTrack.stopTracking().then(success => {
|
||||
* // Handle success (String). Should be "OK".
|
||||
* }, error => {});
|
||||
*
|
||||
* }, error => {});*
|
||||
*
|
||||
* }, error => {});*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const cordova: any;
|
||||
@@ -266,7 +266,7 @@ export interface IBeaconDelegate {
|
||||
*
|
||||
* this.ibeacon.startMonitoringForRegion(beaconRegion)
|
||||
* .then(
|
||||
* () => console.log('Native layer recieved the request to monitoring'),
|
||||
* () => console.log('Native layer received the request to monitoring'),
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
@@ -296,12 +296,12 @@ export class IBeacon extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaCheck({ sync: true })
|
||||
Delegate(): IBeaconDelegate {
|
||||
let delegate = new cordova.plugins.locationManager.Delegate();
|
||||
const delegate = new cordova.plugins.locationManager.Delegate();
|
||||
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didChangeAuthorizationStatus = cb;
|
||||
}
|
||||
);
|
||||
@@ -310,7 +310,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didDetermineStateForRegion = cb;
|
||||
}
|
||||
);
|
||||
@@ -319,7 +319,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didEnterRegion = cb;
|
||||
}
|
||||
);
|
||||
@@ -328,7 +328,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didExitRegion = cb;
|
||||
}
|
||||
);
|
||||
@@ -337,7 +337,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didRangeBeaconsInRegion = cb;
|
||||
}
|
||||
);
|
||||
@@ -346,7 +346,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didStartMonitoringForRegion = cb;
|
||||
}
|
||||
);
|
||||
@@ -355,7 +355,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.monitoringDidFailForRegionWithError = cb;
|
||||
}
|
||||
);
|
||||
@@ -364,7 +364,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidStartAdvertising = cb;
|
||||
}
|
||||
);
|
||||
@@ -373,7 +373,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
const cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidUpdateState = cb;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
export interface ImagePickerOptions {
|
||||
|
||||
@@ -1,42 +1,64 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
CordovaInstance,
|
||||
InstanceCheck,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
|
||||
declare const cordova: Cordova & { InAppBrowser: any; };
|
||||
declare const cordova: Cordova & { InAppBrowser: any };
|
||||
|
||||
export interface InAppBrowserOptions {
|
||||
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
|
||||
location?: 'yes' | 'no';
|
||||
/** Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
|
||||
/* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
|
||||
* Omit or set to no (default) to have the browser open and load normally. */
|
||||
hidden?: 'yes' | 'no';
|
||||
/** Set to yes to have the browser's cookie cache cleared before the new window is opened. */
|
||||
clearcache?: 'yes';
|
||||
/** Set to yes to have the session cookie cache cleared before the new window is opened. */
|
||||
/* Set to yes to have the session cookie cache cleared before the new window is opened. */
|
||||
clearsessioncache?: 'yes';
|
||||
/** (Android Only) set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
|
||||
/* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself.
|
||||
* (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
|
||||
closebuttoncaption?: string;
|
||||
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes.
|
||||
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled. */
|
||||
closebuttoncolor?: string;
|
||||
/** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
|
||||
zoom?: 'yes' | 'no';
|
||||
/** Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
|
||||
/* (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
|
||||
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser. */
|
||||
hardwareback?: 'yes' | 'no';
|
||||
/** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */
|
||||
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
|
||||
/* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no.
|
||||
* (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.*/
|
||||
hidenavigationbuttons?: 'yes' | 'no';
|
||||
/* (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/
|
||||
hideurlbar?: 'yes' | 'no';
|
||||
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes.
|
||||
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible. */
|
||||
navigationbuttoncolor?: string;
|
||||
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes.
|
||||
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.*/
|
||||
toolbarcolor?: string;
|
||||
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
|
||||
shouldPauseOnSuspend?: 'yes' | 'no';
|
||||
/** (Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties */
|
||||
footer?: 'yes' | 'no';
|
||||
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb) , and it will change the footer color from default. Only has effect if user has footer set to yes */
|
||||
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb), and it will change the footer color from default. Only has effect if user has footer set to yes */
|
||||
footercolor?: string;
|
||||
/** (iOS Only) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
|
||||
closebuttoncaption?: string;
|
||||
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
|
||||
disallowoverscroll?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */
|
||||
toolbar?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to make the toolbar translucent(semi-transparent) (defaults to yes). Only applicable if toolbar is not disabled. */
|
||||
toolbartranslucent?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */
|
||||
enableViewportScale?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
|
||||
/* (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
|
||||
* The HTML's video element must also include the webkit-playsinline attribute (defaults to no) */
|
||||
allowInlineMediaPlayback?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
|
||||
@@ -51,10 +73,11 @@ export interface InAppBrowserOptions {
|
||||
toolbarposition?: 'top' | 'bottom';
|
||||
/** (iOS Only) Set to yes or no to change the visibility of the loading indicator (defaults to no). */
|
||||
hidespinner?: 'yes' | 'no';
|
||||
/** (Windows only) Set to yes to create the browser control without a border around it.
|
||||
/* (Windows only) Set to yes to create the browser control without a border around it.
|
||||
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
|
||||
fullscreen?: 'yes';
|
||||
|
||||
/** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */
|
||||
useWideViewPort?: 'yes' | 'no';
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -75,7 +98,6 @@ export interface InAppBrowserEvent extends Event {
|
||||
* @hidden
|
||||
*/
|
||||
export class InAppBrowserObject {
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
/**
|
||||
@@ -89,20 +111,26 @@ export class InAppBrowserObject {
|
||||
* The options string must not contain any blank space, and each feature's
|
||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
||||
*/
|
||||
constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
|
||||
constructor(
|
||||
url: string,
|
||||
target?: string,
|
||||
options?: string | InAppBrowserOptions
|
||||
) {
|
||||
try {
|
||||
|
||||
if (options && typeof options !== 'string') {
|
||||
options = Object.keys(options).map((key: string) => `${key}=${(<InAppBrowserOptions>options)[key]}`).join(',');
|
||||
options = Object.keys(options)
|
||||
.map(
|
||||
(key: string) => `${key}=${(options as InAppBrowserOptions)[key]}`
|
||||
)
|
||||
.join(',');
|
||||
}
|
||||
|
||||
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
window.open(url, target);
|
||||
console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
|
||||
|
||||
console.warn(
|
||||
'Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,20 +139,20 @@ export class InAppBrowserObject {
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
show(): void { }
|
||||
show(): void {}
|
||||
|
||||
/**
|
||||
* Closes the InAppBrowser window.
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
close(): void { }
|
||||
close(): void {}
|
||||
|
||||
/**
|
||||
* Hides an InAppBrowser window that is currently shown. Calling this has no effect
|
||||
* if the InAppBrowser was already hidden.
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
hide(): void { }
|
||||
hide(): void {}
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
@@ -132,7 +160,9 @@ export class InAppBrowserObject {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeScript(script: { file?: string, code?: string }): Promise<any> { return; }
|
||||
executeScript(script: { file?: string; code?: string }): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
@@ -140,7 +170,9 @@ export class InAppBrowserObject {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
insertCSS(css: { file?: string, code?: string }): Promise<any> { return; }
|
||||
insertCSS(css: { file?: string; code?: string }): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
@@ -149,10 +181,19 @@ export class InAppBrowserObject {
|
||||
*/
|
||||
@InstanceCheck()
|
||||
on(event: string): Observable<InAppBrowserEvent> {
|
||||
return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
return new Observable<InAppBrowserEvent>(
|
||||
(observer: Observer<InAppBrowserEvent>) => {
|
||||
this._objectInstance.addEventListener(
|
||||
event,
|
||||
observer.next.bind(observer)
|
||||
);
|
||||
return () =>
|
||||
this._objectInstance.removeEventListener(
|
||||
event,
|
||||
observer.next.bind(observer)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +237,6 @@ export class InAppBrowserObject {
|
||||
})
|
||||
@Injectable()
|
||||
export class InAppBrowser extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
||||
* @param url {string} The URL to load.
|
||||
@@ -206,8 +246,11 @@ export class InAppBrowser extends IonicNativePlugin {
|
||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
||||
* @returns {InAppBrowserObject}
|
||||
*/
|
||||
create(url: string, target?: string, options?: string | InAppBrowserOptions): InAppBrowserObject {
|
||||
create(
|
||||
url: string,
|
||||
target?: string,
|
||||
options?: string | InAppBrowserOptions
|
||||
): InAppBrowserObject {
|
||||
return new InAppBrowserObject(url, target, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, IonicNativePlugin, Cordova, CordovaProperty } from '@ionic-native/core';
|
||||
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ export interface IAPProductOptions {
|
||||
type: string;
|
||||
}
|
||||
|
||||
export type IAPProducts = Array<IAPProduct> & {
|
||||
export type IAPProducts = IAPProduct[] & {
|
||||
/**
|
||||
* Get product by ID
|
||||
*/
|
||||
@@ -383,7 +383,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
|
||||
* Add or register a product
|
||||
* @param product {IAPProductOptions}
|
||||
*/
|
||||
@Cordova({ sync: true})
|
||||
@Cordova({ sync: true })
|
||||
register(product: IAPProductOptions): void {}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
/* tslint:disable */
|
||||
/**
|
||||
* @name In App Review
|
||||
* @description
|
||||
@@ -25,6 +25,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
/* tslint:enable */
|
||||
@Plugin({
|
||||
pluginName: 'InAppReview',
|
||||
plugin: 'com.omarben.inappreview',
|
||||
@@ -34,7 +35,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class InAppReview extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Open the inApp review popup
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
@@ -43,5 +43,4 @@ export class InAppReview extends IonicNativePlugin {
|
||||
requestReview(): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaFunctionOverride,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IndexItem {
|
||||
@@ -16,7 +21,7 @@ export interface IndexItem {
|
||||
/**
|
||||
* Item keywords
|
||||
*/
|
||||
keywords?: Array<string>;
|
||||
keywords?: string[];
|
||||
|
||||
/**
|
||||
* Lifetime in minutes
|
||||
@@ -88,7 +93,7 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Returns if index set was successful
|
||||
*/
|
||||
@Cordova()
|
||||
setItems(items: Array<IndexItem>): Promise<any> {
|
||||
setItems(items: IndexItem[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +103,7 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Resolve if successful
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForDomains(domains: Array<string>): Promise<any> {
|
||||
clearItemsForDomains(domains: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,11 +113,11 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Resolve if successful
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
|
||||
clearItemsForIdentifiers(identifiers: string[]): 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.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Instagram
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
declare const window: any;
|
||||
|
||||
export interface IntelSecurityDataOptions {
|
||||
/** Non-empty string. **/
|
||||
/* Non-empty string. **/
|
||||
data: String;
|
||||
/** Tag text. */
|
||||
tag?: String;
|
||||
@@ -76,7 +76,6 @@ export interface IntelSecurityDataOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class IntelSecurity extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* returns an IntelSecurityStorage object
|
||||
* @type {IntelSecurityStorage}
|
||||
@@ -88,7 +87,6 @@ export class IntelSecurity extends IonicNativePlugin {
|
||||
* @type {IntelSecurityData}
|
||||
*/
|
||||
data: IntelSecurityData = new IntelSecurityData();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,14 +98,15 @@ export class IntelSecurity extends IonicNativePlugin {
|
||||
pluginRef: 'intel.security.secureData'
|
||||
})
|
||||
export class IntelSecurityData {
|
||||
|
||||
/**
|
||||
* This creates a new instance of secure data using plain-text data.
|
||||
* @param options {IntelSecurityDataOptions}
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
|
||||
*/
|
||||
* This creates a new instance of secure data using plain-text data.
|
||||
* @param options {IntelSecurityDataOptions}
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
createFromData(options: IntelSecurityDataOptions): Promise<Number> { return; }
|
||||
createFromData(options: IntelSecurityDataOptions): Promise<Number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This creates a new instance of secure data (using sealed data)
|
||||
@@ -116,7 +115,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
createFromSealedData(options: { sealedData: string }): Promise<Number> { return; }
|
||||
createFromSealedData(options: { sealedData: string }): Promise<Number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the plain-text data of the secure data instance.
|
||||
@@ -124,7 +125,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<string>} Returns a Promise that resolves to the data as plain-text, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getData(instanceID: Number): Promise<string> { return; }
|
||||
getData(instanceID: Number): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the sealed chunk of a secure data instance.
|
||||
@@ -132,7 +135,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to the sealed data, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getSealedData(instanceID: any): Promise<any> { return; }
|
||||
getSealedData(instanceID: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the tag of the secure data instance.
|
||||
@@ -140,7 +145,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<string>} Returns a Promise that resolves to the tag, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getTag(instanceID: any): Promise<string> { return; }
|
||||
getTag(instanceID: any): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the data policy of the secure data instance.
|
||||
@@ -148,7 +155,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<any>} Returns a promise that resolves to the policy object, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getPolicy(instanceID: any): Promise<any> { return; }
|
||||
getPolicy(instanceID: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns an array of the data owners unique IDs.
|
||||
@@ -156,7 +165,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<Array>} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getOwners(instanceID: any): Promise<Array<any>> { return; }
|
||||
getOwners(instanceID: any): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the data creator unique ID.
|
||||
@@ -164,7 +175,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<Number>} Returns a promsie that resolves to the creator's unique ID, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getCreator(instanceID: any): Promise<Number> { return; }
|
||||
getCreator(instanceID: any): Promise<Number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns an array of the trusted web domains of the secure data instance.
|
||||
@@ -172,7 +185,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<Array>} Returns a promise that resolves to a list of web owners, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
getWebOwners(instanceID: any): Promise<Array<any>> { return; }
|
||||
getWebOwners(instanceID: any): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This changes the extra key of a secure data instance. To successfully replace the extra key, the calling application must have sufficient access to the plain-text data.
|
||||
@@ -182,7 +197,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<any>} Returns a promise that resolves with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
changeExtraKey(options: any): Promise<any> { return; }
|
||||
changeExtraKey(options: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This releases a secure data instance.
|
||||
@@ -190,8 +207,9 @@ export class IntelSecurityData {
|
||||
* @returns {Promise<any>} Returns a promise that resovles with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
destroy(instanceID: any): Promise<any> { return; }
|
||||
|
||||
destroy(instanceID: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +221,6 @@ export class IntelSecurityData {
|
||||
pluginRef: 'intel.security.secureStorage'
|
||||
})
|
||||
export class IntelSecurityStorage {
|
||||
|
||||
/**
|
||||
* This deletes a secure storage resource (indicated by id).
|
||||
* @param options {Object}
|
||||
@@ -212,10 +229,9 @@ export class IntelSecurityStorage {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
delete(options: {
|
||||
id: string,
|
||||
storageType?: Number
|
||||
}): Promise<any> { return; }
|
||||
delete(options: { id: string; storageType?: Number }): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This reads the data from secure storage (indicated by id) and creates a new secure data instance.
|
||||
@@ -227,10 +243,12 @@ export class IntelSecurityStorage {
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
read(options: {
|
||||
id: string,
|
||||
storageType?: Number,
|
||||
extraKey?: Number
|
||||
}): Promise<Number> { return; }
|
||||
id: string;
|
||||
storageType?: Number;
|
||||
extraKey?: Number;
|
||||
}): Promise<Number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This writes the data contained in a secure data instance into secure storage.
|
||||
@@ -242,9 +260,10 @@ export class IntelSecurityStorage {
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
write(options: {
|
||||
id: String,
|
||||
instanceID: Number,
|
||||
storageType?: Number
|
||||
}): Promise<any> { return; }
|
||||
|
||||
id: String;
|
||||
instanceID: Number;
|
||||
storageType?: Number;
|
||||
}): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
|
||||
95
src/@ionic-native/plugins/janalytics/index.ts
Normal file
95
src/@ionic-native/plugins/janalytics/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name jAnalytics
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { JAnalytics } from '@ionic-native/JAnalytics';
|
||||
*
|
||||
*
|
||||
* constructor(private jAnalytics: JAnalytics) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.jAnalytics.functionName('Hello', 123)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'JAnalytics',
|
||||
plugin: 'cordova-plugin-janalytics',
|
||||
pluginRef: 'JAnalytics',
|
||||
repo: 'https://github.com/jpush/cordova-plugin-janalytics',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-janalytics --variable APP_KEY=YOUR_APP_KEY',
|
||||
installVariables: ['APP_KEY'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class JAnalytics extends IonicNativePlugin {
|
||||
/**
|
||||
* This function does something
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
init(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
initCrashHandler(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
stopCrashHandler(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
onPageStart(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
onPageEnd(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addCountEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addCalculateEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addLoginEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addRegisterEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addBrowseEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
addPurchaseEvent(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaCheck,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const cordova: any;
|
||||
@@ -44,12 +49,14 @@ export class JinsMeme extends IonicNativePlugin {
|
||||
* Must call this method first.
|
||||
* Sign up for an app ID (and get an app/client secret) at developers.jins.com
|
||||
*
|
||||
*@param {string} setAppClientID
|
||||
*@param {string} clientSecret
|
||||
*@returns {Promise<any>}
|
||||
* @param {string} setAppClientID
|
||||
* @param {string} clientSecret
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAppClientID(appClientId: string, clientSecret: string): Promise<any> { return; }
|
||||
setAppClientID(appClientId: string, clientSecret: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Starts scanning for JINS MEME.
|
||||
* @returns {Observable<any>}
|
||||
@@ -59,13 +66,17 @@ export class JinsMeme extends IonicNativePlugin {
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
})
|
||||
startScan(): Observable<any> { return; }
|
||||
startScan(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Stops scanning JINS MEME.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stopScan(): Promise<any> { return; }
|
||||
stopScan(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Establishes connection to JINS MEME.
|
||||
* @param {string} target
|
||||
@@ -76,29 +87,40 @@ export class JinsMeme extends IonicNativePlugin {
|
||||
})
|
||||
connect(target: string): Observable<any> {
|
||||
return new Observable<any>((observer: any) => {
|
||||
let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
|
||||
const data = cordova.plugins.JinsMemePlugin.connect(
|
||||
target,
|
||||
observer.next.bind(observer),
|
||||
observer.complete.bind(observer),
|
||||
observer.error.bind(observer)
|
||||
);
|
||||
return data;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set auto connection mode.
|
||||
*@param {Boolean} flag
|
||||
*@returns {Promise<any>}
|
||||
* @param {Boolean} flag
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAutoConnect(flag: boolean): Promise<any> { return; }
|
||||
setAutoConnect(flag: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns whether a connection to JINS MEME has been established.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
isConnected(): Promise<any> { return; }
|
||||
isConnected(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Disconnects from JINS MEME.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
disconnect(): Promise<any> { return; }
|
||||
disconnect(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Starts receiving realtime data.
|
||||
* @returns {Observable<any>}
|
||||
@@ -108,60 +130,80 @@ export class JinsMeme extends IonicNativePlugin {
|
||||
clearFunction: 'stopDataReport',
|
||||
clearWithArgs: true
|
||||
})
|
||||
startDataReport(): Observable<any> { return; }
|
||||
startDataReport(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Stops receiving data.
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
* Stops receiving data.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stopDataReport(): Promise<any> { return; }
|
||||
stopDataReport(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns SDK version.
|
||||
*
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSDKVersion(): Promise<any> { return; }
|
||||
getSDKVersion(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns JINS MEME connected with other apps.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getConnectedByOthers(): Promise<any> { return; }
|
||||
getConnectedByOthers(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns calibration status
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
isCalibrated(): Promise<any> { return; }
|
||||
isCalibrated(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns device type.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getConnectedDeviceType(): Promise<any> { return; }
|
||||
getConnectedDeviceType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns hardware version.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getConnectedDeviceSubType(): Promise<any> { return; }
|
||||
getConnectedDeviceSubType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns FW Version.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getFWVersion(): Promise<any> { return; }
|
||||
getFWVersion(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns HW Version.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getHWVersion(): Promise<any> { return; }
|
||||
getHWVersion(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Returns response about whether data was received or not.
|
||||
*@returns {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
isDataReceiving(): Promise<any> { return; }
|
||||
isDataReceiving(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* Keyboard plugin for Cordova.
|
||||
*
|
||||
* Requires Cordova plugin: `ionic-plugin-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/ionic-plugin-keyboard).
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-ionic-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/cordova-plugin-ionic-keyboard).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -20,54 +19,52 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* this.keyboard.show();
|
||||
*
|
||||
* this.keyboard.close();
|
||||
* this.keyboard.hide();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Keyboard',
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
repo: 'https://github.com/ionic-team/ionic-plugin-keyboard',
|
||||
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||
plugin: 'cordova-plugin-ionic-keyboard',
|
||||
pluginRef: 'window.Keyboard',
|
||||
repo: 'https://github.com/ionic-team/cordova-plugin-ionic-keyboard',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Keyboard extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Hide the keyboard accessory bar with the next, previous and done buttons.
|
||||
* @param hide {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
hideKeyboardAccessoryBar(hide: boolean): void { }
|
||||
hideFormAccessoryBar(hide: boolean): void {}
|
||||
|
||||
/**
|
||||
* Hide the keyboard if shown.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
hide(): void {}
|
||||
|
||||
/**
|
||||
* Force keyboard to be shown.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['Android']
|
||||
})
|
||||
show(): void { }
|
||||
show(): void {}
|
||||
|
||||
/**
|
||||
* Close the keyboard if open.
|
||||
* Programmatically set the resize mode
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS']
|
||||
})
|
||||
close(): void { }
|
||||
|
||||
/**
|
||||
* Prevents the native UIScrollView from moving when an input is focused.
|
||||
* @param disable {boolean}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Windows']
|
||||
})
|
||||
disableScroll(disable: boolean): void { }
|
||||
setResizeMode(): void {}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
|
||||
@@ -76,9 +73,24 @@ export class Keyboard extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardshow',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardShow(): Observable<any> { return; }
|
||||
onKeyboardShow(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard will show. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'keyboardWillShow',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardWillShow(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
|
||||
@@ -87,8 +99,22 @@ export class Keyboard extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardhide',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardHide(): Observable<any> { return; }
|
||||
onKeyboardHide(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard will hide. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'keyboardWillHide',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardWillHide(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user