Compare commits

..

53 Commits

Author SHA1 Message Date
Daniel
aad814fcf1 chore(): update changelog 2018-08-31 19:09:35 +02:00
Daniel
03d6b2373c 4.12.2 2018-08-31 19:09:24 +02:00
Daniel Kasper
d82e675442 fix(in-app-browser): fix mandatory options (#2684)
fix(in-app-browser): fix mandatory options
2018-08-31 19:05:33 +02:00
Daniel
1e84e23fd9 chore(): update changelog 2018-08-31 14:26:00 +02:00
Daniel
f3f12cb306 4.12.1 2018-08-31 14:25:53 +02:00
Daniel
b3bd0a83c7 chore(package): bump deps 2018-08-31 14:24:28 +02:00
rvdleun
03e4f0e439 feat(push): Added voip property to IOSPushOptions (#2681)
* feat(push): Added missing voip property to IOSPushOptions

* Update index.ts
2018-08-31 14:23:40 +02:00
Pandiarajan Nagarajan
a73146648f feat(aes256): Added new utility methods to generate secure key and secure IV (#2675) 2018-08-31 14:21:30 +02:00
Daniel Kasper
d90724ef70 feat(in-app-browser): Add missing InAppBrowserOptions-properties (#2669) 2018-08-31 14:21:19 +02:00
Brad Mallow
be0dc3dac4 fix(open-native-settings): allow supported input (#2666)
* allow supported input

* Update index.ts
2018-08-31 14:21:07 +02:00
Daniel
a0a64da518 chore(package): bump deps 2018-08-25 12:02:03 +02:00
somq
591ee87e05 feat(bluetooth-le): add bluetooth-le plugin (#2651)
* feat(bluetooth-le): implemented all available methods and refactored existing ones

* fix(bluetooth-le): Removed @memberof jsdoc annotations to avoid ci check failure

* fix(bluetooth-le): Fixed multiple jsdocs typos/misformats preventing CI to pass checks while generating readmes

* fix(bluetooth-le): Removed package-lock.json

* Update index.ts
2018-08-25 12:01:05 +02:00
Daniel
8db1dbef71 feat(http): add setSSLCertMode function 2018-08-21 20:39:21 +02:00
Daniel
73ae92d77c chore(): update changelog 2018-08-17 00:33:54 +02:00
Daniel
3c2753df64 4.12.0 2018-08-17 00:33:47 +02:00
Daniel
9035476833 chore(package): bump package-lock 2018-08-17 00:33:34 +02:00
Daniel
5f5e605e66 Merge remote-tracking branch 'origin/master' 2018-08-16 22:23:09 +02:00
Daniel
ea6746d134 chore(build): refactor 2018-08-16 22:23:03 +02:00
Daniel Sogl
753fa4a7a4 Update CHANGELOG.md 2018-08-16 22:19:18 +02:00
Daniel
ff784a4377 Auto stash before revert of "4.12.0" 2018-08-16 22:18:20 +02:00
Daniel
0764e28408 Revert "4.12.0"
This reverts commit 5825932e03.
2018-08-16 22:18:04 +02:00
Daniel
0197c88a03 chore(): update changelog 2018-08-16 22:10:36 +02:00
Daniel
5825932e03 4.12.0 2018-08-16 22:10:23 +02:00
Daniel
bccc8ac379 chore(package): update package-lock 2018-08-16 22:10:15 +02:00
Daniel
3eb382d438 chore(package): bump deps 2018-08-16 22:06:19 +02:00
Ashwin Dinesh
ca9a702808 feat(webengage): add optional config with initialization (#2637)
* feat(webengage): add optional config with initialization

* Update index.ts
2018-08-16 22:01:54 +02:00
Daniel Sogl
3f415f9bef fix(photo-library): interface missing includeVideos
Co-authored-by: @devdaddy 

closes: #2624
2018-08-16 21:58:30 +02:00
Luis Enrique Perez Alvarez
0c6d1eabe2 docs(onesignal): fix typo
OneSignla -> OneSignal
2018-08-16 21:56:11 +02:00
Niklas Merz
61fecf511b docs(firebase-dynamic-links): Change example (#2646)
* docs(firebase-dynamic-links): Change example

* Update index.ts
2018-08-16 21:55:59 +02:00
Daniel Ehrhardt
2ac52822b8 fix(extended-device-information): Fixed Memory Display Bug (#2641)
* Fixed Memory Display Bug with ExtendedDeviceInformation Plugin

* Update index.ts

* Update index.ts
2018-08-16 21:55:51 +02:00
rupendraa
229b62c10b feat(local-notifications): add new foreground property (#2633)
* Update index.ts

* Update index.ts
2018-08-16 21:55:17 +02:00
Gordeev Artem
9b4fd02fa5 feat(fabric): add fabric plugin (#2618)
* feat(fabric): add fabric plugin

* Update index.ts
2018-08-16 21:54:39 +02:00
Marat Dyatko
d10777a33b fix(network): bind listener to document instead of window (#2622)
We noticed that in some cases network state listeners are stopped triggering, but `navigator.onLine` still reflects the state correctly. I used the following code to debug and found out an issue with `window` and `document` difference:

```js
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
```

Also, according to plugin documentation, listeners should be bound to `document`: https://github.com/apache/cordova-plugin-network-information#offline
2018-08-01 04:41:51 -04:00
Daniel
4f26069ca6 chore(): update changelog 2018-07-29 10:05:10 +02:00
Daniel
40571e5c99 4.11.0 2018-07-29 10:04:57 +02:00
Daniel
83194f616b Revert "chore(package): upgrade fs-extra"
This reverts commit 4297c3d43e.
2018-07-29 09:59:53 +02:00
Daniel
b1f4df530a rerun build 2018-07-29 09:57:03 +02:00
Daniel
4297c3d43e chore(package): upgrade fs-extra 2018-07-29 09:52:36 +02:00
Daniel
95d495b468 chore(package): bump deps 2018-07-29 09:44:22 +02:00
Daniel
f0989d1b96 chore(package): upgrade to angular 5
BREAKING: Ionic Native v4 requires now Angular 5
2018-07-29 09:21:43 +02:00
Daniel
c113417878 docs(readme): update readme 2018-07-29 09:20:23 +02:00
Daniel
cedd6df423 Merge remote-tracking branch 'origin/master' 2018-07-29 09:16:11 +02:00
Daniel
4b14ce2eec refactor(http): change return type to any 2018-07-29 09:16:00 +02:00
pwilkniss
27d380ef4b feat(clevertap): add CleverTap plugin (#2609)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor
2018-07-29 09:13:37 +02:00
Ashwin Dinesh
bd5bd7ea9d feat(webengage): add webengage plugin (#2604)
* feat(webengage): add webengage plugin

* refactor
2018-07-29 09:11:05 +02:00
Jan Piotrowski
c6713862c5 refactor: Improve Ionic Native warnings (#2611)
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
2018-07-29 09:10:48 +02:00
Daniel
3b32e19bf1 feat(facebook): add getDeferredApplink function
closes: #2510
2018-07-29 09:10:17 +02:00
Daniel
4092831754 fix(http): add correct return types for downloadFile and uploadFile
closes: #2615
2018-07-29 08:57:16 +02:00
Daniel Sogl
c2fe5f8336 docs(contacts): mark as deprecated 2018-07-27 21:39:58 +02:00
Daniel
3f9067d090 chore(): update changelog 2018-07-25 12:57:52 +02:00
Daniel
36a4e81fe4 4.10.1 2018-07-25 12:57:38 +02:00
Gustavo Maximiliano Cortez
79cb478c26 fix(user-agent): Plugin not installed (#2607)
fix(user-agent): Plugin not installed
2018-07-24 16:59:19 +02:00
Dominik Geng
b635ba99ea fix(nfs): Optional arguments for records like textRecord (#2605)
fix(nfs): Optional arguments for records like textRecord
2018-07-24 16:59:02 +02:00
32 changed files with 6968 additions and 849 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ node_modules/
aot/
scripts/ionic-native-bower
dist/

View File

@@ -1,12 +1,97 @@
<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.12.2"></a>
## [4.12.2](https://github.com/ionic-team/ionic-native/compare/v4.12.1...v4.12.2) (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))

View File

@@ -1,6 +1,5 @@
[![Circle CI](https://circleci.com/gh/ionic-team/ionic-native.svg?style=shield)](https://circleci.com/gh/ionic-team/ionic-native) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@ionic-native/core.svg)
# 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.
![img](https://ionic-io-assets.s3.amazonaws.com/ionic-native-console.png)
## 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

View File

@@ -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');
}
});

View File

@@ -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);
};

4678
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,44 @@
{
"name": "ionic-native",
"version": "4.10.0",
"version": "4.12.2",
"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",
"conventional-changelog-cli": "^2.0.5",
"cz-conventional-changelog": "^2.1.0",
"dgeni": "0.4.7",
"dgeni-packages": "0.16.10",
"fs-extra": "2.0.0",
"fs-extra-promise": "0.4.1",
"gulp": "3.9.1",
"gulp-rename": "1.2.2",
"gulp-replace": "0.5.4",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "6.1.2",
"jasmine-core": "^2.99.1",
"karma": "^1.7.0",
"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.10",
"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",
"q": "^1.5.1",
"queue": "^4.5.0",
"rimraf": "^2.6.2",
"rxjs": "^5.5.12",
"semver": "^5.5.1",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "~2.4.2",

View File

@@ -1,4 +1,4 @@
"use strict";
'use strict';
// Node module dependencies
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
queue = require('queue'),
@@ -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),
@@ -87,7 +87,6 @@ const addPluginToQueue = pluginName => {
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
.then(() => fs.mkdirpAsync(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];
@@ -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.writeJsonAsync(
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!');
}
});

View File

@@ -1,11 +1,10 @@
"use strict";
'use strict';
// Node module dependencies
const fs = require('fs-extra-promise').useFs(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!');
}
});

View File

@@ -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);

View File

@@ -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';

View File

@@ -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 {

View File

@@ -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'
);
}
};

View File

@@ -12,20 +12,38 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* ```typescript
* import { AES256 } from '@ionic-native/aes-256';
*
*
* constructor(private aES256: AES256) { }
* private secureKey: string;
* private secureIV: string;
*
* 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;
}
}

File diff suppressed because it is too large Load Diff

View 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;
}
}

View File

@@ -306,6 +306,7 @@ export class ContactFindOptions implements IContactFindOptions {
* @description
* Access and manage Contacts on the device.
*
* @deprecated
* @usage
*
* ```typescript

View File

@@ -4,7 +4,11 @@ import { CordovaProperty, Plugin, IonicNativePlugin } 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;
}

View 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;
}
}

View File

@@ -2,11 +2,9 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } 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;
}
}

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -15,25 +15,42 @@ export interface InAppBrowserOptions {
clearcache?: 'yes';
/** 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.
@@ -54,7 +71,8 @@ export interface InAppBrowserOptions {
/** (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
*/

View File

@@ -17,7 +17,6 @@ export enum ELocalNotificationTriggerUnit {
}
export interface ILocalNotificationTrigger {
/** ***** FIX ***** */
/**
@@ -192,7 +191,6 @@ export interface ILocalNotificationProgressBar {
}
export interface ILocalNotification {
/**
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
* Default: 0
@@ -267,7 +265,7 @@ export interface ILocalNotification {
* the value of the key 1 will be used as the 'on' timing, the value of
* the key 2 will be used as the 'off' timing
*/
led?: {color: string, on: number, off: number} | any[] | boolean | string;
led?: { color: string; on: number; off: number } | any[] | boolean | string;
/**
* Notification priority.
@@ -396,8 +394,12 @@ export interface ILocalNotification {
* ANDROID ONLY
* Set the token for the media session
*/
mediaSession?: string;
mediaSession?: string;
/**
* Make this notification show when app in foreground.
*/
foreground?: boolean;
}
/**
@@ -458,7 +460,6 @@ export interface ILocalNotification {
})
@Injectable()
export class LocalNotifications extends IonicNativePlugin {
/**
* Schedules a single or multiple notifications
* @param options {Notification | Array<ILocalNotification>} optional
@@ -466,7 +467,7 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
schedule(options?: ILocalNotification | Array<ILocalNotification>): void {}
/**
* Updates a previously scheduled notification. Must include the id in the options parameter.
@@ -475,7 +476,7 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
update(options?: ILocalNotification): void { }
update(options?: ILocalNotification): void {}
/**
* Clears single or multiple notifications
@@ -483,14 +484,18 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise when the notification had been cleared
*/
@Cordova()
clear(notificationId: any): Promise<any> { return; }
clear(notificationId: any): Promise<any> {
return;
}
/**
* Clears all notifications
* @returns {Promise<any>} Returns a promise when all notifications have cleared
*/
@Cordova()
clearAll(): Promise<any> { return; }
clearAll(): Promise<any> {
return;
}
/**
* Cancels single or multiple notifications
@@ -498,14 +503,18 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise when the notification is canceled
*/
@Cordova()
cancel(notificationId: any): Promise<any> { return; }
cancel(notificationId: any): Promise<any> {
return;
}
/**
* Cancels all notifications
* @returns {Promise<any>} Returns a promise when all notifications are canceled
*/
@Cordova()
cancelAll(): Promise<any> { return; }
cancelAll(): Promise<any> {
return;
}
/**
* Checks presence of a notification
@@ -513,7 +522,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
isPresent(notificationId: number): Promise<boolean> { return; }
isPresent(notificationId: number): Promise<boolean> {
return;
}
/**
* Checks is a notification is scheduled
@@ -521,7 +532,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
isScheduled(notificationId: number): Promise<boolean> { return; }
isScheduled(notificationId: number): Promise<boolean> {
return;
}
/**
* Checks if a notification is triggered
@@ -529,28 +542,36 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
isTriggered(notificationId: number): Promise<boolean> { return; }
isTriggered(notificationId: number): Promise<boolean> {
return;
}
/**
* Get all the notification ids
* @returns {Promise<Array<number>>}
*/
@Cordova()
getIds(): Promise<Array<number>> { return; }
getIds(): Promise<Array<number>> {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<Array<number>> { return; }
getTriggeredIds(): Promise<Array<number>> {
return;
}
/**
* Get the ids of scheduled notifications
* @returns {Promise<Array<number>>} Returns a promise
*/
@Cordova()
getScheduledIds(): Promise<Array<number>> { return; }
getScheduledIds(): Promise<Array<number>> {
return;
}
/**
* Get a notification object
@@ -558,7 +579,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
get(notificationId: any): Promise<ILocalNotification> { return; }
get(notificationId: any): Promise<ILocalNotification> {
return;
}
/**
* Get a scheduled notification object
@@ -566,7 +589,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
getScheduled(notificationId: any): Promise<ILocalNotification> {
return;
}
/**
* Get a triggered notification object
@@ -574,42 +599,54 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
getTriggered(notificationId: any): Promise<ILocalNotification> {
return;
}
/**
* Get all notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<Array<ILocalNotification>> { return; }
getAll(): Promise<Array<ILocalNotification>> {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
getAllScheduled(): Promise<Array<ILocalNotification>> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
getAllTriggered(): Promise<Array<ILocalNotification>> {
return;
}
/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> { return; }
requestPermission(): Promise<boolean> {
return;
}
/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> { return; }
hasPermission(): Promise<boolean> {
return;
}
/**
* Adds a group of actions
@@ -618,7 +655,12 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addActions(groupId: any, actions: Array<ILocalNotificationAction>): Promise<any> { return; }
addActions(
groupId: any,
actions: Array<ILocalNotificationAction>
): Promise<any> {
return;
}
/**
* Removes a group of actions
@@ -626,7 +668,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
removeActions(groupId: any): Promise<any> { return; }
removeActions(groupId: any): Promise<any> {
return;
}
/**
* Checks if a group of actions is defined
@@ -634,7 +678,9 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<boolean>} Whether the group is defined
*/
@Cordova()
hasActions(groupId: any): Promise<boolean> { return; }
hasActions(groupId: any): Promise<boolean> {
return;
}
/**
* Gets the (platform specific) default settings.
@@ -643,7 +689,9 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
getDefaults(): Promise<any> { return; }
getDefaults(): Promise<any> {
return;
}
/**
* Overwrites the (platform specific) default settings.
@@ -652,7 +700,9 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
setDefaults(defaults: any): Promise<any> { return; }
setDefaults(defaults: any): Promise<any> {
return;
}
/**
* Sets a callback for a specific event
@@ -664,7 +714,9 @@ export class LocalNotifications extends IonicNativePlugin {
clearFunction: 'un',
clearWithArgs: true
})
on(eventName: string): Observable<any> { return; }
on(eventName: string): Observable<any> {
return;
}
/**
* Not an official interface, however its possible to manually fire events.
@@ -674,12 +726,14 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
fireEvent(eventName: string, args: any): void { }
fireEvent(eventName: string, args: any): void {}
/**
* Fire queued events once the device is ready and all listeners are registered.
* @returns {Promise<any>}
*/
@Cordova()
fireQueuedEvents(): Promise<any> { return; }
fireQueuedEvents(): Promise<any> {
return;
}
}

View File

@@ -89,7 +89,8 @@ export class Network extends IonicNativePlugin {
*/
@Cordova({
eventObservable: true,
event: 'offline'
event: 'offline',
element: document
})
onDisconnect(): Observable<any> {
return;
@@ -101,7 +102,8 @@ export class Network extends IonicNativePlugin {
*/
@Cordova({
eventObservable: true,
event: 'online'
event: 'online',
element: document
})
onConnect(): Observable<any> {
return;

View File

@@ -291,13 +291,13 @@ export class Ndef extends IonicNativePlugin {
record(tnf: number, type: number[] | string, id: number[] | string, payload: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
textRecord(text: string, languageCode: string, id: number[] | string): NdefRecord { return; }
textRecord(text: string, languageCode?: string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
uriRecord(uri: string, id: number[] | string): NdefRecord { return; }
uriRecord(uri: string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
absoluteUriRecord(uri: string, payload: number[] | string, id: number[] | string): NdefRecord { return; }
absoluteUriRecord(uri: string, payload: number[] | string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
mimeMediaRecord(mimeType: string, payload: string): NdefRecord { return; }

View File

@@ -700,7 +700,7 @@ export class OneSignal extends IonicNativePlugin {
}
/**
* Clears all OneSignla notifications
* Clears all OneSignal notifications
*/
@Cordova({ sync: true })
clearOneSignalNotifications(): void {}

View File

@@ -1,11 +1,11 @@
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Open Native Settings
* @description
* Plugin to open native screens of iOS/android settings
* @usage
* Plugin to open native screens of iOS/android settings
* @usage
* You can open any of these settings:
* ```
* "about", // ios
@@ -78,7 +78,7 @@ import { Injectable } from '@angular/core';
"wifi_ip", // android
"wifi", // ios, android
"wireless" // android
```
```
* ```typescript
* import { OpenNativeSettings } from '@ionic-native/open-native-settings';
*
@@ -99,13 +99,13 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class OpenNativeSettings extends IonicNativePlugin {
/**
* Opens a setting dialog
* @param setting {string} setting name
* @param setting {string|array} setting name
* @return {Promise<any>}
*/
@Cordova()
open(setting: string): Promise<any> { return; }
open(setting: string | [string, boolean]): Promise<any> {
return;
}
}

View File

@@ -252,6 +252,7 @@ export interface GetLibraryOptions {
chunkTimeSec?: number;
useOriginalFileNames?: boolean;
includeAlbumData?: boolean;
includeVideos?: boolean;
maxItems?: number;
}

View File

@@ -1,10 +1,12 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { checkAvailability, Cordova, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const window: any;
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
export type EventResponse = RegistrationEventResponse &
NotificationEventResponse &
Error;
export interface RegistrationEventResponse {
/**
@@ -13,7 +15,6 @@ export interface RegistrationEventResponse {
registrationId: string;
}
export interface NotificationEventResponse {
/**
* The text of the push message sent from the 3rd party service.
@@ -111,6 +112,13 @@ export interface IOSPushOptions {
* Action Buttons on iOS - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#action-buttons-1
*/
categories?: CategoryArray;
/**
* If true the device will be set up to receive VoIP Push notifications and the
* other options will be ignored since VoIP notifications are silent
* notifications that should be handled in the "notification" event.
*/
voip?: boolean | string;
}
export interface CategoryArray {
@@ -203,7 +211,6 @@ export interface BrowserPushOptions {
* Default: http://push.api.phonegap.com/v1/push Optional.
*/
pushServiceURL?: string;
}
export interface PushOptions {
@@ -314,7 +321,6 @@ export type PushEvent = string;
})
@Injectable()
export class Push extends IonicNativePlugin {
/**
* Init push notifications
* @param options {PushOptions}
@@ -329,7 +335,9 @@ export class Push extends IonicNativePlugin {
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
*/
@Cordova()
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
hasPermission(): Promise<{ isEnabled: boolean }> {
return;
}
/**
* Create a new notification channel for Android O and above.
@@ -338,7 +346,9 @@ export class Push extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
createChannel(channel?: Channel): Promise<any> { return; }
createChannel(channel?: Channel): Promise<any> {
return;
}
/**
* Delete a notification channel for Android O and above.
@@ -347,15 +357,18 @@ export class Push extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
deleteChannel(id?: string): Promise<any> { return; }
deleteChannel(id?: string): Promise<any> {
return;
}
/**
* Returns a list of currently configured channels.
* @return {Promise<Channel[]>}
*/
@Cordova()
listChannels(): Promise<Channel[]> { return; }
listChannels(): Promise<Channel[]> {
return;
}
}
/**
@@ -367,11 +380,12 @@ export class Push extends IonicNativePlugin {
pluginRef: 'PushNotification'
})
export class PushObject {
private _objectInstance: any;
constructor(options: PushOptions) {
if (checkAvailability('PushNotification', 'init', 'PushNotification') === true) {
if (
checkAvailability('PushNotification', 'init', 'PushNotification') === true
) {
this._objectInstance = window.PushNotification.init(options);
}
}
@@ -386,7 +400,9 @@ export class PushObject {
clearFunction: 'off',
clearWithArgs: true
})
on(event: PushEvent): Observable<EventResponse> { return; }
on(event: PushEvent): Observable<EventResponse> {
return;
}
/**
* The unregister method is used when the application no longer wants to receive push notifications.
@@ -394,7 +410,9 @@ export class PushObject {
* so you will need to re-register them if you want them to function again without an application reload.
*/
@CordovaInstance()
unregister(): Promise<any> { return; }
unregister(): Promise<any> {
return;
}
/**
* Set the badge count visible when the app is not running
@@ -407,13 +425,17 @@ export class PushObject {
@CordovaInstance({
callbackOrder: 'reverse'
})
setApplicationIconBadgeNumber(count?: number): Promise<any> { return; };
setApplicationIconBadgeNumber(count?: number): Promise<any> {
return;
}
/**
* Get the current badge count visible when the app is not running
* successHandler gets called with an integer which is the current badge count
*/
@CordovaInstance()
getApplicationIconBadgeNumber(): Promise<number> { return; }
getApplicationIconBadgeNumber(): Promise<number> {
return;
}
/**
* iOS only
@@ -424,13 +446,17 @@ export class PushObject {
@CordovaInstance({
callbackOrder: 'reverse'
})
finish(id?: string): Promise<any> { return; }
finish(id?: string): Promise<any> {
return;
}
/**
* Tells the OS to clear all notifications from the Notification Center
*/
@CordovaInstance()
clearAllNotifications(): Promise<any> { return; }
clearAllNotifications(): Promise<any> {
return;
}
/**
* The subscribe method is used when the application wants to subscribe a new topic to receive push notifications.
@@ -438,7 +464,9 @@ export class PushObject {
* @return {Promise<any>}
*/
@CordovaInstance()
subscribe(topic: string): Promise<any> { return; }
subscribe(topic: string): Promise<any> {
return;
}
/**
* The unsubscribe method is used when the application no longer wants to receive push notifications from a specific topic but continue to receive other push messages.
@@ -446,6 +474,7 @@ export class PushObject {
* @return {Promise<any>}
*/
@CordovaInstance()
unsubscribe(topic: string): Promise<any> { return; }
unsubscribe(topic: string): Promise<any> {
return;
}
}

View File

@@ -35,7 +35,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
@Plugin({
pluginName: 'UserAgent',
plugin: 'cordova-plugin-useragent',
pluginRef: 'plugins.useragent',
pluginRef: 'UserAgent',
repo: 'https://github.com/danielsogl/cordova-plugin-useragent',
platforms: ['Android', 'iOS']
})

View File

@@ -0,0 +1,197 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Webengage
* @description
* Ionic-Native wrapper that wraps Webengage Cordova plugin for Android and iOS
*
* @usage
* ```typescript
* import { Webengage, WebengageUser, WebengagePush, WebengageNotification } from '@ionic-native/webengage';
*
*
* constructor(private webengage: Webengage, private webengageUser: WebengageUser, private webengagePush: WebengagePush, private webengageNotification: WebengageNotification ) { }
*
* ...
*
* this.webengage.engage();
* ```
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage',
repo: 'https://github.com/WebEngage/cordova-plugin',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Webengage extends IonicNativePlugin {
/**
* Initializes WebEngage SDK
* @param {any} [config]
* @return {Promise<any>}
*/
@Cordova()
engage(config?: any): Promise<any> {
return;
}
/**
* Sets WebEngage SDK configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
/**
* Tracks event
* @param {string} eventName
* @param {any} [attributes]
* @return {Promise<any>}
*/
@Cordova()
track(eventName: string, attributes?: any): Promise<any> {
return;
}
/**
* Tracks screen
* @param {string} eventName
* @param {any} [screenData]
* @return {Promise<any>}
*/
@Cordova()
screen(screenName: string, screenData?: any): Promise<any> {
return;
}
}
/**
* @hidden
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.user'
})
@Injectable()
export class WebengageUser extends IonicNativePlugin {
/**
* Logs user in
* @param {string} userId
* @return {Promise<any>}
*/
@Cordova()
login(userId: string): Promise<any> {
return;
}
/**
* Logs user out
* @return {Promise<any>}
*/
@Cordova()
logout(): Promise<any> {
return;
}
/**
* Sets user attribute
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
setAttribute(key: string, value: any): Promise<any> {
return;
}
}
/**
* @hidden
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.push'
})
@Injectable()
export class WebengagePush extends IonicNativePlugin {
/**
* Callback function is invoked when a push notification is clicked
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onClick(callback: any): Promise<any> {
return;
}
/**
* Sets push notification configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
}
/**
* @hidden
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.notification'
})
@Injectable()
export class WebengageNotification extends IonicNativePlugin {
/**
* Callback function is invoked when a in-app notification is shown
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onShown(callback: any): Promise<any> {
return;
}
/**
* Callback function is invoked when a in-app notification is clicked
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onClick(callback: any): Promise<any> {
return;
}
/**
* Callback function is invoked when a in-app notification is dismissed
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onDismiss(callback: any): Promise<any> {
return;
}
/**
* Sets in-app notification configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
}