Compare commits

..
97 Commits
Author SHA1 Message Date
Daniel Sogl 6112d724f2 5.21.3 2020-02-10 19:48:42 +01:00
Daniel Sogl 2913a68d8f Revert "chore(package): compile with angular 9"
This reverts commit 2ad03fa89b.
2020-02-10 19:47:23 +01:00
Daniel Sogl 4d346437f0 Revert "chore(package): refresh package-lock"
This reverts commit 4c07af7782.
2020-02-10 19:47:15 +01:00
Daniel Sogl 904455df9e 5.21.2 2020-02-09 18:11:03 +01:00
Daniel Sogl cac9872796 5.21.1 2020-02-09 12:34:17 +01:00
Daniel Sogl d4465681cf chore(package): bump deps 2020-02-09 12:31:46 +01:00
Daniel Sogl fd3a8de693 5.21.0 2020-02-07 18:09:28 +01:00
Daniel Sogl 4c07af7782 chore(package): refresh package-lock 2020-02-07 18:07:07 +01:00
Daniel Sogl 2ad03fa89b chore(package): compile with angular 9 2020-02-07 18:03:59 +01:00
Daniel Sogl ed37c68990 chore(package): bump jest 2020-02-07 18:00:13 +01:00
Daniel Sogl 66da511526 chore(package): bump deps 2020-02-07 17:59:18 +01:00
chriswattandGitHub 817f0d11b9 fix(background-geolocation): change syncThreshold type to number (#3299)
https://github.com/mauron85/cordova-plugin-background-geolocation#API

The syncThreshold parameter type is Number
2020-02-07 17:54:22 +01:00
Cesar de la VegaandGitHub c8d3afc91d fix(purchases): update to cordova-plugin-purchases@1.0.4 (#3301) 2020-02-07 17:53:29 +01:00
SrinidhiandGitHub 3b18135ebf feat(unvired-cordova-sdk): add new property containing HTTP status code (#3302)
* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name

* feat(unvired-cordova-sdk): add method to get log file path

* feat(unvired-cordova-sdk): test push notifications

* fix(unvired-cordova-sdk): define return for logRead

* doc(unvired-cordova-sdk): remove mobile only restriction for some apis

* feat(unvired-cordova-sdk): add new property containing HTTP status code.
2020-02-07 17:52:28 +01:00
614ade447f feat(): angular ivy support (#3309)
* init

* cleanup packagelock

* testing

* chore(package): refresh package-lock.json

* updates

* chore(): fix builds

* chore(): rework package-lock

* chore(): lint

Co-authored-by: Daniel Sogl <daniel@sogls.de>
2020-02-07 17:51:47 +01:00
Daniel Sogl 1bcaa39ffd 5.20.0 2020-01-27 06:43:25 +01:00
Daniel Sogl 82939763ee chore(package): upgrate typedoc to 0.16 2020-01-27 06:40:43 +01:00
Daniel Sogl 15ed431819 chore(package): bump deps 2020-01-27 06:30:45 +01:00
7baeab9fee docs(smartlook): extended usage sample (#3278)
* docs(smartlook): expanded usage sample

* docs(smartlook) fixed lint error

* Update index.ts

Co-authored-by: Daniel Sogl <daniel@sogls.de>
2020-01-27 06:25:50 +01:00
jospeteandDaniel Sogl 41895c165c feat(wifiwizard2): add cordova-plugin-wifiwizard2 typescript definitions (#3288)
* feat(cordova-plugin-wifiwizard2): add cordova-plugin-wifiwizard2 plugin definitions

* fix ts-lint errors
2020-01-27 06:20:25 +01:00
Stéphane JAISandDaniel Sogl 80f4ced369 docs(wonderpush): update title and description (#3294) 2020-01-27 06:19:45 +01:00
Marc BornträgerandDaniel Sogl 95a67a813d feat(cordova-secure-storage-echo): add extra options interface (#3295) 2020-01-27 06:18:55 +01:00
Sefa IlkimenandDaniel Sogl 799cf94674 feat(http): update declaration for cordova plugin version 2.4.0 (#3298)
* feat(HTTP): update declaration for cordova plugin version 2.3.0

* feat(HTTP): update declaration for cordova plugin version 2.4.0
2020-01-27 06:18:05 +01:00
Antoine Brassard LaheyandDaniel Sogl 2b2eb88a64 docs(firebase-x): add /ngx to import in usage example (#3277)
The path used to import FirebaseX in the usage example is wrong, it should end with /ngx
2020-01-17 10:53:21 +01:00
Daniel Sogl 7cad3f350f 5.19.1 2020-01-03 19:56:45 +01:00
Daniel Sogl 4c8ec5d1fc chore(package): change changelog script name 2020-01-03 19:56:33 +01:00
Daniel Sogl 82b632d772 chore(package): bump deps 2020-01-03 19:54:35 +01:00
Tim BrustandDaniel Sogl 240feba76b fix(in-app-browser): adds missing customscheme type (#3276)
it also adds an overload to the `on` function to pass a generic string to support custom events.
2020-01-03 19:40:11 +01:00
kodolokandDaniel Sogl e55a1e1117 feat(firebase-x): add missing methods, parameter (#3273)
* feat(firebase-x): add colletion enable methods

add setCrashlyticsCollectionEnabled(), setPerformanceCollectionEnabled()

* feat(firebase-x): add parameter to logError

Add an optional stackTrace parameter to Crashlytics logError()

* fixed whitespace errors
2020-01-03 19:39:58 +01:00
Patrick BußmannandDaniel Sogl 8764440087 docs(sign-in-with-apple): updated documentation (#3270) 2020-01-03 19:39:48 +01:00
Daniel Sogl 07b958ac4e chore(): update changelog 2019-12-27 12:46:50 +01:00
Daniel Sogl dd39c2fa85 5.19.0 2019-12-27 12:46:27 +01:00
Daniel Sogl 515b82d634 chore(package): bump deps 2019-12-27 12:45:44 +01:00
rigelglenandDaniel Sogl ecb0bb22ed feat(cordova-plugin-mlkit-translate): Add plugin (#3261) 2019-12-27 12:33:04 +01:00
Tim BrustandDaniel Sogl 3f1fa37a8d feat(pdf-generator): add new pluign (#3268) 2019-12-27 12:09:44 +01:00
甘杨andDaniel Sogl a74c894064 feat(app-update): skip dialog boxes support (#3267) 2019-12-27 12:09:28 +01:00
AndreaandDaniel Sogl 4d7e937d7a feat(firebase-analytics): add resetAnalyticsData to firebase-analytics (#3264)
added resetAnalyticsData method to firebase-analytics plugin
2019-12-27 12:08:40 +01:00
Akshay DwivediandDaniel Sogl fc90795a2c feat(camera-preview):add getCameraCharacteristics (#3260)
* feat(camera-preview):add getCameraCharacteristics

added getCameraCharacteristics to get the characteristics of all available cameras. #3163

* Update index.ts
2019-12-27 12:07:47 +01:00
Akshay DwivediandDaniel Sogl 129ba4dbe2 feat(in-app-browser): add data in Event interface (#3258)
added data in Event interface for InApp Browser. fixes #3244
2019-12-27 12:07:26 +01:00
Venkadesh PandDaniel Sogl 8582fac076 feat(unvired-cordova-sdk): added demo mode login api (#3256)
* feat(unvired-cordova-sdk): added demo mode login api

* feat(unvired-cordova-sdk): added new properties for demo mode.
2019-12-27 12:07:08 +01:00
Daniel Sogl d0f665f6fc chore(): update changelog 2019-12-09 07:00:03 +01:00
Daniel Sogl 0254cf730e 5.18.0 2019-12-09 06:59:52 +01:00
Daniel Sogl 92a99145f8 chore(package): bump deps 2019-12-09 06:57:44 +01:00
Michael ReadandDaniel Sogl a22ee6ed2b feat(in-app-browser): add "beforeload" callback method (#3249)
* fix(in-app-browser): Added missing callback method on the "beforeload" event ([issue#3152](https://github.com/ionic-team/ionic-native/issues/3152))

* fix(in-app-browser): Missing "beforeload" callback method
2019-12-09 06:52:58 +01:00
Dallas JamesandDaniel Sogl 1aa89ae311 feat(ms-adal): add authentication settings (#3252) 2019-12-09 06:52:14 +01:00
SrinidhiandDaniel Sogl 6f4d23d072 doc(unvired-cordova-sdk): remove mobile only restriction for some of the apis (#3251)
* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name

* feat(unvired-cordova-sdk): add method to get log file path

* feat(unvired-cordova-sdk): test push notifications

* fix(unvired-cordova-sdk): define return for logRead

* doc(unvired-cordova-sdk): remove mobile only restriction for some apis
2019-12-09 06:51:34 +01:00
Dallas JamesandDaniel Sogl ecd451ceb3 fix(ms-adal): add missing "claims" parameter to "acquireTokenAsync" function (#3250)
* fix(ms-adal): add missing claims parameter

* add docs for new claims field
2019-12-09 06:50:40 +01:00
Sefa IlkimenandDaniel Sogl bddc221b60 feat(http): update declaration for cordova plugin version 2.3.0 (#3247)
BREAKING CHANGE: you have to update to cordova-plugin-advanced-http@2.3 or later
2019-12-09 06:49:15 +01:00
Patrick BußmannandDaniel Sogl 27e844cbc2 docs(image-picker): updated configuration (#3245) 2019-12-09 06:46:36 +01:00
Daniel Sogl b8695220ea chore(): update changelog 2019-11-26 17:11:35 +01:00
Daniel Sogl 364b30af59 5.17.1 2019-11-26 17:11:20 +01:00
Daniel Sogl 860d79828d chore(pacjage): bump deps 2019-11-26 17:11:11 +01:00
Daniel SoglandGitHub 9057dc2c93 fix(email-composer): Aligned function calls with Cordova plugin
Co-authored-by: ChelloApps<name@example.com>

closes: #3220
2019-11-26 17:05:56 +01:00
heremamitandDaniel Sogl 5223dc7dd5 docs(update): Preview any file import path (#3237)
updated documents to reflect correct import path
2019-11-26 17:03:46 +01:00
Akshay DwivediandDaniel Sogl bb77620d0d fix(purchases): changed optional parameter oldSku (#3238)
changed optional parameter oldSkus to comply with the updated plugin code
2019-11-26 17:03:34 +01:00
Mike HartingtonandGitHub b280ef4c55 Merge pull request #3240 from swernimo/master
fix(push): add showBadge to android channel
2019-11-26 09:10:05 -05:00
Sean Wernimont 8e79890251 fix(push): add showBadge to android channel 2019-11-25 15:35:55 -07:00
Daniel Sogl f4a4bb9e55 chore(): update changelog 2019-11-19 09:43:14 +01:00
Daniel Sogl d108776981 5.17.0 2019-11-19 09:43:01 +01:00
Daniel Sogl 8a65cc943a chore(package): bump deps 2019-11-19 09:40:33 +01:00
Akshay DwivediandDaniel Sogl d2e4d3e5ce feat(background-mode): add disableBatteryOptimizations function (#3235)
implemented disableBatteryOptimizations() method #3085
2019-11-19 09:36:31 +01:00
Akshay DwivediandDaniel Sogl 3440dca70f feat(facebook): add activateApp function (#3234)
Added facebook4 plugin's activateApp method to manually start capturing events #3218
2019-11-19 09:35:53 +01:00
Patrick BußmannandDaniel Sogl 499cc5c075 fix(file): Changed resolveLocalFileSystemURL to FileEntryCallback instead of EntryCallback (#3231) 2019-11-19 09:35:23 +01:00
viniciuscostassandDaniel Sogl f2961fb4bb fix(firebase-x): adjust typings (#3228)
* Update index.ts

Added description field to IChannelOptions object and changed vibration type to get a number array

* Update index.ts

Added description field to IChannelOptions object and changed vibration type to get a number array
2019-11-19 09:35:03 +01:00
RalphandDaniel Sogl 48082eeaef feat(cordova-plugin-fingerprint-aio): change interface to support v3.0.0 release of plugin update index.ts (#3227) 2019-11-19 09:34:04 +01:00
Marius BackesandDaniel Sogl 4c56d227a8 feat(sum-up): change affiliate key on runtime (#3223)
* feat(sum-up): change affiliate key on runtime

* Update index.ts
2019-11-19 09:33:38 +01:00
SnaiCrysandDaniel Sogl 2fd4885fb1 fix(firebase-x): update types to match cordova-plugin-firebasex 7.0.0 (#3226)
BREAKING CHANGE: update firebase-x-cordova plugin to version 7

* fix(firebase-x): update types to match cordova-plugin-firebasex 7.0.0

* fix(firebase-x): Add getAPNSToken(), add `onApnsTokenReceived()`

* Add getAPNSToken() plugin API method to get the APNS token on iOS.
* (iOS) Add `onApnsTokenReceived()` to register a callback function to be invoked when the APNS token is allocated.

* fix lint errors
2019-11-19 09:33:22 +01:00
domschmidtandDaniel Sogl 7d756394dd feat(printer): add v0.8.0 support (#3225)
Migrated interface to v0.8.0
Tested locally ok
2019-11-19 09:32:07 +01:00
SrinidhiandDaniel Sogl f4b03bcce4 feat(unvired-cordova-sdk): add method to get log file path (#3222)
* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name

* feat(unvired-cordova-sdk): add method to get log file path

* feat(unvired-cordova-sdk): test push notifications

* fix(unvired-cordova-sdk): define return for logRead
2019-11-19 09:30:17 +01:00
abhishekksanghvi1989andDaniel Sogl 01bfa5cc5e fix(push): add inline reply property (#3221) 2019-11-19 09:29:47 +01:00
Daniel Sogl 996bf00e85 chore(package): bump deps 2019-11-02 19:14:33 +01:00
Daniel Sogl 30360fe29d chore(): update changelog 2019-10-30 17:11:02 +01:00
Daniel Sogl 88bf517697 5.16.0 2019-10-30 17:10:56 +01:00
Daniel Sogl e6ac206b8d chore(package): bump deps 2019-10-30 17:10:40 +01:00
ivans4andDaniel Sogl 00ef998ee5 fix(bluetooth-le): add isConnectable to ScanParams interface (#3204) 2019-10-30 16:57:25 +01:00
daduryiandDaniel Sogl f81e181588 feat(cordova-plugin-getuisdk): Add GeTuiSdkPlugin plugin (#3212) 2019-10-30 16:56:50 +01:00
Slobodan StojanovićandDaniel Sogl 08332b7c02 feat(fcm): add getAPNSToken and hasPermission methods (#3211) 2019-10-30 16:56:23 +01:00
Rad AzzouzandDaniel Sogl 86cca49236 feat(pspdfkit-cordova): add PSPDFKit-Cordova plugin (#3210)
* feat(pspdfkit-cordova): add PSPDFKit-Cordova plugin

* Fix CI failure
2019-10-30 16:55:58 +01:00
Michael BandDaniel Sogl 2718bccccc Fix wrong import path in documentation (#3209) 2019-10-30 16:55:12 +01:00
SrinidhiandDaniel Sogl 042e36de08 feat(unvired-cordova-sdk): add methods to get and set log level and other functions. (#3207)
* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name
2019-10-30 16:54:54 +01:00
Patrick BußmannandDaniel Sogl ec933011e6 feat(sign-in-with-apple): Added Sign in with Apple (#3200)
* feat(Sign in with Apple): Added Sign in with Apple

* docs(Sign in with Apple): Updated interfaces to official ones
2019-10-30 16:54:14 +01:00
Nate ClarkandDaniel Sogl 2312665792 feat(cordova-plugin-discovery) add SSDP discovery plugin wrapper (#3194) 2019-10-30 16:51:10 +01:00
shubhamtewariandDaniel Sogl eae8c1000c feat(kommunicate): plugin for the kommunicate sdk (#3191)
* feat(kommunicate): create kommunicate plugin

* style(kommunicate): fix lint errors

* feat(kommunicate): add browser platform to
2019-10-30 16:50:54 +01:00
JuanmaandDaniel Sogl 509bd72dde feat(secure-storage-echo): added wrapper for newest plugin (#3190) 2019-10-30 16:49:28 +01:00
Daniel SoglandGitHub fe38903e4b chore(github): add publish action 2019-10-30 16:43:05 +01:00
Daniel Sogl 1ebf447240 chore(package): bump deps 2019-10-28 17:47:27 +01:00
Daniel SoglandGitHub 4788104931 chore(github): adjust node action 2019-10-23 15:51:42 +02:00
Daniel SoglandGitHub fdd38b97b6 chore(github): add node build action 2019-10-23 15:44:35 +02:00
Daniel Sogl 409a985142 chore(): update changelog 2019-10-18 16:08:54 +02:00
Daniel Sogl 8534061b2f 5.15.1 2019-10-18 16:08:48 +02:00
Daniel Sogl 275741faed chore(package): bump deps 2019-10-18 16:07:43 +02:00
jcesarmobileandDaniel Sogl 4c5d70eacd Revert "fix(barcode-scanner): add missing shouldAutorotate property (#3096)" (#3192)
This reverts commit 8ce541ff9a.
2019-10-18 07:14:30 +02:00
San LeenandDaniel Sogl 0b43c69993 fix(wechat): add missing cordova decorators (#3195)
fix wechat plugin
2019-10-18 07:13:51 +02:00
jing-zhouandDaniel Sogl fb5d47bff2 fix(alipay): adjust pay function properties (#3197)
* fix bug 'Success is not a function #158'
https://github.com/terikon/cordova-plugin-photo-library/issues/158

* alipay: add optional success, error callback
for pay()  method
2019-10-18 07:13:02 +02:00
Matt NetkowandDaniel Sogl 7033a1822e fix(keyboard): add missing CordovaProperty import (#3201) 2019-10-18 07:11:39 +02:00
Daniel SoglandGitHub a840a03e33 docs(secure-storage): replace deprecated repo with maintained repo
closes: #3157 #3125
2019-10-08 14:38:28 +02:00
Pavel KrohandDaniel Sogl fb540f7774 docs(smartlook): add iOS platform (#3196) 2019-10-08 12:12:33 +02:00
53 changed files with 12485 additions and 11187 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Readmes
run: npm run readmes
env:
CI: true
+38
View File
@@ -0,0 +1,38 @@
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Readmes
run: npm run readmes
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run shipit
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+3
View File
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
+2488 -1042
View File
File diff suppressed because it is too large Load Diff
+6006 -9625
View File
File diff suppressed because it is too large Load Diff
+28 -25
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "5.15.0",
"version": "5.21.3",
"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)",
@@ -18,48 +18,48 @@
"lint": "gulp lint",
"readmes": "gulp readmes",
"docs-json": "ts-node -P scripts/tsconfig.json scripts/docs-json",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"postchangelog": "git commit -am \"chore(): update changelog\"",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"shipit": "npm run build && npm run readmes && npm run npmpub"
},
"devDependencies": {
"@angular/common": "^8.2.9",
"@angular/compiler": "^8.2.9",
"@angular/compiler-cli": "^8.2.9",
"@angular/core": "^8.2.9",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "^8.2.14",
"@types/cordova": "0.0.34",
"@types/fs-extra": "^8.0.0",
"@types/jest": "^24.0.18",
"@types/lodash": "^4.14.141",
"@types/node": "^12.7.11",
"@types/rimraf": "^2.0.2",
"@types/webpack": "^4.39.2",
"ajv": "^6.10.2",
"@types/fs-extra": "^8.0.1",
"@types/jest": "^25.1.2",
"@types/lodash": "^4.14.149",
"@types/node": "^12.12.26",
"@types/rimraf": "^2.0.3",
"@types/webpack": "^4.41.6",
"ajv": "^6.11.0",
"async-promise-queue": "^1.0.5",
"conventional-changelog-cli": "^2.0.23",
"cz-conventional-changelog": "^3.0.2",
"conventional-changelog-cli": "^2.0.31",
"cz-conventional-changelog": "^3.1.0",
"dgeni": "^0.4.12",
"dgeni-packages": "0.16.10",
"fs-extra": "^8.1.0",
"gulp": "^4.0.2",
"gulp-rename": "^1.4.0",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "^8.1.4",
"jest": "^24.9.0",
"jest": "^25.1.0",
"lodash": "^4.17.15",
"minimist": "1.2.0",
"natives": "^1.1.6",
"rimraf": "^3.0.0",
"rxjs": "^6.5.3",
"ts-jest": "^24.1.0",
"ts-node": "^8.4.1",
"tslint": "^5.20.0",
"rimraf": "^3.0.2",
"rxjs": "^6.5.4",
"ts-jest": "^25.2.0",
"ts-node": "^8.6.2",
"tslint": "^5.20.1",
"tslint-ionic-rules": "0.0.21",
"typedoc": "^0.15.0",
"typedoc": "^0.16.9",
"typescript": "~3.5.3",
"typescript-tslint-plugin": "0.5.5",
"uglifyjs-webpack-plugin": "^2.2.0",
"unminified-webpack-plugin": "^2.0.0",
"webpack": "^4.41.0",
"webpack": "^4.41.5",
"winston": "^3.2.1",
"zone.js": "^0.9.1"
},
@@ -87,5 +87,8 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"tslib": "1.10.0"
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ export function getDecoratorArgs(decorator: any) {
const args = {};
properties.forEach(prop => {
let val;
let val: number | boolean;
switch (prop.initializer.kind) {
case ts.SyntaxKind.StringLiteral:
+13 -10
View File
@@ -1,29 +1,30 @@
import * as ts from 'typescript';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as ngc from '@angular/compiler-cli';
import * as rimraf from 'rimraf';
import { generateDeclarations } from './transpile';
import { clone } from 'lodash';
import { EmitFlags } from '@angular/compiler-cli';
import { EmitFlags, createCompilerHost, CompilerOptions, CompilerHost, createProgram } from '@angular/compiler-cli';
import { importsTransformer } from './transformers/imports';
import { pluginClassTransformer } from './transformers/plugin-class';
import { COMPILER_OPTIONS, PLUGIN_PATHS, ROOT } from './helpers';
export function getProgram(rootNames: string[] = createSourceFiles()) {
const options: ngc.CompilerOptions = clone(COMPILER_OPTIONS);
const options: CompilerOptions = clone(COMPILER_OPTIONS);
options.basePath = ROOT;
options.moduleResolution = ts.ModuleResolutionKind.NodeJs;
options.module = ts.ModuleKind.ES2015;
options.target = ts.ScriptTarget.ES5;
options.lib = ['dom', 'es2017'];
options.inlineSourceMap = true;
options.importHelpers = true;
options.inlineSources = true;
options.enableIvy = false;
delete options.baseUrl;
const host: ngc.CompilerHost = ngc.createCompilerHost({ options });
return ngc.createProgram({
const host: CompilerHost = createCompilerHost({ options });
return createProgram({
rootNames,
options,
host
@@ -34,8 +35,9 @@ export function getProgram(rootNames: string[] = createSourceFiles()) {
export function transpileNgxCore() {
getProgram([path.resolve(ROOT, 'src/@ionic-native/core/index.ts')]).emit({
emitFlags: EmitFlags.Metadata,
emitCallback: ({ program, writeFile, customTransformers, cancellationToken, targetSourceFile }) =>
program.emit(targetSourceFile, writeFile, cancellationToken, true, customTransformers)
emitCallback: ({ program, writeFile, customTransformers, cancellationToken, targetSourceFile }) => {
return program.emit(targetSourceFile, writeFile, cancellationToken, true, customTransformers);
}
});
}
@@ -57,10 +59,11 @@ export function generateDeclarationFiles() {
// remove reference to @ionic-native/core decorators
export function modifyMetadata() {
debugger;
PLUGIN_PATHS.map(p => p.replace(path.join(ROOT, 'src'), path.join(ROOT, 'dist')).replace('index.ts', 'ngx/index.metadata.json'))
.forEach(p => {
const content = fs.readJSONSync(p);
let _prop;
let _prop: { members: { [x: string]: any[]; }; };
for (const prop in content[0].metadata) {
_prop = content[0].metadata[prop];
removeIonicNativeDecorators(_prop);
@@ -78,7 +81,7 @@ export function modifyMetadata() {
function removeIonicNativeDecorators(node: any) {
if (node.decorators && node.decorators.length) {
node.decorators = node.decorators.filter((d, i) => d.expression.module !== '@ionic-native/core');
node.decorators = node.decorators.filter((d: { expression: { module: string; }; }) => d.expression.module !== '@ionic-native/core');
}
if (node.decorators && !node.decorators.length) delete node.decorators;
+19 -11
View File
@@ -1,8 +1,10 @@
import * as fs from 'fs-extra';
import { Application } from 'typedoc';
import { basename, dirname, resolve } from 'path';
import { Application } from 'typedoc';
import { runInNewContext } from 'vm';
import TypeDoc = require('typedoc');
interface Plugin {
packageName: string;
displayName: string;
@@ -19,9 +21,13 @@ interface Plugin {
const rootDir = resolve(__dirname, '../..');
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
const typedoc = new Application({
const typedoc = new Application();
typedoc.options.addReader(new TypeDoc.TSConfigReader());
typedoc.options.addReader(new TypeDoc.TypeDocReader());
typedoc.bootstrap({
mode: 'modules',
tsconfig: resolve(rootDir, 'tsconfig.json'),
ignoreCompilerErrors: true
});
@@ -46,7 +52,9 @@ async function generateTypedoc(root: string, outputPath = typedocTmp) {
function processPlugin(pluginModule): Plugin {
const pluginClass = pluginModule.children.find(isPlugin);
const decorator = getPluginDecorator(pluginClass);
const packageName = `@ionic-native/${basename(dirname(pluginModule.originalName))}`;
const packageName = `@ionic-native/${basename(
dirname(pluginModule.originalName)
)}`;
const displayName = getTag(pluginClass, 'name');
const usage = getTag(pluginClass, 'usage');
const description = getTag(pluginClass, 'description');
@@ -85,17 +93,17 @@ const getTag = (child: any, tagName: string): string => {
}
};
const isModule = (child: any): boolean =>
child.kind === 1;
const isModule = (child: any): boolean => child.kind === 1;
const isClass = (child: any): boolean =>
child.kind === 128;
const isClass = (child: any): boolean => child.kind === 128;
const isPlugin = (child: any): boolean =>
isClass(child) && hasTags(child) && Array.isArray(child.decorators) && child.decorators.some(d => d.name === 'Plugin');
isClass(child) &&
hasTags(child) &&
Array.isArray(child.decorators) &&
child.decorators.some(d => d.name === 'Plugin');
const hasPlugin = (child: any): boolean =>
child.children.some(isPlugin);
const hasPlugin = (child: any): boolean => child.children.some(isPlugin);
const hasTags = (child: any): boolean =>
child.comment && Array.isArray(child.comment.tags);
+3 -1
View File
@@ -37,6 +37,7 @@ const PLUGIN_PEER_DEPENDENCIES = {
rxjs: RXJS_VERSION
};
function getPackageJsonContent(name: string, peerDependencies = {}, dependencies = {}) {
return merge(PACKAGE_JSON_BASE, {
name: '@ionic-native/' + name,
@@ -64,8 +65,9 @@ function prepare() {
const pluginName = pluginPath.split(/[\/\\]+/).slice(-2)[0];
const packageJsonContents = getPackageJsonContent(pluginName, PLUGIN_PEER_DEPENDENCIES);
const dir = path.resolve(DIST, 'plugins', pluginName);
const ngxDir = path.join(dir, 'ngx');
writePackageJson(packageJsonContents, dir);
writePackageJson(packageJsonContents, ngxDir);
});
}
+16 -16
View File
@@ -2,24 +2,20 @@ import { checkAvailability } from './decorators/common';
import { get } from './util';
export class IonicNativePlugin {
static pluginName: string;
static pluginRef: string;
static plugin: string;
static repo: string;
static platforms: string[];
static install: string;
static pluginName = '';
static pluginRef = '';
static plugin = '';
static repo = '';
static platforms: string[] = [];
static install = '';
/**
* Returns a boolean that indicates whether the plugin is installed
* @return {boolean}
*/
static installed(): boolean {
return checkAvailability(this.pluginRef) === true;
const isAvailable = checkAvailability(this.pluginRef) === true;
return isAvailable;
}
/**
@@ -36,27 +32,31 @@ export class IonicNativePlugin {
* Returns the plugin's name
*/
static getPluginName(): string {
return this.pluginName;
const pluginName = this.pluginName;
return pluginName;
}
/**
* Returns the plugin's reference
*/
static getPluginRef(): string {
return this.pluginRef;
const pluginRef = this.pluginRef;
return pluginRef;
}
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string {
return this.plugin;
const plugin = this.plugin;
return plugin;
}
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] {
return this.platforms || [];
const platform = this.platforms;
return platform;
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* constructor(private alipay: Alipay) {
*
* //alipayOrder is a string that has been generated and signed by the server side.
* this.alipay.pay(alipayOrder)
* this.alipay.pay(alipayOrder, success, error)
* .then(result => {
* console.log(result); // Success
* })
@@ -44,7 +44,7 @@ export class Alipay extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
*/
@Cordova()
pay(order: string): Promise<any> {
pay(order: string, success?: (res?: any) => void, error?: (err?: any) => void): Promise<any> {
return;
}
}
@@ -2,9 +2,11 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppUpdateOptions {
authType: string;
authType?: string;
username?: string;
password?: string;
skipPromptDialog?: boolean;
skipProgressDialog?: boolean;
}
/**
@@ -404,7 +404,7 @@ export interface BackgroundGeolocationConfig {
*
* @default 100
*/
syncThreshold?: string;
syncThreshold?: number;
/**
* Optional HTTP headers sent along in HTTP request.
@@ -499,7 +499,7 @@ export declare enum BackgroundGeolocationIOSActivity {
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
*
* ```typescript
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation/ngx';
*
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
*
@@ -267,4 +267,13 @@ export class BackgroundMode extends IonicNativePlugin {
sync: true
})
unlock(): void {}
/**
* Disables battery optimazation mode for the app (android only)
*/
@Cordova({
platforms: ['Android'],
sync: true
})
disableBatteryOptimizations(): void {}
}
@@ -27,11 +27,6 @@ export interface BarcodeScannerOptions {
*/
disableSuccessBeep?: boolean;
/**
* Disable or enable Autorotate. Supported on IOS only.
*/
shouldAutorotate?: boolean;
/**
* Prompt text. Supported on Android only.
*/
@@ -60,22 +55,22 @@ export interface BarcodeScannerOptions {
export interface BarcodeScanResult {
format:
| 'QR_CODE'
| 'DATA_MATRIX'
| 'UPC_E'
| 'UPC_A'
| 'EAN_8'
| 'EAN_13'
| 'CODE_128'
| 'CODE_39'
| 'CODE_93'
| 'CODABAR'
| 'ITF'
| 'RSS14'
| 'RSS_EXPANDED'
| 'PDF_417'
| 'AZTEC'
| 'MSI';
| 'QR_CODE'
| 'DATA_MATRIX'
| 'UPC_E'
| 'UPC_A'
| 'EAN_8'
| 'EAN_13'
| 'CODE_128'
| 'CODE_39'
| 'CODE_93'
| 'CODABAR'
| 'ITF'
| 'RSS14'
| 'RSS_EXPANDED'
| 'PDF_417'
| 'AZTEC'
| 'MSI';
cancelled: boolean;
text: string;
}
@@ -121,11 +116,11 @@ export class BarcodeScanner extends IonicNativePlugin {
PHONE_TYPE: string;
SMS_TYPE: string;
} = {
TEXT_TYPE: 'TEXT_TYPE',
EMAIL_TYPE: 'EMAIL_TYPE',
PHONE_TYPE: 'PHONE_TYPE',
SMS_TYPE: 'SMS_TYPE'
};
TEXT_TYPE: 'TEXT_TYPE',
EMAIL_TYPE: 'EMAIL_TYPE',
PHONE_TYPE: 'PHONE_TYPE',
SMS_TYPE: 'SMS_TYPE'
};
/**
* Open the barcode scanner.
@@ -82,6 +82,8 @@ export interface ScanParams {
matchNum?: BluetoothMatchNum;
/** Defaults to All Matches. Available from API21 / API 23. (Android) */
callbackType?: BluetoothCallbackType;
/** True/false to show only connectable devices, rather than all devices ever seen, defaults to false (Windows) */
isConnectable?: boolean;
}
export interface NotifyParams {
@@ -487,4 +487,13 @@ export class CameraPreview extends IonicNativePlugin {
getHorizontalFOV(): Promise<any> {
return;
}
/**
* Get the characteristics of all available cameras
* @return {Promise<any>}
*/
@Cordova()
getCameraCharacteristics(): Promise<any> {
return;
}
}
@@ -70,9 +70,27 @@ export interface EmailComposerOptions {
* ...
*
*
* this.emailComposer.isAvailable().then((available: boolean) =>{
* this.emailComposer.getClients().then((apps: []) => {
* // Returns an array of configured email clients for the device
* });
*
* this.emailComposer.hasClient().then(app, (isValid: boolean) => {
* if (isValid) {
* // Now we know we have a valid email client configured
* // Not specifying an app will return true if at least one email client is configured
* }
* });
*
* this.emailComposer.hasAccount().then((isValid: boolean) => {
* if (isValid) {
* // Now we know we have a valid email account configured
* }
* });
*
* this.emailComposer.isAvailable().then(app, (available: boolean) => {
* if(available) {
* //Now we know we can send
* // Now we know we can send an email, calls hasClient and hasAccount
* // Not specifying an app will return true if at least one email client is configured
* }
* });
*
@@ -142,6 +160,68 @@ export class EmailComposer extends IonicNativePlugin {
return;
}
/**
* Verifies if an email account is configured on the device.
*
* @returns {Promise<any>} Resolves if available, rejects if not available
*/
@CordovaCheck()
hasAccount(): Promise<any> {
return getPromise<boolean>((resolve) => {
EmailComposer.getPlugin().hasAccount((result: boolean) => {
if (result) {
resolve(true);
} else {
resolve(false);
}
});
});
}
/**
* Verifies if a specific email client is installed on the device.
*
* @param {string} [app] App id or uri scheme.
* @returns {Promise<any>} Resolves if available, rejects if not available
*/
@CordovaCheck()
hasClient(app?: string): Promise<any> {
return getPromise<boolean>((resolve) => {
if (app) {
EmailComposer.getPlugin().hasClient(app, (result: boolean) => {
if (result) {
resolve(true);
} else {
resolve(false);
}
});
} else {
EmailComposer.getPlugin().getClients((apps: string[]) => {
resolve(apps.length && apps.length > 0);
});
}
});
}
/**
* Returns an array of email clients installed on the device.
*
* @returns {Promise<string[]>} Resolves if available, rejects if not available
*/
@CordovaCheck()
@Cordova({ platforms: ['Android'] })
getClients(): Promise<string[]> {
return getPromise<string[]>(resolve => {
EmailComposer.getPlugin().getClients((apps: any) => {
if (Object.prototype.toString.call(apps) === '[object String]') {
apps = [apps];
}
resolve(apps);
});
});
}
/**
* Verifies if sending emails is supported on the device.
*
@@ -150,24 +230,11 @@ export class EmailComposer extends IonicNativePlugin {
*/
@CordovaCheck()
isAvailable(app?: string): Promise<any> {
return getPromise<boolean>((resolve, reject) => {
if (app) {
EmailComposer.getPlugin().isAvailable(app, (isAvailable: boolean) => {
if (isAvailable) {
resolve();
} else {
reject();
}
return getPromise<boolean>((resolve) => {
Promise.all([this.hasAccount, this.hasClient(app)])
.then((results) => {
return resolve(results.length === 2 && results[0] && results[1]);
});
} else {
EmailComposer.getPlugin().isAvailable((isAvailable: boolean) => {
if (isAvailable) {
resolve();
} else {
reject();
}
});
}
});
}
@@ -306,4 +306,13 @@ export class Facebook extends IonicNativePlugin {
getDeferredApplink(): Promise<string> {
return;
}
/**
* Manually log activation events
* @returns {Promise<any>}
*/
@Cordova()
activateApp(): Promise<any> {
return;
}
}
+29
View File
@@ -47,6 +47,12 @@ export interface NotificationData {
* backend.registerToken(token);
* });
*
* this.fcm.hasPermission().then(hasPermission => {
* if (hasPermission) {
* console.log("Has permission!");
* }
* })
*
* this.fcm.unsubscribeFromTopic('marketing');
*
* ```
@@ -62,6 +68,16 @@ export interface NotificationData {
})
@Injectable()
export class FCM extends IonicNativePlugin {
/**
* Gets ios device's current APNS token
*
* @returns {Promise<string>} Returns a Promise that resolves with the APNS token
*/
@Cordova()
getAPNSToken(): Promise<string> {
return;
}
/**
* Gets device's current registration id
*
@@ -108,6 +124,19 @@ export class FCM extends IonicNativePlugin {
return;
}
/**
* Checking for permissions on iOS. On android, it always returns `true`.
*
* @returns {Promise<boolean | null>} Returns a Promise:
* - true: push was allowed (or platform is android)
* - false: push will not be available
* - null: still not answered, recommended checking again later.
*/
@Cordova()
hasPermission(): Promise<boolean | null> {
return;
}
/**
* Watch for incoming notifications
*
+2 -2
View File
@@ -66,13 +66,13 @@ export interface LocalFileSystem {
/**
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
* @param url A URL referring to a local file in a filesystem accessable via this API.
* @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
* @param successCallback A callback that is called to report the FileEntry to which the supplied URL refers.
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is
* denied.
*/
resolveLocalFileSystemURL(
url: string,
successCallback: EntryCallback,
successCallback: FileEntryCallback,
errorCallback?: ErrorCallback
): void;
@@ -3,29 +3,41 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface FingerprintOptions {
/**
* Key for platform keychain
* Title in biometric prompt (android only)
* @default {APP_NAME} Biometric Sign On
*/
clientId: string;
title?: string;
/**
* Secret password. Only for android
* Subtitle in biometric Prompt (android only)
* @default null
*/
clientSecret?: string;
subtitle?: string;
/**
* Disable 'use backup' option. Only for android (optional)
* Description in biometric Prompt
* @default null
*/
description?: string;
/**
* Title of fallback button.
* @default "Use Pin"
*/
fallbackButtonTitle?: string;
/**
* Title for cancel button on Android
* @default "Cancel"
*/
cancelButtonTitle?: string;
/**
* Disable 'use backup' option.
* @default false
*/
disableBackup?: boolean;
/**
* Title of fallback button. Only for iOS
*/
localizedFallbackTitle?: string;
/**
* Description in authentication dialogue. Only for iOS
*/
localizedReason?: string;
}
/**
@@ -42,12 +54,17 @@ export interface FingerprintOptions {
*
* ...
*
* this.faio.show().then((result: any) => console.log(result)).catch((error: any) => console.log(error));
*
* OR with options...
*
* this.faio.show({
* clientId: 'Fingerprint-Demo', //Android: Used for encryption. iOS: used for dialogue if no `localizedReason` is given.
* clientSecret: 'o7aoOMYUbyxaD23oFAnJ' //Necessary for Android encrpytion of keys. Use random secret key.
* disableBackup:true, //Only for Android(optional)
* localizedFallbackTitle: 'Use Pin', //Only for iOS
* localizedReason: 'Please authenticate' //Only for iOS
* title: 'Biometric Authentication', // (Android Only) | optional | Default: "<APP_NAME> Biometric Sign On"
* subtitle: 'Coolest Plugin ever' // (Android Only) | optional | Default: null
* description: 'Please authenticate' // optional | Default: null
* fallbackButtonTitle: 'Use Backup', // optional | When disableBackup is false defaults to "Use Pin".
* // When disableBackup is true defaults to "Cancel"
* disableBackup:true, // optional | default: false
* })
* .then((result: any) => console.log(result))
* .catch((error: any) => console.log(error));
@@ -65,6 +82,73 @@ export interface FingerprintOptions {
})
@Injectable()
export class FingerprintAIO extends IonicNativePlugin {
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_UNKNOWN_ERROR = -100;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_UNAVAILABLE = -101;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_AUTHENTICATION_FAILED = -102;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_SDK_NOT_SUPPORTED = -103;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_HARDWARE_NOT_SUPPORTED = -104;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_PERMISSION_NOT_GRANTED = -105;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_NOT_ENROLLED = -106;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_INTERNAL_PLUGIN_ERROR = -107;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_DISMISSED = -108;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_PIN_OR_PATTERN_DISMISSED = -109;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_SCREEN_GUARD_UNSECURED = -110;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_LOCKED_OUT = -111;
/**
* Convenience constant
* @type {number}
*/
BIOMETRIC_LOCKED_OUT_PERMANENT = -112;
/**
* Check if fingerprint authentication is available
* @return {Promise<any>} Returns a promise with result
@@ -90,4 +90,13 @@ export class FirebaseAnalytics extends IonicNativePlugin {
setCurrentScreen(name: string): Promise<any> {
return;
}
/**
* Clears all analytics data for this instance from the device and resets the app instance ID
* @return {Promise<void>} Returns a promise
*/
@Cordova({ sync: true })
resetAnalyticsData(): Promise<void> {
return;
}
}
+109 -47
View File
@@ -13,6 +13,11 @@ export interface IChannelOptions {
*/
name?: string;
/**
* Channel description. Default: empty string
*/
description?: string;
/**
* The sound to play once a push comes. Default value: 'default'
* Values allowed:
@@ -29,7 +34,7 @@ export interface IChannelOptions {
* Boolean - vibrate or not
* Array - vibration pattern - e.g. [500, 200, 500] - milliseconds vibrate, milliseconds pause, vibrate, pause, etc.
*/
vibration?: boolean;
vibration?: boolean | number[];
/**
* Whether to blink the LED
@@ -74,7 +79,7 @@ export interface IChannelOptions {
*
* @usage
* ```typescript
* import { FirebaseX } from '@ionic-native/firebase-x';
* import { FirebaseX } from '@ionic-native/firebase-x/ngx';
*
*
* constructor(private firebaseX: FirebaseX) { }
@@ -106,7 +111,7 @@ export interface IChannelOptions {
@Injectable()
export class FirebaseX extends IonicNativePlugin {
/**
* Get the device token.
* Get the current FCM token.
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
*/
@Cordova()
@@ -125,6 +130,29 @@ export class FirebaseX extends IonicNativePlugin {
return;
}
/**
* iOS only.
* Get the APNS token allocated for this app install.
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
*/
@Cordova()
getAPNSToken(): Promise<null | string> {
return;
}
/**
* iOS only.
* Registers a handler to call when the APNS token is allocated.
* This will be called once when remote notifications permission has been granted by the user at runtime.
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
onApnsTokenReceived(): Observable<any> {
return;
}
/**
* Registers a callback function to invoke when:
* - a notification or data message is received by the app
@@ -274,6 +302,26 @@ export class FirebaseX extends IonicNativePlugin {
return;
}
/**
* Enable/disable Crashlytics collection.
* @param {boolean} enabled
* @returns {Promise<any>}
*/
@Cordova()
setCrashlyticsCollectionEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Enable/disable performance collection.
* @param {boolean} enabled
* @returns {Promise<any>}
*/
@Cordova()
setPerformanceCollectionEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Log an event using Analytics
* @param {string} type
@@ -359,72 +407,86 @@ export class FirebaseX extends IonicNativePlugin {
* The error message will appear in the Logs section of the non-fatal error event.
* Also logs the error message to the native device console.
* @param {string} error
* @param {object} (optional) a stack trace generated by stacktrace.js
* @return {Promise<any>}
*/
@Cordova()
logError(error: string): Promise<any> {
logError(error: string, stackTrace?: object): Promise<any> {
return;
}
/**
* Request a verification ID and send a SMS with a verification code. Use them to construct a credential to sign in the user (in your app).
* Requests verification of a phone number in order to authenticate a user and sign then into Firebase in your app.
*
* More info:
* https://github.com/dpa99c/cordova-plugin-firebasex#verifyphonenumber
* https://firebase.google.com/docs/auth/android/phone-auth
* https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithCredential
* https://firebase.google.com/docs/reference/js/firebase.User#linkWithCredential
* NOTE: This will only work on physical devices with a SIM card (not iOS Simulator or Android Emulator)
*
* NOTE: This will only work on physical devices.
* In response to your request, you'll receive a verification ID which you can use in conjunction with the verification code
* to sign the user in.
*
* iOS will return: credential (string)
* On iOS and some Android devices, the user will receive and SMS containing the verification code which they must manually enter
* into your app.
*
* Android will return:
* credential.verificationId (object and with key verificationId)
* credential.instantVerification (boolean) credential.code (string)
* (note that this key only exists if instantVerification is true)
* Some Android devices support "instant verfication", in which case an SMS will not be send and you will be returned
* the verification code along with the verification ID. In this case, the user doesn't need to do anything in order for you
* to sign them in.
*
* You need to use device plugin in order to access the right key.
* IMPORTANT NOTE: Android supports auto-verify and instant device verification.
* Therefore in that case it doesn't make sense to ask for an sms code as you won't receive one.
* In this case you'll get a credential.verificationId and a credential.code where code is the auto received verification code
* that would normally be sent via sms. To log in using this procedure you must pass this code to
* PhoneAuthProvider.credential(verificationId, code). You'll find an implementation example further below.
* @param {function} success - callback function to pass {object} credentials to as an argument
* @param {function} error - callback function which will be passed a {string} error message as an argument
* @param {string} phoneNumber - phone number to verify
* @param {integer} timeOutDuration - (optional) time to wait in seconds before timing out
* @param {string} fakeVerificationCode - (optional) to test instant verification on Android ,specify a fake verification code to return for whitelisted phone numbers.
*
* When using node.js Firebase Admin-SDK, follow this tutorial:
* https://firebase.google.com/docs/auth/admin/create-custom-tokens
*
* Pass back your custom generated token and call
* firebase.auth().signInWithCustomToken(customTokenFromYourServer);
* instead of
* firebase.auth().signInWithCredential(credential)
*
* YOU HAVE TO COVER THIS PROCESS, OR YOU WILL HAVE ABOUT 5% OF USERS STICKING ON YOUR SCREEN, NOT RECEIVING ANYTHING
* If this process is too complex for you, use this awesome plugin
* https://github.com/chemerisuk/cordova-plugin-firebase-authentication
* It's not perfect but it fits for the most use cases and doesn't require calling your endpoint, as it has native phone auth support.
*
* Android
* To use this auth you need to configure your app SHA hash in the android app configuration in the firebase console.
* See https://developers.google.com/android/guides/client-auth to know how to get SHA app hash.
*
* iOS
* Setup your push notifications first, and verify that they are arriving on your physical device before you test this method.
* Use the APNs auth key to generate the .p8 file and upload it to firebase. When you call this method,
* FCM sends a silent push to the device to verify it.
*
* @param {string} phoneNumber The phone number, including '+' and country code
* @param {number} timeoutDuration (Android only) The timeout in sec - no more SMS will be sent to this number until this timeout expires
* @returns {Promise<any>}
* The success callback will be passed a credential object with the following properties:
* instantVerification {boolean} - true if the Android device supports instant verification, in which case the verification code will be included in the credential object. If this is false, the device will be sent an SMS containing the verification code for the user to manually enter into your app. Always false on iOS.
* verificationId {string} - the verification ID you'll need to pass along with the verification code to sign the user in. Always returned on both Android & iOS.
* code {string} - verification code. Will only be present if instantVerification is true. Always undefined on iOS.
*/
@Cordova()
verifyPhoneNumber(
success: (value: string | object) => void,
error: (err: string) => void,
phoneNumber: string,
timeoutDuration = 0
): Promise<any> {
return;
}
/**
* Signs the user into Firebase with credentials obtained using verifyPhoneNumber().
* See the Android- and iOS-specific Firebase documentation for more info.
* @param {string} verificationId - the verification ID returned in the credentials object to the verifyPhoneNumber() success callback.
* @param {string} code - the activation code, either returned in the credentials object to the verifyPhoneNumber() success callback if using Instant Verification on Android, or the activation code as entered by the user from the received SMS message.
* @param {function} success - callback function to call on successful sign-in using credentials
* @param {function} error - callback function which will be passed a {string} error message as an argument
*/
@Cordova()
signInWithCredential(
verificationId: string,
code: string,
success: () => void,
error: (err: string) => void
): Promise<any> {
return;
}
/**
* Links the user account to an existing Firebase user account with credentials obtained using verifyPhoneNumber().
* See the Android- and iOS-specific Firebase documentation for more info.
* @param {string} verificationId - the verification ID returned in the credentials object to the verifyPhoneNumber() success callback.
* @param {string} code - the activation code, either returned in the credentials object to the verifyPhoneNumber() success callback if using Instant Verification on Android, or the activation code as entered by the user from the received SMS message.
* @param {function} success - callback function to call on successful sign-in using credentials
* @param {function} error - callback function which will be passed a {string} error message as an argument
*/
@Cordova()
linkUserWithCredential(
verificationId: string,
code: string,
success: () => void,
error: (err: string) => void
): Promise<any> {
return;
}
/**
* Fetch Remote Config parameter values for your app.
* @param {number} cacheExpirationSeconds specify the cacheExpirationSeconds
@@ -0,0 +1,64 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Ge Tui Sdk Plugin
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { GeTuiSdkPlugin } from '@ionic-native/ge-tui-sdk-plugin';
*
*
* constructor(private geTuiSdkPlugin: GeTuiSdkPlugin) { }
*
* this.geTuiSdkPlugin.callback_init((res) => { console.log(res)});
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
* this.geTuiSdkPlugin.initialize();
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
* this.geTuiSdkPlugin.getClientId();
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
* this.geTuiSdkPlugin.getVersion();
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'GeTuiSdkPlugin',
plugin: 'cordova-plugin-getuisdk',
pluginRef: 'GeTuiSdkPlugin',
repo: 'git@github.com:GetuiLaboratory/cordova-plugin-getuisdk.git',
install: 'cordova plugin add cordova-plugin-getuisdk --variable PUSH_APPID=your appid --variable PUSH_APPKEY=your appkey --variable PUSH_APPSECRET=your appsecret',
installVariables: ['PUSH_APPID', 'PUSH_APPKEY', 'PUSH_APPSECRET'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class GeTuiSdkPlugin extends IonicNativePlugin {
@Cordova()
callback_init(callback: Function): Promise<any> {
return;
}
@Cordova({
sync: true,
})
initialize() {
return;
}
@Cordova()
getClientId(): Promise<string> {
return;
}
@Cordova()
getVersion(): Promise<string> {
return;
}
}
+68 -33
View File
@@ -1,15 +1,15 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface HTTPResponse {
/**
* The status number of the response
* The HTTP status number of the response or a negative internal error code.
*/
status: number;
/**
* The headers of the response
* The headers of the response.
*/
headers: any;
headers: {[ key: string ]: string };
/**
* The URL of the response. This property will be the final URL obtained after any redirects.
*/
@@ -30,8 +30,9 @@ export interface HTTPResponse {
* Cordova / Phonegap plugin for communicating with HTTP servers. Supports iOS and Android.
*
* Advantages over Javascript requests:
* - Background threading - all requests are done in a background thread
* - SSL Pinning
* - SSL / TLS Pinning
* - CORS restrictions do not apply
* - Handling of HTTP code 401 - read more at [Issue CB-2415](https://issues.apache.org/jira/browse/CB-2415)
*
* @usage
* ```typescript
@@ -70,6 +71,21 @@ export interface HTTPResponse {
})
@Injectable()
export class HTTP extends IonicNativePlugin {
/**
* This enum represents the internal error codes which can be returned in a HTTPResponse object.
* @readonly
*/
@CordovaProperty()
readonly ErrorCode: {
GENERIC: number;
SSL_EXCEPTION: number;
SERVER_NOT_FOUND: number;
TIMEOUT: number;
UNSUPPORTED_URL: number;
NOT_CONNECTED: number;
POST_PROCESSING_FAILED: number;
};
/**
* This returns an object representing a basic HTTP Authorization header of the form.
* @param username {string} Username
@@ -118,11 +134,12 @@ export class HTTP extends IonicNativePlugin {
}
/**
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
* @param serializer {string} The name of the serializer. Can be urlencoded, utf8 or json
* Set the data serializer which will be used for all future POST, PUT and PATCH requests. Takes a string representing the name of the serializer.
* @param serializer {string} The name of the serializer.
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setdataserializer
*/
@Cordova({ sync: true })
setDataSerializer(serializer: string): void {}
setDataSerializer(serializer: 'urlencoded' | 'json' | 'utf8' | 'multipart' | 'raw'): void {}
/**
* Add a custom cookie.
@@ -172,26 +189,32 @@ export class HTTP extends IonicNativePlugin {
setRequestTimeout(timeout: number): void {}
/**
* Set SSL Cert handling mode, being one of the following values
* default: default SSL cert handling using system's CA certs
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android)
* 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' | 'legacy' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
* Resolve if it should follow redirects automatically.
* @returns {boolean} returns true if it is configured to follow redirects automatically
*/
@Cordova()
setSSLCertMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
@Cordova({ sync: true })
getFollowRedirect(): boolean {
return;
}
/**
* Disable following redirects automatically.
* @param disable {boolean} Set to true to disable following redirects automatically
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
* Configure if it should follow redirects automatically.
* @param follow {boolean} Set to false to disable following redirects automatically
*/
@Cordova({ sync: true })
setFollowRedirect(follow: boolean): void {}
/**
* Set server trust mode, being one of the following values:
* default: default SSL trustship and hostname verification handling using system's CA certs;
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android);
* nocheck: disable SSL certificate checking and hostname verification, trusting all certs (meant to be used only for testing purposes);
* pinned: trust only provided certificates;
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setservertrustmode
* @param {string} mode server trust mode
*/
@Cordova()
disableRedirect(disable: boolean): Promise<void> {
setServerTrustMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
return;
}
@@ -200,7 +223,7 @@ 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
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
post(url: string, body: any, headers: any): Promise<HTTPResponse> {
@@ -212,7 +235,7 @@ export class HTTP extends IonicNativePlugin {
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
@@ -224,7 +247,7 @@ 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
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
put(url: string, body: any, headers: any): Promise<HTTPResponse> {
@@ -236,7 +259,7 @@ 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
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
patch(url: string, body: any, headers: any): Promise<HTTPResponse> {
@@ -248,7 +271,7 @@ export class HTTP extends IonicNativePlugin {
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
@@ -260,13 +283,25 @@ export class HTTP extends IonicNativePlugin {
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make an OPTIONS request
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
options(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
*
* @param url {string} The url to send the request to
@@ -274,7 +309,7 @@ export class HTTP extends IonicNativePlugin {
* @param headers {Object} The headers to set for this request
* @param filePath {string} The local path(s) of the file(s) to upload
* @param name {string} The name(s) of the parameter to pass the file(s) along as
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
* @returns {Promise<any>} returns a FileEntry promise that will resolve on success, and reject on failure
*/
@Cordova()
uploadFile(url: string, body: any, headers: any, filePath: string | string[], name: string | string[]): Promise<any> {
@@ -287,7 +322,7 @@ export class HTTP extends IonicNativePlugin {
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @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
* @returns {Promise<any>} returns a FileEntry promise that will resolve on success, and reject on failure
*/
@Cordova()
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<any> {
@@ -308,16 +343,16 @@ export class HTTP extends IonicNativePlugin {
* @param options.name {string} name(s) to be used during upload see uploadFile for detailed information
* @param options.responseType {string} response type, defaults to text
*
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
sendRequest(
url: string,
options: {
method: 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'upload' | 'download';
method: 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'options' | 'upload' | 'download';
data?: { [index: string]: any };
params?: { [index: string]: string | number };
serializer?: 'json' | 'urlencoded' | 'utf8';
serializer?: 'json' | 'urlencoded' | 'utf8' | 'multipart';
timeout?: number;
headers?: { [index: string]: string };
filePath?: string | string[];
@@ -12,6 +12,7 @@ export interface ImagePickerOptions {
* Max width to allow images to be
*/
width?: number;
/**
* Max height to allow images to be
*/
@@ -22,6 +23,21 @@ export interface ImagePickerOptions {
*/
quality?: number;
/**
* Videos allowed?
*/
allow_video?: boolean;
/**
* the default is the message of the old plugin impl
*/
title?: string;
/**
* the old plugin impl didn't have it, so passing null by default
*/
message?: string;
/**
* Choose the format of the return value.
* Defined in ImagePicker.OutputType. Default is FILE_URI.
@@ -29,6 +45,11 @@ export interface ImagePickerOptions {
* DATA_URL : 1, Return image as base64-encoded string
*/
outputType?: number;
/**
* Disable the iOS popover as seen on iPad
*/
disable_popover?: boolean;
}
export enum OutputType {
@@ -123,17 +123,19 @@ export interface InAppBrowserOptions {
[key: string]: any;
}
export type InAppBrowserEventType = 'loadstart' | 'loadstop' | 'loaderror' | 'exit' | 'beforeload' | 'message';
export type InAppBrowserEventType = 'loadstart' | 'loadstop' | 'loaderror' | 'exit' | 'beforeload' | 'message' | 'customscheme';
export interface InAppBrowserEvent extends Event {
/** the event name */
type: InAppBrowserEventType;
type: string;
/** the URL that was loaded. */
url: string;
/** the error code, only in the case of loaderror. */
code: number;
/** the error message, only in the case of loaderror. */
message: string;
/** the postMessage data, only in the case of message. */
data: any;
}
/**
@@ -178,6 +180,13 @@ export class InAppBrowserObject {
}
}
/**
* Method to be called after the "beforeload" event to continue the script
* @param strUrl {String} The URL the InAppBrowser should navigate to.
*/
@CordovaInstance({ sync: true })
_loadAfterBeforeload(strUrl: string): void {}
/**
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
* if the InAppBrowser was already visible.
@@ -239,6 +248,28 @@ export class InAppBrowserObject {
}
);
}
/**
* A method that allows you to listen to events happening in the browser.
* @param event {string} Name of the event
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
*/
@InstanceCheck()
on(event: string): Observable<InAppBrowserEvent> {
return new Observable<InAppBrowserEvent>(
(observer: Observer<InAppBrowserEvent>) => {
this._objectInstance.addEventListener(
event,
observer.next.bind(observer)
);
return () =>
this._objectInstance.removeEventListener(
event,
observer.next.bind(observer)
);
}
);
}
}
/**
+1 -1
View File
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, CordovaProperty, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export enum KeyboardStyle {
@@ -0,0 +1,167 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Kommunicate
* @description
* The plugin for the Kommunicate SDK.
* With the help of this plugin, you can easily add human + bot chat support functionality to you app.
* Refer to: TODO: insert site link
* For documentation: TODO: insert link
*
* @usage
* ```typescript
* import { Kommunicate } from '@ionic-native/Kommunicate';
*
* constructor(private kommunicate: Kommunicate) { }
* //also add [..., Kommunicate, ... ] inside the providers array, if required
*
* var kmUser = {
* userId : 'randomstring',
* authenticationTypeId : 1
* };
*
* this.kommunicate.login(kmUser)
* .then((res: any) => console.log("Sucessfully logged in." + res))
* .catch((error: any) => console.error("Error logging in." + error));
*
* var conversationObject = {
* isUnique : false
* };
*
* this.kommunicate.conversationBuilder(converationObject)
* .then((clientChannelKey: any) => console.log("Kommunicate create conversation successful the clientChannelKey is : " + clientChannelKey))
* .catch((error: any) => console.error("Error creating conversation." + error));
*
* ```
*/
@Plugin({
pluginName: 'Kommunicate',
plugin: 'kommunicate-cordova-plugin',
pluginRef: 'kommunicate',
repo: 'https://github.com/Kommunicate-io/Kommunicate-Cordova-Ionic-PhoneGap-Chat-Plugin',
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class Kommunicate extends IonicNativePlugin {
/**
* Login the user with the details passed in
* Creates a new user with the details provided there is no existing user
*
* var kmUser = {
* 'userId' : 'userId', //Replace it with the userId of the logged in user
* 'password' : 'password', //replace with password
* 'authenticationTypeId' : 1,
* 'imageLink' : <image-link-for-user>
* 'applicationId' : '<APP_ID>', //replace this with your APP_ID from Applozic Dashboard
* 'deviceApnsType' : 0 //Set 0 for Development and 1 for Distribution (Release)
* };
*
* @param kmUser {any} the user details
* @return {Promise<any>} Returns a promise
*/
@Cordova()
login(kmUser: any): Promise<any> { return; }
/**
* Register for push notification
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
registerPushNotification(): Promise<any> { return; }
/**
* Check if any user is logged in or not
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
isLoggedIn(): Promise<any> { return; }
/**
* Update the token for push notifications
*
* @param token {string} the user details
* @return {Promise<any>} Returns a promise
*/
@Cordova()
updatePushNotificationToken(token: string): Promise<any> { return; }
/**
* Launch the conversation screen (it contains all the existing conversations)
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
launchConversation(): Promise<any> { return; }
/**
* Launch the conversation identified by the given channel(conversation) key
*
* let convObj = {
* 'clientChannelKey' : clientChannelKey, //pass the clientChannelKey here
* 'takeOrder' : true //skip chat list on back press, pass false if you want to show chat list on back press
* };
*
* @param conversationObject {any} the channel key and other information
* @return {Promise<any>} Returns a promise
*/
@Cordova()
launchParticularConversation(conversationObject: any): Promise<any> { return; }
/**
* Start a new conversation, details about the conversation to be passed as parameters
*
* @deprecated
* @param converationParams {any} the user details
* @return {Promise<any>} Returns a promise
*/
@Cordova()
startNewConversation(conversationParams: any): Promise<any> { return; }
/**
* Process push notifications
*
* @param data {any} the user details
* @return {boolean} Returns true/false
*/
@Cordova({ sync: true })
processPushNotification(data: any): boolean { return; }
/**
* Logout the current user
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
logout(): Promise<any> { return; }
/**
* Start a single chat (conversation)
*
* @deprecated
* @param data {any} the user details
* @return {Promise<any>} Returns a promise
*/
@Cordova()
startSingleChat(data: any): Promise<any> { return; }
/**
* Launches a conversation with the properties passed in the conversation param
*
* var conversationObject = {
* 'isUnique' : false,
* 'agentIds':['<AGENT_ID>'], //List of agentIds. AGENT_ID is the emailID used to signup on Kommunicate
* 'botIds': ['<BOT_ID>'] //List of botIds. Go to Manage Bots(https://dashboard.kommunicate.io/bots/manage-bots) -> Copy botID
* };
*
* @param conversationObject {any} the user details
* @return {Promise<any>} Returns a promise
*/
@Cordova()
conversationBuilder(converationObject: any): Promise<any> { return; }
}
@@ -0,0 +1,115 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* This is the language object which will be returned by `downloadModel`, `deleteModel`, `getAvailableModels` and `getDownloadedModels` methods.
*/
export interface LanguageModel {
/**
* BCP-47 language code of the language. For example: en
* For full list of languages codes, see https://firebase.google.com/docs/ml-kit/translation-language-support
*/
code: string;
/**
* Display name of the language. For example: English
*/
displayName: string;
}
/**
* @name MLKitTranslate
* @description
* Plugin that implements MLKit Translation and Language Identification features.
*
* @usage
* ```typescript
* import { MLKitTranslate } from '@ionic-native/ml-kit-translate';
*
*
* constructor(private mlkitTranslate: MLKitTranslate) { }
*
* ...
*
* this.mlkitTranslate.translate('Hello', 'en', 'es')
* .then((resultText: string) => console.log(res))
* .catch((error: string) => console.error(error));
*
* @interfaces
* LanguageModel
* ```
*/
@Plugin({
pluginName: 'MLKitTranslate',
plugin: 'cordova-plugin-mlkit-translate',
pluginRef: 'MLKitTranslate',
repo: 'https://github.com/rigelglen/cordova-plugin-mlkit-translate',
platforms: ['Android', 'iOS']
})
@Injectable()
export class MLKitTranslate extends IonicNativePlugin {
/**
* Translates text from one language to another. Requires the source and target languages need to be downloaded.
* If not the languages are downloaded in the background automatically.
* @param text {string} text to be translated
* @param targetLanguage {string} BCP-47 language code of the language to translate to
* @param sourceLanguage {string=} (optional) BCP-47 language code of the language to translate to. If not provided, source language is inferred from text
* @return {Promise<string>} Returns a promise that resolves with the translated text
*/
@Cordova()
translate(
text: string,
targetLanguage: string,
sourceLanguage?: string
): Promise<string> {
return;
}
/**
* Determines the language of a string of text.
* @param text {string} text to be translated
* @return {Promise<LanguageModel>} Returns a promise that resolves with the identified language
*/
@Cordova()
identifyLanguage(text: string): Promise<LanguageModel> {
return;
}
/**
* List of language models that have been downloaded to the device.
* @return {Promise<LanguageModel[]>} Returns a promise that resolves with an array of languages that have been downloaded.
*/
@Cordova()
getDownloadedModels(): Promise<LanguageModel[]> {
return;
}
/**
* List of language models that can be downloaded.
* @return {Promise<LanguageModel[]>} Returns a promise that resolves with an array of possible languages that can be downloaded.
*/
@Cordova()
getAvailableModels(): Promise<LanguageModel[]> {
return;
}
/**
* Downloads a specified language model.
* @param code {string} BCP-47 language code of the language to download
* @return {Promise<LanguageModel>} Returns a promise that resolves with the downloaded language.
*/
@Cordova()
downloadModel(code: string): Promise<LanguageModel> {
return;
}
/**
* Deletes a specified language model.
* @param code {string} BCP-47 language code of the language to delete
* @return {Promise<LanguageModel>} Returns a promise that resolves with the deleted language.
*/
@Cordova()
deleteModel(code: string): Promise<LanguageModel> {
return;
}
}
+19 -1
View File
@@ -138,12 +138,13 @@ export class AuthenticationContext {
* @param {String} extraQueryParameters
* Extra query parameters (optional)
* Parameters should be escaped before passing to this method (e.g. using 'encodeURI()')
* @param {String} claims Claim parameter. Parameter should be used under conditional access scenarios (optional)
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
*/
@CordovaInstance({
otherPromise: true
})
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> {
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any, claims?: string): Promise<AuthenticationResult> {
return;
}
@@ -165,3 +166,20 @@ export class AuthenticationContext {
}
}
export class AuthenticationSettings {
/**
* Sets flag to use or skip authentication broker.
* By default, the flag value is false and ADAL will not talk to broker.
*
* @param useBroker Flag to use or skip authentication broker
*
* @returns {Promise} Promise either fulfilled or rejected with error
*/
@CordovaInstance({
otherPromise: true
})
static setUseBroker(useBroker: boolean): Promise<void> {
return;
}
}
@@ -0,0 +1,87 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface PDFGeneratorOptions {
/**
* The document size, e.g., A2, A3, or A4.
* Only supported on iOS.
* The default is 'A4'.
*/
documentSize?: string;
/**
* Option to change to landscape orientation.
* Default is 'portrait'.
*/
landscape?: 'landscape' | 'portrait';
/**
* The type to be returned, either 'share' or 'base64'.
* If 'share is chosen, the PDF is shared with the system capabilities.
* Default is 'base64'
*/
type?: string;
/**
* The desired filename the resulting PDF should have.
* Default is 'default.pdf'
*/
fileName?: string;
/**
* Option to set the base URL for pathing.
* Default is 'null'.
*/
baseUrl?: string;
}
/**
* @name PDFGenerator
* @description
* Simple plugin to generate (offline) pdf. The plugin transforms HTML to PDF and also provide the mechanism to share the pdf to other apps like Mail, etc.
*
* @usage
* ```typescript
* import { PDFGenerator } from '@ionic-native/pdf-generator';
*
* constructor(private pdfGenerator: PDFGenerator) { }
*
* ...
*
* this.pdfGenerator.fromURL(url, options).then(base64String => console.log(base64String));
*
* ```
*/
@Plugin({
pluginName: 'PDFGenerator',
plugin: 'cordova-pdf-generator',
pluginRef: 'cordova.plugins.pdf',
repo: 'https://github.com/cesarvr/pdf-generator',
platforms: ['Android', 'iOS']
})
@Injectable({
providedIn: 'root'
})
export class PDFGenerator extends IonicNativePlugin {
/**
* Creates a PDF using a URL, it download the document into an in memory Webkit object, and renders it into a PDF.
* @param url {string} URL to create a PDF from
* @param options {PDFGeneratorOptions} options for PDF generation
* @returns {Promise<string>}
*/
@Cordova({ otherPromise: true })
fromURL(url: string, options?: PDFGeneratorOptions): Promise<string> {
return;
}
/**
* Creates a PDF using string with the HTML representation, it download the document into an in memory Webkit object, and renders it into a PDF.
* @param data {string} HTML string representation to create a PDF from
* @param options {PDFGeneratorOptions} options for PDF generation
* @returns {Promise<string>}
*/
@Cordova({ otherPromise: true })
fromData(data: string, options?: PDFGeneratorOptions): Promise<string> {
return;
}
}
@@ -125,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
@Cordova({
observable: true
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> {
getLibrary(success?: (res?: any) => void, error?: (err?: any) => void, options?: GetLibraryOptions): Observable<LibraryItem[]> {
return;
}
@@ -9,7 +9,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
*
* @usage
* ```typescript
* import { PreviewAnyFile } from '@ionic-native/preview-any-file';
* import { PreviewAnyFile } from '@ionic-native/preview-any-file/ngx';
*
*
* constructor(private previewAnyFile: PreviewAnyFile) { }
+109 -18
View File
@@ -1,6 +1,25 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
interface FontOptions {
name: string; // The name of the font family. Only supported on iOS
size: number; // The size of the font. Only supported on iOS, Android
italic: boolean; // Set to true to enable these font traits. Only supported on iOS
bold: boolean; // Set to true to enable these font traits. Only supported on iOS
align: 'left' | 'right' | 'center' | 'justified'; // Possible alignments are left, right, center and justified. Only supported on iOS
color: string; // The color of the font in hexa-decimal RGB format - "FF0000" means red. Only supported on iOS
}
interface HeaderFooterLabelOptions {
text: string; // The plain text to display. Use %ld to indicate where to insert the page index. For example "Page %ld" would result into "Page 1", "Page 2", .... Only supported on iOS
top: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
right: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
left: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
bottom: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
font: FontOptions; // The font attributes for the label. Only supported on iOS
showPageIndex: boolean; // Set to true if you want to display the page index. Only supported on iOS
}
export interface PrintOptions {
/**
* The name of the print job and the document
@@ -8,16 +27,22 @@ export interface PrintOptions {
name?: string;
/**
* The network URL of the printer.
* Only supported on iOS.
* The number of copies for the print task.
* Only supported on iOS, Windows
*/
printerId?: string;
copies?: number;
/**
* Limits the pages to print even the document contains more.
* To skip the last n pages you can assign a negative value on iOS.
* Only supported on iOS, Android
*/
pageCount?: number;
/**
* Specifies the duplex mode to use for the print job.
* Either double-sided (duplex:true) or single-sided (duplex:false).
* Double-sided by default.
* Only supported on iOS
* Either double-sided on short site (duplex:'short'),
* double-sided on long site (duplex:'long') or single-sided (duplex:'none').
*/
duplex?: boolean;
@@ -25,18 +50,85 @@ export interface PrintOptions {
* The orientation of the printed content, portrait or landscape
* Portrait by default.
*/
landscape?: boolean;
orientation?: 'landscape' | 'portrait';
/**
* If your application only prints black text, setting this property to true can result in better performance in many cases.
* False by default.
*/
grayscale?: boolean;
monochrome?: boolean;
/**
* The Size and position of the print view
* If your application only prints black text, setting this property to true can result in better performance in many cases.
* False by default.
* Only supported on iOS, Windows
*/
bounds?: number[] | any;
photo?: boolean;
/**
* Set to false to disable downscaling the image to fit into the content aread.
* Only supported on Android
*/
autoFit?: boolean;
/**
* The network URL to the printer.
* Only supported on iOS
*/
printer?: string;
/**
* Defines the maximum size of the content area.
* Only supported on iOS
*/
maxHeight?: string;
/**
* Defines the maximum size of the content area.
* Only supported on iOS
*/
maxWidth?: string;
/**
* Set to false to avoid margins.
* The margins for each printed page. Each printer might have its own minimum margins depends on media type and paper format.
*/
margin?: boolean | {
top?: string;
left?: string;
right?: string;
bottom?: string;
};
ui?: {
hideNumberOfCopies?: string; // Set to true to hide the control for the number of copies. Only supported on iOS
hidePaperFormat?: string; // Set to true to hide the control for the paper format. Only supported on iOS
top?: number; // The position of the printer picker. Only supported on iPad
left?: number; // The position of the printer picker. Only supported on iPad
height?: number; // The size of the printer picker. Only supported on iPad
width?: number; // The size of the printer picker. Only supported on iPad
};
paper?: {
width: string; // The dimensions of the paper iOS will will try to choose a format which fits bests. Only supported on iOS
height: string; // The dimensions of the paper iOS will will try to choose a format which fits bests. Only supported on iOS
name: string; // The name of the format like IsoA4 or Roll22Inch. https://docs.microsoft.com/en-us/uwp/api/windows.graphics.printing.printmediasize. Only supported on Windows
length: string; // On roll-fed printers you can decide when the printer cuts the paper. https://docs.microsoft.com/en-us/uwp/api/windows.graphics.printing.printmediasize. Only supported on iOs
};
font?: FontOptions;
header?: {
height: string; // The height of the header or footer on each page. Only supported on iOS
labels: string[]; // An array of labels to display. Only use if there are more then one. Only supported on iOS
label: HeaderFooterLabelOptions;
};
footer?: {
height: string; // The height of the header or footer on each page. Only supported on iOS
labels: string[]; // An array of labels to display. Only use if there are more then one. Only supported on iOS
label: HeaderFooterLabelOptions;
};
}
/**
@@ -54,11 +146,10 @@ export interface PrintOptions {
*
* let options: PrintOptions = {
* name: 'MyDocument',
* printerId: 'printer007',
* duplex: true,
* landscape: true,
* grayscale: true
* }
* orientation: 'landscape',
* monochrome: true
* }
*
* this.printer.print(content, options).then(onSuccess, onError);
* ```
@@ -85,14 +176,14 @@ export class Printer extends IonicNativePlugin {
}
/**
* Checks if the printer service is available (iOS) or if printer services are installed and enabled (Android).
* @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available, and providing the number of printers available
* Checks To check if printing is supported in general
* @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available
*/
@CordovaCheck()
check(): Promise<any> {
return getPromise<any>((resolve: Function) => {
Printer.getPlugin()
.check((avail: boolean, count: any) => {
.canPrintItem((avail: boolean, count: any) => {
resolve({ avail, count });
});
});
@@ -117,7 +208,7 @@ export class Printer extends IonicNativePlugin {
successIndex: 2,
errorIndex: 4
})
print(content: string | HTMLElement, options?: PrintOptions): Promise<any> {
print(content?: string | HTMLElement, options?: PrintOptions): Promise<any> {
return;
}
@@ -0,0 +1,629 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name PSPDFKit-Cordova
* @description
* The official plugin to use PSPDFKit with Cordova and Ionic.
*
* @usage
* ```typescript
* import { PSPDFKit } from '@ionic-native/pspdfkit-cordova/ngx';
*
*
* constructor(private pspdfkit: PSPDFKit) { }
*
* ...
*
* // Set your license key here.
* this.pspdfkit.setLicenseKey("YOUR KEY");
*
* // Show a PDF in single page mode, with a black background.
* this.pspdfkit.present('document.pdf', {pageMode: 'single', backgroundColor: "black"})
* .then(result => {
* console.log(result); // Success
* })
* .catch(error => {
* console.log(error); // Failed
* });
* }
*
* // Scroll to page at index 1.
* this.pspdfkit.setPage(1, true);
*
* ```
*/
@Plugin({
pluginName: 'PSPDFKit',
plugin: 'pspdfkit-cordova',
pluginRef: 'PSPDFKit',
repo: 'https://github.com/PSPDFKit/PSPDFKit-Cordova',
install: 'ionic cordova plugin add pspdfkit-cordova',
platforms: ['Android', 'iOS']
})
@Injectable()
export class PSPDFKit extends IonicNativePlugin {
/**
* Activates PSPDFKit with your license key from https://customers.pspdfkit.com.
*
* @param key {string} The license key.
* @return {Promise<any>} Success and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
setLicenseKey(licenseKey: string): Promise<any> {
return;
}
/**
* iOS: Displays a PDF in a full-screen modal.
* Android: Opens the PSPDFActivity to show a document from the local device file system.
*
* @param path {string} The path should be a string containing the file path (not URL) for the PDF. Relative paths are assumed to be relative to the www directory (if the path has a different base URL set, this will be ignored). To specify a path inside the application documents or library directory, use a `~`, e.g. `"~/Documents/mypdf.pdf"` or `"~/Library/Application Support/mypdf.pdf"`. Path can be null, but must not be omitted
* @param options {any} The `options` parameter is an optional object containing configuration properties for the PDF document and/or view controller. All currently supported values are listed below under Options.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
present(path: string, options?: any): Promise<any> {
return;
}
/**
* Opens the PSPDFActivity to show a document from the app's assets folder. This method copies the
* file to the internal app directory on the device before showing it.
* @param assetFile {string} Relative path within the app's assets folder.
* @param options {any} PSPDFKit configuration options.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -Android
*/
@Cordova()
presentFromAssets(assetFile: string, options?: any): Promise<any> {
return;
}
/**
* Displays a PDF in a full-screen modal and imports annotations from a given XFDF file.
*
* @param path {string} Should be a string containing the file path (not URL) for the PDF. Relative paths are assumed to be relative to the www directory (if the path has a different base URL set, this will be ignored). To specify a path inside the application documents or library directory, use a `~`, e.g. `"~/Documents/mypdf.pdf"` or `"~/Library/Application Support/mypdf.pdf"`. Path can be null, but must not be omitted
* @param xfdfPath {string} should be a string containing the file path (not URL) for the XFDF file backing the PDF document. Relative paths are assumed to be relative to the www directory (if the xfdf path has a different base URL set, we will create an XFDF file in `'"~/Documents/" + xfdfPath'`). To specify a path inside the application documents or library directory, use a ~, e.g. `"~/Documents/myXFDF.xfdf"` or `"~/Library/Application Support/myXFDF.xfdf"`. The xfdfPath cannot be null and must not be omitted.
* @param options {any} The `options` parameter is an optional object containing configuration properties for the PDF document and/or view controller. All currently supported values are listed below under Options.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
presentWithXFDF(path: string, xfdfPath: string, options?: any): Promise<any> {
return;
}
/**
* iOS: Dismisses the modally presented PDF view.
* Android: Dismisses any previously launched PDF activity. Calls the optional callback function after all activities have been dismissed.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
dismiss(): Promise<any> {
return;
}
/**
* Reloads the current PDF.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
reload(): Promise<any> {
return;
}
/**
* Saves the document to original location if it has been changed. If there were no changes to the
* document, the document file will not be modified.
* Provides "wasModified" as a part of a successful response which will be equal to true if
* the file was modified and changes were saved. false if there was nothing to save.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -Android
*/
@Cordova()
saveDocument(): Promise<any> {
return;
}
/**
* Saves any changed annotations in the current document.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
saveAnnotations(): Promise<any> {
return;
}
/**
* Return true in the success (or result) callback if the document has unsaved annotation. Returns false otherwise.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
getHasDirtyAnnotations(): Promise<any> {
return;
}
/**
* Triggers a search for the specified query.
*
* @param query {string} Search Term to query
* @param animated {boolean} Determines if the search should be animated (if omitted, the search will not be animated). The optional headless argument determines whether the search UI should be disaplyed (if omitted, the search UI *will* be displayed).
* @param headless {boolean} Determines whether the search UI should be disaplyed (if omitted, the search UI *will* be displayed).
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
search(query: string, animated?: boolean, headless?: boolean): Promise<any> {
return;
}
/**
* Sets multiple document and view controller settings at once.
*
* @param options {any} The options set will be applied to the current document (if there is one) as well as all subsequently displayed documents. All currently supported values are listed below under Options.
* @param animated {boolean} determines if the property should be animated. Not all property changes can be animated, so if the property does not support animation the animated argument will be ignored.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
setOptions(options: any, animated: boolean): Promise<any> {
return;
}
/**
* Gets several document or view controller options in a single call.
*
* @param names {any} array of option names
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
getOptions(names: any): Promise<any> {
return;
}
/**
* Sets a single document or view controller settings at once.
*
* @param name {string} the option name
* @param value {any} the option value
* @param animated {boolean} determines if the property should be animated. Not all property changes can be animated, so if the property does not support animation the animated argument will be ignored.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
setOption(name: string, value: any, animated: boolean): Promise<any> {
return;
}
/**
* Gets a single document or view controller settings at once.
*
* @param name {string} the option name
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
getOption(name: string): Promise<any> {
return;
}
/**
* Sets the current visible page.
*
* @param page {number} the page index
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
setPage(page: number, animated?: boolean): Promise<any> {
return;
}
/**
* Gets the currently visible page.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
getPage(): Promise<any> {
return;
}
/**
* Gets the page count of the current document.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
getPageCount(): Promise<any> {
return;
}
/**
* Scrolls to the next page.
*
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
scrollToNextPage(animated?: boolean): Promise<any> {
return;
}
/**
* Scrolls to the previous page.
*
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
scrollToPreviousPage(animated?: boolean): Promise<any> {
return;
}
/**
* Sets the appearance mode.
*
* @param appearanceMode {string} the appearance mode. Can be 'default', 'sepia', or 'night'
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
setAppearanceMode(appearanceMode: string): Promise<any> {
return;
}
/**
* Clears the entire render cache. This invalidates render caches for all previously rendered documents.
* Consider using `removeCacheForPresentedDocument()` or `clearCacheForPage()` instead of this,
* since invalidating single documents or specific page caches since excessive cache invalidation may decrease performance.
*
* @param clearDiskCache {boolean} optional parameter. Android: if set to true clears disk cache as well. iOS: has no effect.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
clearCache(clearDiskCache?: boolean): Promise<any> {
return;
}
/**
* Clears the cache from the currently presented document.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
removeCacheForPresentedDocument(): Promise<any> {
return;
}
/**
* Invalidates the render cache for the specified page.
*
* @param pageIndex {number} 0-based index of the page whose render cache should be invalidated.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -Android
*/
@Cordova()
clearCacheForPage(pageIndex: number): Promise<any> {
return;
}
/**
* Hides the annotation toolbar
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
hideAnnotationToolbar(): Promise<any> {
return;
}
/**
* Shows the annotation toolbar
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
showAnnotationToolbar(): Promise<any> {
return;
}
/**
* Toggles the annotation toolbar
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
toggleAnnotationToolbar(): Promise<any> {
return;
}
/**
* Applies the passed in document Instant JSON.
*
* @param jsonValue {string} The document Instant JSON to apply.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
applyInstantJSON(jsonValue: string): Promise<any> {
return;
}
/**
* Adds a new annotation to the current document using the Instant JSON Annotation
* payload - https://pspdfkit.com/guides/ios/current/importing-exporting/instant-json/#instant-annotation-json-api
*
* @param jsonAnnotation {string} Instant JSON of the annotation to add.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
addAnnotation(jsonAnnotation: string): Promise<any> {
return;
}
/**
* Removes a given annotation from the current document. The annotaion is expected to be in Instant
* JSON format - https://pspdfkit.com/guides/ios/current/importing-exporting/instant-json/#instant-annotation-json-api
*
* @param jsonAnnotation {string} Instant JSON of the annotation to remove.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
removeAnnotation(jsonAnnotation: string): Promise<any> {
return;
}
/**
* Gets all annotations of the given type from the page.
*
* @param pageIndex {number} The page to get the annotations for.
* @param type {string} The type of annotations to get (See here for types https://pspdfkit.com/guides/server/current/api/json-format/) or `null` to get all annotations.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
getAnnotations(pageIndex: number, type?: string): Promise<any> {
return;
}
/**
* Gets all unsaved changes to annotations.
*
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
getAllUnsavedAnnotations(): Promise<any> {
return;
}
/**
* Sets the value of the form element of the fully qualified name.
*
* @param value {string} the value.
* @param fullyQualifiedName {string} the fully qualified name of the form element.
* @return {Promise<any>} callback Success (result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
setFormFieldValue(value: string, fullyQualifiedName: string): Promise<any> {
return;
}
/**
* Gets the value of the form element of the fully qualified name.
*
* @param fullyQualifiedName {string} description.
* @return {Promise<any>} callback Success (result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
getFormFieldValue(fullyQualifiedName: string): Promise<any> {
return;
}
/**
* Imports all annotations from the specified XFDF file to the current document.
*
* @param xfdfPath {string} XFDF file path to import annotations
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
importXFDF(xfdfPath: string): Promise<any> {
return;
}
/**
* Exports all annotations from the current document to the specified XFDF file path.
*
* @param xfdfPath {string} XFDF file path to export annotations
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
exportXFDF(xfdfPath: string): Promise<any> {
return;
}
/**
* Processes annotations (embed, remove, flatten, or print) and saves the processed document to the given document path.
*
* @param annotationChange {string} the annotation change. Can be 'flatten', 'remove', 'embed' or 'print'
* @param processedDocumentPath {string} description.
* @param annotationType {string} The optional string annotationType argument. If omitted, we process 'All' annotations. The annotation type can have one of the following values: None, Undefined, Link, Highlight, StrikeOut, Underline, Squiggly, FreeText, Ink, Square, Circle, Line, Text, Stamp, Caret, RichMedia, Screen, Widget, Sound, FileAttachment, Polygon, PolyLine, Popup, Watermark, TrapNet, 3D, Redact, All.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
* -Android
*/
@Cordova()
processAnnotations(annotationChange: string, processedDocumentPath: string, annotationType: string): Promise<any> {
return;
}
/**
* Generates a PDF document from HTML string.
*
* @param html {string} HTML string.
* @param fileName {string} File name of the generated PDF.
* @param options {string} Options to be considered when converting the HTML string to PDF.
* @return {Promise<any>} callback Success (or result) and error callback function.
*
* __Supported Platforms__
*
* -iOS
*/
@Cordova()
convertPDFFromHTMLString(html: string, fileName: string, options: string): Promise<any> {
return;
}
}
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -136,6 +136,7 @@ export interface CategoryActionData {
title: string;
foreground: boolean;
destructive: boolean;
inline?: boolean;
}
export interface AndroidPushOptions {
@@ -230,6 +231,7 @@ export interface Channel {
sound?: string;
vibration?: boolean | number[];
visibility?: Visibility;
badge?: boolean;
}
export type PushEvent = string;
@@ -269,7 +271,11 @@ export type PushEvent = string;
* id: "testchannel1",
* description: "My first test channel",
* // The importance property goes from 1 = Lowest, 2 = Low, 3 = Normal, 4 = High and 5 = Highest.
* importance: 3
* importance: 3,
* //badge is used to if badge appears on the app icon see https://developer.android.com/reference/android/app/NotificationChannel.html#setShowBadge(boolean).
* //false = no badge on app icon.
* //true = badge on app icon
* badge: false
* }).then(() => console.log('Channel created'));
*
* // Delete a channel (Android O and above)
@@ -0,0 +1,173 @@
import { Injectable } from '@angular/core';
import { CordovaCheck, CordovaInstance, getPromise, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface SecureStorageEchoOptions {
android: {
/**
* See https://github.com/mibrito707/cordova-plugin-secure-storage-echo#sharing-data-android
*/
packageName?: string;
/**
* Sets the duration of time (seconds) for which the Private Encryption Key is authorized to be used after the user is successfully authenticated.
* See https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder.html#setUserAuthenticationValidityDurationSeconds(int)
*/
userAuthenticationValidityDuration?: number;
/**
* Custom title for Confirm Credentials screen.
* See https://developer.android.com/reference/android/app/KeyguardManager.html#createConfirmDeviceCredentialIntent(java.lang.CharSequence,%20java.lang.CharSequence)
*/
unlockCredentialsTitle?: string;
/**
* Custom description for Confirm Credentials screen.
*/
unlockCredentialsDescription?: string;
};
}
/**
* @hidden
*/
export class SecureStorageEchoObject {
constructor(private _objectInstance: any) {}
/**
* Gets a stored item
* @param key {string}
* @returns {Promise<string>}
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
get(key: string): Promise<string> {
return;
}
/**
* Stores a value
* @param key {string}
* @param value {string}
* @returns {Promise<any>}
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
set(key: string, value: string): Promise<any> {
return;
}
/**
* Removes a single stored item
* @param key {string}
* @returns {Promise<string>} returns a promise that resolves with the key that was removed
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
remove(key: string): Promise<string> {
return;
}
/**
* Get all references from the storage.
* @returns {Promise<string[]>} returns a promise that resolves with array of keys storage
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
keys(): Promise<string[]> {
return;
}
/**
* Clear all references from the storage.
* @returns {Promise<any>}
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
clear(): Promise<any> {
return;
}
/**
* Brings up the screen-lock settings
* @returns {Promise<any>}
*/
@CordovaInstance()
secureDevice(): Promise<any> {
return;
}
}
/**
* @name Secure Storage Echo
* @description
* This plugin gets, sets and removes key,value pairs from a device's secure storage.
*
* Requires Cordova plugin: `cordova-plugin-secure-storage-echo`. For more info, please see the [Cordova Secure Storage docs](https://github.com/mibrito707/cordova-plugin-secure-storage-echo).
*
* The browser platform is supported as a mock only. Key/values are stored unencrypted in localStorage.
*
* @usage
*
* ```typescript
* import { SecureStorageEcho, SecureStorageEchoObject } from '@ionic-native/secure-storage-echo/ngx';
*
* constructor(private secureStorageEcho: SecureStorageEcho) { }
*
* ...
*
* this.secureStorageEcho.create('my_store_name')
* .then((storage: SecureStorageEchoObject) => {
*
* storage.get('key')
* .then(
* data => console.log(data),
* error => console.log(error)
* );
*
* storage.set('key', 'value')
* .then(
* data => console.log(data),
* error => console.log(error)
* );
*
* storage.remove('key')
* .then(
* data => console.log(data),
* error => console.log(error)
* );
*
* });
*
*
* ```
* @classes
* SecureStorageEchoObject
*/
@Plugin({
pluginName: 'SecureStorageEcho',
plugin: 'cordova-plugin-secure-storage-echo',
pluginRef: 'cordova.plugins.SecureStorage',
repo: 'https://github.com/mibrito707/cordova-plugin-secure-storage-echo',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class SecureStorageEcho extends IonicNativePlugin {
/**
* Creates a namespaced storage.
* @param store {string}
* @returns {Promise<SecureStorageEchoObject>}
*/
@CordovaCheck()
create(store: string, options?: SecureStorageEchoOptions): Promise<SecureStorageEchoObject> {
return getPromise<SecureStorageEchoObject>((res: Function, rej: Function) => {
const instance = new (SecureStorageEcho.getPlugin())(
() => res(new SecureStorageEchoObject(instance)),
rej,
store,
options
);
});
}
}
@@ -124,9 +124,9 @@ export class SecureStorageObject {
*/
@Plugin({
pluginName: 'SecureStorage',
plugin: 'cordova-plugin-secure-storage',
plugin: 'cordova-plugin-secure-storage-echo',
pluginRef: 'cordova.plugins.SecureStorage',
repo: 'https://github.com/Crypho/cordova-plugin-secure-storage',
repo: 'https://github.com/mibrito707/cordova-plugin-secure-storage-echo',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
@@ -0,0 +1,45 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name ServiceDiscovery
* @description
* Simple plugin to get any SSDP / UPnP / DLNA service on a local network
*
* @usage
* ```typescript
* import { ServiceDiscovery } from '@ionic-native/service-discovery';
*
*
* constructor(private serviceDiscovery: ServiceDiscovery) { }
*
* ...
*
*
* this.serviceDiscovery.getNetworkServices('ssdp:all')
* .then(devices => console.log(devices))
* .catch(error => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'ServiceDiscovery',
plugin: 'cordova-plugin-discovery',
pluginRef: 'serviceDiscovery',
repo: 'https://github.com/scottdermott/cordova-plugin-discovery',
platforms: ['Android', 'iOS']
})
@Injectable()
export class ServiceDiscovery extends IonicNativePlugin {
/**
* Finds and returns metadata about devices discovered on the network via SSDP / UPnP / DLNA
* @param service {string} The service name to discover
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
getNetworkServices(service: string): Promise<any> {
return;
}
}
@@ -0,0 +1,177 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @see https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidrequest
*/
export class ASAuthorizationAppleIDRequest {
static readonly ASAuthorizationScopeFullName = 0;
static readonly ASAuthorizationScopeEmail = 1;
requestedScopes?: number[];
}
/**
* @see https://developer.apple.com/documentation/foundation/nspersonnamecomponents/1412193-phoneticrepresentation
*/
export interface NSPersonNameComponents {
/**
* The portion of a names full form of address that precedes the name itself (for example, "Dr.," "Mr.," "Ms.")
*/
namePrefix?: string;
/**
* Name bestowed upon an individual to differentiate them from other members of a group that share a family name (for example, "Johnathan")
*/
givenName?: string;
/**
* Secondary name bestowed upon an individual to differentiate them from others that have the same given name (for example, "Maple")
*/
middleName?: string;
/**
* Name bestowed upon an individual to denote membership in a group or family. (for example, "Appleseed")
*/
familyName?: string;
/**
* The portion of a names full form of address that follows the name itself (for example, "Esq.," "Jr.," "Ph.D.")
*/
nameSuffix?: string;
/**
* Name substituted for the purposes of familiarity (for example, "Johnny")
*/
nickname?: string;
/**
* The phonetic representation name components of the receiver
*/
phoneticRepresentation?: NSPersonNameComponents;
}
/**
* @see https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidcredential
*/
export interface AppleSignInResponse {
/**
* The users email address i.e. abc@privaterelay.appleid.com
*/
email?: string;
/**
* An arbitrary string that your app provided to the request that generated the credential
*/
state?: string;
/**
* A JSON Web Token (JWT) that securely communicates information about the user to your app
*/
identityToken: string;
/**
* A short-lived token used by your app for proof of authorization when interacting with the app's server counterpart
*/
authorizationCode: string;
/**
* The user's name
* @see https://developer.apple.com/documentation/foundation/nspersonnamecomponents?language=objc
*/
fullName?: NSPersonNameComponents;
/**
* An identifier associated with the authenticated user
*/
user?: string;
}
/**
* @see https://developer.apple.com/documentation/foundation/nserror
*/
export interface NSError {
/**
* The error code
*/
code?: number;
/**
* A string containing the localized description of the error
*/
localizedDescription?: string;
/**
* A string containing the localized explanation of the reason for the error
*/
localizedFailureReason?: string;
}
export interface AppleSignInErrorResponse extends NSError {
/**
* The error i.e. "ASAUTHORIZATION_ERROR"
*/
error?: string;
}
/**
* @name Sign In With Apple
* @description
* Sign in with Apple makes it easy for users to sign in to your apps and websites using their Apple ID.
* Instead of filling out forms, verifying email addresses, and choosing new passwords,
* they can use Sign in with Apple to set up an account and start using your app right away.
* All accounts are protected with two-factor authentication for superior security,
* and Apple will not track users activity in your app or website.
* *Source:* https://developer.apple.com/sign-in-with-apple/
*
* @usage
* ```typescript
* import { SignInWithApple, AppleSignInResponse, AppleSignInErrorResponse, ASAuthorizationAppleIDRequest } from '@ionic-native/sign-in-with-apple/ngx';
*
*
* constructor(private signInWithApple: SignInWithApple) { }
*
* ...
*
*
* this.signInWithApple.signin({
* requestedScopes: [
* ASAuthorizationAppleIDRequest.ASAuthorizationScopeFullName,
* ASAuthorizationAppleIDRequest.ASAuthorizationScopeEmail
* ]
* })
* .then((res: AppleSignInResponse) => {
* // https://developer.apple.com/documentation/signinwithapplerestapi/verifying_a_user
* alert('Send token to apple for verification: ' + res.identityToken);
* console.log(res);
* })
* .catch((error: AppleSignInErrorResponse) => {
* alert(error.code + ' ' + error.localizedDescription);
* console.error(error);
* });
*
* ```
*/
@Plugin({
pluginName: 'Sign in with Apple',
plugin: 'cordova-plugin-sign-in-with-apple',
pluginRef: 'cordova.plugins.SignInWithApple',
repo: 'https://github.com/twogate/cordova-plugin-sign-in-with-apple',
platforms: ['iOS']
})
@Injectable()
export class SignInWithApple extends IonicNativePlugin {
/**
* Starts the authorization flows named during controller initialization
* @see https://developer.apple.com/documentation/authenticationservices/asauthorizationcontroller/3153047-performrequests
* @return {Promise<AppleSignInResponse>} Returns a promise when authorization succeeds
* @param {ASAuthorizationAppleIDRequest} options
* @throws AppleSignInErrorResponse
*/
@Cordova()
signin(options: ASAuthorizationAppleIDRequest = {}): Promise<AppleSignInResponse> {
return;
}
}
+12 -9
View File
@@ -64,20 +64,23 @@ export class SmartlookGlobalEventPropertyKey {
/**
* @name Smartlook
* @description
* Official Smartlook SDK plugin. For more information visit (www.smartlook.com).
* Official Smartlook SDK plugin.
* Full documentation can be found here: https://smartlook.github.io/docs/sdk/ionic/
*
* @usage
* ```typescript
* import { Smartlook } from '@ionic-native/smartlook/ngx';
*
*
* constructor(private smartlook: Smartlook) { }
* import { Smartlook, SmartlookSetupConfig } from '@ionic-native/smartlook/ngx';
*
* ...
*
*
* this.smartlook.setupAndStartRecording(new SmartlookSetupConfig("key"));
*
* @Component( ... )
* export class AppComponent {
* constructor(private smartlook: Smartlook) {
* this.platform.ready().then(() => {
* this.smartlook.setupAndStartRecording(new SmartlookSetupConfig("YOUR API KEY"));
* }
* }
* }
* ```
* @classes
* SmartlookSetupConfig
@@ -92,7 +95,7 @@ export class SmartlookGlobalEventPropertyKey {
plugin: 'https://github.com/smartlook/cordova-smartlook.git',
pluginRef: 'cordova.plugins.SmartlookPlugin',
repo: 'https://github.com/smartlook/cordova-smartlook.git',
platforms: ['Android']
platforms: ['Android', 'iOS']
})
@Injectable()
export class Smartlook extends IonicNativePlugin {
+26 -5
View File
@@ -52,6 +52,23 @@ export interface SumUpPayment {
installments: number;
}
/**
* @hidden
*/
export class SumUpKeys {
// The generated accessToken, to automate the login process
accessToken: string;
// affiliateKey can also be set in the object, if it has to be changed on runtime
affiliateKey: string;
constructor() {
this.accessToken = '';
this.affiliateKey = '';
}
}
/**
* @name SumUp
* @description
@@ -64,11 +81,15 @@ export interface SumUpPayment {
*
* constructor(private sumUp: SumUp) { }
*
* this.sumUp.login("ACCESS_TOKEN")
* const sumUpKeys: SumUpKeys = new SumUpKeys();
* sumUpKeys.affiliateKey = 'YOUR_API_KEY'; // if not provided in installation
* sumUpKeys.accessToken = 'YOUR_ACCESS_TOKEN';
*
* this.sumUp.login(sumUpKeys)
* .then((res: SumUpResponse) => console.log(res))
* .catch((error: SumUpResponse) => console.error(error));
*
* this.sumUp.auth("ACCESS_TOKEN")
* this.sumUp.auth('YOUR_ACCESS_TOKEN')
* .then((res: SumUpResponse) => console.log(res))
* .catch((error: SumUpResponse) => console.error(error));
*
@@ -92,7 +113,7 @@ export interface SumUpPayment {
* .then((res: SumUpResponse) => console.log(res))
* .catch((error: SumUpResponse) => console.error(error));
*
* this.sumUp.pay(10.0, "EUR")
* this.sumUp.pay(10.0, 'EUR')
* .then((res: SumUpPayment) => console.log(res))
* .catch((error: SumUpPayment) => console.error(error));
*
@@ -114,11 +135,11 @@ export class SumUp extends IonicNativePlugin {
* Login a user with an optional access token.
* If the access token is provided and valid, the user is logged in autmatically.
* Otherwise the user has to type in the credentials
* @param accessToken {string}
* @param sumUpKeys {SumUpKeys}
* @return {Promise<SumUpResponse>} Return a SumUpResponse object
*/
@Cordova()
login(accessToken?: string): Promise<SumUpResponse> {
login(sumUpKeys: SumUpKeys): Promise<SumUpResponse> {
return;
}
@@ -2,6 +2,15 @@ import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* Log levels supported in the sdk.
*/
export enum LogLevel {
important = 7,
error = 8,
debug = 9
}
/**
* AuthenticateAndActivateResultType Some Documentation
*/
@@ -47,6 +56,11 @@ export enum LoginListenerType {
* If there are multiple accounts active & no account is specified in the login(), then this value is returned indicating that a current account needs to be specified for the login().
*/
app_requires_current_account = 6
/**
* This value indicates app can proceed with demo mode.
*/
login_demo = 7
}
export enum LoginType {
@@ -229,6 +243,16 @@ export class UnviredResult {
errorDetail: string;
}
export class LogResult extends UnviredResult {
type: ResultType;
data: LogLevel;
}
export class LogDataResult extends UnviredResult {
type: ResultType;
data: string;
}
export class NotifResult extends UnviredResult {
type: NotificationListenerType;
}
@@ -240,6 +264,10 @@ export class SettingsResult extends UnviredResult {
export class SyncResult extends UnviredResult {
type: ResultType;
/**
* This code refers to the HTTP status code obtained during the network call.
*/
code: number;
}
export class DbResult extends UnviredResult {
@@ -328,6 +356,18 @@ export class LoginParameters {
*/
metadataJSON: string;
/**
* Specify the demo data xml string for demo mode.
*/
demoData: string;
/**
* Set 'true' if the application supports demo mode otherwise set 'false'.
*/
demoModeRequired: boolean;
/*
* Set this value to true to persist web application database. By default, this value is false.
*/
@@ -550,7 +590,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Returns the contents of the log file as a string.
*/
@Cordova()
logRead(): Promise<any> {
logRead(): Promise<LogDataResult> {
return;
}
@@ -578,6 +618,31 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
return;
}
/**
* Returns the current log level.
*/
@Cordova()
getLogLevel(): Promise<LogResult> {
return;
}
/**
* Returns the path of the log file.
*/
@Cordova()
getLogFilePath(): Promise<string> {
return;
}
/**
* Set the log level of the app.
* @param logLevel The log level to set
*/
@Cordova()
setLogLevel(logLevel: LogLevel): Promise<any> {
return;
}
/**
* This api initializes the Unvired Application.
* @param loginParameters Set of parameters to be passed the login()
@@ -594,6 +659,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
return;
}
/**
* This api initializes the Unvired Application.
* @param loginParameters Set of parameters to be passed the loginWithDemoData()
* For Example:
* ```
* let loginParameters = new LoginParameters()
* loginParameters.appName = 'UNVIRED_DIGITAL_FORMS'
* loginParameters.metadataPath = '../assets/metadata.json'
* loginParameters.loginType = LoginType.unvired
* loginParameters.demoData = "<tag></tag>"
* ```
*/
@Cordova()
loginWithDemoData(loginParameters: LoginParameters): Promise<LoginResult> {
return;
}
/**
* Logs out the last active user.
*/
@@ -759,10 +841,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
* Example:
* ```
* # Mobile: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbSelect('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
* # Mobile & Browser: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbSelect('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@Cordova()
@@ -811,11 +891,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
* Example:
* ```
* Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Mobile
* # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbDelete('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
* # Browser & Mobile
* this.unviredSDK.dbDelete('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@Cordova()
@@ -831,11 +908,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Mobile: Or a Sqlite where Clause ( without the 'where' keyword )
* Example:
* ```
* Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Mobile
* # Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, "FORM_ID = '5caed815892215034dacad56'")
* # Mobile & Browser
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@Cordova()
@@ -844,12 +918,11 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* Execute SQL Statement
* Execute a SQL statement
* @param query {string} SQL Statement.
* Example:
* ```
* this.unviredSDK.dbExecuteStatement('SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = 39')
* this.unviredSDK.dbExecuteStatement("SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = '39'")
* ```
*/
@Cordova()
@@ -858,7 +931,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* Create Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of savepoint
* Example:
@@ -872,7 +944,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* Release Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of savepoint
* ```
@@ -885,7 +956,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* Rollback Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of the savepoint
* Example:
@@ -899,7 +969,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* Begin database transaction.
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
* Example:
@@ -913,7 +982,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in mobile only.
* End database transaction.
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
* Example:
@@ -1071,6 +1139,21 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
return;
}
/**
* Returns an observable containing the state of the synchronisation along with count (if applicable). Possible values are as follows:
* 1. Sending (count) // Ex: sending(3), there are 3 items in outbox and device is online. i.e datasender thread running
* 2. Receiving // There are items to be received from server & device is online
* 3. Processing (count) // Ex: processing (5), there are 5 items in inbox and they are being processed.
* 4. Waiting to connect // The device is offline & there are items in outbox
* 5. Idle // there is no synchronisation activity going on.
*/
@Cordova({
observable: true
})
getSynchronizationState(): Observable<string> {
return;
}
/**
* For Browser platform only.
* Reinitialize web db. Use this api to initialize db from persisted local storage db
@@ -1205,7 +1288,44 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* For Browser platform only
* Helps in updating application database without reauthenticating with server which requires to drop both app and framework database.
*/
@Cordova()
reCreateAppDB(): Promise<any> {
return;
}
/**
* For Mobile platform only
* Starts Inbox handler if there are items in inbox.
*/
@Cordova()
startInboxHandler(): Promise<any> {
return;
}
/**
* For Mobile platform only
* Starts DataSender if there are items in outbox.
*/
@Cordova()
startDataSender(): Promise<any> {
return;
}
/**
* Returns platform name
* Ex: ios, android, windows, browser
*/
@Cordova()
platform(): Promise<string> {
return;
}
/**
* Mobile Platform only.
* Test whether push notifications can be received on the device
*/
@Cordova()
testPushNotification(): Promise<any> {
return;
}
}
@@ -92,6 +92,7 @@ export class Wechat extends IonicNativePlugin {
* this.wechat.auth.then((res) => { alert(res.code); });
* </code>
*/
@Cordova()
auth(scope: any, state: any): Promise<any> {
return;
}
@@ -116,6 +117,7 @@ export class Wechat extends IonicNativePlugin {
* });
* </code>
*/
@Cordova()
sendPaymentRequest(params: any): Promise<any> {
return;
}
@@ -143,6 +145,7 @@ export class Wechat extends IonicNativePlugin {
* });
* </code>
*/
@Cordova()
jumpToWechat(url: string): Promise<any> {
return;
}
@@ -160,6 +163,7 @@ export class Wechat extends IonicNativePlugin {
* });
* </code>
*/
@Cordova()
chooseInvoiceFromWX(params: any): Promise<any> {
return;
}
@@ -0,0 +1,878 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface WifiConfig {
SSID: string;
isHiddenSSID: boolean;
auth: {
algorithm: string;
password?: string;
};
}
export interface WifiScanResultsOptions {
numLevels: number;
}
export interface WifiScanOptions extends WifiScanResultsOptions {
[key: string]: any;
}
/**
* @name WifiWizard2
* @description
* WifiWizard2 enables Wifi management for both Android and iOS applications within Cordova/Phonegap projects.
*
* This project is a fork of the WifiWizard plugin with fixes and updates, as well as patches taken from the Cordova Network Manager plugin.
*
* @usage
* ```typescript
* import { WifiWizard2 } from '@ionic-native/wifi-wizard-2/ngx';
*
*
* constructor(private wifiWizard2: WifiWizard2) { }
*
*
* # Global Functions
* These are functions that can be used by both Android and iOS applications
* ```typescript
* this.wifiWizard2.getConnectedSSID()
* ```
* - Returns connected network SSID (only if connected) in success callback, otherwise fail callback will be called (if not connected or unable to retrieve)
* - This does **NOT** return the BSSID if unable to obtain SSID (like original WifiWizard did)
* ```typescript
* this.wifiWizard2.getConnectedBSSID()
* ```
* - Same as above, except BSSID (mac) is returned
*
* ```typescript
* this.wifiWizard2.timeout(delay)
* ```
* - `delay` should be time in milliseconds to delay
* - Helper async timeout delay, `delay` is optional, default is 2000ms = 2 seconds
* - This method always returns a resolved promise after the delay, it will never reject or throw an error
*
* **Example inside async function**
* ```typescript
* async function example(){
* await this.wifiWizard2.timeout(4000);
* // do something after 4 seconds
* }
* ```
*
* **Example inside standard non-async function**
* ```typescript
* function example(){
* this.wifiWizard2.timeout(4000).then( function(){
* // do something after waiting 4 seconds
* }):
* }
* ```
*
* **Thrown Errors**
*
* - `TIMEOUT_WAITING_FOR_SCAN` on timeout waiting for scan 10 seconds +
* - `SCAN_FAILED` if unable to start scan
*
* # iOS Functions
* For functionality, you need to note the following:
* - Connect/Disconnect only works for iOS11+
* - Can't run in the simulator so you need to attach an actual device when building with xCode
* - Will ensure 'HotspotConfiguration' and 'NetworkExtensions' capabilities are added to your xCode project
* - To connect to open network omit `ssidPassword` or call with `false`
*
* ```typescript
* this.wifiWizard2.iOSConnectNetwork(ssid, ssidPassword)
* ```
* ```typescript
* this.wifiWizard2.iOSDisconnectNetwork(ssid)
* ```
*
* # Android Functions
* - **WifiWizard2** *will automagically try to enable WiFi if it's disabled when calling any android related methods that require WiFi to be enabled*
*
* ## Connect vs Enable
* When writing Android Java code, there is no `connect` methods, you basically either `enable` or `disable` a network. In the original versions of WifiWizard the `connect` method would basically just call `enable` in Android.
* I have changed the way this works in WifiWizard2 version 3.0.0+, converting it to a helper method to eliminate having to call `formatWifiConfig` then `add` and then `enable` ... the `connect` method will now automatically call `formatWifiConfig`, then call `add` to either add or update the network configuration, and then call `enable`.
* If the connect method is unable to update existing network configuration (added by user or other apps), but there is a valid network ID, it will still attempt to enable that network ID.
*
* ```typescript
* this.wifiWizard2.connect(ssid, bindAll, password, algorithm, isHiddenSSID)
* ```
* - `ssid` should be the SSID to connect to *required*
* - `bindAll` should be set to `true` to tell Android to route all connections from your Android app, through the wifi connection (default is `false`) *optional*
* - See `WifiWizard2.enable` for more details regarding `bindAll` feature
* - `algorithm` and `password` is not required if connecting to an open network
* - Currently `WPA` and `WEP` are only supported algorithms
* - For `WPA2` just pass `WPA` as the algorithm
* - Set `isHiddenSSID` to `true` if the network you're connecting to is hidden
* - These arguments are the same as for `formatWifiConfig`
* - This method essentially calls `formatWifiConfig` then `add` then `enable`
* - If unable to update network configuration (was added by user or other app), but a valid network ID exists, this method will still attempt to enable the network
* - Promise will not be returned until method has verified that connection to WiFi was in completed state (waits up to 60 seconds)
*
* **Thrown Errors**
*
*
* - `CONNECT_FAILED_TIMEOUT` unable to verify connection, timed out after 60 seconds
* - `INVALID_NETWORK_ID_TO_CONNECT` Unable to connect based on generated wifi config
* - `INTERPUT_EXCEPT_WHILE_CONNECTING` Interupt exception while waiting for connection
*
*
*
* ## Disconnect vs Disable
* Same as above for Connect vs Enable, except in this situation, `disconnect` will first disable the network, and then attempt to remove it (if SSID is passed)
*
* ```typescript
* this.wifiWizard2.disconnect(ssid)
* ```
* - `ssid` can either be an SSID (string) or a network ID (integer)
* - `ssid` is **OPTIONAL** .. if not passed, will disconnect current WiFi (almost all Android versions now will just automatically reconnect to last wifi after disconnecting)
* - If `ssid` is provided, this method will first attempt to `disable` and then `remove` the network
* - If you do not want to remove network configuration, use `disable` instead
*
* **Thrown Errors**
*
* - `DISCONNECT_NET_REMOVE_ERROR` Android returned error when removing wifi configuration
* - `DISCONNECT_NET_DISABLE_ERROR` Unable to connect based on generated wifi config
* - `DISCONNECT_NET_ID_NOT_FOUND` Unable to determine network ID to disconnect/remove (from passed SSID)
* - `ERROR_DISCONNECT` - Android error disconnecting wifi (only when SSID is not passed)
*
* ```typescript
* this.wifiWizard2.formatWifiConfig(ssid, password, algorithm, isHiddenSSID)
* ```
* - `algorithm` and `password` is not required if connecting to an open network
* - Currently `WPA` and `WEP` are only supported algorithms
* - For `WPA2` just pass `WPA` as the algorithm
* - Set `isHiddenSSID` to `true` if the network you're connecting to is hidden
* ```typescript
* this.wifiWizard2.formatWPAConfig(ssid, password, isHiddenSSID)
* ```
* - This is just a helper method that calls `WifiWizard2.formatWifiConfig( ssid, password, 'WPA', isHiddenSSID );`
*
* ```typescript
* this.wifiWizard2.add(wifi)
* ```
* - `wifi` must be an object formatted by `formatWifiConfig`, this **must** be done before calling `enable`
*
* **Thrown Errors**
*
* - `AUTH_TYPE_NOT_SUPPORTED` - Invalid auth type specified
* - `ERROR_ADDING_NETWORK` - Android returned `-1` specifying error adding network
* - `ERROR_UPDATING_NETWORK` - Same as above, except an existing network ID was found, and unable to update it
*
* ```typescript
* this.wifiWizard2.remove(ssid)
* ```
* - `ssid` can either be an SSID (string) or a network ID (integer)
* - Please note, most newer versions of Android will only allow wifi to be removed if created by your application
*
* **Thrown Errors**
*
* - `UNABLE_TO_REMOVE` Android returned failure in removing network
* - `REMOVE_NETWORK_NOT_FOUND` Unable to determine network ID from passed SSID
*
*
* ```typescript
* this.wifiWizard2.listNetworks()
* ```
*
* ```typescript
* this.wifiWizard2.scan([options])
* ```
* - Same as calling `startScan` and then `getScanResults`, except this method will only resolve the promise after the scan completes and returns the results.
*
* ```typescript
* this.wifiWizard2.startScan()
* ```
* - It is recommended to just use the `scan` method instead of `startScan`
*
* **Thrown Errors**
*
* - `STARTSCAN_FAILED` Android returned failure in starting scan
*
*
* ```typescript
* this.wifiWizard2.getScanResults([options])
* ```
* - `getScanResults` should only be called after calling `startScan` (it is recommended to use `scan` instead as this starts the scan, then returns the results)
* - `[options]` is optional, if you do not want to specify, just pass `success` callback as first parameter, and `fail` callback as second parameter
* - Retrieves a list of the available networks as an array of objects and passes them to the function listHandler. The format of the array is:
* ```typescript
* networks = [
* { "level": signal_level, // raw RSSI value
* "SSID": ssid, // SSID as string, with escaped double quotes: "\"ssid name\""
* "BSSID": bssid // MAC address of WiFi router as string
* "frequency": frequency of the access point channel in MHz
* "capabilities": capabilities // Describes the authentication, key management, and encryption schemes supported by the access point.
* "timestamp": timestamp // timestamp of when the scan was completed
* "channelWidth":
* "centerFreq0":
* "centerFreq1":
* }
* ]
* ```
* - `channelWidth` `centerFreq0` and `centerFreq1` are only supported on API > 23 (Marshmallow), any older API will return null for these values
*
* An options object may be passed. Currently, the only supported option is `numLevels`, and it has the following behavior:
*
* - if `(n == true || n < 2)`, `*.getScanResults({numLevels: n})` will return data as before, split in 5 levels;
* - if `(n > 1)`, `*.getScanResults({numLevels: n})` will calculate the signal level, split in n levels;
* - if `(n == false)`, `*.getScanResults({numLevels: n})` will use the raw signal level;
*
* ```typescript
* this.wifiWizard2.isWifiEnabled()
* ```
* - Returns boolean value of whether Wifi is enabled or not
* ```typescript
* this.wifiWizard2.setWifiEnabled(enabled)
* ```
* - Pass `true` for `enabled` parameter to set Wifi enabled
* - You do not need to call this function to set WiFi enabled to call other methods that require wifi enabled. This plugin will automagically enable WiFi if a method is called that requires WiFi to be enabled.
*
* **Thrown Errors**
*
* - `ERROR_SETWIFIENABLED` wifi state does not match call (enable or disable)
*
* ```typescript
* this.wifiWizard2.getConnectedNetworkID()
* ```
* - Returns currently connected network ID in success callback (only if connected), otherwise fail callback will be called
*
* **Thrown Errors**
*
* - `GET_CONNECTED_NET_ID_ERROR` Unable to determine currently connected network ID (may not be connected)
*
* ## New to 3.1.1+
* ```typescript
* this.wifiWizard2.resetBindAll()
* ```
* - Disable bindAll to WiFi network without disconnecting from WiFi
*
* ```typescript
* this.wifiWizard2.setBindAll()
* ```
* - Enable bindAll to WiFi network without disconnecting from WiFi
*
* ```typescript
* this.wifiWizard2.canConnectToInternet()
* ```
*
* - Returns boolean, true or false, if device is able to connect to https://www.google.com via HTTP connection (since ping is unreliable)
* - Unknown errors will still be thrown like all other async functions
* - If you called `connect` or `enable` and passed `true` for `bindAll`, your application will force the ping through wifi connection.
* - If you did not pass `true` (or passed `false`) for `bindAll`, and the wifi does not have internet connection, Android Lollipop+ (API 21+) will use cell connection to ping (due to Android using cell connection when wifi does not have internet) [More Details](https://android-developers.googleblog.com/2016/07/connecting-your-app-to-wi-fi-device.html)
*
*
* ```typescript
* this.wifiWizard2.canConnectToRouter()
* ```
* - As `canPingWifiRouter` is notoriously unreliable, this method uses HTTP connection to test if able to connect to router (as most routers should have web server running on port 80)
* - Unknown errors will still be thrown like all other async functions
* - This is useful for testing to make sure that your Android app is able to connect to the private network after connecting to WiFi
* - This was added for testing the `bindAll` feature to support issues with Android Lollipop+ (API 21+) not routing calls through WiFi if WiFi does not have internet connection [See Android Blog](https://android-developers.googleblog.com/2016/07/connecting-your-app-to-wi-fi-device.html)
* - Attempts to connect router IP HTTP server on port 80 (example: `http://192.168.0.1/` where `192.168.0.1` is the automatically detected IP address)
*
* ## New to 3.0.0+
* ```typescript
* this.wifiWizard2.isConnectedToInternet()
* ```
*
* - Returns boolean, true or false, if device is able to ping 8.8.8.8
* - Unknown errors will still be thrown like all other async functions
* - If you called `connect` or `enable` and passed `true` for `bindAll`, your application will force the ping through wifi connection.
* - If you did not pass `true` (or passed `false`) for `bindAll`, and the wifi does not have internet connection, Android Lollipop+ (API 21+) will use cell connection to ping (due to Android using cell connection when wifi does not have internet) [More Details](https://android-developers.googleblog.com/2016/07/connecting-your-app-to-wi-fi-device.html)
*
* ```typescript
* this.wifiWizard2.canPingWifiRouter()
* ```
*
* - Returns boolean, true or false, if device is able to ping the connected WiFi router IP (obtained from DHCP info)
* - Version 3.1.1+ uses HTTP connection to test if able to connect to router (as ping previous did not work)
* - Unknown errors will still be thrown like all other async functions
* - This is useful for testing to make sure that your Android app is able to connect to the private network after connecting to WiFi
* - This was added for testing the `bindAll` feature to support issues with Android Lollipop+ (API 21+) not routing calls through WiFi if WiFi does not have internet connection [See Android Blog](https://android-developers.googleblog.com/2016/07/connecting-your-app-to-wi-fi-device.html)
*
* ```typescript
* this.wifiWizard2.enableWifi()
* ```
*
* ```typescript
* this.wifiWizard2.disableWifi()
* ```
*
* ```typescript
* this.wifiWizard2.getWifiIP()
* ```
* - Returns IPv4 address of currently connected WiFi, or rejects promise if IP not found or wifi not connected
*
* ```typescript
* this.wifiWizard2.getWifiRouterIP()
* ```
* - Returns IPv4 WiFi router IP from currently connected WiFi, or rejects promise if unable to determine, or wifi not connected
*
* **Thrown Errors**
*
* - `NO_VALID_IP_IDENTIFIED` if unable to determine a valid IP (ip returned from device is `0.0.0.0`)
*
* ```typescript
* this.wifiWizard2.getWifiIPInfo()
* ```
* - Returns a JSON object with IPv4 address and subnet `{"ip": "192.168.1.2", "subnet": "255.255.255.0" }` or rejected promise if not found or not connected
* **Thrown Errors**
*
* - `NO_VALID_IP_IDENTIFIED` if unable to determine a valid IP (ip returned from device is `0.0.0.0`)
*
* ```typescript
* this.wifiWizard2.reconnect()
* ```
* - Reconnect to the currently active access point, **if we are currently disconnected.**
*
* **Thrown Errors**
*
* - `ERROR_RECONNECT` Android returned error when reconnecting
*
* ```typescript
* this.wifiWizard2.reassociate()
* ```
* - Reconnect to the currently active access point, **even if we are already connected.**
*
* **Thrown Errors**
*
* - `ERROR_REASSOCIATE` Android returned error when reassociating
*
*
* ```typescript
* this.wifiWizard2.getSSIDNetworkID(ssid)
* ```
* - Get Android Network ID from passed SSID
*
* ```typescript
* this.wifiWizard2.disable(ssid)
* ```
* - `ssid` can either be an SSID (string) or a network ID (integer)
* - Disable the passed SSID network
* - Please note that most newer versions of Android will only allow you to disable networks created by your application
*
* **Thrown Errors**
*
* - `UNABLE_TO_DISABLE` Android returned failure in disabling network
* - `DISABLE_NETWORK_NOT_FOUND` Unable to determine network ID from passed SSID to disable
*
*
* ```typescript
* this.wifiWizard2.requestPermission()
* ```
* - Request `ACCESS_FINE_LOCATION` permssion
* - This Android permission is required to run `scan`, `startStart` and `getScanResults`
* - You can request permission by running this function manually, or WifiWizard2 will automagically request permission when one of the functions above is called
*
* **Thrown Errors**
*
* - `PERMISSION_DENIED` user denied permission on device
*
*
* ```typescript
* this.wifiWizard2.enable(ssid, bindAll, waitForConnection)
* ```
* - `ssid` can either be an SSID (string) or a network ID (integer)
* - `bindAll` should be set to `true` to tell Android to route all connections from your Android app, through the wifi connection
* - Android Lollipop+ (API 21+) will not route connections to the WiFi device if it does not have internet connection. Passing `true` to `bindAll` will force Android to route connections from your Android app through Wifi, regardless of internet connection.
* - If you are having problems connecting to a local IP through WiFi because it does not have internet, try enabling `bindAll` and this should fix the problem.
* - During my testing, some versions of Android (5.0 - 7.1.2) would still route connections through WiFi without internet, but it was random that some versions would and would not work.
* - Testing Android Oreo+ (8.0.0+) if wifi does not have internet, 100% of the time it would NOT route connections through WiFi, so you *must* enable this for Oreo or newer to route connections from your application through wifi without internet.
* - When `bindAll` is enabled, *ALL* connections from your app will be routed through WiFi, until you call `disconnect` or `disable`
* - See the Google Android Blog for [More Details](https://android-developers.googleblog.com/2016/07/connecting-your-app-to-wi-fi-device.html)
* - This feature *ONLY* works for Android Lollipop+ (API 21+), if device is running API older than 21, `bindall` will be ignored (as API older than 21 does this by default)
* - Enable the passed SSID network
* - You **MUST** call `WifiWizard2.add(wifi)` before calling `enable` as the wifi configuration must exist before you can enable it (or previously used `connect` without calling `disconnect`)
* - This method does NOT wait or verify connection to wifi network, pass `true` to `waitForConnection` to only return promise once connection is verified in COMPLETED state to specific `ssid`
*
* **Thrown Errors**
*
* `UNABLE_TO_ENABLE` - Android returned `-1` signifying failure enabling
*
* # Installation
*
* ## Master
*
* Run ```cordova plugin add https://github.com/tripflex/wifiwizard2```
*
* To install from the master branch (latest on GitHub)
*
* To install a specific branch (add `#tag` replacing `tag` with tag from this repo, example:
* ```cordova plugin add https://github.com/tripflex/wifiwizard2#v3.1.1```
*
* Find available tags here:
* https://github.com/tripflex/WifiWizard2/tags
*
*
* If you are wanting to have the latest and greatest stable version, then run the 'Releases' command below.
*
* ## Releases
* Run ```cordova plugin add cordova-plugin-wifiwizard2```
*
* ## Meteor
* To install and use this plugin in a Meteor project, you have to specify the exact version from NPM repository:
* [https://www.npmjs.com/package/cordova-plugin-wifiwizard2](https://www.npmjs.com/package/cordova-plugin-wifiwizard2)
*
* As of April 4th 2019, the latest version is 3.1.1:
*
* ```meteor add cordova:cordova-plugin-wifiwizard2@3.1.1```
*
* # Errors/Rejections
* Methods now return formatted string errors as detailed below, instead of returning generic error messages. This allows you to check yourself what specific error was returned, and customize the error message.
* In an upcoming release I may add easy ways to override generic messages, or set your own, but for now, errors returned can be found below each method/function.
*
* ## Generic **Thrown Errors**
* `WIFI_NOT_ENABLED`
* ```
*/
@Plugin({
pluginName: 'WifiWizard2',
plugin: 'cordova-plugin-wifiwizard2',
pluginRef: 'WifiWizard2',
repo: 'https://github.com/tripflex/WifiWizard2',
platforms: ['Android', 'iOS']
})
@Injectable()
export class WifiWizard2 extends IonicNativePlugin {
/**
* Connect to network on iOS device
* @param ssid
* @param ssidPassword Password if connecting to WPA/WPA2 network (omit or use false to connect to open network)
* @returns {Promise}
*/
@Cordova({
otherPromise: true,
platforms: ['iOS']
})
iOSConnectNetwork(ssid: string, ssidPassword: string): Promise<any> {
return;
}
/**
* Disconnect from SSID on iOS device
* @param ssid
* @returns {Promise}
*/
@Cordova({
otherPromise: true,
platforms: ['iOS']
})
iOSDisconnectNetwork(ssid: string): Promise<any> {
return;
}
/**
* Add wifi network configuration
* @param wifiConfig Must be object created by formatWifiConfig()
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
add(wifiConfig: WifiConfig): Promise<any> {
return;
}
/**
* Remove wifi network configuration
* @param {string|number} [ssid]
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
remove(ssid: string | number): Promise<any> {
return;
}
/**
* Connect network with specified SSID
*
* This method will first add the wifi configuration, then enable the network, returning promise when connection is verified.
*
* @param {string|number} [ssid]
* @param {boolean} [bindAll=false] - Whether or not to bind all connections from app, through WiFi connection
* @param {string} [password=]
* @param {string} [algorithm=NONE] - WPA, WPA (for WPA2), WEP or NONE (NONE by default)
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
connect(ssid: string | number, bindAll?: boolean, password?: string, algorithm?: string): Promise<any> {
return;
}
/**
* Disconnect (current if SSID not supplied)
*
* This method, if passed an SSID, will first disable the network, and then remove it from the device. To only "disconnect" (ie disable in android),
* call WifiWizard2.disable() instead of disconnect.
*
* @param {string|number} [ssid=all]
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
disconnect(ssid: string | number): Promise<any> {
return;
}
/**
* Enable Network
* @param {string|number} [ssid]
* @param {boolean} [bindAll=false] - Whether or not to bind all network requests to this wifi network
* @param {boolean} [waitForConnection=false] - Whether or not to wait before resolving promise until connection to wifi is verified
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
enable(ssid: string | number, bindAll?: boolean, waitForConnection?: boolean): Promise<any> {
return;
}
/**
* Disable Network
* @param {string|number} [ssid]
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
disable(ssid: string | number): Promise<any> {
return;
}
/**
* Reconnect to the currently active access point, even if we are already connected.
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
reassociate(): Promise<any> {
return;
}
/**
* Reconnect to the currently active access point, if we are currently disconnected.
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
reconnect(): Promise<any> {
return;
}
/**
* Returns currently configured networks
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
listNetworks(): Promise<any> {
return;
}
/**
* Start network scan and return results
* @param options
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
scan(options?: WifiScanOptions): Promise<any> {
return;
}
/**
* Start wifi network scan (results can be retrieved with getScanResults)
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
startScan(): Promise<any> {
return;
}
/**
* Get wifi scan results (must call startScan first, or just use scan())
* @param options
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getScanResults(options: WifiScanResultsOptions): Promise<any> {
return;
}
/**
* Check if WiFi is enabled
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
isWifiEnabled(): Promise<any> {
return;
}
/**
* Enable or Disable WiFi
* @param enabled
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
setWifiEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Enable WiFi
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
enableWifi(): Promise<any> {
return;
}
/**
* Disable WiFi
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true,
platforms: ['Android']
})
disableWifi(): Promise<any> {
return;
}
/**
* Unbind Network
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
resetBindAll(): Promise<any> {
return;
}
/**
* Bind Network
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
setBindAll(): Promise<any> {
return;
}
/**
* Get Wifi Router IP from DHCP
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getWifiRouterIP(): Promise<any> {
return;
}
/**
* Get Wifi IP
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getWifiIP(): Promise<any> {
return;
}
/**
* Get Wifi IP and Subnet Address
*
* This method returns a JSON object similar to: { "ip": "0.0.0.0", "subnet": "0.0.0.0" }
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getWifiIPInfo(): Promise<any> {
return;
}
/**
* Get Network ID from SSID
* @param {string|number} [ssid]
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getSSIDNetworkID(ssid: string | number): Promise<any> {
return;
}
/**
* Get currently connected network ID
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getConnectedNetworkID(): Promise<any> {
return;
}
/**
* Get currently connected network SSID
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getConnectedSSID(): Promise<any> {
return;
}
/**
* Get currently connected network BSSID/MAC
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
getConnectedBSSID(): Promise<any> {
return;
}
/**
* Check if current WiFi connection has connection to the internet
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
isConnectedToInternet(): Promise<any> {
return;
}
/**
* Check if we can ping current WiFi router IP address
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
canPingWifiRouter(): Promise<any> {
return;
}
/**
* Check if we can connect via HTTP current WiFi router IP address
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
canConnectToRouter(): Promise<any> {
return;
}
/**
* Check if current WiFi connection can connect to internet (checks connection to google.com)
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
canConnectToInternet(): Promise<any> {
return;
}
/**
* Request ACCESS_FINE_LOCATION permission
*
* This permission is required by Android to return scan results, you can manually request it prior to running `scan`
* or this plugin will automatically do it when the scan is ran.
*
* @returns {Promise<any>}
*/
@Cordova({
otherPromise: true
})
requestPermission(): Promise<any> {
return;
}
/**
* Format WiFi configuration for Android Devices
* @param {string|number} [ssid]
* @param {string} [password]
* @param {string} [algorithm]
* @param {boolean} [isHiddenSSID]
* @returns {WifiConfig|boolean}
*/
@CordovaFunctionOverride()
formatWifiConfig(ssid: string | number, password: string, algorithm: string, isHiddenSSID: boolean): WifiConfig | boolean {
return;
}
/**
* Format WPA WiFi configuration for Android Devices
* @param {string|number} [ssid]
* @param {string} password
* @param {boolean} isHiddenSSID
* @returns {WifiConfig|boolean}
*/
@CordovaFunctionOverride()
formatWPAConfig(ssid: string | number, password: string, isHiddenSSID: boolean): WifiConfig | boolean {
return;
}
/**
* Format WiFi SSID String
* @param ssid
* @returns {*}
*/
@CordovaFunctionOverride()
formatWifiString(ssid: string | number): string | number {
return;
}
/**
* Synchronous Sleep/Timeout `await this.timeout()`
* @param delay the amount of time to wait (default 2 seconds)
*/
@CordovaFunctionOverride()
timeout(delay?: number): Promise<any> {
return;
}
}
@@ -142,13 +142,15 @@ export class UserPreferencesMethods extends NestedObject {
}
/**
* @name WonderPush
* @name Push Notifications - WonderPush
* @description
*
* Push notification delivery with the WonderPush service.
* Send unlimited push notifications to iOS and Android devices.
*
* Get started in minutes: [Ionic Quickstart Guide](https://docs.wonderpush.com/docs/ionic-quickstart).
*
* Advanced segmentation, automation and personalization of push messages for 1 per 1000 subscribers.
*
* Requires the Cordova plugin `wonderpush-cordova-sdk`.
*
* [WonderPush push notifications](https://www.wonderpush.com) are the most effective way
+2 -7
View File
@@ -16,11 +16,6 @@
"inlineSources": true,
"sourceMap": true
},
"include": [
"src/@ionic-native/core/**/*.ts"
],
"exclude": [
"node_modules",
"src/@ionic-native/core/**/*.spec.ts"
]
"include": ["src/@ionic-native/core/**/*.ts"],
"exclude": ["node_modules", "src/@ionic-native/core/**/*.spec.ts"]
}
+3 -4
View File
@@ -19,10 +19,9 @@
"inlineSources": true,
"inlineSourceMap": true
},
"include": [
"src/@ionic-native/plugins/**/*.ts"
],
"include": ["src/@ionic-native/plugins/**/*.ts"],
"angularCompilerOptions": {
"genDir": "aot"
}
},
"plugins": [{ "name": "typescript-tslint-plugin" }]
}
+2 -1
View File
@@ -12,6 +12,7 @@
"ter-no-proto": false,
"callable-types": false,
"ordered-imports": false,
"prefer-conditional-expression": false
"prefer-conditional-expression": false,
"max-classes-per-file": true
}
}