Compare commits

..
516 Commits
Author SHA1 Message Date
Mike Hartington 95d402c7f5 5.21.4 2020-02-10 23:56:39 -05:00
Mike Hartington df5f832664 fix(build): corrects npm publishing task
Ref #3311
2020-02-10 23:50:46 -05:00
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
Daniel Sogl cb4d5b5064 chore(): update changelog 2019-10-04 16:35:56 +02:00
Daniel Sogl 265b4ba02f 5.15.0 2019-10-04 16:35:50 +02:00
Daniel Sogl 5fc13abb10 chore(package): bump deps 2019-10-04 16:35:32 +02:00
Matthew HarrisandDaniel Sogl b7a4e44308 docs(camera): adjust example types (#3188)
It seems like these two definitions were switched around accidentally. I'm just going from the obvious logic of it. I don't know if there is some situation where the names are intentionally switched around? Please only accept PR if you can vouch for my change.
2019-10-04 16:32:20 +02:00
jcesarmobileandDaniel Sogl a1fb93707f fix(keyboard): Update types with new 2.2.0 methods (#3187) 2019-10-04 16:31:50 +02:00
Bryant PandDaniel Sogl a575233f23 fix(pro): Removing Pro native wrapper (#3186) 2019-10-04 16:31:31 +02:00
Min YinandDaniel Sogl 66f2e155f0 feat(web-socket-server): Add cordova plugin websocket server (#3183)
* Add Basic WebSocketServer Class

* Change for custom plugin fork

* Set cordova observable property

* Setup for custom fork of plugin

Using custom fork for better support for
observables. Use original repo when pull request
https://github.com/becvert/cordova-plugin-websocket-server/pull/64 is merged

* Add Documentation

* Remove double quotes with single quotes

* Fix lint issues

* Fix stop() docs
2019-10-04 16:30:42 +02:00
SimonandDaniel Sogl 5f16fcd292 feat(emm-app-config): add plugin (#3181)
* Add Emm App Config plugin

Add [emm-app-config](https://github.com/oracle/cordova-plugin-emm-app-config) plugin to retrieve EMM application configuration

* Update index.ts
2019-10-04 16:29:59 +02:00
Sefa IlkimenandDaniel Sogl fc6d1d0c7f feat(http): add type definitions for new features available in v2.2.0 (#3185)
- support uploading multiple files
- support response type `json
2019-09-30 07:48:22 +02:00
Min YinandDaniel Sogl acec6cfb18 fix(web-server): add path to response (#3184) 2019-09-29 13:24:17 +02:00
MaximBelovandDaniel Sogl f5d94d824d docs(mobile-accessibility): adjust documentation (#3180)
* fix(mobile-accessibility): fix documentation

* Update index.ts
2019-09-29 13:23:45 +02:00
Stéphane JAISandDaniel Sogl 70d4fcd30e docs(wonderpush): fix usage example (#3177) 2019-09-29 13:22:47 +02:00
SrinidhiandDaniel Sogl 5cea6141c4 docs(unvired-cordova-sdk): update doc (#3171)
* 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
2019-09-29 13:22:11 +02:00
nrikijiandDaniel Sogl cb543b9841 fix(line-login): adjustment parameter (#3172) 2019-09-29 13:21:49 +02:00
Daniel Sogl 3f172cc2b8 chore(): update changelog 2019-09-13 14:54:35 +02:00
Daniel Sogl 98b463b0d3 5.14.0 2019-09-13 14:54:30 +02:00
Daniel Sogl 8940301e87 Merge remote-tracking branch 'origin/master' 2019-09-13 14:54:03 +02:00
Daniel Sogl 493405426c chore(package): bump deps 2019-09-13 14:53:57 +02:00
Mostafa MansourandDaniel Sogl fcec2d16b3 feat(preview-any-file): add new plugin to preview the … (#3156)
* feat(cordova-plugin-preview-any-file): add new plugin to preview the files in both ios and android

* fix lint error

* add missing descriptions

* add the reop link
2019-09-13 14:53:57 +02:00
Jose Andrés Pérez ArévaloandDaniel Sogl d9ded4d164 feat(ssh-connect): add new plugin for ssh connection (#3169) 2019-09-13 14:53:57 +02:00
Dalton PearsonandDaniel Sogl 141f0e6e41 feat(document-scanner): add quality and base64 (#3168)
* feat(document-scanner): add quality and base64

* removed trailing whitespace
2019-09-13 14:53:57 +02:00
jcesarmobileandDaniel Sogl 199380c0c3 fix(screen-orientation): add window element to eventObservable (#3166) 2019-09-13 14:53:57 +02:00
Alexander VagnerandDaniel Sogl a46e308ea8 fix(firebase-x): adjust typings for hasPermission (#3161)
Current version of plugin has change, described in https://github.com/dpa99c/cordova-plugin-firebasex#breaking-api-changes, this commit fixed `hasPermission()` method typings
2019-09-13 14:53:57 +02:00
Daniel Sogl fb0ee819be chore(package): bump deps 2019-09-13 14:53:26 +02:00
Mostafa MansourandDaniel Sogl 1b6506f53a feat(preview-any-file): add new plugin to preview the … (#3156)
* feat(cordova-plugin-preview-any-file): add new plugin to preview the files in both ios and android

* fix lint error

* add missing descriptions

* add the reop link
2019-09-13 15:42:08 +03:00
Jose Andrés Pérez ArévaloandDaniel Sogl d539eb4f62 feat(ssh-connect): add new plugin for ssh connection (#3169) 2019-09-13 15:41:24 +03:00
Dalton PearsonandDaniel Sogl cfcd8d16a6 feat(document-scanner): add quality and base64 (#3168)
* feat(document-scanner): add quality and base64

* removed trailing whitespace
2019-09-13 15:40:28 +03:00
jcesarmobileandDaniel Sogl 6bc1b932c8 fix(screen-orientation): add window element to eventObservable (#3166) 2019-09-13 15:39:52 +03:00
Alexander VagnerandDaniel Sogl 650615e883 Fix typings for hasPermission() (#3161)
Current version of plugin has change, described in https://github.com/dpa99c/cordova-plugin-firebasex#breaking-api-changes, this commit fixed `hasPermission()` method typings
2019-09-13 15:38:23 +03:00
DomvelandDaniel Sogl 8b3b2a4b27 fix(core): Return the window object as default instead of the boolean from the typeof comparison (#3160)
* Fixes #2972

https://github.com/ionic-team/ionic-native/issues/2972

* If window does not exist.

But is there a case where window does not exist? If ionic-native always runs in browsers enviroment (like Cordova / WebView) we could remove the `typeof` checks.
2019-09-13 15:38:01 +03:00
Bas ten FeldandDaniel Sogl 2b347fe889 fix(app-rate) add missing locale properties (#3159) 2019-09-13 15:37:37 +03:00
Ken SodemannandDaniel Sogl 8032429faa doc(OCR): use the appropriate export name (#3158) 2019-09-05 12:20:20 +02:00
Daniel SoglandGitHub 4cb97eeec4 docs(ocr): update example 2019-09-04 22:56:01 +03:00
Daniel Sogl 1d878c6902 chore(): update changelog 2019-08-30 16:04:21 +02:00
Daniel Sogl e65ce4a879 5.13.0 2019-08-30 16:04:15 +02:00
Daniel Sogl bfa4f62e2b chore(package): use angular 8 and ts 3.5 2019-08-30 16:02:57 +02:00
Daniel Sogl 1af96d1369 chore(package): bump deps 2019-08-30 15:57:46 +02:00
SrinidhiandDaniel Sogl dcce3489f4 doc(unvired-cordova-sdk): update doc (#3147)
* 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
2019-08-30 15:55:27 +02:00
SaninnandDaniel Sogl 3a5c790a56 bugfix: add response type to permission checking (#3149) 2019-08-30 15:53:47 +02:00
Ziyaddin SadigovandDaniel Sogl 73493e222f fix(network): rename onchange method name (#3146) 2019-08-30 15:52:55 +02:00
MaximBelovandDaniel Sogl 26447d22ea fix(anyline): added official plugin (#3144) 2019-08-30 15:52:33 +02:00
Marius BackesandDaniel Sogl a55bb60d70 fix(theme-detection): added android platform (#3143) 2019-08-30 15:52:07 +02:00
jcesarmobileandDaniel Sogl 4d1e0e6949 fix(in-app-browser): update types to match cordova-plugin-inappbrowser 3.1.0 (#3142)
* Update index.d.ts

Property comments are omitted if they are not marked with double asterisks. Added missing asterisks

* Update index.d.ts

Updated comments to match linter settings

* Fix lint errors and some missing comments

* add missing options and improve types
2019-08-30 15:51:38 +02:00
Alberto VarelaandDaniel Sogl 189570d255 feat(google-play-games-services): add new synchronous methods (#3138) 2019-08-30 15:51:29 +02:00
Stéphane JAISandDaniel Sogl 64ca73e5cc docs(wonderpush): fix usage formatting (#3137) 2019-08-12 06:52:03 +02:00
Daniel Sogl 4337515961 chore(): update changelog 2019-08-09 11:17:23 +02:00
Daniel Sogl c0d4a2ee34 5.12.0 2019-08-09 11:17:15 +02:00
Daniel Sogl 1f7e6a5d02 chore(package): bump deps 2019-08-09 11:11:10 +02:00
Akshay DwivediandDaniel Sogl fd81a5e5b7 feat(file-chooser): add missing options param (#3136)
added missing optional parameter to support mime types
2019-08-09 11:09:22 +02:00
Eliran AssarafandDaniel Sogl f3b8e34091 fix(chooser): @param accept is supposed to be optional (#3134) 2019-08-09 11:08:20 +02:00
Matthew HarrisandDaniel Sogl 5cc91bc79a fix(background-geolocation): enum not string (#3131)
based on [this stackoverflow issue](https://stackoverflow.com/questions/57293829/argument-of-type-location-is-not-assignable-to-parameter-of-type-backgroundge/57302110#57302110) it seems passing the string causes problems in (some / all) scenarios
2019-08-09 11:07:39 +02:00
SrinidhiandDaniel Sogl e37a7221b1 doc(unvired-cordova-sdk): update doc (#3130)
* 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
2019-08-09 11:07:11 +02:00
BultjerCMCandDaniel Sogl 016023a7bb fix(ms-adal): use correct accessTokenType prop (#3128)
Removed a typo, which made the Access Token Type undefined all the time.
2019-08-09 11:06:38 +02:00
Matthew HarrisandDaniel Sogl 852df98647 docs(image-picker): set repo url to active repo (#3127)
Original repo hasn't had a commit since 2016. `Repo:` parameter already updated but intro docs wasn't.
2019-08-09 11:05:53 +02:00
jfgreffierandDaniel Sogl 7696706080 feat(http): add sendRequest responseType option (#3120) 2019-08-09 11:05:17 +02:00
Daniel SoglandGitHub 2c0aa4f124 fix(intercom): added logout, displayHelpCenter, sendPushTokenToIntercom (#3119) 2019-08-09 11:05:05 +02:00
František SpurnýandDaniel Sogl 8bcbc955e0 feat(smartlook): add plugin (#3117) 2019-08-09 11:04:51 +02:00
Maxim Belov 3bb6b59112 fix(intercom): added logout, displayHelpCenter, sendPushTokenToIntercom 2019-07-29 22:50:13 +03:00
Daniel Sogl f6e77db7b0 chore(): update changelog 2019-07-29 16:12:06 +02:00
Daniel Sogl acc587aca2 5.11.0 2019-07-29 16:12:00 +02:00
Daniel Sogl c77bdf17c1 chore(package): bump deps 2019-07-29 16:10:14 +02:00
Daniel SoglandGitHub 0c9bf3bf49 feat(urbanairship): add plugin (#3114)
feat(urbanairship): add plugin
2019-07-29 12:02:29 +02:00
Daniel SoglandGitHub f54b9e0797 doc(unvired-cordova-sdk): improve doc (#3108)
* feat(unvired-cordova-sdk): add plugin

* style(unvired-cordova-sdk): fix style

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

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

* style(unvired-cordova-sdk): fix style

* doc(unvired-cordova-sdk): fix readme errors

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

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

* doc(unvired-cordova-sdk): remove clearFunction
2019-07-29 12:00:01 +02:00
Stéphane JAISandDaniel Sogl 7e08680d31 feat(wonderpush): add plugin (#3107) 2019-07-29 11:59:51 +02:00
patryk-fuhrmanandDaniel Sogl de83edb99b feat(cordova-plugin-firebasex): Add plugin (#3106) 2019-07-29 11:59:41 +02:00
Daniel SoglandGitHub fac94485a0 Update index.ts 2019-07-29 11:58:04 +02:00
Maxim Belov 9c9ed3518f feat(urbanship): add plugin 2019-07-29 01:53:09 +03:00
Srinidhi Anand Rao a0779de633 doc(unvired-cordova-sdk): remove clearFunction 2019-07-23 13:57:37 +05:30
Srinidhi Anand Rao 50408b08c6 Merge commit 'a2f5acb48c8d197fad55276ffcee7eee5cf3065f'
# Conflicts:
#	src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
2019-07-21 19:32:45 +05:30
Srinidhi Anand Rao 767391a4b4 doc(unvired-cordova-sdk): improve doc 2019-07-21 19:27:25 +05:30
Daniel Sogl a2f5acb48c chore(): update changelog 2019-07-12 20:27:59 +02:00
Daniel Sogl 3a3e9338e7 5.10.0 2019-07-12 20:27:53 +02:00
8badd2943a feat(anyline): add plugin (#3101)
closes: #3074
Co-authored-by: niconaso
2019-07-12 20:26:22 +02:00
Daniel Sogl 9a46ab1a6d chore(build): remove "default" 2019-07-12 20:12:54 +02:00
Daniel Sogl 952a5c8e11 Merge remote-tracking branch 'origin/master' 2019-07-12 20:11:42 +02:00
Daniel Sogl 2a995d94ec chore(build): upgrate to node 12 and gulp 4 2019-07-12 20:11:26 +02:00
Daniel Sogl 941d394da9 chore(build): upgrate to node 12 and gulp 4 2019-07-12 20:09:33 +02:00
Daniel Sogl cc1f25c38c chore(package): bump deps 2019-07-12 11:45:30 +02:00
nrikijiandDaniel Sogl 7aa08109ce fix(line-login): add missing email prop (#3098) 2019-07-12 11:41:35 +02:00
reymavandDaniel Sogl 8ce541ff9a fix(barcode-scanner): add missing shouldAutorotate property (#3096)
* Disable or enable Autorotate camera into barcode scanner plugin

* fix asterisks in jsdoc must be aligned
2019-07-12 11:40:52 +02:00
Patrick BußmannandDaniel Sogl 75190f5166 docs(deeplinks): Added informations about AASA (iOS) and Asset Links (Android) to documentation (#3094) 2019-07-12 11:40:36 +02:00
SrinidhiandDaniel Sogl c697139089 doc(unvired-cordova-sdk): doc update (#3090)
* feat(unvired-cordova-sdk): add plugin

* style(unvired-cordova-sdk): fix style

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

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

* style(unvired-cordova-sdk): fix style

* doc(unvired-cordova-sdk): fix readme errors

* doc(unvired-cordova-sdk): update doc
2019-07-12 11:40:19 +02:00
Anton ZagrebelnyandDaniel Sogl 717f6864f3 fix(biocatch): added android platform and updated repo (#3086) 2019-07-12 11:39:42 +02:00
Marius BackesandDaniel Sogl e9fa3ee6f2 feat(theme-detection): add plugin (#3082) 2019-07-12 11:39:23 +02:00
Srinidhi Anand Rao 28ce962677 doc(unvired-cordova-sdk): update doc 2019-07-12 14:57:43 +05:30
Srinidhi Anand Rao f576c5f11e doc(unvired-cordova-sdk): fix readme errors 2019-07-05 17:14:52 +05:30
Srinidhi Anand Rao f488a75e26 Merge commit '2b684fadb179af64ac179e0a878b4ffdec0e85aa'
# Conflicts:
#	src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
2019-07-05 15:44:16 +05:30
Srinidhi Anand Rao 55fb503d81 style(unvired-cordova-sdk): fix style 2019-07-05 15:16:14 +05:30
Srinidhi Anand Rao afe95a6752 doc(unvired-cordova-sdk): update doc 2019-07-05 13:15:01 +05:30
Srinidhi Anand Rao 2ca8bda8f7 doc(unvired-cordova-sdk): add doc 2019-07-04 18:12:29 +05:30
Daniel Sogl 2b684fadb1 chore(): update changelog 2019-07-01 19:34:57 +02:00
Daniel Sogl 7f2da56a28 5.9.0 2019-07-01 19:34:23 +02:00
Daniel Sogl 4a546bd11a 5.8.0 2019-07-01 19:34:20 +02:00
Daniel Sogl a0f5254988 Revert "chore(build): use node 12"
This reverts commit 8521b32306.
2019-07-01 19:32:24 +02:00
Daniel Sogl 8521b32306 chore(build): use node 12 2019-07-01 19:30:30 +02:00
Daniel Sogl d52278b2d1 chore(package): bump deps 2019-07-01 19:29:32 +02:00
TimoandDaniel Sogl 2fadb6b0e1 fix(firebase): add missing decorator to clearAllNotifications (#3059) 2019-07-01 19:27:03 +02:00
Lars MikkelsenandDaniel Sogl ad11ed21ac refactor(core): allow rxjs 5.5 as peer dependency (#3068)
This would allow Ionic v3 apps to use Ionic Native v5 wrappers.
2019-07-01 19:26:20 +02:00
WasenshiandDaniel Sogl 5857b9654c feat(calendar): add deleteEventById function (#3075)
* Update index.ts

Please add this function

* Update index.ts
2019-07-01 19:24:40 +02:00
jing-zhouandDaniel Sogl 92d5764e01 fix(alipay): use correct pluginRef (#3081) 2019-07-01 19:20:22 +02:00
Marius BackesandDaniel Sogl a4db080786 feat(sum-up): add plugin (#3080) 2019-07-01 19:19:44 +02:00
Szymon StasikandDaniel Sogl 54ac2bfdf5 feat(diagnostic): add DENIED_ONCE introduced by diagnostic v5 (#3071)
cordova.plugins.diagnostic@5.0.0 introduced breaking change moving from `DENIED` to `DENIED_ONCE` and make the statuses semantically equal for iOS and Android. For backward compatibility `DENIED` is untouched in this PR but marked as deprecated
2019-07-01 19:18:11 +02:00
SrinidhiandDaniel Sogl 9274083b24 feat(unvired-cordova-sdk): add plugin (#3061)
* feat(unvired-cordova-sdk): add plugin

* style(unvired-cordova-sdk): fix style
2019-07-01 19:17:38 +02:00
Cam WiegertandGitHub d04396e631 chore(scripts): add installVariables to docs-json output (#3079) 2019-06-28 14:23:28 -05:00
perry c4b4584d2d couchbase depreciation warning 2019-06-19 11:02:40 -05:00
Eliran ElnasiandDaniel Sogl 1fc09098fe fix(in-app-purchase-2): add missing option to register function (#3063)
* Update TS type for register() method

It should accept also a list of IAPProductOptions

* Update index.ts
2019-06-17 14:52:19 +02:00
Zahid MahmoodandDaniel Sogl b217bdb62a docs(launch-review): add missing bracket (#3062) 2019-06-15 08:14:48 +02:00
Srinidhi Rao 1b60247807 style(unvired-cordova-sdk): fix style 2019-06-14 14:08:58 +05:30
Srinidhi Rao b75f40c76e feat(unvired-cordova-sdk): add plugin 2019-06-14 13:41:48 +05:30
Daniel Sogl 09ca1a1843 chore(package): bump deps 2019-06-10 20:12:32 +02:00
hanatharesh2712andDaniel Sogl 6cbb226ed2 feat(sms-retriever): add plugin (#3052)
* created index.ts file for sms retriver plugin wrapper for ionic native

created index.ts file for sms retriver plugin wrapper for ionic native
Plugin name : cordova-plugin-sms-retriever-manager

* resolved tslint errors

resolved tslint errors

* Update index.ts

* Update index.ts
2019-06-10 20:04:43 +02:00
Jean-Christophe HoeltandDaniel Sogl ed80933b6c feat(in-app-purchase-2): add documentation (#3055)
Ported to typescript from the repo's README and API documentation.
2019-06-10 20:04:26 +02:00
Gyula IsoóandDaniel Sogl 300d7c229c fix(music-control): use correct input type (#3054) 2019-06-10 20:03:34 +02:00
HatemandDaniel Sogl 43442ac4ea feat(apple-wallet): support plugin version 3.0 (#3053)
BREAKING: Requires `cordova-apple-wallet@3.0`
2019-06-10 20:00:44 +02:00
Szymon StasikandDaniel Sogl 12f2782fef feat(diagnostic): add requestRemoteNotificationsAuthorization method (#3051)
solves #3050

while diagnostic plugin docs may be confusing, the `requestRemoteNotificationsAuthorization(successCallback, errorCallback, types, omitRegistration)` signature is available in the sources:

https://github.com/dpa99c/cordova-diagnostic-plugin/blob/0fac4a59d1f246c872c05f513b09f0e9c93abb51/www/ios/diagnostic.notifications.js#L162
2019-06-10 19:55:26 +02:00
Daniel Sogl a586734b92 chore(): update changelog 2019-06-03 07:09:54 +02:00
Daniel Sogl f58183260d 5.7.0 2019-06-03 07:09:06 +02:00
Daniel Sogl a3c49fd17a chore(package): bump deps 2019-06-03 07:08:38 +02:00
Daniel Sogl 6ee94b93ba refactor(core): set rxjs version to 6.5
BREAKING: rxjs@6.5 is required
2019-06-03 07:06:55 +02:00
Anup SharmaandDaniel Sogl a0ec1252e0 feat(onesignal): add missing "setExternalUserId" and "removeExternalUserId" functions (#3049)
* Adding missing functions to index.ts file

The functions were missing, Please refer to the issue #2909 
https://github.com/ionic-team/ionic-native/issues/2909

* Updated comments

Updated comments which were failing tslint test

* removed trailing whitespace

removed trailing whitespace
2019-06-03 06:56:36 +02:00
Michael FornaroandDaniel Sogl dfb0aa3d5d feat(device-accounts): add "getPermissionsByType" function (#3048) 2019-06-03 06:56:23 +02:00
Adam DurenandDaniel Sogl 312c126cc8 docs(firebase-messaging): update docs to support requestPermission forceShow and getToken tokenType options (#3047) 2019-06-03 06:56:00 +02:00
Robert CoieandDaniel Sogl b79c8b1ea0 feat(ocr): add plugin (#3044) 2019-06-03 06:55:49 +02:00
Robert CoieandDaniel Sogl 49e81cc414 feat(document-scanner): add plugin (#3043) 2019-06-03 06:55:40 +02:00
Jeff JulianandDaniel Sogl 2942ebfae4 feat(blinkid): added support for card overlay (#3041) 2019-06-03 06:55:30 +02:00
Jean-Christophe HoeltandDaniel Sogl 4ae35cba9a feat(in-app-purchase-2): update TypeScript definitions (#3037) 2019-06-03 06:55:17 +02:00
Daniel PereiraandDaniel Sogl bb7b516c50 feat(full-screen-image): add plugin (#3026)
* feat(full-screen-image): add plugin

* Update index.ts
2019-06-03 06:55:00 +02:00
pranav9kandDaniel Sogl c0b092b242 feat(biometric-wrapper): add plugin (#3025) 2019-06-03 06:54:50 +02:00
Daniel Sogl a2fe674a3f chore(): update changelog 2019-05-27 07:42:47 +02:00
Daniel Sogl f12da1f4f5 5.6.1 2019-05-27 07:42:39 +02:00
Daniel Sogl 0e7bec3633 chore(package): bump deps 2019-05-27 07:22:40 +02:00
Adam DurenandDaniel Sogl 7588eaf9fd refactor(firebase-config): update wrapper to latest release 2.0.0 (#3027)
* Remove deprecated namespace parameter

* Update for cordova-plugin-firebase-config@2.0.0
2019-05-27 07:20:12 +02:00
Robert CoieandDaniel Sogl c5a9d0d258 docs(developer): remove stale observation about methods being static (#3033) 2019-05-27 07:19:10 +02:00
Safery HossainandDaniel Sogl 18e4a9cda6 docs(music-controls): fix example code (#3036)
The function this.musicControls.subscribe().subscribe was not closed properly, I added the proper syntax for closing the tag.
2019-05-27 07:18:52 +02:00
perry 26f63c744d docs(rollbar): adding link to rollbar in description 2019-05-17 10:20:23 -05:00
Daniel Sogl 1cb4c989f9 chore(): update changelog 2019-05-16 07:07:12 +02:00
Daniel Sogl c80d081c92 5.6.0 2019-05-16 07:07:04 +02:00
Daniel Sogl 3e0a7395ca chore(circle-ci): optim "npm install" 2019-05-16 07:04:44 +02:00
Daniel Sogl 4c6dc71cbe chore(package): bump deps 2019-05-16 07:04:01 +02:00
Daniel SoglandGitHub 81a10280cc feat(biocatch): add plugin #3019
feat(biocatch): add plugin
2019-05-16 06:56:16 +02:00
Daniel SoglandGitHub 56e4a7827f feat(camera-preview): add wrapper for camera preview snapshot #3018
feat(camera-preview): add wrapper for camera preview snapshot
2019-05-16 06:56:00 +02:00
Daniel SoglandGitHub c4fe2b7203 feat(foreground-service): add plugin #3017
feat(foreground-service): add plugin
2019-05-16 06:55:42 +02:00
Daniel SoglandGitHub 0dc320bbd2 feat(FileOpener): add showOpenWithDialog function #3014
feat(FileOpener): Added method showOpenWithDialog
2019-05-16 06:55:27 +02:00
Daniel SoglandGitHub b4201e1b52 fix(blinkid): correct issue with blink card #3011
fix(blinkid): correct issue with blink card
2019-05-16 06:55:02 +02:00
Daniel SoglandGitHub 9a4bef34bb refactor(device-accounts): update source #3010
refactor(device-accounts): update source
2019-05-16 06:54:45 +02:00
Daniel SoglandGitHub 2bc8bdc49c feat(firebase-crash): add plugin (#3003) 2019-05-16 06:54:24 +02:00
RomainandDaniel Sogl e363d98bd8 fix(firebase-crashlytics): update initialise method (#2990) (#2991) 2019-05-16 06:54:13 +02:00
Anton Zagrebelny 980447673b fix(biocatch): updateCustomerSessionID argument can be null 2019-05-14 19:00:24 +03:00
Anton Zagrebelny 7afed90b56 fix(biocatch): start publicKey is now required even if null 2019-05-14 18:46:30 +03:00
Anton Zagrebelny 0634e64b58 refactor(biocatch): fixed casing 2019-05-14 16:21:21 +03:00
Anton Zagrebelny a42e7b8258 feat(biocatch): add Biocatch plugin 2019-05-14 15:40:43 +03:00
Marc Kassay 5b5c6e61ac feat(foreground-service): allows background services 2019-05-13 18:10:42 -04:00
max-in-to 79037743b8 feat(camera-preview): add wrapper for camera preview snapshot 2019-05-09 21:14:27 -07:00
nerdic-coder ed36dc492d feat(FileOpener): Added method showOpenWithDialog 2019-05-08 16:32:53 +03:00
Jeff Julian 1f31954cb3 fix(blinkid): resolve issues with blink card 2019-05-03 19:16:55 -05:00
Jeff Julian 4601ea3e01 fix(blinkid): correct issue with blink card 2019-05-03 19:04:14 -05:00
Michael FornaroandGitHub 45c64b0394 Merge branch 'master' into master 2019-05-04 09:28:29 +10:00
Michael 591c290dbd Fixing pluginRef and plugin name to match maintained npm module 2019-05-04 09:23:12 +10:00
Julian Sanio 66b9d1a011 feat(firebase-crash): add plugin 2019-04-29 17:58:17 +02:00
Daniel Sogl 25ef7c98bc chore(): update changelog 2019-04-29 08:14:33 +02:00
Daniel Sogl 19ddf3fb93 5.5.1 2019-04-29 08:14:25 +02:00
Daniel Sogl 20a3791a88 chore(package): bump deps 2019-04-29 08:12:26 +02:00
Simone ColazzoandDaniel Sogl 9800271352 feat(CameraPreview): add getHorizontalFOV callback (#3000) 2019-04-29 08:07:10 +02:00
Daniel SoglandGitHub e288a5d757 fix(background-geolocation): update source
closes: #2979
2019-04-29 08:05:01 +02:00
Daniel Sogl ab7c7fa491 chore(): update changelog 2019-04-19 19:06:25 +02:00
Daniel Sogl 9e306e7de1 5.5.0 2019-04-19 19:06:18 +02:00
Daniel Sogl 92e0cb2385 chore(package): bump deps 2019-04-19 19:03:43 +02:00
Niklas MerzandDaniel Sogl 0800f4a414 docs(fingerprint-aio): change parameter description (#2995)
* docs(fingerprint-aio): change parameter description

* Update index.ts
2019-04-19 18:59:51 +02:00
Adam DurenandDaniel Sogl e47774b771 fix(firebase-messaging): fix the typings of the FCM message payload (#2998) 2019-04-19 18:58:38 +02:00
Tobias KauschandDaniel Sogl c0ce17b170 fix(background-mode): update types definitions (#2997)
On the last PR https://github.com/ionic-team/ionic-native/pull/2982
there was a little typing problem for the .on event listener call.
2019-04-19 18:58:28 +02:00
ZacandDaniel Sogl c518c8114d fix(google-plus): mark login param as required (#2996) 2019-04-19 18:58:04 +02:00
Johan DufourandDaniel Sogl 21dc1f9a56 feat(spotify-auth): add Spotify OAuth plugin (#2989) 2019-04-19 18:56:52 +02:00
Cesar de la VegaandDaniel Sogl 7ea51fcf06 feat(purchases): update plugin to v0.0.5 (#2988)
* Updates to Cordova plugin 0.0.5

* Makes underlyingErrorMessage optional
2019-04-19 18:56:28 +02:00
Michael FornaroandDaniel Sogl c063652800 feat(device-accounts): update plugin source (#2976)
* feat: updating device account wrapper with maintained fork with android 8.0 compatibility

* updating func to include getPermission for email permissions on android 8.0+

* revert package-lock as per feedback

* fix conflicts in package-lock.json, revert back to commit 49d7ca7375
2019-04-19 18:56:17 +02:00
Daniel SoglandGitHub 9024ea516a fix(nfc): rename makeReadyOnly to makeReadOnly
fix: #2985
2019-04-11 20:20:36 +02:00
Michael e92b7aeb74 fix conflicts in package-lock.json, revert back to commit 49d7ca7375 2019-04-08 08:07:33 +10:00
Michael dc51c3e1e8 revert package-lock as per feedback 2019-04-08 08:04:23 +10:00
Daniel Sogl 4859387925 chore(): update changelog 2019-04-07 20:02:36 +02:00
Daniel Sogl 10787c8056 5.4.0 2019-04-07 20:02:29 +02:00
Wojciech BubolkaandDaniel Sogl f874185a35 feat(in-app-purchase-2): add manageSubscriptions() (#2980)
* feat(in-app-purchase-2): add manageSubscriptions()

* feat(in-app-purchase-2): add manageSubscriptions()
2019-04-07 19:59:58 +02:00
Daniel Sogl 00e34877f3 chore(package): bump deps 2019-04-07 19:59:37 +02:00
Daniel Sogl 4de49c37dd feat(nativegeocoder): update plugin to v3.2.0 (#2958) 2019-04-07 19:56:31 +02:00
Daniel SoglandGitHub bd4b2e2bb4 feat(nativegeocoder): update plugin to v3.2.0 (#2958)
* feat(nativegeocoder): update plugin to v3.2.0

* update imports
2019-04-07 19:22:12 +02:00
maluaandDaniel Sogl aa138c4cfe fix(facebook): use object notation, otherwise EVENTS is´ undefined (#2955)
* fix(facebook-events-object): use object notation, otherwise EVENTS is undefined

* reverted prettier double quotes to single quotes
2019-04-07 19:19:42 +02:00
Timur GirginandDaniel Sogl 4e60c631ae fix(in-app-purchase2): Registering a product with an alias is now optional (#2946)
According to the documentation, alias is optional
https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#storeregisterproduct
2019-04-07 19:15:17 +02:00
Arzan BhorrandDaniel Sogl 767d3b3dd4 feat(google-play-games-services): add getPlayerScore function (#2949) 2019-04-07 19:13:04 +02:00
Cesar de la VegaandDaniel Sogl 39be27566b feat(purchases): add new plugin for purchases (#2940)
* feat(purchases): create new plugin

* style(purchases): fix double quotes linter warning

* Update instructions to add strip frameworks phase

* removes trailing space

* fixes jsdoc
2019-04-07 19:10:42 +02:00
selected-pixel-jamesonandDaniel Sogl 029f82f1fd feat(in-app-purchase-2): add missing property (#2961)
feat(in-app-purchase-2): add missing property
2019-04-07 19:09:59 +02:00
Julián Mesa LlopisandDaniel Sogl 6a19509ded fix(ble): fix definitions (#2974)
* Fix bad definitions in blueooth-le module in initialize and enable funcions

* Fix MATCH_MODE_AGGRESSIVE

* Fix startScan return

* Fix connect return

* Fix rssi function return type

* Fix disconnect return.
Fix close return.
Fix discover return.
Fix services return.
Fix mtu return.
2019-04-07 19:09:22 +02:00
Johan DufourandDaniel Sogl c75aeb9c39 fix(background-mode): update types definitions (#2982) 2019-04-07 19:07:48 +02:00
Michael dcd95582d2 updating func to include getPermission for email permissions on android 8.0+ 2019-04-06 11:19:42 +11:00
Michael 354af9fe6f feat: updating device account wrapper with maintained fork with android 8.0 compatibility 2019-04-03 12:28:16 +11:00
Daniel Sogl 49d7ca7375 chore(): update changelog 2019-03-19 19:03:51 +01:00
Daniel Sogl 8d91856103 5.3.0 2019-03-19 19:03:39 +01:00
Daniel Sogl 5221c8cf41 Merge remote-tracking branch 'origin/master' 2019-03-19 18:36:42 +01:00
Daniel Sogl d827db27b0 Revert "refactor(template): update Inject decorator"
BREAKING CHANGE: This reverts commit c5ae6362d7.
2019-03-19 18:36:21 +01:00
Daniel Sogl b9e46730e3 Revert "refactor(template): update Inject decorator"
This reverts commit c5ae6362d7.
2019-03-19 18:35:00 +01:00
Daniel Sogl fcda5ffcab Revert "refactor: optimize plugins for angular treeshaking"
This reverts commit 8b53c04dc5.
2019-03-19 18:34:54 +01:00
Daniel Sogl 6fde61d69c chore(package): bump deps 2019-03-19 18:34:22 +01:00
Daniel SoglandGitHub c8ff885023 chore: fix linter 2019-03-19 18:25:24 +01:00
Cam WiegertandGitHub 06654afae3 fix(scripts): check for TypeDoc tags when selecting plugin class (#2963) 2019-03-14 13:35:32 -05:00
Cesar de la VegaandMike Hartington e1a25af0b5 chore(common): fix linter error (#2941)
fix linter error by using conditional expression instead of assigning to element in multiple places
2019-03-11 14:35:26 -04:00
Sebastian Baar 419b68217e update imports 2019-03-10 13:46:53 +01:00
Sebastian Baar cd97375e63 feat(nativegeocoder): update plugin to v3.2.0 2019-03-10 13:45:30 +01:00
Cam WiegertandGitHub b0dea6dc58 feat(scripts): add docs-json script (#2947) 2019-03-05 13:22:58 -06:00
Adam Bradley 7e090cc6f2 fix(ssr): remove cordova warning during ssr 2019-02-24 00:16:45 -06:00
Adam Bradley c2029f7927 fix(ssr): fix window references 2019-02-23 17:05:19 -06:00
Adam Bradley 5b1bdc37e0 fix(ssr): fix window references 2019-02-23 16:54:09 -06:00
Adam Bradley e3e8c85087 fix(ssr): check for window and document 2019-02-23 11:34:16 -06:00
Daniel Sogl 03c01c687e chore(): update changelog 2019-02-20 18:05:14 +01:00
Daniel Sogl c0684cb3d8 5.2.0 2019-02-20 18:05:08 +01:00
Daniel Sogl 9a85a5cd62 chore(package): bump deps 2019-02-20 17:54:47 +01:00
HatemandDaniel Sogl 7ae2ad4e3e feat(apple-wallet): update wrapper to release 2.0 (#2935)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts

* update readme

* feat (apple wallet ): add methods to check existence and ellibagility

* lint

* lint

* Update index.ts
2019-02-20 17:42:41 +01:00
Daniel Sogl c5ae6362d7 refactor(template): update Inject decorator 2019-02-20 17:40:13 +01:00
Daniel Sogl 8b53c04dc5 refactor: optimize plugins for angular treeshaking
BREAKING CHANGE: You can remove the plugin import from the app.module.ts because of the changed Inject decorator
2019-02-20 17:37:39 +01:00
Daniel Sogl 64230319a2 feat(linkedin): delete plugin
BREAKING: Removes linked in plugin (https://engineering.linkedin.com/blog/2018/12/developer-program-updates)
closes: #2925
2019-02-14 16:54:40 +01:00
Daniel Sogl 3d8cdde7eb chore(): update changelog 2019-02-14 16:39:43 +01:00
Daniel Sogl e1b7aca3a9 5.1.0 2019-02-14 16:39:37 +01:00
Daniel Sogl 9bdb2fac9d feat(app-launcher): add plugin
related: #2889
2019-02-14 16:37:41 +01:00
Daniel Sogl 41c6bcafe6 feat(firebase-crashlytics): add plugin
related: #2889
2019-02-14 16:34:26 +01:00
Daniel Sogl d55d1d6f7f chore(build): set min core version 2019-02-14 16:29:31 +01:00
Darshan PaniaandDaniel Sogl aed25a6642 feat(clevertap): update for latest CleverTap Cordova plugin (#2931)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor

* feat(clevertap): update for latest CleverTap Cordova plugin
2019-02-14 11:56:51 +01:00
EdmuandDaniel Sogl daf04566a1 feat(http): add sendRequest function (#2910)
Adds missing sendRequest feature that has been implemented to cordova-plugin-advanced
which allows overriding global options for single request being sent via this method

Closes #2824
2019-02-14 09:58:22 +01:00
Daniel Sogl 4cb2aee62b chore(package): bump deps 2019-02-14 09:58:03 +01:00
Daniel Sogl 63124f35fd fix(build): remove wrong jsdoc 2019-02-14 09:52:05 +01:00
Doumbia MahamadouandDaniel Sogl 632dec28ae feat(luxand): add plugin (#2883)
* add Luxand Face SDK plugin

* (fix): alphatize imports for luxand plugin

* fix: changes required

* add git repo url
2019-02-14 09:50:46 +01:00
Carson Chen ZoomandDaniel Sogl 50e05349ec feat(zoom): add plugin (#2916) 2019-02-14 09:49:29 +01:00
Afshawn LotfiandDaniel Sogl fd27136de7 feat(magnetometer): add plugin (#2917) 2019-02-14 09:49:00 +01:00
byrner75andDaniel Sogl 2833da472a feat(quikkly): add plugin(#2923) 2019-02-14 09:48:29 +01:00
smelzerandDaniel Sogl c5ceba1aae feat(photo-viewer): add new params (#2895)
* Change for new 'headers' option

As of 1.1.19 of PhotoViewer, a new PhotoViewer option was added called 'headers' which allows for HTTP headers to be used when requesting the image.  This is useful for authenticated sites.

* Typo in example

* Added new PhotoViewerOptions

There are several other new PhotoViewerOptions besides 'headers' that need to be imported into the latest version.  I was selfishly only concerned about the one I needed, but the build really needs them all.
2019-02-14 09:47:03 +01:00
Keith D. MooreandDaniel Sogl e1a490357d fix(http): add 'legacy' as valid option to setSSLCertMode (#2913)
* Add 'legacy' as valid option to setSSLCertMode

Fixes #2912

* Add 'legacy' to params for setSSLCertMode

* Update index.ts
2019-02-14 09:46:07 +01:00
mysoretandDaniel Sogl 959a9135e4 feat(abbyy-rtr): add new options (#2915)
* Update index.ts

cordova-plugin-abbyy-rtr-sdk has updated a new field of orientation as per the version 1.0.9

* Update index.ts
2019-02-14 09:45:37 +01:00
Cam WiegertandDaniel Sogl fc0a238229 fix(google-play-games-services): correct Cordova plugin name typo (#2920)
closes ionic-team/ionic-docs#424
2019-02-14 09:44:44 +01:00
Daniel SoglandGitHub eeb68f1706 docs(background-geolocation): update usage doc (#2924)
docs(background-geolocation): update usage doc
2019-02-14 09:44:24 +01:00
Daniel SoglandGitHub bceb428690 fix(build): fixed duplicate import identifiers (#2914) 2019-02-14 09:41:26 +01:00
Daniel SoglandGitHub 242240c711 chore(lint): update lit-rules 2019-02-14 09:41:16 +01:00
arnauddrain e9911aa4ad style(background-geolocation): remove trailing whitespace 2019-02-11 14:20:56 +01:00
arnauddrain 04798c7354 docs(background-geolocation): update usage doc 2019-02-11 14:10:53 +01:00
Justin Cuaresma 3aedde55d8 fix(build): fixed duplicate import identifiers 2019-02-01 23:09:50 -05:00
Daniel Sogl 92140cd2db refactor(): small changes 2019-01-26 20:20:55 +01:00
Daniel SoglandGitHub 184986f06b docs(readme-gen): remove beta tag 2019-01-24 20:01:57 +01:00
Daniel SoglandGitHub 2ce2725b2a docs(gene): remove beta tag 2019-01-24 20:01:03 +01:00
Daniel SoglandGitHub 3d8455ae35 docs(readme): remove beta notes 2019-01-24 19:58:56 +01:00
mhartington bf7ba9bd01 chore(): remove beta flag from release 2019-01-23 14:53:15 -05:00
mhartington 0883240f60 chore(): bump 2019-01-23 14:37:02 -05:00
Nate DrakeandDaniel Sogl b6f340ae82 fix(bluetooth-le): Fix typo in InitializeResult interface definition (#2891) 2019-01-23 16:35:25 +01:00
Daniel 0612aef725 chore(package): update deps 2019-01-23 08:10:51 +01:00
Daniel 4bf7ba6085 chore(build): update update_docs.sh 2019-01-23 08:06:04 +01:00
Daniel 707d40bd83 chore(build): fix lint errors 2019-01-23 08:04:14 +01:00
Daniel b4e0764d71 chore(build): use node 10 2019-01-23 08:03:18 +01:00
Daniel c1d7ce13dd chore(build): update utils.inc.sh 2019-01-23 08:02:24 +01:00
Daniel 999853eb32 chore(build): update prepare.sh 2019-01-23 07:58:54 +01:00
Daniel dfd6714331 chore(package): refresh package-lock 2019-01-23 07:57:02 +01:00
Daniel 898c68bb5e Merge remote-tracking branch 'origin/v5' 2019-01-23 07:54:31 +01:00
Daniel Sogl 9250d49970 chore(): update changelog 2019-01-20 17:09:26 +01:00
Daniel Sogl 2397ef9d60 4.20.0 2019-01-20 17:09:14 +01:00
Daniel Sogl dbd8b4c080 chore(package): bump deps 2019-01-20 17:06:51 +01:00
Daniel SoglandGitHub 1ba6f97082 feat(background-geolocation): add v3 functions and interfaces (#2393)
feat(background-geolocation): add v3 functions and interfaces
2019-01-19 09:42:59 +01:00
Nate DrakeandDaniel Sogl c2f45616ac fix(bluetooth-le): Fix typo in interface definition (#2881) 2019-01-19 09:31:07 +01:00
Nicolas NasoandDaniel Sogl 603d6943ef feat(lottie-splash-screen): add new plugin (#2880)
* feat(lottie-splash-screen): added new plugin

* Update index.ts
2019-01-19 09:30:41 +01:00
JaviRpoandDaniel Sogl 3226f76ef9 feat(web-intent): Add missing type info (#2878) 2019-01-19 09:26:29 +01:00
TobyEbandDaniel Sogl 874be0bb04 feat(colored-browser-tabs): added new plugin (#2876)
* feat(colored-browser-tabs): added new plugin

* feat(colored-browser-tabs): added new plugin

* feat(colored-browser-tabs): added new plugin

* Update index.ts

* Update index.ts
2019-01-19 09:23:32 +01:00
Srđan TubinandDaniel Sogl 9e6705df7f feat(adjust): add adjust sdk plugin (#2872)
* feat(adjust): add adjust sdk plugin

* Update index.ts
2019-01-19 09:15:44 +01:00
retreatnotandDaniel Sogl 7c46d8c2fc feat(firebase): add clearAllNotifications method (#2867)
* feat(firebase): add clearAllNotifications method

Added new method clearAllNotifications()

https://github.com/arnesson/cordova-plugin-firebase/blob/master/docs/API.md#clearAllNotifications

* remove trailing whitespace
2019-01-19 09:15:35 +01:00
Daniel 7d3ddf89ae chore(): update changelog 2019-01-04 22:22:17 +01:00
Daniel 19b3e8f521 4.19.0 2019-01-04 22:22:10 +01:00
Daniel c14ea31a8a chore(package): bump deps 2019-01-04 22:21:43 +01:00
AppFeelandDaniel Sogl 707ce1cad9 feat(admob): add plugin (#2864)
* feat(admob): add plugin

* Update index.ts
2019-01-04 22:08:49 +01:00
ewwwgiddingsandDaniel Sogl d33bcb0220 feat(in-app-browser): add 'beforeload' as option (#2863)
Please see the issue I created here for more information: https://github.com/ionic-team/ionic-native/issues/2861

This allows Ionic-Native to be used with the latest features of Cordova InAppBrowser's github.
2019-01-04 22:08:20 +01:00
AppFeelandDaniel Sogl 5df3de7dc0 feat(analytics-firebase): add plugin (#2862)
* feat(analytics-firebase): upload analytics-firebase plugin

* Update index.ts
2019-01-04 22:08:07 +01:00
Matthew HarrisandDaniel Sogl d499a4db8d docs(camera): fix markup (#2858)
camera xml example wasn't wrapped in code brackets
2019-01-04 22:07:46 +01:00
waliuandDaniel Sogl e2b25deff6 feat(gao-de-location): add plugin (#2857)
* Add a gaode Map Location

* 增加详细的返回信息

* Return type has been added

* Update index.ts
2019-01-04 22:07:01 +01:00
Eric HorodyskiandDaniel Sogl c3de8dfaba feat(baidu-push): add plugin (#2838)
* Initial push.

* Revert tslint.json and switch imports around to be alphabetical.

* Remove non-used plugins to decrease build time.

* Finish the BaiduPush interface.

* Add observables.

* Restore other plugins.

* Restore file formatting.

* Update documentation.

* Update index.ts
2019-01-04 22:06:52 +01:00
Dima VishnevetskyandDaniel Sogl 448e064012 docs(firebase): add onNotificationOpen usage example (#2835) 2019-01-04 22:06:37 +01:00
João MourãoandDaniel Sogl 6ef854f4f1 docs(camera): update xml in warning part (#2832)
* Update xml in warning part

* Update index.ts
2019-01-04 22:06:17 +01:00
J-LoupandDaniel Sogl ea3150e99a fix(health): fix typos (#2831) 2019-01-04 22:05:58 +01:00
shinya.saihoandDaniel Sogl 3edd62e56c chore(template): reorder imports (#2839) 2018-12-27 09:31:04 +01:00
Daniel b63102a5fa Fix random build errors 2018-12-01 16:34:42 +01:00
Daniel df7ec0146c chore(): update changelog 2018-12-01 16:28:27 +01:00
Daniel 20878516b4 4.18.0 2018-12-01 16:28:20 +01:00
Simon Bang TerkildsenandDaniel b166cc51ea fix(local-notifications): update type of the every property (#2825) 2018-12-01 16:21:17 +01:00
Daniel 543fa64b35 Revert "bump deps"
This reverts commit dcac00e7ad.
2018-12-01 15:55:58 +01:00
Daniel dcac00e7ad bump deps 2018-12-01 15:53:51 +01:00
Luka313andDaniel 006570483d feat(downloader): add plugin (#2820)
* feat(downloader): add plugin

* Update index.ts
2018-12-01 15:49:50 +01:00
Ziyaddin SadigovandDaniel Sogl b7594e201b docs(network): fix typo (#2828) 2018-12-01 15:48:53 +01:00
JMRMouraoandDaniel Sogl 1396b61215 docs(camera): improve docs (#2827) 2018-12-01 15:48:41 +01:00
Fabrício JúnioandDaniel Sogl 4f8779a969 refactor(card-io): allow number as type for guideColor (#2815)
* Change guide color to string|number type 

When the platform is Android, the cordova plugin wait for an Int value to set the guide color.

* Update index.ts
2018-11-15 20:11:01 +01:00
nrikijiandDaniel Sogl 7145afa24f feat(line-login): add loginWeb function (#2810)
* add line-login

* Update index.ts

* add params and result type

* Update index.ts

* Update index.ts

* feat(line-login)add method
2018-11-15 07:36:49 +01:00
AppieandDaniel Sogl 66316d29fe refactor(keyboard-setResizeMode): use explicit type (#2811)
This will ensure consumers of this plugin don't need to go on a quest of finding what the possible values are, the values are derived from [here](https://github.com/ionic-team/cordova-plugin-ionic-keyboard#keyboardresizemode)
2018-11-15 07:35:39 +01:00
Suraj RaoandDaniel Sogl 7dcd6b27a0 docs(sqlite): update usage example (#2805)
executeSql takes array param not object according to the function declaration in code.
2018-11-07 08:37:49 +01:00
Daniel b98393462d chore(): update changelog 2018-11-02 18:04:49 +01:00
Daniel f9011c89c8 4.17.0 2018-11-02 18:04:43 +01:00
Daniel 4b4b2c45a0 chore: bump deps 2018-11-02 17:54:07 +01:00
Antonio José LópezandDaniel Sogl 43bfeb487a feat(firebase-authentication): add plugin (#2797)
* feat(firebase-authentication): add plugin

* Update index.ts

* Update index.ts
2018-11-02 17:18:41 +01:00
PhilipandDaniel Sogl accfba8a40 docs(file): update jsdoc (#2757)
* Update index.ts: Fix JSDoc

* Update index.ts

* Update index.ts
2018-11-02 17:17:38 +01:00
nrikijiandDaniel Sogl dc4183da07 feat(line-login): add plugin (#2782)
* add line-login

* Update index.ts

* add params and result type

* Update index.ts

* Update index.ts
2018-11-02 17:09:15 +01:00
duncan-candDaniel Sogl b61b33987f fix(contacts plugin): add the rawId parameter (#2799)
* fix(contacts plugin): add the rawId parameter

This adds the rawId parameter to the contact class which allows the rawId value to be passed to Android which is required for saving contacts.

* Update index.ts
2018-11-02 17:08:43 +01:00
dominic-ksandDaniel Sogl 39b4b85631 docs(social-sharing): update web share api link (#2794)
Just a tiny error in an anchor link there.
2018-10-28 09:38:54 +01:00
Rick SolletandDaniel Sogl 669dd02285 docs(mobile-accessibility): update usage (#2795) 2018-10-28 09:38:03 +01:00
Ahsan AyazandDaniel Sogl a3bd19769f feat(crashlytics): allow user to set userIdentifier for crashlytics (#2792)
setting user identifier is available since cordova-plugin-firebase@2.0.3 (https://github.com/arnesson/cordova-plugin-firebase/blob/master/CHANGELOG.md#features)
added the functionality to the firebase ionic native plugin
2018-10-27 11:18:04 +02:00
Martin KauscheandDaniel Sogl ff3ef094e0 docs(admob-plus): fix the Plugin Name, added repo (#2781)
The newly added wrapper for Admob __Plus__  had Admob __Free__ as its name.

This resulted in a broken docs-Page, _Admob Free_ occurred twice, both showing infos for _Admob Plus_
2018-10-18 16:24:46 +02:00
Daniel 2933d40cdc chore(): update changelog 2018-10-17 19:55:57 +02:00
Daniel 874ae88ff4 4.16.0 2018-10-17 19:55:52 +02:00
MarcoandDaniel Sogl a02ca715e9 docs(one-signal): fix target url for notification icon (#2780)
The correct path is described at the official documentation from OneSignal. 
Link: https://documentation.onesignal.com/docs/customize-notification-icons
2018-10-17 19:53:44 +02:00
Daniel SoglandGitHub 336b3ff89b fix(local-notifications): add missing functions (#2779)
closes: #2778
2018-10-17 19:53:22 +02:00
Stephen WolffandDaniel Sogl 2aa73b5546 feat(nfc): add NFC readerMode (#2777)
* Work on NFC reader-mode

* Remove dist files, not needed in plugin development folder

* Revert package changes

This reverts part of commit 24a893fdcf.

* Update index.ts

* Correct the flags and return types for the wrapper

* Add reader flags.

Thanks @sfaizanh
2018-10-17 19:52:52 +02:00
Jordan BengeandDaniel Sogl 99cebcba0b feat(lastCam): add plugin (#2759)
* feat(lastCam): add plugin

* feat: added watchRecordingTimer observer

* fix(lastCam): update plugin name

* refactor: lint file and refactor description
2018-10-17 19:52:39 +02:00
Paul StelzerandDaniel Sogl 6c99ec8033 feat(admob-plus): Add admob-plus (#2753) 2018-10-17 19:52:25 +02:00
Faizan HasanandDaniel Sogl a167bd85aa fix(keyboard) isVisible property missing (#2751)
* isVisible property missing

* fix(lint)

* fix(lint) CI

* fix(CordovaProperty) Imported CordovaProperty from core
2018-10-14 13:31:01 +02:00
Niklas MerzandDaniel Sogl 487acd603b refactor(network): add enum for connection types (#2754) 2018-10-14 13:30:34 +02:00
SultanandDaniel Sogl fb4d2640c1 docs(apple-wallet): update example (#2755)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts

* update readme
2018-10-14 13:30:25 +02:00
Markus KarileetandDaniel Sogl 4468b520ad feat(speechkit): plugin updated with voice parameter (#2761) 2018-10-14 13:30:11 +02:00
BradyShoberandDaniel Sogl 1a2dc3ee73 feat(firebase-messaging): add revokeToken function (#2763) 2018-10-14 13:30:00 +02:00
Max LynchandGitHub 00a1674fd6 Merge pull request #2758 from ajcrites/geo-msg
docs(geolocation): use more generic / professional message
2018-10-03 18:07:12 -05:00
Andrew Crites 2b14bd979e docs(geolocation): use more generic / professional message 2018-10-03 18:59:43 -04:00
Daniel SoglandGitHub fcd6d26727 fix(keyboard): add missing property 2018-09-25 17:11:43 +02:00
Daniel f95003cbe1 chore(): update changelog 2018-09-25 17:02:43 +02:00
Daniel 8e5f2e5ab3 4.15.0 2018-09-25 17:02:35 +02:00
SultanandDaniel Sogl 307477da78 feat(plugins): add AppleWallet (#2740)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts
2018-09-25 16:57:01 +02:00
Daniel f691883a29 disable failing unit test (tmp) 2018-09-25 16:54:58 +02:00
Daniel 0d5d4f30a9 docs(keyboard): fix small typo 2018-09-25 16:51:53 +02:00
Ken SodemannandDaniel 1457a1698b fix(keyboard): use cordova-plugin-ionic-keyboard (#2743)
Previous was using the deprecated keyboard plugin.

Fixes #2306
2018-09-25 16:50:29 +02:00
Rahul PandeyandDaniel Sogl bfd46eed16 feat(SqliteDbCopy):add plugin (#2731)
* feat(SqliteDbCopy):add plugin

* refactor(SqliteDbCopy):add success/error index

* Update index.ts
2018-09-25 16:44:53 +02:00
Bart WesselinkandDaniel Sogl 3eff280127 feat(siri-shortcuts): Add clear option for the activated shortcut (#2734)
* feat(siri-shortcuts): Add clear option for the getActivatedShortcutOperation

* Update index.ts
2018-09-25 16:43:47 +02:00
Benoit PerrinandDaniel Sogl 8116ddd139 feat(plugins): add web-server plugin (#2726)
* feat(plugins): add web-server plugin

Add support of the cordova-plugin-webserver plugin, to start a
a dynamic content web server on iOS and android devices.

* Update index.ts
2018-09-25 16:42:07 +02:00
Daniel a6bcc9affd feat(taptic-engine): add missing functions and types 2018-09-18 22:35:58 +02:00
Daniel c0d8c99e8d Merge remote-tracking branch 'origin/master' 2018-09-18 22:29:20 +02:00
Daniel fe9655ed84 chore(build): fix publish script 2018-09-18 16:08:49 +02:00
Daniel 41c034cc19 chore(): update changelog 2018-09-18 16:03:39 +02:00
Daniel 89631a9fa6 4.14.0 2018-09-18 16:03:29 +02:00
Daniel 04db233b33 feat(chooster): add plugin
closes: #2612
2018-09-18 15:58:57 +02:00
Daniel 10d222dcea feat(local-notifications): add missing functions 2018-09-18 15:37:39 +02:00
Daniel 640da1b618 docs(ibeacon): typo 2018-09-18 15:22:17 +02:00
Daniel aecb0f9460 chore(package): bump dgeni 2018-09-18 15:17:21 +02:00
Daniel d077c48205 fix(web-intent): add missing properties
closes: #2701
2018-09-18 11:08:45 +02:00
Daniel 49d27e816c refactor(email-composer): reorder code 2018-09-18 11:03:02 +02:00
Daniel SoglandGitHub 3699fa9b50 fix(mobile-accessibility): add correct pluginRef
closes: #1860
2018-09-18 10:12:27 +02:00
Daniel ab4f1f5bbe docs(onesignal): hide option from docs
closes: #1969
2018-09-18 10:08:24 +02:00
Daniel 51006a76a0 feat(onesignal): add missing functions
closes: #2504
2018-09-18 10:05:34 +02:00
Rishi HindochaandDaniel Sogl 8bab32173a fix(onesignal): add missing setLocationShared method (#2723)
* fix(onesignal): add missing setLocationShared method

* Update index.ts
2018-09-18 09:40:55 +02:00
Daniel SoglandGitHub 3ef9593704 fix(push): add missing Chanel options
closes: #2712
2018-09-18 09:30:09 +02:00
Daniel ffae843c0f chore(): update changelog 2018-09-17 18:54:45 +02:00
Daniel 33e4392b63 refactor: remove unused lint rules 2018-09-17 17:59:41 +02:00
Daniel 9acbb9fcd6 refactor: follow only-arrow-functions lint rule 2018-09-17 17:56:35 +02:00
Daniel c1e1c5cb79 refactor: follow order-imports lint rule 2018-09-17 17:50:36 +02:00
Daniel 0c7cfeeeb8 refactor: update lint rules 2018-09-17 17:09:46 +02:00
Daniel a7830693af chore(scripts): remove fs-extra-promise 2018-09-17 15:14:37 +02:00
Daniel b60d5d4851 chore(): update changelog 2018-09-15 11:15:09 +02:00
Daniel 0c4aeddd1b 4.13.0 2018-09-15 11:15:04 +02:00
Daniel 667de5ba26 Revert "chore(): update changelog"
This reverts commit 2c2c1e482c.
2018-09-15 11:14:49 +02:00
Daniel 2dc7ee8916 Revert "4.12.3"
This reverts commit 7c419b48ad.
2018-09-15 11:14:41 +02:00
Daniel 2c2c1e482c chore(): update changelog 2018-09-15 11:05:56 +02:00
Daniel 7c419b48ad 4.12.3 2018-09-15 11:05:48 +02:00
弄潮儿andDaniel Sogl 0b9717636c feat(janalytics): add plugin (#2711)
* add janalytics native plugin

* add new plugin of wechat

* rm plugin wechat

* Update index.ts
2018-09-15 11:02:53 +02:00
弄潮儿andDaniel Sogl 10ac9ff9de feat(wechat): add plugin (#2716)
* add janalytics native plugin

* add new plugin of wechat

* rm janalytics plugin

* Update index.ts

* Update index.ts

* Update index.ts
2018-09-15 11:01:10 +02:00
Paul StelzerandDaniel Sogl 90d75af9d1 feat(branch-io): Add branch.io attribution and invitation plugin (#2691)
* feat(branch-io): Add branch.io attribution and invitation plugin

* Update index.ts
2018-09-15 10:55:01 +02:00
Paul StelzerandDaniel Sogl 3b3f942ed5 feat(appsflyer): Added Appsflyer Cordova SDK as ionic native plugin (#2690)
* feat(appsflyer): Added Appsflyer Cordova SDK

* fix(appsflyer): Corrected promises

* fix(appsflyer): Add description

* fix(appsflyer): Missing semicolon

* Update index.ts
2018-09-15 10:48:17 +02:00
Niklas MerzandDaniel Sogl 9601a64227 feat(calldirectory): add log function (#2708)
* feat(calldirectory): add log function

* Update index.ts
2018-09-15 10:43:11 +02:00
Paul StelzerandDaniel Sogl 22fd49b5d3 fix(in-app-review): Transfer Plugin to the correct folder (#2688) 2018-09-15 10:41:20 +02:00
ratnakar24andDaniel Sogl 890129bfda fix(ms-adal): Update createAuthenticationContext (#2705)
* Update createAuthenticationContext

Update createAuthenticationContext to include validateAuthority flag since it is throwing Error: Fail to valid authority with errors: [50049].
Without the flag it is throwing Error: Fail to valid authority with errors: [50049].

* Update index.ts
2018-09-15 10:39:41 +02:00
Tyler HallandDaniel Sogl 6a9a871758 docs(onesignal): update incorrect path to hook file (#2715) 2018-09-15 10:39:14 +02:00
Todd VrbaandDaniel Sogl ac467c50ac feat(mixpanel): Update/add functions (#2697)
* Update mixpanel typings for Ionic native.

* Update index.ts
2018-09-15 10:37:52 +02:00
iAmMrHandsandDaniel Sogl 267149b16f feat(local-notifications): Added local additional local notification action fields (#2713) 2018-09-15 10:37:24 +02:00
somqandDaniel Sogl 7047920a2a fix(bluetooth-le): Various methods fixes (#2707)
* feat(bluetooth-le): implemented all available methods and refactored existing ones

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

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

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

* Update index.ts

* fix(bluetooth-le): Fixed stringToBytes method, now properly takes a string as arg and return an Uint8Array

* fix(bluetooth-le): getAdapterInfo now returns an Observable for easier tracking of adapter states

* fix(bluetooth-le): Fixed missing cordova param (observable: true) in initializePeripheral method, fixed getAdapterInfo method, now return an adapterInfo object

* chore(bluetooth-le): Removed @description markup to allow a proper doc auto-format

* fix(bluetooth-le): Reverted getAdapterInfo method to a Promise return
2018-09-15 10:37:03 +02:00
Daniel aad814fcf1 chore(): update changelog 2018-08-31 19:09:35 +02:00
Daniel 03d6b2373c 4.12.2 2018-08-31 19:09:24 +02:00
Daniel KasperandDaniel Sogl d82e675442 fix(in-app-browser): fix mandatory options (#2684)
fix(in-app-browser): fix mandatory options
2018-08-31 19:05:33 +02:00
Daniel 1e84e23fd9 chore(): update changelog 2018-08-31 14:26:00 +02:00
Daniel f3f12cb306 4.12.1 2018-08-31 14:25:53 +02:00
Daniel b3bd0a83c7 chore(package): bump deps 2018-08-31 14:24:28 +02:00
rvdleunandDaniel Sogl 03e4f0e439 feat(push): Added voip property to IOSPushOptions (#2681)
* feat(push): Added missing voip property to IOSPushOptions

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

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

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

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

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

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

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

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

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

* Update index.ts

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

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

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

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

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

* style(clevertap): cleanup stray lint error

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

* refactor
2018-07-29 09:11:05 +02:00
Jan PiotrowskiandDaniel Sogl c6713862c5 refactor: Improve Ionic Native warnings (#2611)
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
2018-07-29 09:10:48 +02:00
Daniel 3b32e19bf1 feat(facebook): add getDeferredApplink function
closes: #2510
2018-07-29 09:10:17 +02:00
Daniel 4092831754 fix(http): add correct return types for downloadFile and uploadFile
closes: #2615
2018-07-29 08:57:16 +02:00
Daniel SoglandGitHub c2fe5f8336 docs(contacts): mark as deprecated 2018-07-27 21:39:58 +02:00
Daniel 3f9067d090 chore(): update changelog 2018-07-25 12:57:52 +02:00
Daniel 36a4e81fe4 4.10.1 2018-07-25 12:57:38 +02:00
Gustavo Maximiliano CortezandDaniel Sogl 79cb478c26 fix(user-agent): Plugin not installed (#2607)
fix(user-agent): Plugin not installed
2018-07-24 16:59:19 +02:00
Dominik GengandDaniel Sogl b635ba99ea fix(nfs): Optional arguments for records like textRecord (#2605)
fix(nfs): Optional arguments for records like textRecord
2018-07-24 16:59:02 +02:00
132 changed files with 22968 additions and 10235 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}}
+1
View File
@@ -4,6 +4,7 @@ node_modules/
.tmp
aot/
scripts/ionic-native-bower
scripts/docs-json/*.json
dist/
src/@ionic-native/plugins/**/ngx
*.d.ts
+3
View File
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
+2779 -808
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -88,8 +88,6 @@ It's just a stub. The `return` is only there to keep the TypeScript type-checker
By default, the `@Cordova` decorator wraps the plugin callbacks in a Promise that resolves when the success callback is called and rejects when the error callback is called. It also ensures that Cordova and the underlying plugin are available, and prints helpful diagnostics if they aren't.
You'll also notice that `getCurrentPosition` is a static method. That's because the plugin class is just a utility class to call the underlying Cordova plugin methods, it's not an instance and has no state.
Next, let's look at the `watchPosition` method.
```
+1 -3
View File
@@ -11,13 +11,11 @@ Ionic Native wraps plugin callbacks in a Promise or Observable, providing a comm
Run following command to install Ionic Native in your project.
```bash
npm install @ionic-native/core@beta --save
npm install @ionic-native/core --save
```
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
**NOTE: to use Ionic Native v5, you must use the `@beta` tag when installing any NPM package.**
## Documentation
For the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).
+2 -2
View File
@@ -3,7 +3,7 @@ jobs:
build:
working_directory: ~/ionic-native/
docker:
- image: node:8
- image: node:12
steps:
- checkout
- restore_cache:
@@ -22,7 +22,7 @@ jobs:
key: node_modules_{{ checksum "package.json" }}
- run:
name: Install node modules
command: npm i
command: npm ci
- save_cache:
key: node_modules_{{ checksum "package.json" }}
paths:
+1 -3
View File
@@ -32,9 +32,7 @@ gulp.task('lint', () => {
gulp.task('plugin:create', () => {
if (flags.n && flags.n !== '') {
const src = flags.m
? './scripts/templates/wrap-min.tmpl'
: './scripts/templates/wrap.tmpl',
const src = flags.m ? './scripts/templates/wrap-min.tmpl' : './scripts/templates/wrap.tmpl',
pluginName = flags.n,
spaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1'),
kebabCase = _.kebabCase(pluginName);
+8440 -8007
View File
File diff suppressed because it is too large Load Diff
+39 -34
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "5.0.0-beta.24",
"version": "5.21.4",
"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)",
@@ -17,49 +17,51 @@
"npmpub": "ts-node -P scripts/tsconfig.json scripts/tasks/publish",
"lint": "gulp lint",
"readmes": "gulp readmes",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"postchangelog": "git commit -am \"chore(): update changelog\"",
"docs-json": "ts-node -P scripts/tsconfig.json scripts/docs-json",
"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": "^7.2.1",
"@angular/compiler": "^7.2.1",
"@angular/compiler-cli": "^7.2.1",
"@angular/core": "^7.2.1",
"@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": "^5.0.4",
"@types/jest": "^23.3.13",
"@types/lodash": "^4.14.120",
"@types/node": "^10.12.18",
"@types/rimraf": "^2.0.2",
"@types/webpack": "^4.4.23",
"ajv": "^6.7.0",
"async-promise-queue": "^1.0.4",
"conventional-changelog-cli": "^2.0.11",
"cz-conventional-changelog": "^2.1.0",
"dgeni": "^0.4.11",
"@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.31",
"cz-conventional-changelog": "^3.1.0",
"dgeni": "^0.4.12",
"dgeni-packages": "0.16.10",
"fs-extra": "^7.0.1",
"gulp": "3.9.1",
"gulp-rename": "^1.4.0",
"fs-extra": "^8.1.0",
"gulp": "^4.0.2",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "^8.1.3",
"jest": "^23.6.0",
"lodash": "^4.17.11",
"gulp-tslint": "^8.1.4",
"jest": "^25.1.0",
"lodash": "^4.17.15",
"minimist": "1.2.0",
"natives": "^1.1.6",
"rimraf": "^2.6.3",
"rxjs": "^6.3.3",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
"tslint": "^5.12.1",
"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",
"typescript": "3.2.4",
"uglifyjs-webpack-plugin": "^2.1.1",
"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.28.4",
"winston": "^3.1.0",
"zone.js": "^0.8.26"
"webpack": "^4.41.5",
"winston": "^3.2.1",
"zone.js": "^0.9.1"
},
"jest": {
"transform": {
@@ -85,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;
+7 -2
View File
@@ -37,10 +37,15 @@ function transformImports(file: ts.SourceFile, ctx: ts.TransformationContext, ng
decorators.forEach(d => methods = getMethodsForDecorator(d).concat(methods));
const methodElements = methods.map(m => ts.createIdentifier(m));
const methodNames = methodElements.map((el) => el.escapedText);
importStatement.importClause.namedBindings.elements = [
ts.createIdentifier('IonicNativePlugin'),
...methods.map(m => ts.createIdentifier(m)),
...importStatement.importClause.namedBindings.elements.filter(el => keep.indexOf(el.name.text) !== -1)
...methodElements,
...importStatement.importClause.namedBindings.elements.filter(
el => keep.indexOf(el.name.text) !== -1 && methodNames.indexOf(el.name.text) === -1
)
];
if (ngcBuild) {
+109
View File
@@ -0,0 +1,109 @@
import * as fs from 'fs-extra';
import { basename, dirname, resolve } from 'path';
import { Application } from 'typedoc';
import { runInNewContext } from 'vm';
import TypeDoc = require('typedoc');
interface Plugin {
packageName: string;
displayName: string;
description: string;
platforms: string[];
usage: string;
repo: string;
installVariables: string[];
cordovaPlugin: {
name: string;
};
}
const rootDir = resolve(__dirname, '../..');
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
const typedoc = new Application();
typedoc.options.addReader(new TypeDoc.TSConfigReader());
typedoc.options.addReader(new TypeDoc.TypeDocReader());
typedoc.bootstrap({
mode: 'modules',
ignoreCompilerErrors: true
});
run(pluginsDir);
async function run(pluginsDir: string) {
const typedocData = await generateTypedoc(pluginsDir);
const modules = typedocData.children.filter(isModule);
const plugins = modules.filter(hasPlugin).map(processPlugin);
await fs.outputJson(resolve(__dirname, 'plugins.json'), plugins, {
spaces: 2
});
}
async function generateTypedoc(root: string, outputPath = typedocTmp) {
const pluginDirs = await fs.readdir(root);
const paths = pluginDirs.map(dir => resolve(root, dir, 'index.ts'));
typedoc.generateJson(paths, outputPath);
return fs.readJson(outputPath);
}
function processPlugin(pluginModule): Plugin {
const pluginClass = pluginModule.children.find(isPlugin);
const decorator = getPluginDecorator(pluginClass);
const packageName = `@ionic-native/${basename(
dirname(pluginModule.originalName)
)}`;
const displayName = getTag(pluginClass, 'name');
const usage = getTag(pluginClass, 'usage');
const description = getTag(pluginClass, 'description');
return {
packageName,
displayName,
description,
usage,
platforms: decorator.platforms,
repo: decorator.repo,
installVariables: decorator.installVariables,
cordovaPlugin: {
name: decorator.plugin
}
};
}
/**
* Typedoc only gives us the Plugin decorator internals
* as a string. So, rather than try to parse that with a RegExp,
* we evaluate it using Node's vm module.
*/
const getPluginDecorator = (child: any) => {
if (isPlugin(child)) {
const decorator = child.decorators.find(d => d.name === 'Plugin');
return runInNewContext(`(${decorator.arguments.config})`);
}
};
const getTag = (child: any, tagName: string): string => {
if (hasTags(child)) {
const tag = child.comment.tags.find(t => t.tag === tagName);
if (tag) {
return tag.text;
}
}
};
const isModule = (child: any): boolean => child.kind === 1;
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');
const hasPlugin = (child: any): boolean => child.children.some(isPlugin);
const hasTags = (child: any): boolean =>
child.comment && Array.isArray(child.comment.tags);
+3
View File
@@ -0,0 +1,3 @@
# docs-json
This script reads and generates [typedoc](https://github.com/TypeStrong/typedoc) data for each of the plugins in `src/@ionic-native/plugins`. That data is then formatted and output as `plugins.json` in this directory.
@@ -187,7 +187,7 @@ docType: "<$ doc.docType $>"
<ol class="installation">
<li>Install the Cordova and Ionic Native plugins:<br>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '&lt;').replace('>', '&gt;') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install @ionic-native/<$ doc.npmId $>@beta
$ npm install @ionic-native/<$ doc.npmId $>
</code></pre>
</li>
<li><a href="https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module">Add this plugin to your app's module</a></li>
@@ -17,7 +17,7 @@
```
$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install @ionic-native/<$ doc.npmId $>@beta
$ npm install @ionic-native/<$ doc.npmId $>
```
## [Usage Documentation](https://ionicframework.com/docs/native/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/')|replace('index.ts','')|replace('src/@ionic-native/plugins/','') $>)
+6 -14
View File
@@ -6,35 +6,27 @@ const config = require('./config.json'),
Dgeni = require('dgeni');
module.exports = gulp => {
gulp.task('docs', [], () => {
gulp.task('docs', () => {
try {
const ionicPackage = require('./dgeni/dgeni-config')(
projectPackage.version
),
const ionicPackage = require('./dgeni/dgeni-config')(projectPackage.version),
dgeni = new Dgeni([ionicPackage]);
return dgeni
.generate()
.then(docs => console.log(docs.length + ' docs generated'));
return dgeni.generate().then(docs => console.log(docs.length + ' docs generated'));
} catch (err) {
console.log(err.stack);
}
});
gulp.task('readmes', [], function() {
gulp.task('readmes', () => {
fs.copySync(
path.resolve(__dirname, '..', '..', 'README.md'),
path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md')
);
try {
const ionicPackage = require('./dgeni/dgeni-readmes-config')(
projectPackage.version
),
const ionicPackage = require('./dgeni/dgeni-readmes-config')(projectPackage.version),
dgeni = new Dgeni([ionicPackage]);
return dgeni
.generate()
.then(docs => console.log(docs.length + ' README files generated'));
return dgeni.generate().then(docs => console.log(docs.length + ' README files generated'));
} catch (err) {
console.log(err.stack);
}
+1 -1
View File
@@ -34,4 +34,4 @@ function run {
}
source $(dirname $0)/../utils.inc.sh
source $(dirname $0)/utils.inc.sh
+1 -1
View File
@@ -47,4 +47,4 @@ function run {
fi
}
source $(dirname $0)/../utils.inc.sh
source $(dirname $0)/utils.inc.sh
+241 -244
View File
@@ -1,244 +1,241 @@
# bash utils from angularjs
# This file provides:
# - a default control flow
# * initializes the environment
# * call a function in your script based on the arguments
# - named argument parsing and automatic generation of the "usage" for your script
# - utility functions
#
# Usage:
# - define the variable ARGS_DEF (see below) with the arguments for your script
# - include this file using `source utils.inc` at the end of your script.
#
# Default control flow:
# 0. Set the current directory to the directory of the script. By this
# the script can be called from anywhere.
# 1. Parse the named arguments
# 2. [Redacted]
# 3. If the parameter "verbose" is set, the `-x` flag will be set in bash.
# 4. The function "init" will be called if it exists
# 5. If the parameter "action" is set, it will call the function with the name of that parameter.
# Otherwise the function "run" will be called.
#
# Named Argument Parsing:
# - The variable ARGS_DEF defines the valid command arguments
# * Required args syntax: --paramName=paramRegex
# * Optional args syntax: [--paramName=paramRegex]
# * e.g. ARG_DEFS=("--required_param=(.+)" "[--optional_param=(.+)]")
# - Checks that:
# * all arguments match to an entry in ARGS_DEF
# * all required arguments are present
# * all arguments match their regex
# - Afterwards, every paramter value will be stored in a variable
# with the name of the parameter in upper case (with dash converted to underscore).
#
# Special arguments that are always available:
# - "--action=.*": This parameter will be used to dispatch to a function with that name when the
# script is started
# - "--verbose=true": This will set the `-x` flag in bash so that all calls will be logged
#
# Utility functions:
# - readJsonProp
# - replaceJsonProp
# - resolveDir
# - getVar
# - serVar
# - isFunction
# always stop on errors
set -e
function usage {
echo "Usage: ${0} ${ARG_DEFS[@]}"
exit 1
}
function parseArgs {
local REQUIRED_ARG_NAMES=()
# -- helper functions
function varName {
# everything to upper case and dash to underscore
echo ${1//-/_} | tr '[:lower:]' '[:upper:]'
}
function readArgDefs {
local ARG_DEF
local AD_OPTIONAL
local AD_NAME
local AD_RE
# -- helper functions
function parseArgDef {
local ARG_DEF_REGEX="(\[?)--([^=]+)=(.*)"
if [[ ! $1 =~ $ARG_DEF_REGEX ]]; then
echo "Internal error: arg def has wrong format: $ARG_DEF"
exit 1
fi
AD_OPTIONAL="${BASH_REMATCH[1]}"
AD_NAME="${BASH_REMATCH[2]}"
AD_RE="${BASH_REMATCH[3]}"
if [[ $AD_OPTIONAL ]]; then
# Remove last bracket for optional args.
# Can't put this into the ARG_DEF_REGEX somehow...
AD_RE=${AD_RE%?}
fi
}
# -- run
for ARG_DEF in "${ARG_DEFS[@]}"
do
parseArgDef $ARG_DEF
local AD_NAME_UPPER=$(varName $AD_NAME)
setVar "${AD_NAME_UPPER}_OPTIONAL" "$AD_OPTIONAL"
setVar "${AD_NAME_UPPER}_RE" "$AD_RE"
if [[ ! $AD_OPTIONAL ]]; then
REQUIRED_ARG_NAMES+=($AD_NAME)
fi
done
}
function readAndValidateArgs {
local ARG_NAME
local ARG_VALUE
local ARG_NAME_UPPER
# -- helper functions
function parseArg {
local ARG_REGEX="--([^=]+)=?(.*)"
if [[ ! $1 =~ $ARG_REGEX ]]; then
echo "Can't parse argument $i"
usage
fi
ARG_NAME="${BASH_REMATCH[1]}"
ARG_VALUE="${BASH_REMATCH[2]}"
ARG_NAME_UPPER=$(varName $ARG_NAME)
}
function validateArg {
local AD_RE=$(getVar ${ARG_NAME_UPPER}_RE)
if [[ ! $AD_RE ]]; then
echo "Unknown option: $ARG_NAME"
usage
fi
if [[ ! $ARG_VALUE =~ ^${AD_RE}$ ]]; then
echo "Wrong format: $ARG_NAME"
usage;
fi
# validate that the "action" option points to a valid function
if [[ $ARG_NAME == "action" ]] && ! isFunction $ARG_VALUE; then
echo "No action $ARG_VALUE defined in this script"
usage;
fi
}
# -- run
for i in "$@"
do
parseArg $i
validateArg
setVar "${ARG_NAME_UPPER}" "$ARG_VALUE"
done
}
function checkMissingArgs {
local ARG_NAME
for ARG_NAME in "${REQUIRED_ARG_NAMES[@]}"
do
ARG_VALUE=$(getVar $(varName $ARG_NAME))
if [[ ! $ARG_VALUE ]]; then
echo "Missing: $ARG_NAME"
usage;
fi
done
}
# -- run
readArgDefs
readAndValidateArgs "$@"
checkMissingArgs
}
# getVar(varName)
function getVar {
echo ${!1}
}
# setVar(varName, varValue)
function setVar {
eval "$1=\"$2\""
}
# isFunction(name)
# - to be used in an if, so return 0 if successful and 1 if not!
function isFunction {
if [[ $(type -t $1) == "function" ]]; then
return 0
else
return 1
fi
}
# readJsonProp(jsonFile, property)
# - restriction: property needs to be on an own line!
function readJsonProp {
echo $(sed -En 's/.*"'$2'"[ ]*:[ ]*"(.*)".*/\1/p' $1)
}
# replaceJsonProp(jsonFile, property, newValue)
# - note: propertyRegex will be automatically placed into a
# capturing group! -> all other groups start at index 2!
function replaceJsonProp {
replaceInFile $1 "\"$2\": \".*?\"" "\"$2\": \"$3\""
}
# replaceInFile(file, findPattern, replacePattern)
function replaceInFile {
perl -pi -e "s/$2/$3/g;" $1
}
# resolveDir(relativeDir)
# - resolves a directory relative to the current script
function resolveDir {
echo $(cd $SCRIPT_DIR; cd $1; pwd)
}
function main {
# normalize the working dir to the directory of the script
cd $(dirname $0);SCRIPT_DIR=$(pwd)
ARG_DEFS+=("[--verbose=(true|false)]")
parseArgs "$@"
# --verbose argument
if [[ $VERBOSE == "true" ]]; then
set -x
fi
if isFunction init; then
init "$@"
fi
# jump to the function denoted by the --action argument,
# otherwise call the "run" function
if [[ $ACTION ]]; then
$ACTION "$@"
else
run "$@"
fi
}
main "$@"
# bash utils from angularjs
# This file provides:
# - a default control flow
# * initializes the environment
# * call a function in your script based on the arguments
# - named argument parsing and automatic generation of the "usage" for your script
# - utility functions
#
# Usage:
# - define the variable ARGS_DEF (see below) with the arguments for your script
# - include this file using `source utils.inc` at the end of your script.
#
# Default control flow:
# 0. Set the current directory to the directory of the script. By this
# the script can be called from anywhere.
# 1. Parse the named arguments
# 2. [Redacted]
# 3. If the parameter "verbose" is set, the `-x` flag will be set in bash.
# 4. The function "init" will be called if it exists
# 5. If the parameter "action" is set, it will call the function with the name of that parameter.
# Otherwise the function "run" will be called.
#
# Named Argument Parsing:
# - The variable ARGS_DEF defines the valid command arguments
# * Required args syntax: --paramName=paramRegex
# * Optional args syntax: [--paramName=paramRegex]
# * e.g. ARG_DEFS=("--required_param=(.+)" "[--optional_param=(.+)]")
# - Checks that:
# * all arguments match to an entry in ARGS_DEF
# * all required arguments are present
# * all arguments match their regex
# - Afterwards, every paramter value will be stored in a variable
# with the name of the parameter in upper case (with dash converted to underscore).
#
# Special arguments that are always available:
# - "--action=.*": This parameter will be used to dispatch to a function with that name when the
# script is started
# - "--verbose=true": This will set the `-x` flag in bash so that all calls will be logged
#
# Utility functions:
# - readJsonProp
# - replaceJsonProp
# - resolveDir
# - getVar
# - serVar
# - isFunction
# always stop on errors
set -e
function usage {
echo "Usage: ${0} ${ARG_DEFS[@]}"
exit 1
}
function parseArgs {
local REQUIRED_ARG_NAMES=()
# -- helper functions
function varName {
# everything to upper case and dash to underscore
echo ${1//-/_} | tr '[:lower:]' '[:upper:]'
}
function readArgDefs {
local ARG_DEF
local AD_OPTIONAL
local AD_NAME
local AD_RE
# -- helper functions
function parseArgDef {
local ARG_DEF_REGEX="(\[?)--([^=]+)=(.*)"
if [[ ! $1 =~ $ARG_DEF_REGEX ]]; then
echo "Internal error: arg def has wrong format: $ARG_DEF"
exit 1
fi
AD_OPTIONAL="${BASH_REMATCH[1]}"
AD_NAME="${BASH_REMATCH[2]}"
AD_RE="${BASH_REMATCH[3]}"
if [[ $AD_OPTIONAL ]]; then
# Remove last bracket for optional args.
# Can't put this into the ARG_DEF_REGEX somehow...
AD_RE=${AD_RE%?}
fi
}
# -- run
for ARG_DEF in "${ARG_DEFS[@]}"
do
parseArgDef $ARG_DEF
local AD_NAME_UPPER=$(varName $AD_NAME)
setVar "${AD_NAME_UPPER}_OPTIONAL" "$AD_OPTIONAL"
setVar "${AD_NAME_UPPER}_RE" "$AD_RE"
if [[ ! $AD_OPTIONAL ]]; then
REQUIRED_ARG_NAMES+=($AD_NAME)
fi
done
}
function readAndValidateArgs {
local ARG_NAME
local ARG_VALUE
local ARG_NAME_UPPER
# -- helper functions
function parseArg {
local ARG_REGEX="--([^=]+)=?(.*)"
if [[ ! $1 =~ $ARG_REGEX ]]; then
echo "Can't parse argument $i"
usage
fi
ARG_NAME="${BASH_REMATCH[1]}"
ARG_VALUE="${BASH_REMATCH[2]}"
ARG_NAME_UPPER=$(varName $ARG_NAME)
}
function validateArg {
local AD_RE=$(getVar ${ARG_NAME_UPPER}_RE)
if [[ ! $AD_RE ]]; then
echo "Unknown option: $ARG_NAME"
usage
fi
if [[ ! $ARG_VALUE =~ ^${AD_RE}$ ]]; then
echo "Wrong format: $ARG_NAME"
usage;
fi
# validate that the "action" option points to a valid function
if [[ $ARG_NAME == "action" ]] && ! isFunction $ARG_VALUE; then
echo "No action $ARG_VALUE defined in this script"
usage;
fi
}
# -- run
for i in "$@"
do
parseArg $i
validateArg
setVar "${ARG_NAME_UPPER}" "$ARG_VALUE"
done
}
function checkMissingArgs {
local ARG_NAME
for ARG_NAME in "${REQUIRED_ARG_NAMES[@]}"
do
ARG_VALUE=$(getVar $(varName $ARG_NAME))
if [[ ! $ARG_VALUE ]]; then
echo "Missing: $ARG_NAME"
usage;
fi
done
}
# -- run
readArgDefs
readAndValidateArgs "$@"
checkMissingArgs
}
# getVar(varName)
function getVar {
echo ${!1}
}
# setVar(varName, varValue)
function setVar {
eval "$1=\"$2\""
}
# isFunction(name)
# - to be used in an if, so return 0 if successful and 1 if not!
function isFunction {
if [[ $(type -t $1) == "function" ]]; then
return 0
else
return 1
fi
}
# readJsonProp(jsonFile, property)
# - restriction: property needs to be on an own line!
function readJsonProp {
echo $(sed -En 's/.*"'$2'"[ ]*:[ ]*"(.*)".*/\1/p' $1)
}
# replaceJsonProp(jsonFile, property, newValue)
# - note: propertyRegex will be automatically placed into a
# capturing group! -> all other groups start at index 2!
function replaceJsonProp {
replaceInFile $1 "\"$2\": \".*?\"" "\"$2\": \"$3\""
}
# replaceInFile(file, findPattern, replacePattern)
function replaceInFile {
perl -pi -e "s/$2/$3/g;" $1
}
# resolveDir(relativeDir)
# - resolves a directory relative to the current script
function resolveDir {
echo $(cd $SCRIPT_DIR; cd $1; pwd)
}
function main {
# normalize the working dir to the directory of the script
cd $(dirname $0);SCRIPT_DIR=$(pwd)
ARG_DEFS+=("[--verbose=(true|false)]")
parseArgs "$@"
# --verbose argument
if [[ $VERBOSE == "true" ]]; then
set -x
fi
if isFunction init; then
init "$@"
fi
# jump to the function denoted by the --action argument,
# otherwise call the "run" function
if [[ $ACTION ]]; then
$ACTION "$@"
else
run "$@"
fi
}
main "$@"
+33 -31
View File
@@ -11,7 +11,7 @@ import { Logger } from '../logger';
// tslint:disable-next-line:no-var-requires
const MAIN_PACKAGE_JSON = require('../../package.json');
const VERSION = MAIN_PACKAGE_JSON.version;
const FLAGS = '--access public --tag beta';
const FLAGS = '--access public';
const PACKAGE_JSON_BASE = {
description: 'Ionic Native - Native plugins for ionic apps',
@@ -29,14 +29,16 @@ const DIST = path.resolve(ROOT, 'dist/@ionic-native');
const PACKAGES = [];
const RXJS_VERSION = '*';
const MIN_CORE_VERSION = '^5.1.0';
const RXJS_VERSION = '^5.5.0 || ^6.5.0';
const PLUGIN_PEER_DEPENDENCIES = {
'@ionic-native/core': VERSION, // TODO change this in production
'@ionic-native/core': MIN_CORE_VERSION,
rxjs: RXJS_VERSION
};
function getPackageJsonContent(name, peerDependencies = {}, dependencies = {}) {
function getPackageJsonContent(name: string, peerDependencies = {}, dependencies = {}) {
return merge(PACKAGE_JSON_BASE, {
name: '@ionic-native/' + name,
dependencies,
@@ -50,7 +52,10 @@ function writePackageJson(data: any, dir: string) {
fs.writeJSONSync(filePath, data);
PACKAGES.push(dir);
}
function writeNGXPackageJson(data: any, dir: string){
const filePath = path.resolve(dir, 'package.json');
fs.writeJSONSync(filePath, data);
}
function prepare() {
// write @ionic-native/core package.json
writePackageJson(
@@ -61,41 +66,38 @@ function prepare() {
// write plugin package.json files
PLUGIN_PATHS.forEach((pluginPath: string) => {
const pluginName = pluginPath.split(/[\/\\]+/).slice(-2)[0];
const packageJsonContents = getPackageJsonContent(
pluginName,
PLUGIN_PEER_DEPENDENCIES
);
const packageJsonContents = getPackageJsonContent(pluginName, PLUGIN_PEER_DEPENDENCIES);
const dir = path.resolve(DIST, 'plugins', pluginName);
const ngxDir = path.join(dir, 'ngx');
writePackageJson(packageJsonContents, dir);
writeNGXPackageJson(packageJsonContents, ngxDir);
});
}
async function publish(ignoreErrors = false) {
Logger.profile('Publishing');
// upload 1 package per CPU thread at a time
const worker = Queue.async.asyncify((pkg: any) =>
new Promise<any>((resolve, reject) => {
exec(`npm publish ${pkg} ${FLAGS}`, (err, stdout) => {
if (stdout) {
Logger.verbose(stdout.trim());
resolve(stdout);
}
if (err) {
if (!ignoreErrors) {
if (
err.message.includes(
'You cannot publish over the previously published version'
)
) {
Logger.verbose('Ignoring duplicate version error.');
return resolve();
}
reject(err);
const worker = Queue.async.asyncify(
(pkg: any) =>
new Promise<any>((resolve, reject) => {
exec(`npm publish ${pkg} ${FLAGS}`, (err, stdout) => {
if (stdout) {
Logger.verbose(stdout.trim());
resolve(stdout);
}
}
});
})
if (err) {
if (!ignoreErrors) {
if (
err.message.includes('You cannot publish over the previously published version')
) {
Logger.verbose('Ignoring duplicate version error.');
return resolve();
}
reject(err);
}
}
});
})
);
try {
+21 -20
View File
@@ -1,25 +1,26 @@
export function checkReady() {
const DEVICE_READY_TIMEOUT = 5000;
if (typeof process === 'undefined') {
const win: any = typeof window !== 'undefined' ? window : {};
const DEVICE_READY_TIMEOUT = 5000;
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
const before = Date.now();
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
const before = Date.now();
let didFireReady = false;
document.addEventListener('deviceready', () => {
console.log(
`Ionic Native: deviceready event fired after ${Date.now() - before} ms`
);
didFireReady = true;
});
let didFireReady = false;
win.document.addEventListener('deviceready', () => {
console.log(`Ionic Native: deviceready event fired after ${Date.now() - before} ms`);
didFireReady = true;
});
setTimeout(() => {
if (!didFireReady && window.cordova) {
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);
}
}, DEVICE_READY_TIMEOUT);
setTimeout(() => {
if (!didFireReady && win.cordova) {
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);
}
}, DEVICE_READY_TIMEOUT);
}
}
@@ -30,13 +30,9 @@ class MockInstancePluginObject {
class MockCordovaPlugin {
static ping = jest.fn((arg: string) => 'pong');
static pingAsync = jest.fn(
(arg: string, success: Function, error: Function) => success('pong')
);
static pingAsync = jest.fn((arg: string, success: Function, error: Function) => success('pong'));
ping = jest.fn((arg: string) => 'pong');
pingAsync = jest.fn((arg: string, success: Function, error: Function) =>
success('pong')
);
pingAsync = jest.fn((arg: string, success: Function, error: Function) => success('pong'));
}
describe('Common decorator functions', () => {
@@ -73,12 +69,8 @@ describe('Common decorator functions', () => {
test('original method should have received args', () => {
expect(MockCordovaPlugin.pingAsync.mock.calls[0][0]).toBe('pingpong');
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][1]).toBe(
'function'
);
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][2]).toBe(
'function'
);
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][1]).toBe('function');
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][2]).toBe('function');
});
});
+45 -110
View File
@@ -1,4 +1,4 @@
import { Observable, fromEvent } from 'rxjs';
import { fromEvent, Observable } from 'rxjs';
import { CordovaOptions } from './interfaces';
@@ -7,9 +7,7 @@ declare const window: any;
export const ERR_CORDOVA_NOT_AVAILABLE = { error: 'cordova_not_available' };
export const ERR_PLUGIN_NOT_INSTALLED = { error: 'plugin_not_installed' };
export function getPromise<T>(
callback: (resolve: Function, reject?: Function) => any
): Promise<T> {
export function getPromise<T>(callback: (resolve: Function, reject?: Function) => any): Promise<T> {
const tryNativePromise = () => {
if (Promise) {
return new Promise<T>((resolve, reject) => {
@@ -22,9 +20,10 @@ export function getPromise<T>(
}
};
if (window.angular) {
if (typeof window !== 'undefined' && window.angular) {
const doc = window.document;
const injector = window.angular
.element(document.querySelector('[ng-app]') || document.body)
.element(doc.querySelector('[ng-app]') || doc.body)
.injector();
if (injector) {
const $q = injector.get('$q');
@@ -58,14 +57,7 @@ export function wrapPromise(
(...args: any[]) => reject(args)
);
} else {
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});
@@ -79,12 +71,7 @@ export function wrapPromise(
return p;
}
function wrapOtherPromise(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
return getPromise((resolve: Function, reject: Function) => {
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
if (pluginResult) {
@@ -99,12 +86,7 @@ function wrapOtherPromise(
});
}
function wrapObservable(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
return new Observable(observer => {
let pluginResult;
@@ -162,12 +144,12 @@ function wrapObservable(
/**
* Wrap the event with an observable
* @private
* @param event even name
* @param event event name
* @param element The element to attach the event listener to
* @returns {Observable}
*/
function wrapEventObservable(event: string, element: any): Observable<any> {
element = element ? get(window, element) : window;
element = (typeof window !== 'undefined' && element) ? get(window, element) : element || (typeof window !== 'undefined' ? window : {});
return fromEvent(element, event);
}
@@ -203,11 +185,8 @@ export function checkAvailability(
pluginInstance = getPlugin(pluginRef);
if (
!pluginInstance ||
(!!methodName && typeof pluginInstance[methodName] === 'undefined')
) {
if (!window.cordova) {
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
if (typeof window === 'undefined' || !window.cordova) {
cordovaWarn(pluginName, methodName);
return ERR_CORDOVA_NOT_AVAILABLE;
}
@@ -223,23 +202,14 @@ export function checkAvailability(
* Checks if _objectInstance exists and has the method/property
* @private
*/
export function instanceAvailability(
pluginObj: any,
methodName?: string
): boolean {
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
return (
pluginObj._objectInstance &&
(!methodName ||
typeof pluginObj._objectInstance[methodName] !== 'undefined')
(!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined')
);
}
export function setIndex(
args: any[],
opts: any = {},
resolve?: Function,
reject?: Function
): any {
export function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
// ignore resolve and reject in case sync
if (opts.sync) {
return args;
@@ -258,19 +228,12 @@ export function setIndex(
resolve(result);
}
});
} else if (
opts.callbackStyle === 'object' &&
opts.successName &&
opts.errorName
) {
} else if (opts.callbackStyle === 'object' && opts.successName && opts.errorName) {
const obj: any = {};
obj[opts.successName] = resolve;
obj[opts.errorName] = reject;
args.push(obj);
} else if (
typeof opts.successIndex !== 'undefined' ||
typeof opts.errorIndex !== 'undefined'
) {
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
const setSuccessIndex = () => {
// If we've specified a success/error index
if (opts.successIndex > args.length) {
@@ -339,15 +302,15 @@ export function callInstance(
args = setIndex(args, opts, resolve, reject);
if (instanceAvailability(pluginObj, methodName)) {
return pluginObj._objectInstance[methodName].apply(
pluginObj._objectInstance,
args
);
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
}
}
export function getPlugin(pluginRef: string): any {
return get(window, pluginRef);
if (typeof window !== 'undefined') {
return get(window, pluginRef);
}
return null;
}
export function get(element: Element | Window, path: string) {
@@ -362,11 +325,7 @@ export function get(element: Element | Window, path: string) {
return obj;
}
export function pluginWarn(
pluginName: string,
plugin?: string,
method?: string
): void {
export function pluginWarn(pluginName: string, plugin?: string, method?: string): void {
if (method) {
console.warn(
'Native: tried calling ' +
@@ -378,14 +337,10 @@ export function pluginWarn(
' plugin is not installed.'
);
} else {
console.warn(
`Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
console.warn(`Native: tried accessing the ${pluginName} plugin but it's not installed.`);
}
if (plugin) {
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
console.warn(`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`);
}
}
@@ -395,20 +350,22 @@ export function pluginWarn(
* @param method
*/
export function cordovaWarn(pluginName: string, method?: string): void {
if (method) {
console.warn(
'Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
if (typeof process === 'undefined') {
if (method) {
console.warn(
'Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
}
}
}
@@ -419,11 +376,7 @@ export type WrapFn = (...args: any[]) => any;
/**
* @private
*/
export const wrap = (
pluginObj: any,
methodName: string,
opts: CordovaOptions = {}
): WrapFn => {
export const wrap = (pluginObj: any, methodName: string, opts: CordovaOptions = {}): WrapFn => {
return (...args: any[]) => {
if (opts.sync) {
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
@@ -443,11 +396,7 @@ export const wrap = (
/**
* @private
*/
export function wrapInstance(
pluginObj: any,
methodName: string,
opts: any = {}
): Function {
export function wrapInstance(pluginObj: any, methodName: string, opts: any = {}): Function {
return (...args: any[]) => {
if (opts.sync) {
return callInstance(pluginObj, methodName, args, opts);
@@ -515,14 +464,7 @@ export function wrapInstance(
(...args: any[]) => reject(args)
);
} else {
result = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
if (result && result.then) {
result.then(resolve, reject);
@@ -543,14 +485,7 @@ export function wrapInstance(
(...args: any[]) => reject(args)
);
} else {
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});
@@ -1,4 +1,5 @@
import { Observable, Observer } from 'rxjs';
import { checkAvailability, getPlugin } from './common';
function overrideFunction(pluginObj: any, methodName: string): Observable<any> {
@@ -1,7 +1,12 @@
import { wrapInstance } from './common';
import { CordovaOptions } from './interfaces';
export function cordovaInstance(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) {
export function cordovaInstance(
pluginObj: any,
methodName: string,
config: CordovaOptions,
args: IArguments | any[]
) {
args = Array.from(args);
return wrapInstance(pluginObj, methodName, config).apply(this, args);
}
+6 -1
View File
@@ -1,6 +1,11 @@
import { wrap } from './common';
import { CordovaOptions } from './interfaces';
export function cordova(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) {
export function cordova(
pluginObj: any,
methodName: string,
config: CordovaOptions,
args: IArguments | any[]
) {
return wrap(pluginObj, methodName, config).apply(this, args);
}
+32 -18
View File
@@ -2,47 +2,61 @@ 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; }
static installed(): boolean {
const isAvailable = checkAvailability(this.pluginRef) === true;
return isAvailable;
}
/**
* Returns the original plugin object
*/
static getPlugin(): any { return get(window, this.pluginRef); }
static getPlugin(): any {
if (typeof window !== 'undefined') {
return get(window, this.pluginRef);
}
return null;
}
/**
* Returns the plugin's name
*/
static getPluginName(): string { return this.pluginName; }
static getPluginName(): string {
const pluginName = this.pluginName;
return pluginName;
}
/**
* Returns the plugin's reference
*/
static getPluginRef(): string { return this.pluginRef; }
static getPluginRef(): string {
const pluginRef = this.pluginRef;
return pluginRef;
}
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string { return this.plugin; }
static getPluginInstallName(): string {
const plugin = this.plugin;
return plugin;
}
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] { return this.platforms || []; }
static getSupportedPlatforms(): string[] {
const platform = this.platforms;
return platform;
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ declare const window: any;
* creates Angular 1 services of the form $cordovaSERVICE, ex: $cordovaStatusBar.
*/
export function initAngular1(plugins: any) {
if (window.angular) {
if (typeof window !== 'undefined' && window.angular) {
const ngModule = window.angular.module('ionic.native', []);
for (const name in plugins) {
+4 -3
View File
@@ -7,7 +7,9 @@ export function get(element: Element | Window, path: string) {
const paths: string[] = path.split('.');
let obj: any = element;
for (let i = 0; i < paths.length; i++) {
if (!obj) { return null; }
if (!obj) {
return null;
}
obj = obj[paths[i]];
}
return obj;
@@ -17,9 +19,8 @@ export function get(element: Element | Window, path: string) {
* @private
*/
export function getPromise(callback: Function = () => {}): Promise<any> {
const tryNativePromise = () => {
if (window.Promise) {
if (typeof Promise === 'function' || (typeof window !== 'undefined' && window.Promise)) {
return new Promise<any>((resolve, reject) => {
callback(resolve, reject);
});
+32 -27
View File
@@ -9,7 +9,6 @@ declare const AbbyyRtrSdk: any;
* default setting will be used.
*/
export interface TextCaptureOptions {
/**
* The name of the license file. This file must be located in the
* www/rtr_assets/ directory in your project.
@@ -57,6 +56,11 @@ export interface TextCaptureOptions {
* the latest recognition result.
*/
isStopButtonVisible?: boolean;
/**
* Specify the orientation, possible values 'landscape' or 'portrait'.
*/
orientation?: string;
}
/**
@@ -64,7 +68,6 @@ export interface TextCaptureOptions {
* The callback you implement should parse this object and show results to user.
*/
export interface TextCaptureResult {
/**
* An array of objects representing recognized lines of text.
* These objects have the following keys:
@@ -75,7 +78,7 @@ export interface TextCaptureResult {
* · rect (string): position and size of the bounding rectangle,
* a string of 4 integers separated with whitespaces ("x y width height").
*/
textLines: { text: string, quadrangle: string, rect?: string }[];
textLines: { text: string; quadrangle: string; rect?: string }[];
/**
* Additional information. This object has the following keys:
@@ -91,10 +94,10 @@ export interface TextCaptureResult {
* the array contains language identifiers (["English", "French", "German"]).
*/
resultInfo: {
stabilityStatus: string,
userAction: string,
frameSize: string,
recognitionLanguages: string[]
stabilityStatus: string;
userAction: string;
frameSize: string;
recognitionLanguages: string[];
};
/**
@@ -114,7 +117,6 @@ export interface TextCaptureResult {
* keys: you must specify either one of them, but not both at the same time.
*/
export interface DataCaptureOptions {
/**
* The predefined data capture profile to use, for example: "MRZ".
* Note: For the list of supported documents, see Specifications — Data
@@ -134,10 +136,10 @@ export interface DataCaptureOptions {
* the regular expression that should be matched when capturing a field.
*/
customDataCaptureScenario?: {
name: string,
description: string,
recognitionLanguages: string[],
fields: { regEx: string }[]
name: string;
description: string;
recognitionLanguages: string[];
fields: { regEx: string }[];
};
/**
@@ -175,6 +177,11 @@ export interface DataCaptureOptions {
* the latest recognition result.
*/
isStopButtonVisible?: boolean;
/**
* Specify the orientation, possible values 'landscape' or 'portrait'.
*/
orientation?: string;
}
/**
@@ -182,7 +189,6 @@ export interface DataCaptureOptions {
* implement should parse this object and show results to user.
*/
export interface DataCaptureResult {
/**
* The data scheme which was applied during data capture.
* The value is an object which has two keys:
@@ -195,8 +201,8 @@ export interface DataCaptureResult {
* present in the result.
*/
dataScheme?: {
id: string,
name: string
id: string;
name: string;
};
/**
@@ -222,15 +228,15 @@ export interface DataCaptureResult {
* of 4 integers separated with whitespaces ("x y width height").
*/
dataFields: {
id: string,
name: string,
text: string,
quadrangle: string,
id: string;
name: string;
text: string;
quadrangle: string;
components: {
text: string,
quadrangle: string,
rect: string
}
text: string;
quadrangle: string;
rect: string;
};
};
/**
@@ -245,9 +251,9 @@ export interface DataCaptureResult {
* with 2 integers separated with a whitespace ("720 1280").
*/
resultInfo: {
stabilityStatus: string,
userAction: string,
frameSize: string
stabilityStatus: string;
userAction: string;
frameSize: string;
};
/**
@@ -297,7 +303,6 @@ export interface DataCaptureResult {
})
@Injectable()
export class AbbyyRTR extends IonicNativePlugin {
/**
* Opens a modal dialog with controls for the Text Capture scenario.
* @param {TextCaptureOptions} options
+3 -3
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
* })
@@ -30,7 +30,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
@Plugin({
pluginName: 'Alipay',
plugin: 'cordova-plugin-gubnoi-alipay',
pluginRef: 'Alipay',
pluginRef: 'cordova.plugins.alipay',
repo: 'https://github.com/jing-zhou/cordova-plugin-alipay',
install: 'ionic cordova plugin add cordova-plugin-gubnoi-alipay --variable APP_ID=your_app_id',
installVariables: ['APP_ID'],
@@ -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;
}
}
@@ -204,20 +204,20 @@ export class AndroidPermissions extends IonicNativePlugin {
/**
* Check permission
* @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise
* @return {Promise<AndroidPermissionResponse>} Returns a promise
*/
@Cordova()
checkPermission(permission: string): Promise<any> {
checkPermission(permission: string): Promise<AndroidPermissionResponse> {
return;
}
/**
* Request permission
* @param {string} permission The name of the permission to request
* @return {Promise<any>}
* @return {Promise<AndroidPermissionResponse>}
*/
@Cordova()
requestPermission(permission: string): Promise<any> {
requestPermission(permission: string): Promise<AndroidPermissionResponse> {
return;
}
@@ -234,10 +234,14 @@ export class AndroidPermissions extends IonicNativePlugin {
/**
* This function still works now, will not support in the future.
* @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise
* @return {Promise<AndroidPermissionResponse>} Returns a promise
*/
@Cordova()
hasPermission(permission: string): Promise<any> {
hasPermission(permission: string): Promise<AndroidPermissionResponse> {
return;
}
}
export interface AndroidPermissionResponse {
hasPermission: boolean;
}
@@ -0,0 +1,51 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AnylineOptions {
// Valid License Key
licenseKey: string;
// Scanning options
config: any;
}
/**
* @name Anyline
* @description
* Anyline provides an easy-to-use SDK for applications to enable Optical Character Recognition (OCR) on mobile devices.
*
* @usage
* ```typescript
* import { Anyline } from '@ionic-native/anyline/ngx';
*
*
* constructor(private anyline: Anyline) { }
*
* ...
*
*
* this.anyline.scan(options)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'Anyline',
plugin: 'io-anyline-cordova',
pluginRef: 'Anyline',
repo: 'https://github.com/Anyline/anyline-ocr-cordova-module',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Anyline extends IonicNativePlugin {
/**
* Scan
* @param options {AnylineOptions} Scanning options
* @return {Promise<any>} Returns a promise that resolves when Code is captured
*/
@Cordova()
scan(options: AnylineOptions): Promise<any> {
return;
}
}
@@ -0,0 +1,66 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppLauncherOptions {
uri?: string;
packageName?: string;
}
/**
* @name App Launcher
* @description
* Simple Cordova plugin to see if other apps are installed and launch them.
*
* @usage
* ```typescript
* import { AppLauncher, AppLauncherOptions } from '@ionic-native/app-launcher/ngx';
* import { Platform } from '@ionic/angular';
*
* constructor(private appLauncher: AppLauncher, private platform: Platform) { }
*
* ...
*
* const options: AppLauncherOptions = {
* }
*
* if(this.platform.is('ios')) {
* options.uri = 'fb://'
* } else {
* options.packageName = 'com.facebook.katana'
* }
*
* this.appLauncher.canLaunch(options)
* .then((canLaunch: boolean) => console.log('Facebook is available'))
* .catch((error: any) => console.error('Facebook is not available'));
*
* ```
*/
@Plugin({
pluginName: 'AppLauncher',
plugin: 'cordova-plugin-app-launcher',
pluginRef: 'window.plugins.launcher',
repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher',
platforms: ['Android', 'iOS']
})
@Injectable()
export class AppLauncher extends IonicNativePlugin {
/**
* Check if any apps are installed that can launch via a specified URI or Package Name.
* @param options App Launcher options
* @return {Promise<any>} Returns a promise that resolves if the app is installed
*/
@Cordova()
canLaunch(options: AppLauncherOptions): Promise<boolean> {
return;
}
/**
* Launches the app via a specified URI or Package Name
* @param options App Launcher options
* @return {Promise<any>} Returns a promise that resolves the launched app
*/
@Cordova()
launch(options: AppLauncherOptions): Promise<any> {
return;
}
}
@@ -80,6 +80,12 @@ export interface AppRateCustomLocale {
/** Feedback prompt title */
feedbackPromptTitle?: string;
/** Feedback prompt message */
appRatePromptMessage?: string;
/** Feedback prompt message */
feedbackPromptMessage?: string;
}
export interface AppRateCallbacks {
@@ -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;
}
/**
+141 -33
View File
@@ -7,11 +7,28 @@ export interface EncryptedCardData {
wrappedKey: string;
}
export interface SignatureCertificatesData {
certificateSubCA: string;
certificateLeaf: string;
nonce: string;
nonceSignature: string;
}
export interface CardData {
cardholderName: string;
primaryAccountNumberSuffix: string;
localizedDescription?: string;
paymentNetwork: string;
paymentNetwork?: string;
}
export interface PairedDevicesFlags {
isInWallet: boolean;
isInWatch: boolean;
FPANID: string;
}
export interface WatchExistData {
isWatchPaired: boolean;
}
/**
@@ -26,55 +43,107 @@ export interface CardData {
*
* constructor(private appleWallet: AppleWallet) { }
*
*
* ...
*
*
* this.appleWallet.available()
* .then((res) => {
* // res is a boolean value, either true or false
* console.log("Is Apple Wallet available? ", res);
* // Simple call to determine if the current device supports Apple Pay and has a supported card installed.
* this.appleWallet.isAvailable()
* .then((res: boolean) => {
* // Expect res to be boolean
* })
* .catch((message) => {
* console.error("ERROR AVAILBLE>> ", message);
* .catch((err) => {
* // Catch {{err}} here
* });
*
* ...
*
* let data: cardData = {
* cardholderName: 'Test User',
* primaryAccountNumberSuffix: '1234',
* localizedDescription: 'Description of payment card',
* paymentNetwork: 'VISA'
* }
*
* // Simple call to check Card Eligibility
* this.appleWallet.checkCardEligibility(primaryAccountIdentifier: string)
* .then((res: boolean) => {
* // Expect res to be boolean
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
*
* // Simple call to checkCardEligibilityBySuffix
* this.appleWallet.checkCardEligibilityBySuffix(cardSuffix: string)
* .then((res: boolean) => {
* // Expect res to be boolean
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
* // Simple call to check out if there is any paired Watches so that you can toggle visibility of 'Add to Watch' button
* this.appleWallet.checkPairedDevices()
* .then((res: WatchExistData) => {
* // object contains boolean flags showing paired devices
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
*
*
* // Simple call to check paired devices with a card by its suffix
* this.appleWallet.checkPairedDevicesBySuffix(cardSuffix: string)
* .then((res: PairedDevicesFlags) => {
* // object contains boolean values that ensure that card is already exists in wallet or paired-watch
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
*
* // Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* // This method provides the data needed to create a request to add your payment pass (credit/debit card). After a successful callback, pass the certificate chain to your issuer server-side using our callback delegate method `AppleWallet.completeAddPaymentPass`. The issuer server-side should returns an encrypted JSON payload containing the encrypted card data, which is required to be get the final response
*
* this.appleWallet.startAddPaymentPass(data: cardData)
* .then((res) => {
* console.log("startAddPaymentPass success response ", res);
* .then((res: SignatureCertificatesData) => {
* // User proceed and successfully asked to add card to his wallet
* // Use the callback response JSON payload to complete addition process
* })
* .catch((err) => {
* console.error("startAddPaymentPass ERROR response", err);
* // Catch {{err}} here
* });
*
*
* ...
*
* let data: encryptedCardData = {
* activationData: 'encoded Base64 activationData from your server',
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
* wrappedKey: 'encoded Base64 wrappedKey from your server',
* }
*
* this.appleWallet.encryptedCardData(data: encryptedCardData)
* .then((res) => {
* console.log("completeAddCardToAppleWallet success response ", res);
* this.appleWallet.completeAddPaymentPass(data: encryptedCardData)
* .then((res: string) => {
* // Expect res to be string either 'success' or 'error'
* })
* .catch((err) => {
* console.error("completeAddCardToAppleWallet ERROR response", err);
* // Catch {{err}} here
* // Error and can not add the card, or something wrong happend
* // PKAddPaymentPassViewController will be dismissed
* });
*
* ```
* @Interfaces
* EncryptedCardData
* SignatureCertificatesData
* CardData
* PairedDevicesFlags
* WatchExistData
*/
@Plugin({
pluginName: 'AppleWallet',
@@ -86,31 +155,70 @@ export interface CardData {
@Injectable()
export class AppleWallet extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Wallet
* @return {Promise<boolean>} Returns a promise
* Simple call to determine if the current device supports Apple Pay and has a supported card installed.
* @return {Promise<boolean>}
*/
@Cordova()
available(): Promise<boolean> {
isAvailable(): Promise<boolean> {
return;
}
/**
* Simple call to check Card Eligibility
* @param {string} primaryAccountIdentifier
* @return {Promise<boolean>}
*/
@Cordova()
checkCardEligibility(primaryAccountIdentifier: string): Promise<boolean> {
return;
}
/**
* Simple call to checkCardEligibilityBySuffix
* @param {string} cardSuffix
* @return {Promise<PairedDevicesFlags>}
*/
@Cordova()
checkCardEligibilityBySuffix(cardSuffix: string): Promise<boolean> {
return;
}
/**
* Simple call to check out if there is any paired Watches so that you can toggle visibility of 'Add to Watch' button
* @return {Promise<WatchExistData>}
*/
@Cordova()
checkPairedDevices(): Promise<WatchExistData> {
return;
}
/**
* Simple call to check paired devices with a card by its suffix
* @param {string} cardSuffix
* @return {Promise<PairedDevicesFlags>}
*/
@Cordova()
checkPairedDevicesBySuffix(cardSuffix: string): Promise<PairedDevicesFlags> {
return;
}
/**
* Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* @param {cardData} data
* @return {Promise<any>} Returns a promise
* @return {Promise<SignatureCertificatesData>}
*/
@Cordova()
startAddPaymentPass(data: CardData): Promise<any> {
startAddPaymentPass(data: CardData): Promise<SignatureCertificatesData> {
return;
}
/**
* Simple call contains the card data needed to add a card to Apple Pay.
* Simple completion handler that takes encrypted card data returned from your server side, in order to get the final response from Apple to know if the card is added succesfully or not.
* @param {encryptedCardData} data
* @return {Promise<any>} Returns a promise
* @return {Promise<string>}
*/
@Cordova()
completeAddPaymentPass(data: EncryptedCardData): Promise<any> {
completeAddPaymentPass(data: EncryptedCardData): Promise<string> {
return;
}
}
@@ -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, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation/ngx';
*
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
*
@@ -514,14 +514,16 @@ export declare enum BackgroundGeolocationIOSActivity {
* };
*
* this.backgroundGeolocation.configure(config)
* .subscribe((location: BackgroundGeolocationResponse) => {
* .then(() => {
*
* console.log(location);
* this.backgroundGeolocation.on(BackgroundGeolocationEvents.location).subscribe((location: BackgroundGeolocationResponse) => {
* console.log(location);
*
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
* // and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
* this.backgroundGeolocation.finish(); // FOR IOS ONLY
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
* // and the background-task may be completed. You must do this regardless if your operations are successful or not.
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
* this.backgroundGeolocation.finish(); // FOR IOS ONLY
* });
*
* });
*
@@ -538,7 +540,7 @@ export declare enum BackgroundGeolocationIOSActivity {
*/
@Plugin({
pluginName: 'BackgroundGeolocation',
plugin: 'cordova-plugin-mauron85-background-geolocation@alpha',
plugin: '@mauron85/cordova-plugin-background-geolocation',
pluginRef: 'BackgroundGeolocation',
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
platforms: ['Android', 'iOS']
@@ -549,7 +551,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
* Configure the plugin.
*
* @param options {BackgroundGeolocationConfig} options An object of type Config
* @return {Observable<BackgroundGeolocationResponse>}
* @return {Promise<any>}
*/
@Cordova()
configure(options: BackgroundGeolocationConfig): Promise<any> {
@@ -91,8 +91,37 @@ export class BackgroundMode extends IonicNativePlugin {
* Disable the background mode.
* Once the background mode has been disabled, the app will be paused when in background.
*/
@Cordova()
disable(): Promise<any> {
@Cordova({
sync: true
})
disable(): void {
return;
}
/**
* Enable or disable the background mode.
*
* @param enable {boolean} The status to set for.
*
* @return {void}
*/
@Cordova({
sync: true
})
setEnabled(enable: boolean): void {}
/**
* Fire event with given arguments.
*
* @param event {string} event The event's name.
* @param args {array} The callback's arguments.
*
* @return {string}
*/
@Cordova({
sync: true
})
fireEvent(event: string, ...args: any[]): string {
return;
}
@@ -119,17 +148,15 @@ export class BackgroundMode extends IonicNativePlugin {
}
/**
* Override the default title, ticker and text.
* Overwrite the default settings.
* Available only for Android platform.
* @param {BackgroundModeConfiguration} options List of option to configure. See table below
* @param overrides {BackgroundModeConfiguration} Dict of options to be overridden.
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
setDefaults(options?: BackgroundModeConfiguration): Promise<any> {
return;
}
setDefaults(overrides?: BackgroundModeConfiguration): void {}
/**
* Modify the displayed information.
@@ -143,7 +170,8 @@ export class BackgroundMode extends IonicNativePlugin {
configure(options?: BackgroundModeConfiguration): void {}
/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* Register callback for given event.
* > Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* @param event {string} Event name
* @returns {Observable<any>}
*/
@@ -156,6 +184,17 @@ export class BackgroundMode extends IonicNativePlugin {
return;
}
/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* @param event {string} Event name
* @param callback {function} The function to be exec as callback.
* @returns {Observable<any>}
*/
@Cordova()
un(event: string, callback: (...args: any[]) => void): void {
return;
}
/**
* Android allows to programmatically move from foreground to background.
*/
@@ -202,15 +241,14 @@ export class BackgroundMode extends IonicNativePlugin {
excludeFromTaskList(): void {}
/**
* The method works async instead of isActive() or isEnabled().
* If the screen is off.
* @param fn {function} Callback function to invoke with boolean arg.
* @returns {Promise<boolean>}
*/
@Cordova({
platforms: ['Android']
})
isScreenOff(): Promise<boolean> {
return;
}
isScreenOff(fn: (arg0: boolean) => void): void {}
/**
* Turn screen on
@@ -229,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 {}
}
+102
View File
@@ -0,0 +1,102 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name BioCatch
* @description
* BioCatch SDK Cordova support
*
* @usage
* ```typescript
* import { BioCatch } from '@ionic-native/biocatch';
*
*
* constructor(private biocatch: BioCatch) { }
*
* ...
*
*
* this.biocatch.start('customer-session-1', 'http://example.com', 'some-public-key')
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'BioCatch',
plugin: 'cordova-plugin-biocatch',
pluginRef: 'BioCatch',
repo: 'https://bitbucket.org/carlos_orellana/ionic-plugin',
platforms: ['iOS', 'Android'],
})
@Injectable()
export class BioCatch extends IonicNativePlugin {
/**
* Start a session
* @param customerSessionID {String} Customer session id
* @param wupUrl {String} WUP server URL
* @param publicKey {String} Public Key
* @return {Promise<void>} Returns a promise
*/
@Cordova()
start(customerSessionID: string | null, wupUrl: string, publicKey: string | null): Promise<void> {
return;
}
/**
* Pause the session
* @return {Promise<void>} Returns a promise
*/
@Cordova()
pause(): Promise<void> {
return;
}
/**
* Resume the session
* @return {Promise<void>} Returns a promise
*/
@Cordova()
resume(): Promise<void> {
return;
}
/**
* Stop the session
* @return {Promise<void>} Returns a promise
*/
@Cordova()
stop(): Promise<void> {
return;
}
/**
* Reset the session
* @return {Promise<void>} Returns a promise
*/
@Cordova()
resetSession(): Promise<void> {
return;
}
/**
* Change the session context
* @param contextName {String} Context name
* @return {Promise<void>} Returns a promise
*/
@Cordova()
changeContext(contextName: string): Promise<void> {
return;
}
/**
* Update the customer session ID
* @param customerSessionID {String}
* @return {Promise<void>} Returns a promise
*/
@Cordova()
updateCustomerSessionID(customerSessionID: string | null): Promise<void> {
return;
}
}
@@ -0,0 +1,59 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name BiometricWrapper
* @description
* This plugin capture biometric(Iris and Fingerprint) and validate the user.
* May be used in Banking domain
*
* @usage
* ```typescript
* import { BiometricWrapper } from '@ionic-native/biometric-wrapper/ngx';
*
*
* constructor(private biometricWrapper: BiometricWrapper) { }
*
* ...
*
*
* this.biometricWrapper.activateIris({'PID_XML': '<pid-xml/>'})
* .then((res: any) => )
* .catch((error: any) => );
*
* ```
*/
@Plugin({
pluginName: 'BiometricWrapper',
plugin: 'cordova-plugin-biometric',
pluginRef: 'cordova.plugins.BiometricWrapper',
repo: '',
install: '',
installVariables: [],
platforms: ['Android']
})
@Injectable()
export class BiometricWrapper extends IonicNativePlugin {
/**
* This function activate iris activity
* @return {Promise<any>} Returns a promise that resolves when iris data captured
*/
@Cordova()
activateIris(args: any): Promise<any> {
return;
}
/**
* This function activate fingerprint activity
* @return {Promise<any>} Returns a promise that resolves when FP data captured
*/
@Cordova()
activateFingerprint(args: any): Promise<any> {
return;
}
}
+60 -91
View File
@@ -198,6 +198,13 @@ export interface DocumentVerificationOverlaySettingsCtor {
new(): DocumentVerificationOverlaySettings;
}
export interface BlinkCardOverlaySettings extends OverlaySettings {
glareMessage: string;
}
export interface BlinkCardOverlaySettingsCtor {
new(): BlinkCardOverlaySettings;
}
export interface RecognizerResult {
resultState: RecognizerResultState;
}
@@ -837,47 +844,26 @@ export interface EgyptIdFrontRecognizer extends Recognizer<EgyptIdFrontRecognize
}
export interface EgyptIdFrontRecognizerCtor extends RecognizerCtor<EgyptIdFrontRecognizer> {}
export interface ElitePaymentCardBackRecognizerResult extends RecognizerResult {
cardNumber: string;
cvv: string;
fullDocumentImage: string;
inventoryNumber: string;
validThru: Date;
}
export interface ElitePaymentCardBackRecognizerResultCtor extends RecognizerResultCtor<ElitePaymentCardBackRecognizerResult> {}
export interface ElitePaymentCardBackRecognizer extends Recognizer<ElitePaymentCardBackRecognizerResult> {
anonymizeCardNumber: boolean;
anonymizeCvv: boolean;
detectGlare: boolean;
extractCvv: boolean;
extractInventoryNumber: boolean;
extractValidThru: boolean;
fullDocumentImageDpi: number;
fullDocumentImageExtensionFactors: ImageExtensionFactors;
returnFullDocumentImage: boolean;
}
export interface ElitePaymentCardCombinedRecognizerResult extends RecognizerResult {
export interface BlinkCardEliteRecognizerResult extends RecognizerResult {
cardNumber: string;
cvv: string;
digitalSignature: string;
digitalSignatureVersion: string;
documentDataMatch: boolean;
fullDocumentImage: string;
fullDocumentBackImage: string;
fullDocumentFrontImage: string;
inventoryNumber: string;
owner: string;
scanningFirstSideDone: boolean;
validThru: Date;
}
export interface ElitePaymentCardCombinedRecognizerResultCtor extends RecognizerResultCtor<ElitePaymentCardCombinedRecognizerResult> {}
export interface BlinkCardEliteRecognizerResultCtor extends RecognizerResultCtor<BlinkCardEliteRecognizerResult> {}
export interface ElitePaymentCardCombinedRecognizer extends Recognizer<ElitePaymentCardCombinedRecognizerResult> {
export interface BlinkCardEliteRecognizer extends Recognizer<BlinkCardEliteRecognizerResult> {
anonymizeCardNumber: boolean;
anonymizeCvv: boolean;
anonymizeOwner: boolean;
detectGlare: boolean;
extractCvv: boolean;
extractInventoryNumber: boolean;
extractOwner: boolean;
extractValidThru: boolean;
@@ -886,20 +872,7 @@ export interface ElitePaymentCardCombinedRecognizer extends Recognizer<ElitePaym
returnFullDocumentImage: boolean;
signResult: boolean;
}
export interface ElitePaymentCardFrontRecognizerResult extends RecognizerResult {
fullDocumentImage: string;
owner: string;
}
export interface ElitePaymentCardFrontRecognizerResultCtor extends RecognizerResultCtor<ElitePaymentCardFrontRecognizerResult> {}
export interface ElitePaymentCardFrontRecognizer extends Recognizer<ElitePaymentCardFrontRecognizerResult> {
anonymizeOwner: boolean;
detectGlare: boolean;
extractOwner: boolean;
fullDocumentImageDpi: number;
fullDocumentImageExtensionFactors: ImageExtensionFactors;
}
export interface BlinkCardEliteRecognizerCtor extends RecognizerCtor<BlinkCardEliteRecognizer> {}
export interface EudlRecognizerResult extends RecognizerResult {
address: string;
@@ -1731,24 +1704,7 @@ export interface NewZealandDlFrontRecognizer extends Recognizer<NewZealandDlFron
}
export interface NewZealandDlFrontRecognizerCtor extends RecognizerCtor<NewZealandDlFrontRecognizer> {}
export interface PaymentCardBackRecognizerResult extends RecognizerResult {
cvv: string;
fullDocumentImage: string;
inventoryNumber: string;
}
export interface PaymentCardBackRecognizerResultCtor extends RecognizerResultCtor<PaymentCardBackRecognizerResult> {}
export interface PaymentCardBackRecognizer extends Recognizer<PaymentCardBackRecognizerResult> {
anonymizeCvv: boolean;
detectGlare: boolean;
extractInventoryNumber: boolean;
fullDocumentImageDpi: number;
fullDocumentImageExtensionFactors: ImageExtensionFactors;
returnFullDocumentImage: boolean;
}
export interface PaymentCardBackRecognizerCtor extends RecognizerCtor<PaymentCardBackRecognizer> {}
export interface PaymentCardCombinedRecognizerResult extends RecognizerResult {
export interface BlinkCardRecognizerResult extends RecognizerResult {
cardNumber: string;
cvv: string;
digitalSignature: string;
@@ -1757,16 +1713,19 @@ export interface PaymentCardCombinedRecognizerResult extends RecognizerResult {
fullDocumentBackImage: string;
fullDocumentFrontImage: string;
inventoryNumber: string;
issuer: string;
owner: string;
scanningFirstSideDone: boolean;
validThru: Date;
}
export interface PaymentCardCombinedRecognizerResultCtor extends RecognizerResultCtor<PaymentCardCombinedRecognizerResult> {}
export interface BlinkCardRecognizerResultCtor extends RecognizerResultCtor<BlinkCardRecognizerResult> {}
export interface PaymentCardCombinedRecognizer extends Recognizer<PaymentCardCombinedRecognizerResult> {
export interface BlinkCardRecognizer extends Recognizer<BlinkCardRecognizerResult> {
anonymizeCardNumber: boolean;
anonymizeCvv: boolean;
anonymizeOwner: boolean;
detectGlare: boolean;
extractCvv: boolean;
extractInventoryNumber: boolean;
extractOwner: boolean;
extractValidThru: boolean;
@@ -1775,27 +1734,7 @@ export interface PaymentCardCombinedRecognizer extends Recognizer<PaymentCardCom
returnFullDocumentImage: boolean;
signResult: boolean;
}
export interface PaymentCardCombinedRecognizerCtor extends RecognizerCtor<PaymentCardCombinedRecognizer> {}
export interface PaymentCardFrontRecognizerResult extends RecognizerResult {
cardNumber: string;
fullDocumentImage: string;
owner: string;
validThru: Date;
}
export interface PaymentCardFrontRecognizerResultCtor extends RecognizerResultCtor<PaymentCardFrontRecognizerResult> {}
export interface PaymentCardFrontRecognizer extends Recognizer<PaymentCardFrontRecognizerResult> {
anonymizeCardNumber: boolean;
anonymizeOwner: boolean;
detectGlare: boolean;
extractOwner: boolean;
extractValidThru: boolean;
fullDocumentImageDpi: number;
fullDocumentImageExtensionFactors: ImageExtensionFactors;
returnFullDocumentImage: boolean;
}
export interface PaymentCardFrontRecognizerCtor extends RecognizerCtor<PaymentCardFrontRecognizer> {}
export interface BlinkCardRecognizerCtor extends RecognizerCtor<BlinkCardRecognizer> {}
export interface Pdf417RecognizerResult extends RecognizerResult {
barcodeType: string;
@@ -2738,6 +2677,40 @@ export interface UsdlCombinedRecognizerCtor extends RecognizerCtor<UsdlCombinedR
* this.barcodeStringData = barcodeRecognizer.result.stringData;
* }
* }
*
* ...
*
* const overlaySettings = new this.blinkId.BlinkCardOverlaySettings();
* const recognizer = new this.blinkId.BlinkCardRecognizer();
* recognizer.returnFullDocumentImage = false;
* recognizer.detectGlare = true;
* recognizer.extractCvv = true;
* recognizer.extractValidThru = true;
* recognizer.extractOwner = true;
*
* const recognizerCollection = new this.blinkId.RecognizerCollection([recognizer]);
* const canceled = await this.blinkId.scanWithCamera(
* overlaySettings,
* recognizerCollection,
* {
* ios: '', //iOS License Key
* android: '' //Android License Key
* },
* );
*
* if (!canceled) {
* if (recognizer.result.resultState === RecognizerResultState.valid) {
* const results = recognizer.result;
*
* if (results.resultState === RecognizerResultState.valid) {
* const ccInfo = {
* cardNumber: Number(results.cardNumber),
* expirationMonth: Number(results.validThru.month),
* expirationYear: Number(results.validThru.year),
* cvv: Number(results.cvv)
* };
* }
* }
* ```
*/
@Plugin({
@@ -2753,7 +2726,7 @@ export interface UsdlCombinedRecognizerCtor extends RecognizerCtor<UsdlCombinedR
export class BlinkId extends IonicNativePlugin {
/**
* Opens the camera dialog and attempts to scan a barcode/document
* @param overlaySettings {OverlaySettings} for camera overla customization
* @param overlaySettings {OverlaySettings} for camera overlay customization
* @param recognizerCollection {RecognizerCollection} collection of recognizers to scan with
* @returns {Promise<boolean>}
*/
@@ -2773,6 +2746,7 @@ export class BlinkId extends IonicNativePlugin {
@CordovaProperty() BarcodeOverlaySettings: BarcodeOverlaySettingsCtor;
@CordovaProperty() DocumentOverlaySettings: DocumentOverlaySettingsCtor;
@CordovaProperty() DocumentVerificationOverlaySettings: DocumentVerificationOverlaySettingsCtor;
@CordovaProperty() BlinkCardOverlaySettings: BlinkCardOverlaySettingsCtor;
@CordovaProperty() RecognizerCollection: RecognizerCollectionCtor;
@@ -2795,6 +2769,10 @@ export class BlinkId extends IonicNativePlugin {
@CordovaProperty() AustriaIdFrontRecognizer: AustriaIdFrontRecognizerCtor;
@CordovaProperty() AustriaPassportRecognizerResult: AustriaPassportRecognizerResultCtor;
@CordovaProperty() AustriaPassportRecognizer: AustriaPassportRecognizerCtor;
@CordovaProperty() BlinkCardEliteRecognizer: BlinkCardEliteRecognizerCtor;
@CordovaProperty() BlinkCardEliteRecognizerResult: BlinkCardEliteRecognizerResultCtor;
@CordovaProperty() BlinkCardRecognizerResult: BlinkCardRecognizerResultCtor;
@CordovaProperty() BlinkCardRecognizer: BlinkCardRecognizerCtor;
@CordovaProperty() ColombiaDlFrontRecognizerResult: ColombiaDlFrontRecognizerResultCtor;
@CordovaProperty() ColombiaIdBackRecognizerResult: ColombiaIdBackRecognizerResultCtor;
@CordovaProperty() ColombiaIdBackRecognizer: ColombiaIdBackRecognizerCtor;
@@ -2812,9 +2790,6 @@ export class BlinkId extends IonicNativePlugin {
@CordovaProperty() DocumentFaceRecognizerResult: DocumentFaceRecognizerResultCtor;
@CordovaProperty() EgyptIdFrontRecognizerResult: EgyptIdFrontRecognizerResultCtor;
@CordovaProperty() EgyptIdFrontRecognizer: EgyptIdFrontRecognizerCtor;
@CordovaProperty() ElitePaymentCardBackRecognizerResult: ElitePaymentCardBackRecognizerResultCtor;
@CordovaProperty() ElitePaymentCardCombinedRecognizerResult: ElitePaymentCardCombinedRecognizerResultCtor;
@CordovaProperty() ElitePaymentCardFrontRecognizerResult: ElitePaymentCardFrontRecognizerResultCtor;
@CordovaProperty() EudlRecognizerResult: EudlRecognizerResultCtor;
@CordovaProperty() GermanyCombinedRecognizerResult: GermanyCombinedRecognizerResultCtor;
@CordovaProperty() GermanyCombinedRecognizer: GermanyCombinedRecognizerCtor;
@@ -2868,12 +2843,6 @@ export class BlinkId extends IonicNativePlugin {
@CordovaProperty() MyKadFrontRecognizer: MyKadFrontRecognizerCtor;
@CordovaProperty() NewZealandDlFrontRecognizerResult: NewZealandDlFrontRecognizerResultCtor;
@CordovaProperty() NewZealandDlFrontRecognizer: NewZealandDlFrontRecognizerCtor;
@CordovaProperty() PaymentCardBackRecognizerResult: PaymentCardBackRecognizerResultCtor;
@CordovaProperty() PaymentCardBackRecognizer: PaymentCardBackRecognizerCtor;
@CordovaProperty() PaymentCardCombinedRecognizerResult: PaymentCardCombinedRecognizerResultCtor;
@CordovaProperty() PaymentCardCombinedRecognizer: PaymentCardCombinedRecognizerCtor;
@CordovaProperty() PaymentCardFrontRecognizerResult: PaymentCardFrontRecognizerResultCtor;
@CordovaProperty() PaymentCardFrontRecognizer: PaymentCardFrontRecognizerCtor;
@CordovaProperty() Pdf417RecognizerResult: Pdf417RecognizerResultCtor;
@CordovaProperty() Pdf417Recognizer: Pdf417RecognizerCtor;
@CordovaProperty() PolandCombinedRecognizerResult: PolandCombinedRecognizerResultCtor;
+24 -22
View File
@@ -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 {
@@ -339,7 +341,7 @@ export interface InitializeResult {
/** Service's UUID */
service: string;
/** Characteristic UUID */
characterisitc: string;
characteristic: string;
/** This integer value will be incremented every read/writeRequested */
requestId: number;
/** Offset value */
@@ -431,20 +433,20 @@ export class BluetoothLE extends IonicNativePlugin {
* @name initialize
* Initialize Bluetooth on the device
* @param {InitParams} [params]
* @returns {(Promise<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)
* @returns {(Observable<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)
*/
@Cordova({ callbackOrder: 'reverse' })
initialize(params?: InitParams): Promise<{ status: 'enabled' | 'disabled' }> {
@Cordova({ successIndex: 0, errorIndex: 2, observable: true })
initialize(params?: InitParams): Observable<{ status: 'enabled' | 'disabled' }> {
return;
}
/**
* @name enable (Android)
* Enable Bluetooth on the device. Android support only
* @returns {Promise<{ status: boolean }>}
* @returns void
*/
@Cordova({ callbackOrder: 'reverse', sync: true })
enable(): Promise<{ status: boolean }> {
enable() {
return;
}
@@ -480,10 +482,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Android API >= 23 also requires location services to be enabled. Use isLocationEnabled to determine whether location services are enabled.
* If not enabled, use requestLocation to prompt the location services settings page.
* @param {ScanParams} params Scan params
* @returns {(Observable<{ status: ScanStatus }>)}
* @returns {(Observable< ScanStatus >)}
*/
@Cordova({ callbackOrder: 'reverse', observable: true })
startScan(params: ScanParams): Observable<{ status: ScanStatus }> {
startScan(params: ScanParams): Observable< ScanStatus > {
return;
}
@@ -559,7 +561,7 @@ export class BluetoothLE extends IonicNativePlugin {
connect(params: {
address: string;
autoConnect?: boolean;
}): Observable<{ status: DeviceInfo }> {
}): Observable< DeviceInfo > {
return;
}
@@ -579,10 +581,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Disconnect from a Bluetooth LE device.
* Note: It's simpler to just call close(). Starting with iOS 10, disconnecting before closing seems required!
* @param {{address: string}} params The address/identifier
* @returns {Promise<{ status: DeviceInfo }>}
* @returns {Promise<DeviceInfo>}
*/
@Cordova({ callbackOrder: 'reverse' })
disconnect(params: { address: string }): Promise<{ status: DeviceInfo }> {
disconnect(params: { address: string }): Promise<DeviceInfo> {
return;
}
@@ -592,10 +594,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Prior to 2.7.0, you needed to disconnect to the device before closing, but this is no longer the case.
* Starting with iOS 10, disconnecting before closing seems required!
* @param {{ address: string }} params The address/identifier
* @returns {Promise<{ status: DeviceInfo }>}
* @returns {Promise<DeviceInfo>}
*/
@Cordova({ callbackOrder: 'reverse' })
close(params: { address: string }): Promise<{ status: DeviceInfo }> {
close(params: { address: string }): Promise<DeviceInfo> {
return;
}
@@ -609,7 +611,7 @@ export class BluetoothLE extends IonicNativePlugin {
* Subsequent discover events will make use of this cache.
* If your device's services change, set the clearCache parameter to force Android to re-discover services.
* @param {{ address: string, clearCache: boolean }} params The address/identifier
* @returns {Promise<{ device: Device }>}
* @returns {Promise<Device>}
* success: device object (contains array of service objects)
* error: The callback that will be triggered when the unbond operation fails
*/
@@ -617,7 +619,7 @@ export class BluetoothLE extends IonicNativePlugin {
discover(params: {
address: string;
clearCache?: boolean;
}): Promise<{ device: Device }> {
}): Promise<Device> {
return;
}
@@ -626,13 +628,13 @@ export class BluetoothLE extends IonicNativePlugin {
* Discover the device's services.
* Not providing an array of services will return all services and take longer to discover. iOS support only.
* @param {{address: string, services: string[]}} params
* @returns {Promise<{ services: Services }>}
* @returns {Promise<Services>}
*/
@Cordova({ callbackOrder: 'reverse' })
services(params: {
address: string;
services?: string[];
}): Promise<{ services: Services }> {
}): Promise<Services> {
return;
}
@@ -747,10 +749,10 @@ export class BluetoothLE extends IonicNativePlugin {
* @name rssi
* Read RSSI of a connected device. RSSI is also returned with scanning.
* @param {{ address: string }} params
* @returns {Promise<{ rssi: RSSI }>}
* @returns {Promise< RSSI >}
*/
@Cordova({ callbackOrder: 'reverse' })
rssi(params: { address: string }): Promise<{ rssi: RSSI }> {
rssi(params: { address: string }): Promise< RSSI > {
return;
}
@@ -758,10 +760,10 @@ export class BluetoothLE extends IonicNativePlugin {
* @name mtu (Android, Android 5+)
* Set MTU of a connected device. Android only.
* @param {{ address: string, mtu: number }} params
* @returns {Promise<{ mtu: MTU }>}
* @returns {Promise< MTU >}
*/
@Cordova({ callbackOrder: 'reverse' })
mtu(params: { address: string; mtu?: number }): Promise<{ mtu: MTU }> {
mtu(params: { address: string; mtu?: number }): Promise< MTU > {
return;
}
@@ -1057,7 +1059,7 @@ export class BluetoothLE extends IonicNativePlugin {
@CordovaProperty()
SCAN_MODE_LOW_LATENCY: number;
@CordovaProperty()
MATCH_MODE_AGRESSIVE: number;
MATCH_MODE_AGGRESSIVE: number;
@CordovaProperty()
MATCH_MODE_STICKY: number;
@CordovaProperty()
@@ -475,6 +475,21 @@ export class Calendar extends IonicNativePlugin {
return;
}
/**
* Delete an event by id.
*
* @param {string} [id] The event id
* @param {Date} [fromDate] The date where it start deleting from
* @return Returns a Promise
*/
@Cordova()
deleteEventById(
id: string,
fromDate?: Date
): Promise<any> {
return;
}
/**
* Open the calendar at the specified date.
* @param {Date} date The date you want to open the calendar on
@@ -113,6 +113,14 @@ export interface CameraPreviewPictureOptions {
* this.picture = 'assets/img/test.jpg';
* });
*
* // take a snap shot
* this.cameraPreview.takeSnapshot(this.pictureOpts).then((imageData) => {
* this.picture = 'data:image/jpeg;base64,' + imageData;
* }, (err) => {
* console.log(err);
* this.picture = 'assets/img/test.jpg';
* });
*
*
* // Switch camera
* this.cameraPreview.switchCamera();
@@ -245,6 +253,20 @@ export class CameraPreview extends IonicNativePlugin {
return;
}
/**
* Take a snapshot of preview window (size specified in startCamera options)
* @param {CameraPreviewPictureOptions} [options] quality of the picture to take
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
takeSnapshot(options?: CameraPreviewPictureOptions): Promise<any> {
return;
}
/**
*
* Set camera color effect.
@@ -456,4 +478,22 @@ export class CameraPreview extends IonicNativePlugin {
onBackButton(): Promise<any> {
return;
}
/**
* Return in use device camera fov
* @return {Promise<any>}
*/
@Cordova()
getHorizontalFOV(): Promise<any> {
return;
}
/**
* Get the characteristics of all available cameras
* @return {Promise<any>}
*/
@Cordova()
getCameraCharacteristics(): Promise<any> {
return;
}
}
+2 -2
View File
@@ -211,11 +211,11 @@ export class Camera extends IonicNativePlugin {
* Convenience constant
*/
PictureSourceType = {
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
/** Choose image from picture library (same as PHOTOLIBRARY for Android) */
PHOTOLIBRARY: 0,
/** Take picture from camera */
CAMERA: 1,
/** Choose image from picture library (same as PHOTOLIBRARY for Android) */
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
SAVEDPHOTOALBUM: 2
};
+1 -1
View File
@@ -61,7 +61,7 @@ export class Chooser extends IonicNativePlugin {
* base64-encoded data: URI, MIME type, display name, and original URI.
*/
@Cordova()
getFile(accept: string): Promise<ChooserResult | undefined> {
getFile(accept?: string): Promise<ChooserResult | undefined> {
return;
}
}
@@ -577,6 +577,43 @@ export class CleverTap extends IonicNativePlugin {
return;
}
/****************************
* Notification Inbox methods
****************************/
/**
* Call this method to initialize the App Inbox
*/
@Cordova()
initializeInbox(): Promise<any> {
return;
}
/**
* Call this method to get the count of unread Inbox messages
*/
@Cordova()
getInboxMessageUnreadCount(): Promise<any> {
return;
}
/**
* Call this method to get the count of total Inbox messages
*/
@Cordova()
getInboxMessageCount(): Promise<any> {
return;
}
/**
* Call this method to open the App Inbox
* @param styleConfig : any or empty object
*/
@Cordova()
showInbox(styleConfig: any): Promise<any> {
return;
}
/*******************
* Developer Options
******************/
@@ -4,7 +4,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Couchbase Lite
* @description
* Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android
* Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android <docs-card href="https://ionicframework.com/integrations/couchbase-lite" ionicon="alert">This Plugin is no longer supported by Couchbase. Please see our Couchbase Lite Integration</docs-card>
*
* @usage
* ```typescript
@@ -33,6 +33,9 @@ export interface DeeplinkOptions {
* @description This plugin handles deeplinks on iOS and Android for both custom URL scheme links
* and Universal App Links.
*
* Please read the [ionic plugin deeplinks docs](https://github.com/ionic-team/ionic-plugin-deeplinks) for iOS and Android integration.
* You must add `universal-links` to your `config.xml` and set up Apple App Site Association (AASA) for iOS and Asset Links for Android.
*
* @usage
* ```typescript
* import { Deeplinks } from '@ionic-native/deeplinks/ngx';
@@ -35,9 +35,9 @@ export interface AndroidAccount {
*/
@Plugin({
pluginName: 'DeviceAccounts',
plugin: 'cordova-device-accounts',
pluginRef: 'plugins.DeviceAccounts',
repo: 'https://github.com/danielsogl/cordova-device-accounts',
plugin: 'cordova-device-accounts-v2',
pluginRef: 'DeviceAccounts',
repo: 'https://github.com/xUnholy/cordova-device-accounts-v2',
platforms: ['Android']
})
@Injectable()
@@ -78,4 +78,23 @@ export class DeviceAccounts extends IonicNativePlugin {
getEmail(): Promise<string> {
return;
}
/**
* Get permissions for access to email registered on Android device 8.0+
* @returns {Promise<string>}
*/
@Cordova()
getPermissions(): Promise<string> {
return;
}
/**
* Get permissions for access to email registered on Android device 8.0+ for requested type
* @param {string} type
* @returns {Promise<string>}
*/
@Cordova()
getPermissionsByType(type: string): Promise<string> {
return;
}
}
@@ -73,7 +73,11 @@ export class Diagnostic extends IonicNativePlugin {
@CordovaProperty()
permissionStatus: {
GRANTED: string;
/**
* @deprecated cordova.plugins.diagnostic@5.0.0 uses DENIED_ONCE to unify DENIED* statuses across iOS/Android
*/
DENIED: string;
DENIED_ONCE: string;
NOT_REQUESTED: string;
DENIED_ALWAYS: string;
RESTRICTED: string;
@@ -812,6 +816,15 @@ export class Diagnostic extends IonicNativePlugin {
return;
}
/**
* Requests reminders authorization for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
requestRemoteNotificationsAuthorization(types?: string[], omitRegistration?: boolean): Promise<string> {
return;
}
/**
* Indicates the current setting of notification types for the app in the Settings app.
* Note: on iOS 8+, if "Allow Notifications" switch is OFF, all types will be returned as disabled.
@@ -0,0 +1,94 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export enum DocumentScannerSourceType {
/**
* Scan directly from device camera.
* This is the default.
*/
CAMERA = 1,
/**
* Scan from an image already stored on device.
*/
GALLERY = 0
}
export interface DocumentScannerOptions {
/**
* Choose to scan from camera or existing image file. Only valid for Android.
*/
sourceType?: DocumentScannerSourceType;
/**
* Filename to save scanned image to (minus extension, which is always ".png").
* Only valid for iOS. Caller is responsible for cleaning up any files created
* if this parameter is set to anything other than the default value,
* which is "image".
*/
fileName?: string;
/**
* Quality to use when capturing the image, must be a float value
* from 1.0(default - Highest quality) to 5.0(Lowest Quality). Any value
* in between will be accepted. Any value not equal to or not between these values
* will default to the highest quality of 1.0.
*/
quality?: number;
/**
* If the image should be returned as a base64 encoding instead of as a file URL.
* If true, the plugin will return the scanned image as base64. If false,
* the plugin will return the image URL of the image.
*/
returnBase64?: boolean;
}
/**
* @name Document Scanner
* @description
* This plugin processes images of documents, compensating for perspective.
*
* @usage
* ```typescript
* import { DocumentScanner, DocumentScannerOptions } from '@ionic-native/document-scanner';
*
*
* constructor(private documentScanner: DocumentScanner) { }
*
* ...
*
* let opts: DocumentScannerOptions = {};
* this.documentScanner.scanDocument(opts)
* .then((res: string) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*
* @interfaces
* DocumentScannerOptions
* @enums
* DocumentScannerSourceType
*/
@Plugin({
pluginName: 'DocumentScanner',
plugin: 'cordova-plugin-document-scanner',
pluginRef: 'scan',
repo: 'https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner',
platforms: ['Android', 'iOS']
})
@Injectable()
export class DocumentScanner extends IonicNativePlugin {
/**
* Scan a document
* @param opts {DocumentScannerOptions} optional parameter for controlling scanning
* @return {Promise<string>} file URL of scanned document image
*/
@Cordova({
callbackOrder: 'reverse'
})
scanDoc(opts?: DocumentScannerOptions): Promise<string> {
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();
}
});
}
});
}
@@ -0,0 +1,61 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Emm App Config
* @description
* This plugin provides information on EMM application configuration
*
* Requires the Cordova plugin: `cordova-plugin-emm-app-config`. For more info, please see the [Cordova EMM App Config Plugin Docs](https://github.com/oracle/cordova-plugin-emm-app-config).
*
*
* @usage
* ```typescript
* import { EmmAppConfig } from '@ionic-native/emm-app-config/ngx';
*
*
* constructor(private readonly emmAppConfig: EmmAppConfig) { }
*
* ...
*
* // Get all the values of the emm app configuration
* const values = this.emmAppConfig.getValue();
*
* // Get specific value of the emm app configuration
* const value = this.emmAppConfig.getValue('serverUrl');
*
* // Get an event every time the emm app config changes
* this.emmAppConfig.registerChangedListener()
* .subscribe(() => console.log('App config changes'));
*
* ```
*/
@Plugin({
platforms: ['Android', 'iOS'],
plugin: 'cordova-plugin-emm-app-config',
pluginName: 'EmmAppConfig',
pluginRef: 'cordova.plugins.EmmAppConfig',
repo: 'https://github.com/oracle/cordova-plugin-emm-app-config',
})
@Injectable()
export class EmmAppConfig extends IonicNativePlugin {
/**
* Get value from the Emm application configuration.
* @param configKey {string} Key of the value to get, or null to get all the values as an object.
* @return {any} Returns configuration on an object
*/
@Cordova({ sync: true }) getValue(configKey?: string): any {
return;
}
/**
* Register a listener that will be invoked when the application configuration is changed.
* @return {void}
*/
@Cordova({ observable: true }) registerChangedListener(): Observable<void> {
return;
}
}
+42 -33
View File
@@ -117,39 +117,39 @@ export interface FacebookLoginResponse {
})
@Injectable()
export class Facebook extends IonicNativePlugin {
EVENTS: {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app';
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app';
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions';
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions';
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration';
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view';
EVENT_NAME_SEARCHED: 'fb_mobile_search';
EVENT_NAME_RATED: 'fb_mobile_rate';
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion';
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token';
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart';
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist';
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout';
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info';
EVENT_NAME_PURCHASED: 'fb_mobile_purchase';
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved';
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked';
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits';
EVENT_PARAM_CURRENCY: 'fb_currency';
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method';
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type';
EVENT_PARAM_CONTENT_ID: 'fb_content_id';
EVENT_PARAM_SEARCH_STRING: 'fb_search_string';
EVENT_PARAM_SUCCESS: 'fb_success';
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value';
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available';
EVENT_PARAM_NUM_ITEMS: 'fb_num_items';
EVENT_PARAM_LEVEL: 'fb_level';
EVENT_PARAM_DESCRIPTION: 'fb_description';
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source';
EVENT_PARAM_VALUE_YES: '1';
EVENT_PARAM_VALUE_NO: '0';
EVENTS = {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app',
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app',
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions',
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions',
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration',
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view',
EVENT_NAME_SEARCHED: 'fb_mobile_search',
EVENT_NAME_RATED: 'fb_mobile_rate',
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion',
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token',
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart',
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist',
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout',
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info',
EVENT_NAME_PURCHASED: 'fb_mobile_purchase',
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved',
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked',
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits',
EVENT_PARAM_CURRENCY: 'fb_currency',
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method',
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type',
EVENT_PARAM_CONTENT_ID: 'fb_content_id',
EVENT_PARAM_SEARCH_STRING: 'fb_search_string',
EVENT_PARAM_SUCCESS: 'fb_success',
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value',
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available',
EVENT_PARAM_NUM_ITEMS: 'fb_num_items',
EVENT_PARAM_LEVEL: 'fb_level',
EVENT_PARAM_DESCRIPTION: 'fb_description',
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source',
EVENT_PARAM_VALUE_YES: '1',
EVENT_PARAM_VALUE_NO: '0'
};
/**
@@ -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
*
@@ -1,6 +1,13 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface FileChooserOptions {
/**
* comma seperated mime types to filter files.
*/
mime: string;
}
/**
* @name File Chooser
* @description
@@ -20,6 +27,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* .catch(e => console.log(e));
*
* ```
* @interfaces
* FileChooserOptions
*/
@Plugin({
pluginName: 'FileChooser',
@@ -33,10 +42,11 @@ export class FileChooser extends IonicNativePlugin {
/**
* Open a file
* @param {FileChooserOptions} [options] Optional parameter, defaults to ''. Filters the file selection list according to mime types
* @returns {Promise<string>}
*/
@Cordova()
open(): Promise<string> {
open(options?: FileChooserOptions): Promise<string> {
return;
}
@@ -18,6 +18,10 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* .then(() => console.log('File is opened'))
* .catch(e => console.log('Error opening file', e));
*
* this.fileOpener.showOpenWithDialog('path/to/file.pdf', 'application/pdf')
* .then(() => console.log('File is opened'))
* .catch(e => console.log('Error opening file', e));
*
* ```
*/
@Plugin({
@@ -71,4 +75,19 @@ export class FileOpener extends IonicNativePlugin {
appIsInstalled(packageId: string): Promise<any> {
return;
}
/**
* Opens with system modal to open file with an already installed app.
* @param {string} filePath File Path
* @param {string} fileMIMEType File MIME Type
* @returns {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'error'
})
showOpenWithDialog(filePath: string, fileMIMEType: string): Promise<any> {
return;
}
}
+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',
* clientSecret: 'password', //Only necessary for Android
* 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;
}
}
@@ -28,18 +28,38 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
plugin: 'cordova-plugin-firebase-config',
pluginRef: 'cordova.plugins.firebase.config',
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-config',
platforms: ['Android', 'iOS']
platforms: ['Android', 'iOS'],
})
@Injectable()
export class FirebaseConfig extends IonicNativePlugin {
/**
* Fetches remote config values with appropriate TTL and then activates them.
* Starts fetching configs, adhering to the specified minimum fetch interval.
*
* @param {number} ttlSeconds
* @param {number} expirationDuration
* @returns {Promise<null>}
*/
@Cordova({ sync: true })
update(ttlSeconds: number): Promise<null> {
fetch(expirationDuration?: number): Promise<null> {
return;
}
/**
* Asynchronously activates the most recently fetched configs, so that the fetched key value pairs take effect.
*
* @returns {Promise<null>}
*/
@Cordova({ sync: true })
activate(): Promise<null> {
return;
}
/**
* Asynchronously fetches and then activates the fetched configs.
*
* @returns {Promise<null>}
*/
@Cordova({ sync: true })
fetchAndActivate(): Promise<null> {
return;
}
@@ -47,11 +67,10 @@ export class FirebaseConfig extends IonicNativePlugin {
* Fetches a boolean configuration value from RemoteConfig
*
* @param {string} key
* @param {string} [namespace]
* @returns {Promise<boolean>}
*/
@Cordova({ sync: true })
getBoolean(key: string, namespace?: string): Promise<boolean> {
getBoolean(key: string): Promise<boolean> {
return;
}
@@ -59,11 +78,10 @@ export class FirebaseConfig extends IonicNativePlugin {
* Fetches a string configuration value from RemoteConfig
*
* @param {string} key
* @param {string} [namespace]
* @returns {Promise<boolean>}
*/
@Cordova({ sync: true })
getString(key: string, namespace?: string): Promise<string> {
getString(key: string): Promise<string> {
return;
}
@@ -71,11 +89,10 @@ export class FirebaseConfig extends IonicNativePlugin {
* Fetches a numeric configuration value from RemoteConfig
*
* @param {string} key
* @param {string} [namespace]
* @returns {Promise<boolean>}
*/
@Cordova({ sync: true })
getNumber(key: string, namespace?: string): Promise<number> {
getNumber(key: string): Promise<number> {
return;
}
@@ -83,11 +100,10 @@ export class FirebaseConfig extends IonicNativePlugin {
* Fetches an array of bytes configuration value from RemoteConfig
*
* @param {string} key
* @param {string} [namespace]
* @returns {Promise<boolean>}
*/
@Cordova({ sync: true })
getBytes(key: string, namespace?: string): Promise<any[]> {
getBytes(key: string): Promise<any[]> {
return;
}
}
@@ -0,0 +1,64 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name FirebaseCrash
* @description
* This plugin brings crash reporting from Google Firebase to your Cordova project! Android and iOS supported.
*
* @usage
* ```typescript
* import { FirebaseCrash } from '@ionic-native/firebase-crash';
*
* constructor(private firebaseCrash: FirebaseCrash) { }
*
* ...
*
* this.firebaseCrash.setUserId('123456789');
* this.firebaseCrash.log('message');
* this.firebaseCrash.logError('non fatal exception');
*
* ```
*/
@Plugin({
pluginName: 'FirebaseCrash',
plugin: 'cordova-plugin-firebase-crash',
pluginRef: 'cordova.plugins.firebase.crashlytics',
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-crash',
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseCrash extends IonicNativePlugin {
/**
* Add logging that will be sent with your crash data in case of app crash.
* https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#add_custom_logs
* @param {string} message
* @return {Promise<any>}
*/
@Cordova({ sync: true })
log(message: string): Promise<any> {
return;
}
/**
* Log non-fatal exceptions in addition to automatically reported app crashes.
* https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#log_non-fatal_exceptions
* @param {string} message
* @return {Promise<any>}
*/
@Cordova({ sync: true })
logError(message: string): Promise<any> {
return;
}
/**
* Sets the user identifier property for crashlytics reporting.
* https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#set_user_ids
* @param {string} userId value to set the userId
* @returns {Promise<any>}
*/
@Cordova({ sync: true })
setUserId(userId: string): Promise<any> {
return;
}
}
@@ -0,0 +1,182 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Firebase Crashlytics
* @description
* A Google Firebase Crashlytics plugin to enable capture of crash reports.
*
* @usage
* ```typescript
* import { FirebaseCrashlytics } from '@ionic-native/firebase-crashlytics/ngx';
*
*
* constructor(private firebaseCrashlytics: FirebaseCrashlytics) { }
*
* ...
*
*
* const crashlytics = this.firebaseCrashlytics.initialize();
* crashlytics.logException('my caught exception');
*
* ```
*/
@Plugin({
pluginName: 'FirebaseCrashlytics',
plugin: 'cordova-plugin-firebase-crashlytics',
pluginRef: 'FirebaseCrashlytics',
repo: 'https://github.com/ReallySmallSoftware/cordova-plugin-firebase-crashlytics',
install: 'ionic cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0',
installVariables: ['ANDROID_FIREBASE_CORE_VERSION'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseCrashlytics extends IonicNativePlugin {
/**
* Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used:
*
* @returns {void}
*/
@Cordova({
sync: true
})
initialise(): any {
return; // We add return; here to avoid any IDE / Compiler errors
}
/**
* Generate a forced crash. Visible in console after restart of application.
*
* @returns {void}
*/
@Cordova({
sync: true
})
crash(): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
/**
* Log a priority message. Will only be logged in the event of a crash.
*
* @param {number} priority
* @param {string} tag
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
logPriority(priority: number, tag: string, message: string): void {
return;
}
/**
* Log a message. Will only be logged in the event of a crash.
*
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
log(message: string): void {
return;
}
/**
* Log when a handled exception has happened. Visible in console after restart of application.
*
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
logException(message: string): void {
return;
}
/**
* Set extra key/value string value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {string} value
* @returns {void}
*/
@Cordova({
sync: true
})
setString(key: string, value: string): void {
return;
}
/**
* Set extra key/value bool value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {boolean} value
* @returns {void}
*/
@Cordova({
sync: true
})
setBool(key: string, value: boolean): void {
return;
}
/**
* Set extra key/value double value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setDouble(key: string, value: number): void {
return;
}
/**
* Set extra key/value float value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setFloat(key: string, value: number): void {
return;
}
/**
* Set extra key/value integer value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setInt(key: string, value: number): void {
return;
}
/**
* Set the identifier for the user. Take care when using this method and ensure you privacy policy is updated accordingly.
*
* @param {string} identifier
* @returns {void}
*/
@Cordova({
sync: true
})
setUserIdentifier(identifier: string): void {
return;
}
}
@@ -2,11 +2,41 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface IFirebaseMessage {
aps: any;
gcm: any;
export interface IFirebaseGCMMessage {
gcm: {
body: string;
title: string;
sound: string;
icon: string;
tag: string;
color: string;
clickAction: string;
};
'google.message_id': string;
'google.sent_time': number;
[key: string]: any;
}
export interface IFirebaseAPSMessage {
aps: {
alert: {
title: string;
body: string;
};
badge?: number;
};
'gcm.message_id': 'string';
[key: string]: any;
}
export type IFirebaseMessage = IFirebaseAPSMessage | IFirebaseGCMMessage;
export interface IRequestPermissionOptions {
forceShow?: boolean;
}
export type FirebaseMessagingTokenType = 'apns-buffer' | 'apns-string';
/**
* @beta
* @name Firebase Messaging
@@ -36,7 +66,7 @@ export interface IFirebaseMessage {
plugin: 'cordova-plugin-firebase-messaging',
pluginRef: 'cordova.plugins.firebase.messaging',
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
platforms: ['Android', 'iOS']
platforms: ['Android', 'iOS'],
})
@Injectable()
export class FirebaseMessaging extends IonicNativePlugin {
@@ -61,22 +91,27 @@ export class FirebaseMessaging extends IonicNativePlugin {
}
/**
* Grant permission to recieve push notifications (will trigger prompt on iOS).
* Grant permission to receive push notifications (will trigger prompt on iOS).
*
* @param {IRequestPermissionOptions} [options]
* @returns {Promise<string>}
*/
@Cordova({ sync: true })
requestPermission(): Promise<string> {
requestPermission(options?: { forceShow?: boolean }): Promise<string> {
return;
}
/**
* Returns a promise that fulfills with the current FCM token
*
* This method also accepts optional argument type.
* Currently iOS implementation supports values "apns-buffer" and "apns-string" that defines presentation of resolved APNS token.
*
* @param {FirebaseMessagingTokenType} [type] iOS only. Defines presentation of resolved APNS token
* @returns {Promise<string>}
*/
@Cordova({ sync: true })
getToken(): Promise<string> {
getToken(type?: FirebaseMessagingTokenType): Promise<string> {
return;
}
@@ -0,0 +1,589 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface IChannelOptions {
/**
* Channel ID - must be unique per app package
*/
id: string;
/**
* Channel name. Default: empty string
*/
name?: string;
/**
* Channel description. Default: empty string
*/
description?: string;
/**
* The sound to play once a push comes. Default value: 'default'
* Values allowed:
* 'default' - plays the default notification sound
* 'ringtone' - plays the currently set ringtone
* 'false' - silent; don't play any sound
* filename - the filename of the sound file located in '/res/raw' without file extension (mysound.mp3 -> mysound)
*/
sound?: string;
/**
* Vibrate on new notification. Default value: true
* Possible values:
* Boolean - vibrate or not
* Array - vibration pattern - e.g. [500, 200, 500] - milliseconds vibrate, milliseconds pause, vibrate, pause, etc.
*/
vibration?: boolean | number[];
/**
* Whether to blink the LED
*/
light?: boolean;
/**
* LED color in ARGB format - this example BLUE color. If set to -1, light color will be default. Default value: -1.
*/
lightColor?: string;
/**
* Importance - integer from 0 to 4. Default value: 4
* 0 - none - no sound, does not show in the shade
* 1 - min - no sound, only shows in the shade, below the fold
* 2 - low - no sound, shows in the shade, and potentially in the status bar
* 3 - default - shows everywhere, makes noise, but does not visually intrude
* 4 - high - shows everywhere, makes noise and peeks
*/
importance?: 0 | 1 | 2 | 3 | 4;
/**
* Show badge over app icon when non handled pushes are present. Default value: true
*/
badge?: boolean;
/**
* Show message on locked screen. Default value: 1
* Possible values (default 1):
* -1 - secret - Do not reveal any part of the notification on a secure lockscreen.
* 0 - private - Show the notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.
* 1 - public - Show the notification in its entirety on all lockscreens.
*/
visibility?: -1 | 0 | 1;
}
/**
* @name Firebase X
* @description
* This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported.
* It is a maintained fork from unmaintained ionic-navite plugin called Firebase.
*
* @usage
* ```typescript
* import { FirebaseX } from '@ionic-native/firebase-x/ngx';
*
*
* constructor(private firebaseX: FirebaseX) { }
*
* ...
*
*
* this.firebaseX.getToken()
* .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
* .catch(error => console.error('Error getting token', error));
*
* this.firebaseX.onMessageReceived()
* .subscribe(data => console.log(`User opened a notification ${data}`));
*
* this.firebaseX.onTokenRefresh()
* .subscribe((token: string) => console.log(`Got a new token ${token}`));
* ```
* @interfaces
* IChannelOptions
*
*/
@Plugin({
pluginName: 'FirebaseX',
plugin: 'cordova-plugin-firebasex',
pluginRef: 'FirebasePlugin',
repo: 'https://github.com/dpa99c/cordova-plugin-firebasex',
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseX extends IonicNativePlugin {
/**
* Get the current FCM token.
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
*/
@Cordova()
getToken(): Promise<null | string> {
return;
}
/**
* Get notified when a token is refreshed.
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
onTokenRefresh(): Observable<any> {
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
* - a system notification is tapped by the user
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
onMessageReceived(): Observable<any> {
return;
}
/**
* Grant permission to receive push notifications (will trigger prompt) and return hasPermission: true. iOS only (Android will always return true).
* @return {Promise<any>}
*/
@Cordova({
platforms: ['iOS']
})
grantPermission(): Promise<any> {
return;
}
/**
* Check permission to receive push notifications and return hasPermission: true. iOS only (Android will always return true).
* @return {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}
/**
* Unregister from firebase, used to stop receiving push notifications. Call this when you logout user from your app.
*/
@Cordova()
unregister(): Promise<any> {
return;
}
/**
* Set a number on the icon badge. Set 0 to clear the badge
* @param {number} badgeNumber
* @return {Promise<any>}
*/
@Cordova()
setBadgeNumber(badgeNumber: number): Promise<any> {
return;
}
/**
* Get icon badge number.
* @return {Promise<any>}
*/
@Cordova()
getBadgeNumber(): Promise<any> {
return;
}
/**
* Clear all pending notifications from the drawer.
* @return {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
clearAllNotifications(): Promise<any> {
return;
}
/**
* Subscribe to a topic. Topic messaging allows you to send a message to multiple devices that have opted in to a particular topic.
* @param {string} topic
* @return {Promise<any>}
*/
@Cordova()
subscribe(topic: string): Promise<any> {
return;
}
/**
* Unsubscribe from a topic. This will stop you receiving messages for that topic.
* @param {string} topic
* @return {Promise<any>}
*/
@Cordova()
unsubscribe(topic: string): Promise<any> {
return;
}
/**
* Android 8+ only. Creates a custom channel to be used by notification messages which have the channel property set in the message payload to the id of the created channel:
* - for background (system) notifications: android.notification.channel_id
* - for foreground/data notifications: data.notification_android_channel_id
*
* Calling on Android 7 or below or another platform will have no effect.
* @param {IChannelOptions} channelOptions
* @return {Promise<any>}
*/
@Cordova()
createChannel(channelOptions: IChannelOptions): Promise<any> {
return;
}
/**
* Android 8+ only. Overrides the properties for the default channel.
* The default channel is used if no other channel exists or is specified in the notification.
* Any options not specified will not be overridden. Should be called as soon as possible (on app start) so default notifications will work as expected.
* Calling on Android 7 or below or another platform will have no effect.
* @param {IChannelOptions} channelOptions
* @return {Promise<any>}
*/
@Cordova()
setDefaultChannel(channelOptions: IChannelOptions): Promise<any> {
return;
}
/**
* Android 8+ only. Removes a previously defined channel.
* Calling on Android 7 or below or another platform will have no effect.
* @param {string} channelID
* @return {Promise<any>}
*/
@Cordova()
deleteChannel(channelID: string): Promise<any> {
return;
}
/**
* Android 8+ only. Gets a list of all channels.
* Calling on Android 7 or below or another platform will have no effect.
* @return {Promise<any>}
*/
@Cordova()
listChannels(): Promise<any> {
return;
}
/**
* Enable/disable analytics collection (useful for GDPR/privacy settings).
* @param {boolean} enabled
* @returns {Promise<any>}
*/
@Cordova()
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
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
* @param {Object} data
* @return {Promise<any>}
*/
@Cordova()
logEvent(type: string, data: any): Promise<any> {
return;
}
/**
* Set the name of the current screen in Analytics
* @param {string} name Screen name
* @return {Promise<any>}
*/
@Cordova()
setScreenName(name: string): Promise<any> {
return;
}
/**
* Set a user id for use in Analytics
* @param {string} userId
* @return {Promise<any>}
*/
@Cordova()
setUserId(userId: string): Promise<any> {
return;
}
/**
* Set a user property for use in Analytics
* @param {string} name
* @param {string} value
* @return {Promise<any>}
*/
@Cordova()
setUserProperty(name: string, value: string): Promise<any> {
return;
}
/**
* Set Crashlytics user identifier.
* To diagnose an issue, its often helpful to know which of your users experienced a given crash.
* Crashlytics includes a way to anonymously identify users in your crash reports.
* To add user IDs to your reports, assign each user a unique identifier in the form of an ID number, token, or hashed value.
*
* More info https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#set_user_ids
* @param {string} userId
* @returns {Promise<any>}
*/
@Cordova()
setCrashlyticsUserId(userId: string): Promise<any> {
return;
}
/**
* Simulates (causes) a fatal native crash which causes a crash event to be sent to Crashlytics (useful for testing).
* See the Firebase documentation regarding crash testing.
* Crashes will appear under Event type = "Crashes" in the Crashlytics console.
* @return {Promise<any>}
*/
@Cordova()
sendCrash(): Promise<any> {
return;
}
/**
* Sends a crash-related log message that will appear in the Logs section of the next native crash event.
* Note: if you don't then crash, the message won't be sent! Also logs the message to the native device console.
* @param {string} message
* @return {Promise<any>}
*/
@Cordova()
logMessage(message: string): Promise<any> {
return;
}
/**
* Sends a non-fatal error event to Crashlytics. In a Cordova app, you may use this to log unhandled Javascript exceptions, for example.
* The event will appear under Event type = "Non-fatals" in the Crashlytics console.
* 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, stackTrace?: object): Promise<any> {
return;
}
/**
* Requests verification of a phone number in order to authenticate a user and sign then into Firebase in your app.
*
* NOTE: This will only work on physical devices with a SIM card (not iOS Simulator or Android Emulator)
*
* 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.
*
* On iOS and some Android devices, the user will receive and SMS containing the verification code which they must manually enter
* into your app.
*
* 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.
*
* @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.
*
* 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
* @return {Promise<any>}
*/
@Cordova()
fetch(cacheExpirationSeconds?: number): Promise<any> {
return;
}
/**
* Activate the Remote Config fetched config.
* @return {Promise<any>}
*/
@Cordova()
activateFetched(): Promise<any> {
return;
}
/**
* Retrieve a Remote Config value.
* @param {string} key
* @return {Promise<any>}
*/
@Cordova()
getValue(key: string): Promise<any> {
return;
}
/**
* Android only. Retrieve a Remote Config byte array.
* @param {string} key
* @return {Promise<any>}
*/
@Cordova()
getByteArray(key: string): Promise<any> {
return;
}
/**
* Android only. Get the current state of the FirebaseRemoteConfig singleton object.
* @return {Promise<any>}
*/
@Cordova()
getInfo(): Promise<any> {
return;
}
/**
* Android only. Change the settings for the FirebaseRemoteConfig object's operations.
* @param {Object} settings
* @return {Promise<any>}
*/
@Cordova()
setConfigSettings(settings: any): Promise<any> {
return;
}
/**
* Android only. Set defaults in the Remote Config.
* @param {Object} settings
* @return {Promise<any>}
*/
@Cordova()
setDefaults(settings: any): Promise<any> {
return;
}
/**
* Start a trace.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
startTrace(name: string): Promise<any> {
return;
}
/**
* To count the performance-related events that occur in your app (such as cache hits or retries),
* add a line of code similar to the following whenever the event occurs,
* using a string other than retry to name that event if you are counting a different type of event.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
incrementCounter(name: string): Promise<any> {
return;
}
/**
* Stop the trace.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
stopTrace(name: string): Promise<any> {
return;
}
}
@@ -343,6 +343,9 @@ export class Firebase extends IonicNativePlugin {
* Clear all pending notifications from the drawer
* @return {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
clearAllNotifications(): Promise<any> {
return;
}
@@ -0,0 +1,94 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Foreground Service
* @description
* This plugin allows for android devices to continue running services in the background, using a
* foreground ongoing notification. This is targeted towards use with plugins such as
* 'cordova-geolocation' that will not run while the app is in the background on android API 26+.
*
* For android API 28+, the following xml snippet should be inserted into ```config.xml```:
*
* ```
* ...
* <platform name="android">
* <config-file parent="/*" target="AndroidManifest.xml">
* <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
* </config-file>
* ...
* ```
* @usage
* ```typescript
* import { ForegroundService } from '@ionic-native/foreground-service/ngx';
*
*
* constructor(public foregroundService: ForegroundService) { }
*
* ...
*
* startService() {
* // Notification importance is optional, the default is 1 - Low (no sound or vibration)
* this.foregroundService.start('GPS Running', 'Background Service', 'drawable/fsicon');
* }
*
* stopService() {
* // Disable the foreground service
* this.foregroundService.stop();
* }
*
* ```
*/
@Plugin({
pluginName: 'ForegroundService',
plugin: 'cordova-plugin-foreground-service',
pluginRef: 'cordova.plugins.foregroundService',
repo: 'https://github.com/DavidBriglio/cordova-plugin-foreground-service',
platforms: ['Android']
})
@Injectable()
export class ForegroundService extends IonicNativePlugin {
/**
* Enables the foreground service
*
* @param {string} title (content title) A brief headline for the notification
* @param {string} text (content text) Supporting information
* @param {string} icon The drawable icon can be any drawable image that exists in the resource folder. This means you must copy the icon you want to use into the platforms/android/app/src/main/res/drawable folder set. If no icon can be found using the icon name parameter, a default star icon will be used.
*
* For an example, if the `fsicon.png` (see xml below) resides here: ```src/assets/icon/fsicon.png```. Then ```icon``` parameter value would be ```'drawable/fsicon'```. In order for this example to work, the following xml snippet must be in ```config.xml```.
*
* ```
* <platform name="android">
* <resource-file src="www/assets/icon/fsicon.png" target="app/src/main/res/drawable/fsicon.png" />
* ...
* ```
* @param {number} importance Notification importance dictates how the notification is initially presented:
*
* Value | Importance | Description | Examples
* --- | --- | --- | ---
* 1|IMPORTANCE_LOW|Does not make a sound or heads-up display (plugin's default)|New content the user has subscribed to, social network invitations
* 2|IMPORTANCE_DEFAULT|Makes a sound, but no heads-up display|Traffic alerts, task reminders
* 3|IMPORTANCE_HIGH|Makes a sound and heads-up display|Text messages, alarms, phone calls
*
* @param {number} id The notification id is a customizable integer that is used to reference the notification that will be launched. This is customizable to avoid conflicting with any other notifications. If this is not included, a [*unique*] default id will be used.
*
* @see https://material.io/design/platform-guidance/android-notifications.html
*/
@Cordova({
sync: true
})
start(title: string, text: string, icon?: string, importance: 1 | 2 | 3 = 1, id = 0): void {
return;
}
/**
* Disables the foreground service
*/
@Cordova({
sync: true
})
stop(): void {
return;
}
}
@@ -0,0 +1,61 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Full Screen Image
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { FullScreenImage } from '@ionic-native/full-screen-image';
*
*
* constructor(private fullScreenImage: FullScreenImage) { }
*
* ...
*
* this.fullScreenImage.showImageURL('/assets/...')
* .then((data: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ...
*
* this.fullScreenImage.showImageBase64('iVBORw0KGgoAAAANSUhEUgAAA...')
* .then((data: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'FullScreenImage',
plugin: 'es.keensoft.fullscreenimage',
pluginRef: 'FullScreenImage',
repo: 'https://github.com/keensoft/FullScreenImage-Cordova-Plugin',
platforms: ['Android', 'iOS']
})
@Injectable()
export class FullScreenImage extends IonicNativePlugin {
/**
* Opens an image from a URL or path
* @param url {string} url or image path
* @return {Promise<any>}
*/
@Cordova({ sync: true })
showImageURL(url: string): Promise<any> {
return;
}
/**
* Opens an image from a base64 string
* @param base64String {string} base64 string
* @param name? {string} image name
* @param type? {string} image extension
* @return {Promise<any>}
*/
@Cordova({ sync: true })
showImageBase64(base64String: string, name?: string, type?: string): Promise<any> {
return;
}
}
@@ -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;
}
}
+1 -1
View File
@@ -145,7 +145,7 @@ export class Geofence extends IonicNativePlugin {
*/
onNotificationClicked(): Observable<any> {
return new Observable<any>(observer => {
window &&
typeof window !== 'undefined' &&
window.geofence &&
(window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => (window.geofence.onNotificationClicked = () => {});
@@ -15,6 +15,13 @@ export interface ScoreData {
}
export interface PlayerScoreData {
/**
* The player score.
*/
playerScore: number;
}
export interface LeaderboardData {
/**
@@ -83,6 +90,40 @@ export interface Player {
}
export interface SubmittedScoreData {
/**
* The leaderboard ID from Goole Play Developer console.
*/
leaderboardId: string;
/**
* The player ID from Goole Play Developer console.
*/
playerId: string;
/**
* The score data in a display-appropriate format.
*/
formattedScore: string;
/**
* Whether or not this score was the player's new best score.
*/
newBest: boolean;
/**
* The raw score value of this score result.
*/
rawScore: number;
/**
* The score tag associated with this result, if any.
*/
scoreTag: string;
}
/**
* @name Google Play Games Services
* @description
@@ -126,6 +167,21 @@ export interface Player {
* leaderboardId: 'SomeLeaderboardId'
* });
*
* // Submit a score and wait for reponse.
* this.googlePlayGamesServices.submitScoreNow({
* score: 100,
* leaderboardId: 'SomeLeaderboardId'
* }).then((data: SubmittedScoreData) => {
* console.log('Score related data', data);
* });
*
* // Get the player score on a leaderboard.
* this.googlePlayGamesServices.getPlayerScore({
* leaderboardId: 'SomeLeaderBoardId'
* }).then((data: PlayerScoreData) => {
* console.log('Player score', data);
* });
*
* // Show the native leaderboards window.
* this.googlePlayGamesServices.showAllLeaderboards()
* .then(() => console.log('The leaderboard window is visible.'));
@@ -138,12 +194,23 @@ export interface Player {
* // Unlock an achievement.
* this.googlePlayGamesServices.unlockAchievement({
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement sent'));
*
* // Unlock an achievement and wait for response.
* this.googlePlayGamesServices.unlockAchievementNow({
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement unlocked'));
*
* // Incremement an achievement.
* this.googlePlayGamesServices.incrementAchievement({
* step: 1,
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement increment sent'));
*
* // Incremement an achievement and wait for response.
* this.googlePlayGamesServices.incrementAchievementNow({
* step: 1,
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement incremented'));
*
* // Show the native achievements window.
@@ -154,7 +221,7 @@ export interface Player {
*/
@Plugin({
pluginName: 'GooglePlayGamesServices',
plugin: 'cordova-plugin-play-games-service',
plugin: 'cordova-plugin-play-games-services',
pluginRef: 'plugins.playGamesServices',
repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
platforms: ['Android'],
@@ -220,6 +287,33 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
return;
}
/**
* Submit a score to a leaderboard and waits for the response from
* Google Play Games. You should ensure that you have a
* successful return from auth() before submitting a score.
*
* @param data {ScoreData} The score data you want to submit.
* @return {Promise<SubmittedScoreData>} Returns a promise that resolves when Play
* Games Services returns the score information.
*/
@Cordova()
submitScoreNow(data: ScoreData): Promise<SubmittedScoreData> {
return;
}
/**
* Get the player score on a leaderboard. You should ensure that you have a
* successful return from auth() before requesting a score.
*
* @param data {LeaderboardData} The leaderboard score you want to request.
* @return {Promise<PlayerScoreData>} Returns a promise that resolves when Play
* Games Services returns the player score.
*/
@Cordova()
getPlayerScore(data: LeaderboardData): Promise<PlayerScoreData> {
return;
}
/**
* Launches the native Play Games leaderboard view controller to show all the
* leaderboards.
@@ -250,25 +344,49 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
*
* @param data {AchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is unlocked.
* achievement is sent.
*/
@Cordova()
unlockAchievement(data: AchievementData): Promise<string> {
return;
}
/**
* Unlock an achievement and wait for response.
*
* @param data {AchievementData}
* @return {Promise<any>} Returns a promise that resolves when the Play
* Games Services returns that the achievement is unlocked.
*/
@Cordova()
unlockAchievementNow(data: AchievementData): Promise<string> {
return;
}
/**
* Increment an achievement.
*
* @param data {IncrementableAchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is incremented.
* achievement is sent.
*/
@Cordova()
incrementAchievement(data: IncrementableAchievementData): Promise<string> {
return;
}
/**
* Increment an achievement and wait for response.
*
* @param data {IncrementableAchievementData}
* @return {Promise<any>} Returns a promise that resolves when the Play
* Games Services returns that the achievement has been incremented.
*/
@Cordova()
incrementAchievementNow(data: IncrementableAchievementData): Promise<string> {
return;
}
/**
* Lauches the native Play Games achievements view controller to show
* achievements.
@@ -39,7 +39,7 @@ export class GooglePlus extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
login(options?: any): Promise<any> {
login(options: any): Promise<any> {
return;
}
+103 -47
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
@@ -77,10 +93,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'}
*/
@Cordova({ sync: true })
getBasicAuthHeader(
username: string,
password: string
): { Authorization: string } {
getBasicAuthHeader(username: string, password: string): { Authorization: string } {
return;
}
@@ -121,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.
@@ -175,25 +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
* nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes)
* pinned: trust only provided certs
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode
* @param {'default' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
* Resolve if it should follow redirects automatically.
* @returns {boolean} returns true if it is configured to follow redirects automatically
*/
@Cordova()
setSSLCertMode(mode: 'default' | '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;
}
@@ -202,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> {
@@ -214,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> {
@@ -226,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> {
@@ -238,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> {
@@ -250,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> {
@@ -262,30 +283,36 @@ 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
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @param filePath {string} The local path of the file to upload
* @param name {string} The name of the parameter to pass the file along as
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
* @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 will resolve on success, and reject on failure
*/
@Cordova()
uploadFile(
url: string,
body: any,
headers: any,
filePath: string,
name: string
): Promise<any> {
uploadFile(url: string, body: any, headers: any, filePath: string | string[], name: string | string[]): Promise<any> {
return;
}
@@ -295,15 +322,44 @@ 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(
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<any> {
return;
}
/**
*
* @param url {string} The url to send the request to
* @param options {Object} options for individual request
* @param options.method {string} request method
* @param options.data {Object} payload to be send to the server (only applicable on post, put or patch methods)
* @param options.params {Object} query params to be appended to the URL (only applicable on get, head, delete, upload or download methods)
* @param options.serializer {string} data serializer to be used (only applicable on post, put or patch methods), defaults to global serializer value, see setDataSerializer for supported values
* @param options.timeout {number} timeout value for the request in seconds, defaults to global timeout value
* @param options.headers {Object} headers object (key value pair), will be merged with global values
* @param options.filePath {string} file path(s) to be used during upload and download see uploadFile and downloadFile for detailed information
* @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 will resolve on success, and reject on failure
*/
@Cordova()
sendRequest(
url: string,
body: any,
headers: any,
filePath: string
): Promise<any> {
options: {
method: 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'options' | 'upload' | 'download';
data?: { [index: string]: any };
params?: { [index: string]: string | number };
serializer?: 'json' | 'urlencoded' | 'utf8' | 'multipart';
timeout?: number;
headers?: { [index: string]: string };
filePath?: string | string[];
name?: string | string[];
responseType?: 'text' | 'arraybuffer' | 'blob' | 'json';
}
): Promise<HTTPResponse> {
return;
}
}
@@ -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 {
@@ -42,7 +63,7 @@ export enum OutputType {
* Cordova Plugin For Multiple Image Selection
*
* Requires Cordova plugin: `cordova-plugin-image-picker`.
* For more info, please see the https://github.com/wymsee/cordova-imagePicker
* For more info, please see the https://github.com/Telerik-Verified-Plugins/ImagePicker
*
* @usage
* ```typescript
+130 -57
View File
@@ -10,83 +10,123 @@ import { Observable, Observer } from 'rxjs';
declare const cordova: Cordova & { InAppBrowser: any };
export interface InAppBrowserOptions {
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
location?: 'yes' | 'no';
/* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
* Omit or set to no (default) to have the browser open and load normally. */
hidden?: 'yes' | 'no';
/**
* (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
* The HTML's video element must also include the webkit-playsinline attribute (defaults to no)
*/
allowInlineMediaPlayback?: 'yes' | 'no';
/**
* set to enable the beforeload event to modify which pages are actually loaded in the browser. Accepted values are get to
* intercept only GET requests, post to intercept on POST requests or yes to intercept both GET & POST requests.
* Note that POST requests are not currently supported and will be ignored (if you set beforeload=post it will raise an error).
*/
beforeload?: 'yes' | 'get' | 'post';
/** Set to yes to have the browser's cookie cache cleared before the new window is opened. */
clearcache?: 'yes';
/* Set to yes to have the session cookie cache cleared before the new window is opened. */
/** set to yes to have the browser's entire local storage cleared (cookies, HTML5 local storage, IndexedDB, etc.) before the new window is opened */
cleardata?: 'yes';
/**
* Set to yes to have the session cookie cache cleared before the new window is opened.
* For WKWebView, requires iOS 11+ on target device.
*/
clearsessioncache?: 'yes';
/* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself.
* (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
/**
* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself.
* (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself.
*/
closebuttoncaption?: string;
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled. */
/**
* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled.
*/
closebuttoncolor?: string;
/** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
zoom?: 'yes' | 'no';
/* (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser. */
hardwareback?: 'yes' | 'no';
/*
* Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
/* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no.
* (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.*/
hidenavigationbuttons?: 'yes' | 'no';
/* (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/
hideurlbar?: 'yes' | 'no';
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible. */
navigationbuttoncolor?: string;
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.*/
toolbarcolor?: string;
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
shouldPauseOnSuspend?: 'yes' | 'no';
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
disallowoverscroll?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */
enableViewportScale?: 'yes' | 'no';
/** (Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties */
footer?: 'yes' | 'no';
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb), and it will change the footer color from default. Only has effect if user has footer set to yes */
footercolor?: string;
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
disallowoverscroll?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */
toolbar?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to make the toolbar translucent(semi-transparent) (defaults to yes). Only applicable if toolbar is not disabled. */
toolbartranslucent?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */
enableViewportScale?: 'yes' | 'no';
/* (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
* The HTML's video element must also include the webkit-playsinline attribute (defaults to no) */
allowInlineMediaPlayback?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
keyboardDisplayRequiresUserAction?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no). */
suppressesIncrementalRendering?: 'yes' | 'no';
/** (iOS Only) Set to pagesheet, formsheet or fullscreen to set the presentation style (defaults to fullscreen). */
presentationstyle?: 'pagesheet' | 'formsheet' | 'fullscreen';
/** (iOS Only) Set to fliphorizontal, crossdissolve or coververtical to set the transition style (defaults to coververtical). */
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
/** (iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window. */
toolbarposition?: 'top' | 'bottom';
/**
* (Windows only) Set to yes to create the browser control without a border around it.
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window.
*/
fullscreen?: 'yes';
/**
* (Android & Windows Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser.
*/
hardwareback?: 'yes' | 'no';
/**
* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
* Omit or set to no (default) to have the browser open and load normally.
*/
hidden?: 'yes' | 'no';
/**
* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no.
* (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.
*/
hidenavigationbuttons?: 'yes' | 'no';
/**
* (iOS Only) Set to yes or no to change the visibility of the loading indicator (defaults to no).
*/
hidespinner?: 'yes' | 'no';
/* (Windows only) Set to yes to create the browser control without a border around it.
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
fullscreen?: 'yes';
/** (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no. */
hideurlbar?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
keyboardDisplayRequiresUserAction?: 'yes' | 'no';
/**
* (Android) Set to yes to swap positions of the navigation buttons and the close button. Specifically, navigation buttons go to the left and close button to the right.
* (iOS) Set to yes to swap positions of the navigation buttons and the close button. Specifically, close button goes to the right and navigation buttons to the left.
*/
lefttoright?: 'yes' | 'no';
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
location?: 'yes' | 'no';
/**
* Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no).
*/
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
/**
* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible.
*/
navigationbuttoncolor?: string;
/** (iOS Only) Set to pagesheet, formsheet or fullscreen to set the presentation style (defaults to fullscreen). */
presentationstyle?: 'pagesheet' | 'formsheet' | 'fullscreen';
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
shouldPauseOnSuspend?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no). */
suppressesIncrementalRendering?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */
toolbar?: 'yes' | 'no';
/**
* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.
*/
toolbarcolor?: string;
/** (iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window. */
toolbarposition?: 'top' | 'bottom';
/** (iOS Only) Set to yes or no to make the toolbar translucent(semi-transparent) (defaults to yes). Only applicable if toolbar is not disabled. */
toolbartranslucent?: 'yes' | 'no';
/** (iOS Only) Set to fliphorizontal, crossdissolve or coververtical to set the transition style (defaults to coververtical). */
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
/** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */
useWideViewPort?: 'yes' | 'no';
/** (iOS Only) Set to yes to use WKWebView engine for the InappBrowser. Omit or set to no (default) to use UIWebView. */
usewkwebview?: 'yes' | 'no';
/** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
zoom?: 'yes' | 'no';
/**
* @hidden
*/
[key: string]: any;
}
export type InAppBrowserEventType = 'loadstart' | 'loadstop' | 'loaderror' | 'exit' | 'beforeload' | 'message' | 'customscheme';
export interface InAppBrowserEvent extends Event {
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
/** the event name */
type: string;
/** the URL that was loaded. */
url: string;
@@ -94,6 +134,8 @@ export interface InAppBrowserEvent extends Event {
code: number;
/** the error message, only in the case of loaderror. */
message: string;
/** the postMessage data, only in the case of message. */
data: any;
}
/**
@@ -129,13 +171,22 @@ export class InAppBrowserObject {
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
} catch (e) {
window.open(url, target);
if (typeof window !== 'undefined') {
window.open(url, target);
}
console.warn(
'Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.'
);
}
}
/**
* 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.
@@ -176,6 +227,28 @@ export class InAppBrowserObject {
return;
}
/**
* A method that allows you to listen to events happening in the browser.
* @param event {InAppBrowserEventType} 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: InAppBrowserEventType): 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)
);
}
);
}
/**
* A method that allows you to listen to events happening in the browser.
* @param event {string} Name of the event
@@ -1,79 +1,10 @@
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name In App Purchase 2
* @description
* In-App Purchase for Cordova on iOS, Android and Windows
*
* @usage
* ```typescript
* import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2/ngx';
*
* constructor(private store: InAppPurchase2) { }
*
* ...
* ```
*
* * @advanced
*
* ```typescript
* // After Platform Ready
* this.store.verbosity = this.store.DEBUG;
* this.store.register({
* id: productId,
* alias: productId,
* type: this.store.NON_RENEWING_SUBSCRIPTION
* });
*
* // Register Event Handlers for the specific product
* this.store.when(productId).registered( (product: IAPProduct) => {
* console.log('Registered: ' + JSON.stringify(product));
* });
*
* // Updated
* this.store.when(productId).updated( (product: IAPProduct) => {
* console.log('Loaded' + JSON.stringify(product));
* });
*
* // Issue with buying
* this.store.when(productId).cancelled( (product) => {
* alert('Purchase was Cancelled');
* });
*
* // Track All Store Errors
* this.store.error( (err) => {
* alert('Store Error ' + JSON.stringify(err));
* });
*
* this.store.ready(() => {
* console.log(JSON.stringify(this.store.get(productId)));
* console.log('Store is Ready: ' + JSON.stringify(status));
* console.log('Products: ' + JSON.stringify(this.store.products));
* });
*
*
* // Errors
* this.store.when(productId).error( (error) => {
* this.loader.dismiss();
* alert('An Error Occured' + JSON.stringify(error));
* });
* // Refresh Starts Handlers
* console.log('Refresh Store');
* this.store.refresh();
*
* ...
*
* // To Purchase
* this.store.order(productId);
*
* ```
*
*/
export interface IAPProductOptions {
id: string;
alias: string;
alias?: string;
type: string;
}
@@ -98,7 +29,7 @@ export interface IAPProduct {
id: string;
alias: string;
alias?: string;
type: string;
@@ -122,16 +53,91 @@ export interface IAPProduct {
owned: boolean;
downloading: boolean;
downloading?: boolean;
downloaded: boolean;
downloaded?: boolean;
additionalData: any;
lastRenewalDate?: Date;
transaction: any;
expiryDate?: Date;
introPrice?: string;
introPriceMicros?: number;
introPriceNumberOfPeriods?: number;
introPriceSubscriptionPeriod?: string;
introPricePaymentMode?: string;
ineligibleForIntroPrice?: boolean;
billingPeriod?: number;
billingPeriodUnit?: string;
trialPeriod?: number;
trialPeriodUnit?: string;
additionalData?: any;
transaction?: any;
/**
* Call `product.finish()` to confirm to the store that an approved order has been delivered.
*
* This will change the product state from `APPROVED` to `FINISHED` (see product life-cycle).
*
* As long as you keep the product in state `APPROVED`:
*
* - the money may not be in your account (i.e. user isn't charged)
* - you will receive the `approved` event each time the application starts,
* where you should try again to finish the pending transaction.
*
* **example use**
*
* ```js
* store.when("product.id").approved(function(product){
* // synchronous
* app.unlockFeature();
* product.finish();
* });
* ```
*
* ```js
* store.when("product.id").approved(function(product){
* // asynchronous
* app.downloadFeature(function() {
* product.finish();
* });
* });
* ```
*/
finish(): void;
/**
* Initiate purchase validation as defined by the `store.validator` attribute.
*
* **return value**
*
* A Promise with the following methods:
*
* - `done(function(product){})`
* - called whether verification failed or succeeded.
* - `expired(function(product){})`
* - called if the purchase expired.
* - `success(function(product, purchaseData){})`
* - called if the purchase is valid and verified.
* - `purchaseData` is the device dependent transaction details
* returned by the validator, which you can most probably ignore.
* - `error(function(err){})`
* - validation failed, either because of expiry or communication
* failure.
* - `err` is a store.Error object, with a code expected to be
* `store.ERR_PAYMENT_EXPIRED` or `store.ERR_VERIFICATION_FAILED`.
*/
verify(): any;
set(key: string, value: any): void;
@@ -149,23 +155,41 @@ export interface IAPProduct {
}
export interface IAPProductEvents {
/** Called when product data is loaded from the store. */
loaded: (callback: IAPQueryCallback) => void;
/** Called when any change occured to a product. */
updated: (callback: IAPQueryCallback) => void;
/** Called when an order failed. The `err` parameter is an IAPError object. */
error: (callback: IAPQueryCallback) => void;
/** Called when a product order is approved. */
approved: (callback: IAPQueryCallback) => void;
/** Called when a non-consumable product or subscription is owned. */
owned: (callback: IAPQueryCallback) => void;
/** Called when a product order is cancelled by the user. */
cancelled: (callback: IAPQueryCallback) => void;
/** Called when an order is refunded by the user. */
refunded: (callback: IAPQueryCallback) => void;
/** Called when product has just been registered. */
registered: (callback: IAPQueryCallback) => void;
/** Called when the product details have been successfully loaded. */
valid: (callback: IAPQueryCallback) => void;
/** Called when the product cannot be loaded from the store. */
invalid: (callback: IAPQueryCallback) => void;
/** Called when an order has just been requested. */
requested: (callback: IAPQueryCallback) => void;
/** Called when the purchase process has been initiated. */
initiated: (callback: IAPQueryCallback) => void;
/** Called when the purchase process has completed. */
finished: (callback: IAPQueryCallback) => void;
/** Called when receipt validation successful. */
verified: (callback: IAPQueryCallback) => void;
/** Called when receipt verification failed. */
unverified: (callback: IAPQueryCallback) => void;
/** Called when validation find a subscription to be expired. */
expired: (callback: IAPQueryCallback) => void;
/** Called when content download is started. */
downloading: (product: IAPProduct, progress: any, time_remaining: any) => void;
/** Called when content download has successfully completed. */
downloaded: (callback: IAPQueryCallback) => void;
}
@@ -180,18 +204,343 @@ export class IAPError {
/**
* @name In App Purchase 2
* @description
* In-App Purchase on iOS, Android, Windows, macOS and XBox.
*
* ## Features
*
* | | ios | android | win-8 | win-10/uwp | mac |
* |--|--|--|--|--|--|
* | consumables | | | | | |
* | non consumables | | | | | |
* | subscriptions | | | | | |
* | restore purchases | | | | | |
* | receipt validations | | | | | |
* | downloadable content | | | | | |
* | introductory prices | | | | | |
*
* Supports:
*
* - **iOS** version 7.0 or higher.
* - **Android** version 2.2 (API level 8) or higher
* - with Google Play client version 3.9.16 or higher
* - **Windows** Store/Phone 8.1 or higher
* - **Windows 10 Mobile**
* - **macOS** version 10
* - **Xbox One**
* - (and any platform supporting Microsoft's UWP)
*
* @usage
* ```
* ```typescript
* import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2/ngx';
*
*
* constructor(private inAppPurchase2: InAppPurchase2) { }
* constructor(public platform: Platform, private store: InAppPurchase2) {
* platform.ready().then(() => {
* this.store.register({
* id: "my_product_id",
* type: this.store.NON_RENEWING_SUBSCRIPTION,
* });
* this.store.when("my_product_id")
* .approved(p => p.verify())
* .verified(p => p.finish());
* this.store.refresh();
* });
* }
*
* ...
*
* this.store.order("my_product_id");
*
* ```
*
* ## Full example
*
* ```typescript
* // After platform ready
* this.store.verbosity = this.store.DEBUG;
* this.store.register({
* id: "my_product_id",
* type: this.store.PAID_SUBSCRIPTION,
* });
*
* // Register event handlers for the specific product
* this.store.when("my_product_id").registered( (product: IAPProduct) => {
* console.log('Registered: ' + JSON.stringify(product));
* });
*
* // Updated
* this.store.when("my_product_id").updated( (product: IAPProduct) => {
* console.log('Updated' + JSON.stringify(product));
* });
*
* // User closed the native purchase dialog
* this.store.when("my_product_id").cancelled( (product) => {
* console.error('Purchase was Cancelled');
* });
*
* // Track all store errors
* this.store.error( (err) => {
* console.error('Store Error ' + JSON.stringify(err));
* });
*
* // Run some code only when the store is ready to be used
* this.store.ready(() => {
* console.log('Store is ready');
* console.log('Products: ' + JSON.stringify(this.store.products));
* console.log(JSON.stringify(this.store.get("my_product_id")));
* });
*
* // Refresh the status of in-app products
* this.store.refresh();
*
* ...
*
* // To make a purchase
* this.store.order("my_product_id");
*
* ```
*
* ## Philosophy
*
* The API is mostly events based. As a user of this plugin,
* you will have to register listeners to changes happening to the products
* you register.
*
* The core of the listening mechanism is the `when()` method. It allows you to
* be notified of changes to one or a set of products using a query mechanism:
* ```typescript
* this.store.when("product").updated(refreshScreen); // match any product
* this.store.when("full_version").owned(unlockApp); // match a specific product
* this.store.when("subscription").approved(serverCheck); // match all subscriptions
* this.store.when("downloadable content").downloaded(showContent);
* ```
*
* The `updated` event is fired whenever one of the fields of a product is
* changed (its `owned` status for instance).
*
* This event provides a generic way to track the statuses of your purchases,
* to unlock features when needed and to refresh your views accordingly.
*
* ## Registering products
*
* The store needs to know the type and identifiers of your products before you
* can use them in your code.
*
* Use `store.register()` to define them before your first call to `store.refresh()`.
*
* Once registered, you can use `store.get()` to retrieve an `IAPProduct` object.
*
* ```typescript
* this.store.register({
* id: "my_consumable1",
* type: this.store.CONSUMABLE
* });
* ...
* const p = this.store.get("my_consumable1");
* ```
*
* The product `id` and `type` have to match products defined in your
* Apple, Google or Microsoft developer consoles.
*
* Learn more about it [from the wiki](https://github.com/j3k0/cordova-plugin-purchase/wiki).
*
* ## Displaying products
*
* Right after you registered your products, nothing much is known about them
* except their `id`, `type` and an optional `alias`.
*
* When you perform the initial call to `store.refresh()`, the platforms' server will
* be contacted to load informations about the registered products: human
* readable `title` and `description`, `price`, etc.
*
* This isn't an optional step, store owners require you
* to display information about a product exactly as retrieved from their server: no
* hard-coding of price and title allowed! This is also convenient for you
* as you can change the price of your items knowing that it'll be reflected instantly
* on your clients' devices.
*
* Note that the information may not be available when the first view that needs
* them appears on screen. For you, the best option is to have your view monitor
* changes made to the product.
*
* ## Purchasing
*
* #### initiate a purchase
*
* Purchases are initiated using the `store.order("some_product_id")` method.
*
* The store will manage the internal purchase flow. It'll end:
*
* - with an `approved` event. The product enters the `APPROVED` state.
* - with a `cancelled` event. The product gets back to the `VALID` state.
* - with an `error` event. The product gets back to the `VALID` state.
*
* See the product life-cycle section for details about product states.
*
* #### finish a purchase
*
* Once the transaction is approved, the product still isn't owned: the store needs
* confirmation that the purchase was delivered before closing the transaction.
*
* To confirm delivery, you'll use the `product.finish()` method.
*
* #### example usage
*
* During initialization:
* ```typescript
* this.store.when("extra_chapter").approved((product: IAPProduct) => {
* // download the feature
* app.downloadExtraChapter()
* .then(() => product.finish());
* });
* ```
*
* When the purchase button is clicked:
* ```typescript
* this.store.order("extra_chapter");
* ```
*
* #### un-finished purchases
*
* If your app wasn't able to deliver the content, `product.finish()` won't be called.
*
* Don't worry: the `approved` event will be re-triggered the next time you
* call `store.refresh()`, which can very well be the next time
* the application starts. Pending transactions are persistant.
*
* #### simple case
*
* In the most simple case, where:
*
* - delivery of purchases is only local ;
* - you don't want (or need) to implement receipt validation ;
*
* You may just want to finish all purchases automatically. You can do it this way:
* ```js
* this.store.when("product").approved((p: IAPProduct) => p.finish());
* ```
*
* NOTE: the "product" query will match any purchases (see "queries" to learn more details about queries).
*
* ## Receipt validation
*
* To get the most up-to-date information about purchases (in case a purchase have been canceled, or a subscription renewed),
* you should implement server side receipt validation.
*
* This also protects you against fake "purchases", made by some users using
* "free in-app purchase" apps on their devices.
*
* When a purchase has been approved by the store, it's enriched with
* transaction information (see `product.transaction` attribute).
*
* To verify a purchase you'll have to do three things:
*
* - configure the validator.
* - call `product.verify()` from the `approved` event, before finishing the transaction.
* - finish the transaction when transaction is `verified`.
*
* **Shameless Plug**: this is a feature many users struggle with, so as the author of this plugin, we can provide it to you as-a-service: https://billing.fovea.cc/
* (which is free until you start making serious money)
*
* #### example using a validation URL
*
* ```js
* this.store.validator = "https://billing.fovea.cc/";
*
* this.store.when("my stuff")
* .approved((p: IAPProduct) => p.verify())
* .verified((p: IAPProduct) => p.finish());
* ```
*
* ## Subscriptions
*
* For subscription, you MUST implement remote receipt validation.
*
* When the receipt validator returns a `store.PURCHASE_EXPIRED` error code, the subscription will
* automatically loose its `owned` status.
*
* Typically, you'll enable and disable access to your content this way.
* ```typescript
* this.store.when("my_subcription").updated((product: IAPProduct) => {
* if (product.owned)
* app.subscriberMode();
* else
* app.guestMode();
* });
* ```
*
* ## Product life-cycle
*
* A product will change state during the application execution.
*
* Find below a diagram of the different states a product can pass by.
*
* ```
* REGISTERED +--> INVALID
* |
* +--> VALID +--> REQUESTED +--> INITIATED +-+
* |
* ^ +------------------------------+
* | |
* | | +--> DOWNLOADING +--> DOWNLOADED +
* | | | |
* | +--> APPROVED +--------------------------------+--> FINISHED +--> OWNED
* | |
* +-------------------------------------------------------------+
*
* #### Notes
*
* - When finished, a consumable product will get back to the `VALID` state, while other will enter the `OWNED` state.
* - Any error in the purchase process will bring a product back to the `VALID` state.
* - During application startup, products may go instantly from `REGISTERED` to `APPROVED` or `OWNED`, for example if they are purchased non-consumables or non-expired subscriptions.
* - Non-Renewing Subscriptions are iOS products only. Please see the [iOS Non Renewing Subscriptions documentation](https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/ios.md#non-renewing) for a detailed explanation.
*
* ## events
*
* - `loaded(IAPProduct)`
* - Called when product data is loaded from the store.
* - `updated(IAPProduct)`
* - Called when any change occured to a product.
* - `error(err)`
* - Called when an order failed.
* - The `err` parameter is an error object
* - `approved(IAPProduct)`
* - Called when a product order is approved.
* - `owned(IAPProduct)`
* - Called when a non-consumable product or subscription is owned.
* - `cancelled(IAPProduct)`
* - Called when a product order is cancelled by the user.
* - `refunded(IAPProduct)`
* - Called when an order is refunded by the user.
* - Actually, all other product states have their promise
* - `registered`, `valid`, `invalid`, `requested`,
* `initiated` and `finished`
* - `verified(IAPProduct)`
* - Called when receipt validation successful
* - `unverified(IAPProduct)`
* - Called when receipt verification failed
* - `expired(IAPProduct)`
* - Called when validation find a subscription to be expired
* - `downloading(IAPProduct, progress, time_remaining)`
* - Called when content download is started
* - `downloaded(IAPProduct)`
* - Called when content download has successfully completed
*
* ## Learn More
*
* - [GitHub](https://github.com/j3k0/cordova-plugin-purchase)
* - [GitBook](https://purchase.cordova.fovea.cc/)
* - [Wiki](https://github.com/j3k0/cordova-plugin-purchase/wiki)
* - [API reference](https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md)
*
* ## Technical Support or Questions
*
* If you have questions or need help integrating In-App Purchase, [Open an Issue on GitHub](https://github.com/j3k0/cordova-plugin-purchase/issues) or email us at _support@fovea.cc_.
*
* @interfaces
* IAPProduct
* IAPProductOptions
* IAPProductEvents
* ```
*/
@Plugin({
pluginName: 'InAppPurchase2',
@@ -225,12 +574,26 @@ export class InAppPurchase2 extends IonicNativePlugin {
@CordovaProperty()
verbosity: number;
/**
* Set to true to clear the transaction queue. Not recommended for production.
* https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#random-tips
*/
@CordovaProperty()
autoFinishTransactions: boolean;
/**
* Set to true to invoke the platform purchase sandbox. (Windows only)
*/
@CordovaProperty()
sandbox: boolean;
/**
* Set to true to disable downloading of hosted content. (Apple only).
* Useful in development or when migrating your app away from Apple Hosted Content.
*/
@CordovaProperty()
disableHostedContent: boolean;
@CordovaProperty()
FREE_SUBSCRIPTION: string;
@@ -342,6 +705,8 @@ export class InAppPurchase2 extends IonicNativePlugin {
DOWNLOADED: string;
/* validation error codes */
@CordovaProperty()
INVALID_PAYLOAD: number;
@@ -351,11 +716,20 @@ export class InAppPurchase2 extends IonicNativePlugin {
@CordovaProperty()
PURCHASE_EXPIRED: number;
@CordovaProperty()
PURCHASE_CONSUMED: number;
@CordovaProperty()
INTERNAL_ERROR: number;
@CordovaProperty()
NEED_MORE_DATA: number;
@CordovaProperty()
products: IAPProducts;
@CordovaProperty()
validator: string | ((product: string | IAPProduct, callback: Function) => void);
validator: string | ((url: string | IAPProduct, callback: Function) => void);
@CordovaProperty()
log: {
@@ -387,7 +761,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
* @param product {IAPProductOptions}
*/
@Cordova({ sync: true })
register(product: IAPProductOptions): void {}
register(product: IAPProductOptions | IAPProductOptions[]): void {}
/**
*
@@ -421,6 +795,29 @@ export class InAppPurchase2 extends IonicNativePlugin {
off(callback: Function): void {
}
/**
* Initiate the purchase of a product.
*
* The `product` argument can be either:
*
* - the `IAPProduct` object
* - the product `id`
* - the product `alias`
*
* The `additionalData` argument is an optional object with attributes:
* - `oldPurchasedSkus`: a string array with the old subscription to upgrade/downgrade on Android. See: [android developer](https://developer.android.com/google/play/billing/billing_reference.html#upgrade-getBuyIntentToReplaceSkus) for more info
* - `developerPayload`: string representing the developer payload as described in [billing best practices](https://developer.android.com/google/play/billing/billing_best_practices.html)
* - `applicationUsername`: the identifier of the user in your application.
*
* See the "Purchasing section" to learn more about the purchase process.
*
* **return value**
*
* `store.order()` returns a Promise with the following methods:
*
* - `then` - called when the order was successfully initiated.
* - `error` - called if the order couldn't be initiated.
*/
@Cordova({ sync: true })
order(product: string | IAPProduct, additionalData?: any): { then: Function; error: Function; } {
return;
@@ -428,9 +825,50 @@ export class InAppPurchase2 extends IonicNativePlugin {
@Cordova()
ready(callback: Function): void { return; }
/**
* After you're done registering your store's product and events handlers,
* time to call `store.refresh()`.
*
* This will initiate all the complex behind-the-scene work, to load product
* data from the servers and restore whatever already have been
* purchased by the user.
*
* Note that you can call this method again later during the application
* execution to re-trigger all that hard-work. It's kind of expensive in term of
* processing, so you'd better consider it twice.
*
* One good way of doing it is to add a "Refresh Purchases" button in your
* applications settings. This way, if delivery of a purchase failed or
* if a user wants to restore purchases he made from another device, he'll
* have a way to do just that.
*
* **example usage**
*
* ```typescript
* // ...
* // register products and events handlers here
* // ...
* //
* // then and only then, call refresh.
* this.store.refresh();
* ```
*
* **restore purchases**
*
* Add a "Refresh Purchases" button to call the `store.refresh()` method, like:
*
* `<button onclick="<pseudo_code>this.store.refresh()</pseudo_code>">Restore Purchases</button>`
*
* To make the restore purchases work as expected, please make sure that
* the "approved" event listener had be registered properly,
* and in the callback `product.finish()` should be called.
*/
@Cordova({ sync: true })
refresh(): void {
}
/** Opens the Manage Subscription page (AppStore, Play, Microsoft, ...). */
@Cordova({ sync: true })
manageSubscriptions(): void {}
}
@@ -61,6 +61,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
logout(): Promise<any> {
return;
}
/**
*
* @param secureHash {string}
@@ -141,6 +150,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayHelpCenter(): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
@@ -188,4 +206,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @param token {string}
* @return {Promise<any>} Returns a promise
*/
@Cordova()
sendPushTokenToIntercom(token: string): Promise<any> {
return;
}
}
+65 -3
View File
@@ -1,7 +1,20 @@
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 {
Light = 'light',
Dark = 'dark'
}
export enum KeyboardResizeMode {
Native = 'native',
Ionic = 'ionic',
Body = 'body',
None = 'none'
}
/**
* @name Keyboard
* @description
@@ -43,7 +56,10 @@ export class Keyboard extends IonicNativePlugin {
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
@Cordova({ sync: true })
@Cordova({
sync: true,
platforms: ['iOS']
})
hideFormAccessoryBar(hide: boolean): void {}
/**
@@ -72,7 +88,27 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS']
})
setResizeMode(mode: string): void {}
setResizeMode(mode: KeyboardResizeMode): void {}
/**
* Programatically set Keyboard style
* @param mode {string}
*/
@Cordova({
sync: true,
platforms: ['iOS']
})
setKeyboardStyle(style: KeyboardStyle): void {}
/**
* Programatically enable or disable the WebView scroll
* @param mode {string}
*/
@Cordova({
sync: true,
platforms: ['iOS']
})
disableScroll(disable: boolean): void {}
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
@@ -100,6 +136,19 @@ export class Keyboard extends IonicNativePlugin {
return;
}
/**
* Creates an observable that notifies you when the keyboard did show. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardDidShow',
platforms: ['iOS', 'Android']
})
onKeyboardDidShow(): Observable<any> {
return;
}
/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
@@ -125,4 +174,17 @@ export class Keyboard extends IonicNativePlugin {
onKeyboardWillHide(): Observable<any> {
return;
}
/**
* Creates an observable that notifies you when the keyboard did hide. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardDidHide',
platforms: ['iOS', 'Android']
})
onKeyboardDidHide(): Observable<any> {
return;
}
}
@@ -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; }
}
@@ -18,7 +18,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* ...
*
* this.launchReview.launch()
* .then(() => console.log('Successfully launched store app');
* .then(() => console.log('Successfully launched store app'));
*
* if(this.launchReview.isRatingSupported()){
* this.launchReview.rating()
@@ -23,6 +23,11 @@ export interface LineLoginProfile {
* Line Profile Name
*/
displayName: string;
/**
* Email
*/
email?: string;
}
export interface LineLoginAccessToken {
@@ -91,10 +96,7 @@ export class LineLogin extends IonicNativePlugin {
* Login
* @return {Promise<LineLoginProfile>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
@Cordova()
login(): Promise<LineLoginProfile> {
return;
}
@@ -104,10 +106,7 @@ export class LineLogin extends IonicNativePlugin {
* (iOS only)
* @return {Promise<LineLoginProfile>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
@Cordova()
loginWeb(): Promise<LineLoginProfile> {
return;
}
-130
View File
@@ -1,130 +0,0 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_company_admin' | 'w_share';
/**
* @name LinkedIn
* @description
* A Cordova plugin that lets you use LinkedIn Native SDKs for Android and iOS.
*
* Please see the [plugin's repo](https://github.com/zyramedia/cordova-plugin-linkedin#installation) for detailed installation steps.
*
* @usage
* ```typescript
* import { LinkedIn } from '@ionic-native/linkedin/ngx';
*
* constructor(private linkedin: LinkedIn) { }
*
* ...
*
* // check if there is an active session
* this.linkedin.hasActiveSession().then((active) => console.log('has active session?', active));
*
* // login
* const scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
* this.linkedin.login(scopes, true)
* .then(() => console.log('Logged in!'))
* .catch(e => console.log('Error logging in', e));
*
*
* // get connections
* this.linkedin.getRequest('people/~')
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
* // share something on profile
* const body = {
* comment: 'Hello world!',
* visibility: {
* code: 'anyone'
* }
* }
*
* this.linkedin.postRequest('~/shares', body)
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
*
* ```
*/
@Plugin({
pluginName: 'LinkedIn',
plugin: 'cordova-plugin-linkedin',
pluginRef: 'cordova.plugins.LinkedIn',
repo: 'https://github.com/zyra/cordova-plugin-linkedin',
install: 'ionic cordova plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
installVariables: ['APP_ID'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class LinkedIn extends IonicNativePlugin {
/**
* Login with the LinkedIn App
* @param scopes {string[]} Scopes to authorize
* @param promptToInstall {boolean} set to true to prompt the user to download the LinkedIn app if it's not installed
* @return {Promise<any>}
*/
@Cordova()
login(scopes: LinkedInLoginScopes[], promptToInstall: boolean): Promise<any> {
return;
}
/**
* Clears the current session
*/
@Cordova({ sync: true })
logout(): void {
}
/**
* Make a get request
* @param path {string} request path
* @return {Promise<any>}
*/
@Cordova()
getRequest(path: string): Promise<any> {
return;
}
/**
* Make a post request
* @param path {string} request path
* @param body {Object} request body
* @return {Promise<any>}
*/
@Cordova()
postRequest(path: string, body: any): Promise<any> {
return;
}
/**
* Opens a member's profile
* @param memberId {string} Member id
* @return {Promise<any>}
*/
@Cordova()
openProfile(memberId: string): Promise<any> {
return;
}
/**
* Checks if there is already an existing active session. This should be used to avoid unnecessary login.
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether there is an active session
*/
@Cordova()
hasActiveSession(): Promise<boolean> {
return;
}
/**
* Checks if there is an active session and returns the access token if it exists.
* @return {Promise<any>} returns a promise that resolves with an object that contains an access token if there is an active session
*/
@Cordova()
getActiveSession(): Promise<any> {
return;
}
}
+140
View File
@@ -0,0 +1,140 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface LuxandConfig {
/** The licence key got from Luxand */
licence: string;
/** The internal database name the tracker should use */
dbname: string;
/** the number of retry when registering of identifying a face */
loginTryCount: number;
}
export interface OMLFacialData {
/** The status message */
status: string;
/** The message returned by the plugin */
message: string;
/** The unique name generated and associated to a face when registering */
name: string;
/** The unique id Luxand Face SDK tracker associate to a face in it's internal database */
id: number;
/** Extra information about the face including age, expressions */
extra: {
AGE?: any;
GENDER?: any;
EYESOPENED?: any;
SMILE: any;
};
}
/**
* @name Luxand
* @description
* This plugin let you integrat Luxand Face SDK into your ionic projects, so you can implements face authentication easily in your applications.
*
* @usage
* ```typescript
* import { Luxand } from '@ionic-native/luxand';
*
*
* constructor(private luxand: Luxand) { }
*
* ...
*
* //init Luxand Face SDK
*
* this.luxand.init({
* licence: "",
* dbname: "data.dat",
* loginTryCount: 3
* })
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
* // register a face
* this.luxand.register({
* timeout: 20000//20 seconds
* })
* .then(r=>{
* console.log("Your FACE ID:", r.id);
* console.log("Your AGE:", r.extra.AGE);
* console.log("Your GENDER:", r.extra.GENDER);
* console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO");
* console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO");
* })
* .catch(err=>{
* if(err.messgae === "Already registered") {
* //extra data available
* console.log("Your AGE:", r.extra.AGE);
* console.log("Your GENDER:", r.extra.GENDER);
* console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO");
* console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO");
* }
* })
* //to login using a face
* this.luxand.login({
* timeout: 20000
* }).then(r=>console.log(r))
* .catch(err=>console.log(err));
*
* ```
* @interfaces
* OMLFacialData
* LuxandConfig
*/
@Plugin({
pluginName: 'Luxand',
plugin: 'codova-plugin-luxand',
pluginRef: 'window.Luxand',
repo: 'https://github.com/molobala/cordova-plugin-luxand',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Luxand extends IonicNativePlugin {
/**
* Initialize Luxand SDK
* @param config {LuxandConfig} LuxandConfig configuration object to use to init the SDK
* @return {Promise<any>} // Returns a promise that resolves if Luxand FaceSDK is initialized succesffully
*/
@Cordova()
init(config: LuxandConfig): Promise<any> {
return;
}
/**
* Identify methode, try to register a face in internal data base
* @param params {any} Allow to specify the timeout value
* @return {Promise<OMLFacialData>} // Returns a promise that resolve if a face has been detected and saved by the tracker in the internal database
*/
@Cordova()
register(params: {timeout: number}): Promise<OMLFacialData> {
return;
}
/**
* Login method, try to authenticated a face
* @param params {any} Allow to specify the timeout value
* @return {Promise<OMLFacialData>}
*/
@Cordova()
login(params: {timeout: number}): Promise<OMLFacialData> {
return; // Returns a promise that resolve if a face is recognize successfully
}
/**
* clear method, try to remove a face from internal database
* @param id {number}
* @return {Promise<any>}
*/
@Cordova()
clear(id: number): Promise<any> {
return;
}
/**
* clearMemory method, try to clear internal database
* @return {Promise<any>}
*/
@Cordova()
clearMemory(): Promise<any> {
return;
}
}
@@ -0,0 +1,96 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface MagnetometerReading {
/**
* X reading of magnetometer. (Number)
*/
x: number;
/**
* Y reading of magnetometer. (Number)
*/
y: number;
/**
* Z reading of magnetometer. (Number)
*/
z: number;
/**
* Calculated total - always positive of magnetometer. (Number)
*/
magnitude: number;
}
/**
* @name Device eMagnetometer
* @description
* Requires Cordova plugin: `cordova-plugin-magnetometer`. For more info, please see the [Device Orientation docs](https://github.com/sdesalas/cordova-plugin-magnetometer).
*
* @usage
* ```typescript
* // DeviceOrientationCompassHeading is an interface for compass
* import { Magnetometer, MagnetometerReading } from '@ionic-native/device-orientation/ngx';
*
* constructor(private magnetometer: Magnetometer) { }
*
* ...
*
* // Get the device current compass heading
* this.deviceOrientation.getReading().then(
* (data: MagnetometerReading) => console.log(data),
* (error: any) => console.log(error)
* );
*
* // Watch the device compass heading change
* var subscription = this.deviceOrientation.watchReadings().subscribe(
* (data: MagnetometerReading) => console.log(data)
* );
*
* // Stop watching heading change
* subscription.unsubscribe();
* ```
* @interfaces
* MagnetometerReading
*/
@Plugin({
pluginName: 'Magnetometer',
plugin: 'cordova-plugin-magnetometer',
pluginRef: 'cordova.plugins.magnetometer',
repo: 'https://github.com/sdesalas/cordova-plugin-magnetometer',
platforms: [
'Android',
'iOS',
]
})
@Injectable()
export class Magnetometer extends IonicNativePlugin {
/**
* Get the current compass reading.
* @returns {Promise<MagnetometerReading>}
*/
@Cordova()
getReading(): Promise<MagnetometerReading> {
return;
}
/**
* Get the device current heading at a regular interval
*
* Stop the watch by unsubscribing from the observable
* @param {DeviceOrientationCompassOptions} [options] Options for compass. Frequency and Filter. Optional
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
clearFunction: 'stop'
})
watchReadings(
): Observable<MagnetometerReading> {
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;
}
}
@@ -9,7 +9,7 @@ import { Injectable } from '@angular/core';
*
* @usage
* ```typescript
* import { MobileAccessibility } from '@ionic-native/mobile-ccessibility/ngx';
* import { MobileAccessibility } from '@ionic-native/mobile-accessibility/ngx';
*
*
* constructor(private mobileAccessibility: MobileAccessibility) { }
+20 -2
View File
@@ -3,7 +3,7 @@ import { CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin, checkAvai
export interface AuthenticationResult {
accessToken: string;
accesSTokenType: string;
accessTokenType: string;
expiresOn: Date;
idToken: string;
isMultipleResourceRefreshToken: boolean;
@@ -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;
}
}
@@ -134,6 +134,7 @@ export interface MusicControlsOptions {
* break;
* }
* }
* });
*
* this.musicControls.listen(); // activates the observable above
*
@@ -203,7 +204,7 @@ export class MusicControls extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
updateElapsed(args: { elapsed: string; isPlaying: boolean }): void {}
updateElapsed(args: { elapsed: number; isPlaying: boolean }): void {}
/**
* Toggle dismissable:
@@ -8,7 +8,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* @usage
* ```typescript
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
* import { NativeGeocoder, NativeGeocoderResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
*
* constructor(private nativeGeocoder: NativeGeocoder) { }
*
@@ -20,16 +20,15 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* };
*
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
* .then((result: NativeGeocoderReverseResult[]) => console.log(JSON.stringify(result[0])))
* .then((result: NativeGeocoderResult[]) => console.log(JSON.stringify(result[0])))
* .catch((error: any) => console.log(error));
*
* this.nativeGeocoder.forwardGeocode('Berlin', options)
* .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude))
* .then((result: NativeGeocoderResult[]) => console.log('The coordinates are latitude=' + result[0].latitude + ' and longitude=' + result[0].longitude))
* .catch((error: any) => console.log(error));
* ```
* @interfaces
* NativeGeocoderReverseResult
* NativeGeocoderForwardResult
* NativeGeocoderResult
* NativeGeocoderOptions
*/
@Plugin({
@@ -47,32 +46,40 @@ export class NativeGeocoder extends IonicNativePlugin {
* @param latitude {number} The latitude
* @param longitude {number} The longitude
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderReverseResult[]>}
* @return {Promise<NativeGeocoderResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderReverseResult[]> { return; }
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
/**
* Forward geocode a given address to find coordinates
* @param addressString {string} The address to be geocoded
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderForwardResult[]>}
* @return {Promise<NativeGeocoderResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderForwardResult[]> { return; }
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
}
/**
* Encapsulates format information about a reverse geocoding result.
* Encapsulates format information about a geocoding result.
* more Info:
* - https://developer.apple.com/documentation/corelocation/clplacemark
* - https://developer.android.com/reference/android/location/Address.html
*/
export interface NativeGeocoderReverseResult {
export interface NativeGeocoderResult {
/**
* The latitude.
*/
latitude: string;
/**
* The longitude.
*/
longitude: string;
/**
* The country code.
*/
@@ -109,20 +116,10 @@ export interface NativeGeocoderReverseResult {
* The subThoroughfare.
*/
subThoroughfare: string;
}
/**
* Encapsulates format information about a forward geocoding result.
*/
export interface NativeGeocoderForwardResult {
/**
* The latitude.
* The areasOfInterest
*/
latitude: string;
/**
* The longitude.
*/
longitude: string;
areasOfInterest: string[];
}
/**
+1 -1
View File
@@ -104,7 +104,7 @@ export class Network extends IonicNativePlugin {
* @return {Observable<any>}
*/
@CordovaCheck()
onchange(): Observable<any> {
onChange(): Observable<any> {
return merge(this.onConnect(), this.onDisconnect());
}
+1 -1
View File
@@ -196,7 +196,7 @@ export class NFC extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
makeReadyOnly(): Promise<any> {
makeReadOnly(): Promise<any> {
return;
}
+167
View File
@@ -0,0 +1,167 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export enum OCRSourceType {
/**
* Normal processing from a file URL. This is the overall recommended choice
* for most applications. The distinction between file and native URLs is
* only relevant on iOS; under Android `NORMFILEURL` and `NORMNATIVEURL`
* are interchangeable.
*/
NORMFILEURL = 0,
/**
* Normal processing from a native URL. Since this source type uses deprecated
* OS APIs to interact with the camera plugin, it is best avoided, especially
* if ongoing forward compatibility is a concern. For further information, see
* https://github.com/NeutrinosPlatform/cordova-plugin-mobile-ocr#plugin-usage
* Under Android, this is equivalent to `NORMFILEURL`.
*/
NORMNATIVEURL = 1,
/**
* Fast processing from a file URL. As the compression done internally causes
* a significant loss in extraction quality, it should only be preferred when
* dealing with large images containing significant amounts of text, where
* the execution time required to perform normal processing is prohibitive.
* The distinction between file and native URLs is only relevant on iOS;
* under Android `FASTFILEURL` and `FASTNATIVEURL` are interchangeable.
*/
FASTFILEURL = 2,
/**
* Fast processing from a native URL. See comments above for `FASTFILEURL`
* concerning quality loss.
*
* The distinction between file and native URLs is only relevant on iOS;
* under Android `FASTFILEURL` and `FASTNATIVEURL` are interchangeable.
*/
FASTNATIVEURL = 3,
/**
* Normal processing from a base64-encoded string. Quality is equivalent
* to `NORMFILEURL`, but due to significantly higher memory requirements,
* is only appropriate for use with very small images.
*/
BASE64 = 4,
}
/**
* Four points (ordered in clockwise direction) that enclose a text
* component. May not be axis-aligned due to perspective skew.
*/
export interface OCRCorners {
x1: number;
y1: number;
x2: number;
y2: number;
x3: number;
y3: number;
x4: number;
y4: number;
}
/**
* An axis-aligned bounding rectangle. `x` and `y` represent the top left.
*/
export interface OCRRect {
x: number;
y: number;
height: number;
width: number;
}
/**
* This is the return value from the `recText` method.
*/
export interface OCRResult {
/**
* Was any text extracted? If `foundText` is false, no other fields are
* returned. If foundText is true, all other fields are reliable.
*/
foundText: boolean;
/**
* A block is the largest unit of text, which can be thought of as a paragraph.
* This field consists of several parallel arrays, so the text in `blocktext[0]`
* is bounded by `blockpoints[0]` and `blockframe[0]`.
*/
blocks: {
blocktext: string[];
blockpoints: OCRCorners[];
blockframe: OCRRect[];
};
/**
* A line is the central unit of text, containing several elements. A block
* can contain N lines. This field consists of several parallel arrays, so the
* text in `linetext[0]` is bounded by `linepoints[0]` and `lineframe[0]`.
*/
lines: {
linetext: string[];
linepoints: OCRCorners[];
lineframe: OCRRect[];
};
/**
* A word (or element) is the smallest unit of text. This field consists of
* several parallel arrays, so the text in `wordtext[0]` is bounded by
* `wordpoints[0]` and `wordframe[0]`.
*/
words: {
wordtext: string[];
wordpoints: OCRCorners[];
wordframe: OCRRect[];
};
}
/**
* @name OCR
* @description
* This plugin attempts to identify and extract text from an image.
*
* @usage
* ```typescript
* import { OCR, OCRSourceType } from '@ionic-native/ocr/ngx';
*
*
* constructor(private ocr: OCR) { }
*
* ...
*
* this.ocr.recText(OCRSourceType.NORMFILEURL, "file://path/to/image.png")
* .then((res: OCRResult) => console.log(JSON.stringify(res)))
* .catch((error: any) => console.error(error));
*
* ```
*
* @interfaces
* OCRCorners
* OCRRect
* OCRResult
*
* @enums
* OCRSourceType
*/
@Plugin({
pluginName: 'OCR',
plugin: 'cordova-plugin-mobile-ocr',
pluginRef: 'textocr',
repo: 'https://github.com/NeutrinosPlatform/cordova-plugin-mobile-ocr',
platforms: ['Android', 'iOS']
})
@Injectable()
export class OCR extends IonicNativePlugin {
/**
* Extract text from image
* @param sourceType {OCRSourceType} type of image source
* @param source {string} image source (either file URL or base64 string)
* @return {Promise<OCRResult>} extracted text and geometry
*/
@Cordova()
recText(sourceType: OCRSourceType, source: string): Promise<OCRResult> {
return;
}
}
@@ -770,4 +770,19 @@ export class OneSignal extends IonicNativePlugin {
*/
@Cordova()
userProvidedPrivacyConsent(callback: Function): void {}
/**
* Allows you to use your own system's user ID's to send push notifications to your users.
* To tie a user to a given user ID, you can use this method.
* @param {string} externalId
*/
@Cordova()
setExternalUserId(externalId: string): void {}
/**
* Removes whatever was set as the current user's external user ID.
*/
@Cordova()
removeExternalUserId(): void {}
}
@@ -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;
}

Some files were not shown because too many files have changed in this diff Show More