mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 00:12:53 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
45c64b0394
99
CHANGELOG.md
99
CHANGELOG.md
@ -1,9 +1,60 @@
|
||||
## [5.5.1](https://github.com/ionic-team/ionic-native/compare/v5.5.0...v5.5.1) (2019-04-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background-geolocation:** update source ([e288a5d](https://github.com/ionic-team/ionic-native/commit/e288a5d)), closes [#2979](https://github.com/ionic-team/ionic-native/issues/2979)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **CameraPreview:** add getHorizontalFOV callback ([#3000](https://github.com/ionic-team/ionic-native/issues/3000)) ([9800271](https://github.com/ionic-team/ionic-native/commit/9800271))
|
||||
|
||||
|
||||
|
||||
# [5.5.0](https://github.com/ionic-team/ionic-native/compare/v5.4.0...v5.5.0) (2019-04-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background-mode:** update types definitions ([#2997](https://github.com/ionic-team/ionic-native/issues/2997)) ([c0ce17b](https://github.com/ionic-team/ionic-native/commit/c0ce17b))
|
||||
* **firebase-messaging:** fix the typings of the FCM message payload ([#2998](https://github.com/ionic-team/ionic-native/issues/2998)) ([e47774b](https://github.com/ionic-team/ionic-native/commit/e47774b))
|
||||
* **google-plus:** mark login param as required ([#2996](https://github.com/ionic-team/ionic-native/issues/2996)) ([c518c81](https://github.com/ionic-team/ionic-native/commit/c518c81))
|
||||
* **nfc:** rename `makeReadyOnly` to `makeReadOnly` ([9024ea5](https://github.com/ionic-team/ionic-native/commit/9024ea5)), closes [#2985](https://github.com/ionic-team/ionic-native/issues/2985)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **device-accounts:** update plugin source ([#2976](https://github.com/ionic-team/ionic-native/issues/2976)) ([c063652](https://github.com/ionic-team/ionic-native/commit/c063652))
|
||||
* **purchases:** update plugin to v0.0.5 ([#2988](https://github.com/ionic-team/ionic-native/issues/2988)) ([7ea51fc](https://github.com/ionic-team/ionic-native/commit/7ea51fc))
|
||||
* **spotify-auth:** add Spotify OAuth plugin ([#2989](https://github.com/ionic-team/ionic-native/issues/2989)) ([21dc1f9](https://github.com/ionic-team/ionic-native/commit/21dc1f9))
|
||||
|
||||
|
||||
|
||||
# [5.4.0](https://github.com/ionic-team/ionic-native/compare/v5.3.0...v5.4.0) (2019-04-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background-mode:** update types definitions ([#2982](https://github.com/ionic-team/ionic-native/issues/2982)) ([c75aeb9](https://github.com/ionic-team/ionic-native/commit/c75aeb9))
|
||||
* **ble:** fix definitions ([#2974](https://github.com/ionic-team/ionic-native/issues/2974)) ([6a19509](https://github.com/ionic-team/ionic-native/commit/6a19509))
|
||||
* **facebook:** use object notation, otherwise EVENTS is´ undefined ([#2955](https://github.com/ionic-team/ionic-native/issues/2955)) ([aa138c4](https://github.com/ionic-team/ionic-native/commit/aa138c4))
|
||||
* **in-app-purchase2:** Registering a product with an alias is now optional ([#2946](https://github.com/ionic-team/ionic-native/issues/2946)) ([4e60c63](https://github.com/ionic-team/ionic-native/commit/4e60c63))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-play-games-services:** add getPlayerScore function ([#2949](https://github.com/ionic-team/ionic-native/issues/2949)) ([767d3b3](https://github.com/ionic-team/ionic-native/commit/767d3b3))
|
||||
* **in-app-purchase-2:** add manageSubscriptions() ([#2980](https://github.com/ionic-team/ionic-native/issues/2980)) ([f874185](https://github.com/ionic-team/ionic-native/commit/f874185))
|
||||
* **in-app-purchase-2:** add missing property ([#2961](https://github.com/ionic-team/ionic-native/issues/2961)) ([029f82f](https://github.com/ionic-team/ionic-native/commit/029f82f))
|
||||
* **nativegeocoder:** update plugin to v3.2.0 ([#2958](https://github.com/ionic-team/ionic-native/issues/2958)) ([4de49c3](https://github.com/ionic-team/ionic-native/commit/4de49c3))
|
||||
* **purchases:** add new plugin for purchases ([#2940](https://github.com/ionic-team/ionic-native/issues/2940)) ([39be275](https://github.com/ionic-team/ionic-native/commit/39be275))
|
||||
|
||||
|
||||
|
||||
# [5.3.0](https://github.com/ionic-team/ionic-native/compare/v5.2.0...v5.3.0) (2019-03-19)
|
||||
|
||||
|
||||
* Revert "refactor(template): update Inject decorator" ([d827db2](https://github.com/ionic-team/ionic-native/commit/d827db2))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **scripts:** check for TypeDoc tags when selecting plugin class ([#2963](https://github.com/ionic-team/ionic-native/issues/2963)) ([06654af](https://github.com/ionic-team/ionic-native/commit/06654af))
|
||||
@ -15,9 +66,13 @@
|
||||
|
||||
### Features
|
||||
|
||||
* **nativegeocoder:** update plugin to v3.2.0 ([cd97375](https://github.com/ionic-team/ionic-native/commit/cd97375))
|
||||
* **scripts:** add docs-json script ([#2947](https://github.com/ionic-team/ionic-native/issues/2947)) ([b0dea6d](https://github.com/ionic-team/ionic-native/commit/b0dea6d))
|
||||
|
||||
|
||||
* Revert "refactor(template): update Inject decorator" ([d827db2](https://github.com/ionic-team/ionic-native/commit/d827db2))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* This reverts commit c5ae6362d7771b62ae35a6b8ddc6e866aa9964a9.
|
||||
@ -101,14 +156,14 @@
|
||||
|
||||
### Features
|
||||
|
||||
* add analytics-firebase plugin ([e374b52](https://github.com/ionic-team/ionic-native/commit/e374b52))
|
||||
* **adjust:** add adjust sdk plugin ([#2872](https://github.com/ionic-team/ionic-native/issues/2872)) ([9e6705d](https://github.com/ionic-team/ionic-native/commit/9e6705d))
|
||||
* **admob:** add plugin ([#2864](https://github.com/ionic-team/ionic-native/issues/2864)) ([707ce1c](https://github.com/ionic-team/ionic-native/commit/707ce1c))
|
||||
* **analytics-firebase:** add plugin ([#2862](https://github.com/ionic-team/ionic-native/issues/2862)) ([5df3de7](https://github.com/ionic-team/ionic-native/commit/5df3de7))
|
||||
* **audio-management:** add plugin for audio streams ([#2877](https://github.com/ionic-team/ionic-native/issues/2877)) ([34ecd29](https://github.com/ionic-team/ionic-native/commit/34ecd29))
|
||||
* **baidu-push:** add plugin ([#2838](https://github.com/ionic-team/ionic-native/issues/2838)) ([c3de8df](https://github.com/ionic-team/ionic-native/commit/c3de8df))
|
||||
* **firebase:** add clearAllNotifications method ([#2867](https://github.com/ionic-team/ionic-native/issues/2867)) ([7c46d8c](https://github.com/ionic-team/ionic-native/commit/7c46d8c))
|
||||
* add analytics-firebase plugin ([e374b52](https://github.com/ionic-team/ionic-native/commit/e374b52))
|
||||
* **blinkid:** add plugin ([#2833](https://github.com/ionic-team/ionic-native/issues/2833)) ([8e405cc](https://github.com/ionic-team/ionic-native/commit/8e405cc))
|
||||
* **firebase:** add clearAllNotifications method ([#2867](https://github.com/ionic-team/ionic-native/issues/2867)) ([7c46d8c](https://github.com/ionic-team/ionic-native/commit/7c46d8c))
|
||||
* **gao-de-location:** add plugin ([#2857](https://github.com/ionic-team/ionic-native/issues/2857)) ([e2b25de](https://github.com/ionic-team/ionic-native/commit/e2b25de))
|
||||
* **in-app-browser:** add 'beforeload' as option ([#2863](https://github.com/ionic-team/ionic-native/issues/2863)) ([d33bcb0](https://github.com/ionic-team/ionic-native/commit/d33bcb0))
|
||||
|
||||
@ -432,6 +487,10 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* build errors ([f70eaea](https://github.com/ionic-team/ionic-native/commit/f70eaea))
|
||||
* fix lint ([b36a1f9](https://github.com/ionic-team/ionic-native/commit/b36a1f9))
|
||||
* fix more lint errors ([0b3d299](https://github.com/ionic-team/ionic-native/commit/0b3d299))
|
||||
* fix rxjs 6 imports ([e0b0687](https://github.com/ionic-team/ionic-native/commit/e0b0687))
|
||||
* **android-fingerprint-auth:** ensure ERRORS array is defined ([#2508](https://github.com/ionic-team/ionic-native/issues/2508)) ([714114d](https://github.com/ionic-team/ionic-native/commit/714114d))
|
||||
* **background-geolocation:** watchLocationMode returns observable ([#2547](https://github.com/ionic-team/ionic-native/issues/2547)) ([3f8a6f2](https://github.com/ionic-team/ionic-native/commit/3f8a6f2))
|
||||
* **calendar:** Fixes createCalendar parameter typing ([84e0aa1](https://github.com/ionic-team/ionic-native/commit/84e0aa1))
|
||||
@ -440,6 +499,7 @@
|
||||
* **ibeacon:** correct Type {Region} in some params ([#2453](https://github.com/ionic-team/ionic-native/issues/2453)) ([300db62](https://github.com/ionic-team/ionic-native/commit/300db62))
|
||||
* **in-app-purchase-2:** fix ready method signature ([#2043](https://github.com/ionic-team/ionic-native/issues/2043)) ([a018381](https://github.com/ionic-team/ionic-native/commit/a018381))
|
||||
* **linting:** Fixing misc linting errors that typedoc complains about ([#2476](https://github.com/ionic-team/ionic-native/issues/2476)) ([d3c2859](https://github.com/ionic-team/ionic-native/commit/d3c2859))
|
||||
* fix tealium jsdoc ([f34b6e6](https://github.com/ionic-team/ionic-native/commit/f34b6e6))
|
||||
* **native-geocoder:** set response type to an array ([#2505](https://github.com/ionic-team/ionic-native/issues/2505)) ([defb276](https://github.com/ionic-team/ionic-native/commit/defb276))
|
||||
* **onesignal:** make params optional ([#2507](https://github.com/ionic-team/ionic-native/issues/2507)) ([e6db281](https://github.com/ionic-team/ionic-native/commit/e6db281))
|
||||
* **onesignal:** update OSPermissionState interface ([#2561](https://github.com/ionic-team/ionic-native/issues/2561)) ([fc088f8](https://github.com/ionic-team/ionic-native/commit/fc088f8))
|
||||
@ -448,11 +508,6 @@
|
||||
* **stripe:** fixed casing of postal code param ([#2520](https://github.com/ionic-team/ionic-native/issues/2520)) ([d6a9ed1](https://github.com/ionic-team/ionic-native/commit/d6a9ed1))
|
||||
* **themeable-browser:** allow hidden and clear cache ([a4cc7f7](https://github.com/ionic-team/ionic-native/commit/a4cc7f7))
|
||||
* **v5-builder:** stop transforming "declare" classes ([#2503](https://github.com/ionic-team/ionic-native/issues/2503)) ([6662234](https://github.com/ionic-team/ionic-native/commit/6662234))
|
||||
* build errors ([f70eaea](https://github.com/ionic-team/ionic-native/commit/f70eaea))
|
||||
* fix lint ([b36a1f9](https://github.com/ionic-team/ionic-native/commit/b36a1f9))
|
||||
* fix more lint errors ([0b3d299](https://github.com/ionic-team/ionic-native/commit/0b3d299))
|
||||
* fix rxjs 6 imports ([e0b0687](https://github.com/ionic-team/ionic-native/commit/e0b0687))
|
||||
* fix tealium jsdoc ([f34b6e6](https://github.com/ionic-team/ionic-native/commit/f34b6e6))
|
||||
* **web-intent:** fix options param ([#2450](https://github.com/ionic-team/ionic-native/issues/2450)) ([23b760b](https://github.com/ionic-team/ionic-native/commit/23b760b))
|
||||
* **web-intent:** registerBroadcastReceiver as Observable ([#2491](https://github.com/ionic-team/ionic-native/issues/2491)) ([47f7397](https://github.com/ionic-team/ionic-native/commit/47f7397))
|
||||
|
||||
@ -541,9 +596,9 @@
|
||||
* **one-signal:** add clearOneSignalNotifications function ([fc0338a](https://github.com/ionic-team/ionic-native/commit/fc0338a))
|
||||
* **plugin:** Add google nearby plugin ([eb1bcdd](https://github.com/ionic-team/ionic-native/commit/eb1bcdd))
|
||||
* **plugin:** add iOS File Picker ([571df3a](https://github.com/ionic-team/ionic-native/commit/571df3a))
|
||||
* **plugin:** add Microdoft App Center Analytics plugin ([b65946b](https://github.com/ionic-team/ionic-native/commit/b65946b))
|
||||
* **plugin:** add Microdoft App Center Analytics plugin ([7a5bee9](https://github.com/ionic-team/ionic-native/commit/7a5bee9))
|
||||
* **plugin:** add Microdoft App Center Analytics plugin ([84c9bfb](https://github.com/ionic-team/ionic-native/commit/84c9bfb))
|
||||
* **plugin:** add Microdoft App Center Analytics plugin ([b65946b](https://github.com/ionic-team/ionic-native/commit/b65946b))
|
||||
* **plugin:** add Microsoft App Center Crashes plugin ([44e0e24](https://github.com/ionic-team/ionic-native/commit/44e0e24))
|
||||
* **plugin:** add Microsoft App Center Push plugin ([cdabebd](https://github.com/ionic-team/ionic-native/commit/cdabebd))
|
||||
* **plugin:** add OpenALPR plugin ([e27fbf4](https://github.com/ionic-team/ionic-native/commit/e27fbf4))
|
||||
@ -1065,8 +1120,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Features
|
||||
|
||||
* add IonicNativePlugin base class ([#1425](https://github.com/ionic-team/ionic-native/issues/1425)) ([17366a2](https://github.com/ionic-team/ionic-native/commit/17366a2))
|
||||
* **keychain:** add Keychain plugin ([#1420](https://github.com/ionic-team/ionic-native/issues/1420)) ([16dc71a](https://github.com/ionic-team/ionic-native/commit/16dc71a))
|
||||
* add IonicNativePlugin base class ([#1425](https://github.com/ionic-team/ionic-native/issues/1425)) ([17366a2](https://github.com/ionic-team/ionic-native/commit/17366a2))
|
||||
|
||||
|
||||
|
||||
@ -1435,12 +1490,12 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add clearAllNotifications() ([8c021bc](https://github.com/ionic-team/ionic-native/commit/8c021bc))
|
||||
* **battery-status:** add missing pluginRef ([3da0efe](https://github.com/ionic-team/ionic-native/commit/3da0efe))
|
||||
* **core:** fix exception in CordovaProperty ([#998](https://github.com/ionic-team/ionic-native/issues/998)) ([cb29363](https://github.com/ionic-team/ionic-native/commit/cb29363)), closes [#992](https://github.com/ionic-team/ionic-native/issues/992)
|
||||
* **core:** fix plugin check ([da7a370](https://github.com/ionic-team/ionic-native/commit/da7a370))
|
||||
* **googlemaps:** fix GoogleMapsLaLngBounds ([c3127d3](https://github.com/ionic-team/ionic-native/commit/c3127d3)), closes [#972](https://github.com/ionic-team/ionic-native/issues/972)
|
||||
* **plugin:** adds subscribe() and unsubscribe() ([94025a7](https://github.com/ionic-team/ionic-native/commit/94025a7))
|
||||
* add clearAllNotifications() ([8c021bc](https://github.com/ionic-team/ionic-native/commit/8c021bc))
|
||||
|
||||
|
||||
### Features
|
||||
@ -1598,8 +1653,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **card-io:** fix typo in options ([e6700a3](https://github.com/ionic-team/ionic-native/commit/e6700a3))
|
||||
* add return ([3fdc4a8](https://github.com/ionic-team/ionic-native/commit/3fdc4a8))
|
||||
* **card-io:** fix typo in options ([e6700a3](https://github.com/ionic-team/ionic-native/commit/e6700a3))
|
||||
* **globalization:** add missing parameter to numberToString function ([1072ab1](https://github.com/ionic-team/ionic-native/commit/1072ab1)), closes [#835](https://github.com/ionic-team/ionic-native/issues/835)
|
||||
* **headercolor:** solve typo in usage and chore ([bab2971](https://github.com/ionic-team/ionic-native/commit/bab2971))
|
||||
|
||||
@ -1852,7 +1907,6 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove CanvasCamera plugin ([c75f898](https://github.com/ionic-team/ionic-native/commit/c75f898))
|
||||
* **base64togallery:** fixes callbacks ([#513](https://github.com/ionic-team/ionic-native/issues/513)) ([1db1374](https://github.com/ionic-team/ionic-native/commit/1db1374))
|
||||
* **diagnostic:** Add DENIED_ALWAYS to permissionStatus, also some code formatting ([9d573a9](https://github.com/ionic-team/ionic-native/commit/9d573a9))
|
||||
* **diagnostic:** Fix diagnostic objects ([cb176aa](https://github.com/ionic-team/ionic-native/commit/cb176aa))
|
||||
@ -1866,6 +1920,7 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
* **mixpanel:** Make eventProperties optional ([#501](https://github.com/ionic-team/ionic-native/issues/501)) ([51364f8](https://github.com/ionic-team/ionic-native/commit/51364f8))
|
||||
* **ng1:** fail gracefully when angular 1 promises can't be retrieved ([d135dc2](https://github.com/ionic-team/ionic-native/commit/d135dc2))
|
||||
* **ng1:** grab injector from app. [#451](https://github.com/ionic-team/ionic-native/issues/451) ([2dc68a4](https://github.com/ionic-team/ionic-native/commit/2dc68a4))
|
||||
* remove CanvasCamera plugin ([c75f898](https://github.com/ionic-team/ionic-native/commit/c75f898))
|
||||
* **social-sharing:** shareViaEmail now resolves/rejects when not providing optional args ([c76de34](https://github.com/ionic-team/ionic-native/commit/c76de34))
|
||||
* **social-sharing:** various fixes ([#520](https://github.com/ionic-team/ionic-native/issues/520)) ([4f97164](https://github.com/ionic-team/ionic-native/commit/4f97164))
|
||||
|
||||
@ -1942,11 +1997,11 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add the reject function at the expected errorIndex position in the args array ([#436](https://github.com/ionic-team/ionic-native/issues/436)) ([4e87ac7](https://github.com/ionic-team/ionic-native/commit/4e87ac7))
|
||||
* **camera-preview:** changes implementation to match Cordova plugin ([#441](https://github.com/ionic-team/ionic-native/issues/441)) ([55ba65a](https://github.com/ionic-team/ionic-native/commit/55ba65a))
|
||||
* **file:** fixes exclusive option ([#459](https://github.com/ionic-team/ionic-native/issues/459)) ([14e41a3](https://github.com/ionic-team/ionic-native/commit/14e41a3))
|
||||
* **file:** initialize writeFile options ([#468](https://github.com/ionic-team/ionic-native/issues/468)) ([16628a4](https://github.com/ionic-team/ionic-native/commit/16628a4))
|
||||
* **nativeaudio:** fix plugin reference ([2510c5f](https://github.com/ionic-team/ionic-native/commit/2510c5f))
|
||||
* add the reject function at the expected errorIndex position in the args array ([#436](https://github.com/ionic-team/ionic-native/issues/436)) ([4e87ac7](https://github.com/ionic-team/ionic-native/commit/4e87ac7))
|
||||
|
||||
|
||||
### Features
|
||||
@ -2145,12 +2200,12 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove unnecessary decorator ([#257](https://github.com/ionic-team/ionic-native/issues/257)) ([25fab64](https://github.com/ionic-team/ionic-native/commit/25fab64))
|
||||
* **actionsheet:** add missing optional parameter for hide function ([#262](https://github.com/ionic-team/ionic-native/issues/262)) ([644e999](https://github.com/ionic-team/ionic-native/commit/644e999))
|
||||
* **background-geolocation:** fix pluginref again ([b8a5133](https://github.com/ionic-team/ionic-native/commit/b8a5133))
|
||||
* **geolocation:** fix plugin reference ([4f0cd24](https://github.com/ionic-team/ionic-native/commit/4f0cd24)), closes [#258](https://github.com/ionic-team/ionic-native/issues/258)
|
||||
* **googlemaps:** use correct methods for addGroundOverlay and addKmlOverlay ([#268](https://github.com/ionic-team/ionic-native/issues/268)) ([b8be1de](https://github.com/ionic-team/ionic-native/commit/b8be1de))
|
||||
* **socialsharing:** all methods return Promises now ([e150224](https://github.com/ionic-team/ionic-native/commit/e150224)), closes [#275](https://github.com/ionic-team/ionic-native/issues/275)
|
||||
* remove unnecessary decorator ([#257](https://github.com/ionic-team/ionic-native/issues/257)) ([25fab64](https://github.com/ionic-team/ionic-native/commit/25fab64))
|
||||
|
||||
|
||||
### Features
|
||||
@ -2286,8 +2341,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
* **datepicker:** datepicker options are optional ([c3cfd14](https://github.com/ionic-team/ionic-native/commit/c3cfd14))
|
||||
* **datepicker:** dates are Dates ([ce6adcc](https://github.com/ionic-team/ionic-native/commit/ce6adcc))
|
||||
* **datepicker:** fix plugin functionality ([1a778e7](https://github.com/ionic-team/ionic-native/commit/1a778e7))
|
||||
* **datepicker:** fix plugin functionality ([91de971](https://github.com/ionic-team/ionic-native/commit/91de971))
|
||||
* **datepicker:** fix plugin functionality ([1a778e7](https://github.com/ionic-team/ionic-native/commit/1a778e7))
|
||||
* **devicemotion:** combine watch and clear into one function ([d17f62d](https://github.com/ionic-team/ionic-native/commit/d17f62d))
|
||||
* **geolocation:** set callback order to reverse on getCurrentPosition ([1fac387](https://github.com/ionic-team/ionic-native/commit/1fac387))
|
||||
* **imagepicker:** pluginRef ([01d7972](https://github.com/ionic-team/ionic-native/commit/01d7972))
|
||||
@ -2345,15 +2400,18 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
* **calendar:** make getCalendarOptions sync ([78c5408](https://github.com/ionic-team/ionic-native/commit/78c5408))
|
||||
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
|
||||
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
|
||||
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
|
||||
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
||||
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
||||
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
|
||||
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))
|
||||
* add apprate ([0dd4fec](https://github.com/ionic-team/ionic-native/commit/0dd4fec))
|
||||
@ -2361,9 +2419,6 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil
|
||||
* add badge plugin ([3088df4](https://github.com/ionic-team/ionic-native/commit/3088df4))
|
||||
* add clipboard plugin ([0b6cca7](https://github.com/ionic-team/ionic-native/commit/0b6cca7))
|
||||
* add clipboard plugin ([fa4c266](https://github.com/ionic-team/ionic-native/commit/fa4c266))
|
||||
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
||||
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
||||
|
||||
|
||||
|
||||
|
1858
package-lock.json
generated
1858
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "5.3.0",
|
||||
"version": "5.5.1",
|
||||
"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)",
|
||||
@ -23,20 +23,20 @@
|
||||
"shipit": "npm run build && npm run readmes && npm run npmpub"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/common": "^7.2.9",
|
||||
"@angular/compiler": "^7.2.9",
|
||||
"@angular/compiler-cli": "^7.2.9",
|
||||
"@angular/core": "^7.2.9",
|
||||
"@angular/common": "^7.2.14",
|
||||
"@angular/compiler": "^7.2.14",
|
||||
"@angular/compiler-cli": "^7.2.14",
|
||||
"@angular/core": "^7.2.14",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/fs-extra": "^5.0.5",
|
||||
"@types/jest": "^24.0.11",
|
||||
"@types/lodash": "^4.14.123",
|
||||
"@types/node": "^10.14.1",
|
||||
"@types/node": "^10.14.6",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"@types/webpack": "^4.4.26",
|
||||
"@types/webpack": "^4.4.29",
|
||||
"ajv": "^6.10.0",
|
||||
"async-promise-queue": "^1.0.4",
|
||||
"conventional-changelog-cli": "^2.0.12",
|
||||
"conventional-changelog-cli": "^2.0.17",
|
||||
"cz-conventional-changelog": "^2.1.0",
|
||||
"dgeni": "^0.4.12",
|
||||
"dgeni-packages": "0.16.10",
|
||||
@ -45,21 +45,21 @@
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-tslint": "^8.1.4",
|
||||
"jest": "^24.5.0",
|
||||
"jest": "^24.7.1",
|
||||
"lodash": "^4.17.11",
|
||||
"minimist": "1.2.0",
|
||||
"natives": "^1.1.6",
|
||||
"rimraf": "^2.6.3",
|
||||
"rxjs": "^6.4.0",
|
||||
"ts-jest": "^24.0.0",
|
||||
"ts-node": "^8.0.3",
|
||||
"tslint": "^5.14.0",
|
||||
"rxjs": "^6.5.1",
|
||||
"ts-jest": "^24.0.2",
|
||||
"ts-node": "^8.1.0",
|
||||
"tslint": "^5.16.0",
|
||||
"tslint-ionic-rules": "0.0.21",
|
||||
"typedoc": "^0.14.2",
|
||||
"typescript": "3.2.4",
|
||||
"uglifyjs-webpack-plugin": "^2.1.2",
|
||||
"unminified-webpack-plugin": "^2.0.0",
|
||||
"webpack": "^4.29.6",
|
||||
"webpack": "^4.30.0",
|
||||
"winston": "^3.2.1",
|
||||
"zone.js": "^0.8.29"
|
||||
},
|
||||
|
@ -540,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']
|
||||
|
@ -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
|
||||
|
@ -431,20 +431,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 +480,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 +559,7 @@ export class BluetoothLE extends IonicNativePlugin {
|
||||
connect(params: {
|
||||
address: string;
|
||||
autoConnect?: boolean;
|
||||
}): Observable<{ status: DeviceInfo }> {
|
||||
}): Observable< DeviceInfo > {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -579,10 +579,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 +592,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 +609,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 +617,7 @@ export class BluetoothLE extends IonicNativePlugin {
|
||||
discover(params: {
|
||||
address: string;
|
||||
clearCache?: boolean;
|
||||
}): Promise<{ device: Device }> {
|
||||
}): Promise<Device> {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -626,13 +626,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 +747,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 +758,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 +1057,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()
|
||||
|
@ -456,4 +456,13 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
onBackButton(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return in use device camera fov
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getHorizontalFOV(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -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'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -43,8 +43,8 @@ export interface FingerprintOptions {
|
||||
* ...
|
||||
*
|
||||
* this.faio.show({
|
||||
* clientId: 'Fingerprint-Demo',
|
||||
* clientSecret: 'password', //Only necessary for Android
|
||||
* clientId: 'Fingerprint-Demo', //Android: Used for encryption. iOS: used for dialogue if no `localizedReason` is given.
|
||||
* clientSecret: 'o7aoOMYUbyxaD23oFAnJ' //Necessary for Android encrpytion of keys. Use random secret key.
|
||||
* disableBackup:true, //Only for Android(optional)
|
||||
* localizedFallbackTitle: 'Use Pin', //Only for iOS
|
||||
* localizedReason: 'Please authenticate' //Only for iOS
|
||||
|
@ -2,11 +2,35 @@ 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;
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Messaging
|
||||
@ -36,7 +60,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 {
|
||||
|
@ -15,6 +15,13 @@ export interface ScoreData {
|
||||
|
||||
}
|
||||
|
||||
export interface PlayerScoreData {
|
||||
/**
|
||||
* The player score.
|
||||
*/
|
||||
playerScore: number;
|
||||
}
|
||||
|
||||
export interface LeaderboardData {
|
||||
|
||||
/**
|
||||
@ -126,6 +133,13 @@ export interface Player {
|
||||
* leaderboardId: 'SomeLeaderboardId'
|
||||
* });
|
||||
*
|
||||
* // 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.'));
|
||||
@ -220,6 +234,19 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
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.
|
||||
|
@ -39,7 +39,7 @@ export class GooglePlus extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
login(options?: any): Promise<any> {
|
||||
login(options: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
export interface IAPProductOptions {
|
||||
id: string;
|
||||
alias: string;
|
||||
alias?: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@ -225,6 +225,13 @@ 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)
|
||||
*/
|
||||
@ -433,4 +440,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
|
||||
refresh(): void {
|
||||
}
|
||||
|
||||
@Cordova({ sync: true })
|
||||
manageSubscriptions(): void {}
|
||||
|
||||
}
|
||||
|
@ -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[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -196,7 +196,7 @@ export class NFC extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
makeReadyOnly(): Promise<any> {
|
||||
makeReadOnly(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
418
src/@ionic-native/plugins/purchases/index.ts
Normal file
418
src/@ionic-native/plugins/purchases/index.ts
Normal file
@ -0,0 +1,418 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name Purchases
|
||||
* @description
|
||||
* Purchases is a cross platform solution for managing in-app subscriptions. A backend is also provided via [RevenueCat](https://www.revenuecat.com)
|
||||
*
|
||||
* ## Features
|
||||
* | | RevenueCat |
|
||||
* | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
* | ✅ | Server-side receipt validation |
|
||||
* | ➡️ | [Webhooks](https://docs.revenuecat.com/docs/webhooks) - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more |
|
||||
* | 🎯 | Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web |
|
||||
* | 📊 | Analytics - automatic calculation of metrics like conversion, mrr, and churn |
|
||||
* | 📝 | [Online documentation](https://docs.revenuecat.com/docs) up to date |
|
||||
* | 🔀 | [Integrations](https://www.revenuecat.com/integrations) - over a dozen integrations to easily send purchase data where you need it |
|
||||
* | 💯 | Well maintained - [frequent releases](https://github.com/RevenueCat/purchases-ios/releases) |
|
||||
* | 📮 | Great support - [Help Center](https://docs.revenuecat.com/discuss) |
|
||||
* | 🤩 | Awesome [new features](https://trello.com/b/RZRnWRbI/revenuecat-product-roadmap) |
|
||||
*
|
||||
* ## Getting Started
|
||||
*
|
||||
* For more detailed information, you can view our complete documentation at [docs.revenuecat.com](https://docs.revenuecat.com/docs).
|
||||
*
|
||||
* @usage
|
||||
* #### 1. Get a RevenueCat API key
|
||||
*
|
||||
* Log in to the [RevenueCat dashboard](https://app.revenuecat.com) and obtain a free API key for your application.
|
||||
*
|
||||
* #### 2. Initialize the SDK
|
||||
*
|
||||
* You should only configure _Purchases_ once (usually on app launch) as soon as your app has a unique user id for your user. This can be when a user logs in if you have accounts or on launch if you can generate a random user identifier.
|
||||
*
|
||||
* ```typescript
|
||||
* import { Platform } from "@ionic/angular";
|
||||
* import { Purchases } from "@ionic-native/purchases/ngx";
|
||||
*
|
||||
* constructor(public platform: Platform, private purchases: Purchases) {
|
||||
* platform.ready().then(() => {
|
||||
* this.purchases.setDebugLogsEnabled(true); // Enable to get debug logs
|
||||
* this.purchases.setup("my_api_key", "my_app_user_id");
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* #### 3. Displaying Available Products
|
||||
*
|
||||
* _Purchases_ will automatically fetch the latest _active_ entitlements and get the product information from Apple or Google. This means when users launch your purchase screen, products will already be loaded.
|
||||
*
|
||||
* Below is an example of fetching entitlements and launching an upsell screen.
|
||||
*
|
||||
* ```typescript
|
||||
* this.purchases.getEntitlements()
|
||||
* .subscribe(entitlements => ,
|
||||
* error => );
|
||||
* ```
|
||||
*
|
||||
* #### 4. Make a purchase
|
||||
*
|
||||
* When it comes time to make a purchase, _Purchases_ has a simple method, `makePurchase`. The code sample below shows the process of purchasing a product and confirming it unlocks the "my_entitlement_identifier" content.
|
||||
*
|
||||
* ```typescript
|
||||
* this.purchases.makePurchase("product_id")
|
||||
* .subscribe(response => {
|
||||
* if (response.purchaserInfo.activeEntitlements.includes("my_entitlement_identifier")) {
|
||||
* // Unlock content
|
||||
* }
|
||||
* },
|
||||
* ({ error, userCancelled }) => // Error making purchase. You can check error.userCancelled to check if user cancelled the purchase
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* `makePurchase` handles the underlying framework interaction and automatically validates purchases with Apple and Google through our secure servers. This helps reduce in-app purchase fraud and decreases the complexity of your app. Receipt tokens are stored remotely and always kept up-to-date.
|
||||
*
|
||||
* #### 5. Get Subscription Status
|
||||
*
|
||||
* _Purchases_ makes it easy to check what active subscriptions the current user has. This can
|
||||
* be done two ways within the `.purchaserInfo` method:
|
||||
*
|
||||
* 1. Checking active Entitlements - this lets you see what entitlements ([from RevenueCat dashboard](https://app.revenuecat.com))
|
||||
* are active for the user.
|
||||
* 2. Checking the active subscriptions - this lets you see what product ids (from iTunes Connect or Play Store) are active for the user.
|
||||
*
|
||||
* ```typescript
|
||||
* this.purchases.getPurchaserInfo()
|
||||
* .subscribe(info => {
|
||||
* // Option 1: Check if user has access to entitlement (from RevenueCat dashboard)
|
||||
* const isPro =
|
||||
* info.activeEntitlements !== "undefined" &&
|
||||
* info.activeEntitlements.includes("pro");
|
||||
* // Option 2: Check if user has active subscription (from App Store Connect or Play Store)
|
||||
* const isPro =
|
||||
* info.activeSubscriptions !== "undefined" &&
|
||||
* info.activeSubscriptions.includes("my_product_identifier");
|
||||
* },
|
||||
* error => );
|
||||
* ```
|
||||
*
|
||||
* > Since the SDK updates and caches the latest PurchaserInfo when the app becomes active, the completion block in `.purchaserInfo` won't need to make a network request in most cases.
|
||||
*
|
||||
* ### Restoring Purchases
|
||||
*
|
||||
* Restoring purchases is a mechanism by which your user can restore their in-app purchases, reactivating any content that had previously been purchased from the same store account (Apple or Google).
|
||||
*
|
||||
* If two different App User IDs try to restore transactions from the same underlying store account (Apple or Google) RevenueCat will create an alias between the two App User IDs and count them as the same user going forward.
|
||||
*
|
||||
* This is a common if your app does not have accounts and is relying on RevenueCat's random App User IDs.
|
||||
*
|
||||
* ```typescript
|
||||
* this.purchases.restore()
|
||||
* .subscribe(info => {
|
||||
* //... check purchaserInfo to see if entitlement is now active
|
||||
* },
|
||||
* error => );
|
||||
* ```
|
||||
* > If you've provided your own App User ID, calling restoreTransactions could alias the logged in user to another generated App User ID that has made a purchase on the same device.
|
||||
*
|
||||
* > By default, RevenueCat will not let you reuse an App or Play Store account that already has an active subscription. If you set allowSharingAppStoreAccount = True the SDK will be permissive in accepting shared accounts, creating aliases as needed.
|
||||
*
|
||||
* > By default allowSharingAppStoreAccount is True for RevenueCat random App User IDs but must be enabled manually if you want to allow permissive sharing for your own App User IDs.
|
||||
*
|
||||
* ## Debugging
|
||||
*
|
||||
* You can enabled detailed debug logs by setting `debugLogsEnabled = true`. You can set this **before** you configure Purchases.
|
||||
*
|
||||
* ```typescript
|
||||
* this.purchases.setDebugLogsEnabled(true);
|
||||
* this.purchases.setup("my_api_key", "my_app_user_id");
|
||||
* ```
|
||||
*
|
||||
* **OS_ACTIVITY_MODE**
|
||||
* > On iOS, disabling `OS_ACTIVITY_MODE` in your XCode scheme will block debug logs from printing in the console. If you have debug logs enabled, but don't see any output, go to `Product -> Scheme -> Edit Scheme...` in Xcode and uncheck the `OS_ACTIVITY_MODE` environment variable.
|
||||
*
|
||||
* Example output:
|
||||
* ```
|
||||
* [Purchases] - DEBUG: Debug logging enabled.
|
||||
* [Purchases] - DEBUG: SDK Version - 2.0.0
|
||||
* [Purchases] - DEBUG: Initial App User ID - (null)
|
||||
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>
|
||||
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products
|
||||
* [Purchases] - DEBUG: No cached entitlements, fetching
|
||||
* [Purchases] - DEBUG: Vending purchaserInfo from cache
|
||||
* [Purchases] - DEBUG: applicationDidBecomeActive
|
||||
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products 200
|
||||
* ```
|
||||
* ## Entitlements
|
||||
*
|
||||
* An entitlement represents features or content that a user is "entitled" to. With Entitlements, you can set up your available in-app products remotely and control their availability without the need to update your app. For more information on configuring entitlements, look at our [entitlements documetation](https://docs.revenuecat.com/docs/entitlements).
|
||||
*
|
||||
* ## Sample App
|
||||
*
|
||||
* We've added an [example](https://github.com/RevenueCat/purchases-ionic-example) showing a simple example using _Purchases_ with the RevenueCat backend. Note that the pre-registered in app purchases in the demo apps are for illustration purposes only and may not be valid in App Store Connect. [Set up your own purchases](https://docs.revenuecat.com/docs/entitlements) with RevenueCat when running the example.
|
||||
*
|
||||
* #### Additional iOS Setup
|
||||
*
|
||||
* ##### Add Strip Frameworks Phase
|
||||
* The App Store, in it's infinite wisdom, still rejects fat frameworks, so we need to strip our framework before it is deployed. To do this, add the following script phase to your build.
|
||||
* 1. In Xcode, in project manager, select your app target.
|
||||
* 2. Open the `Build Phases` tab
|
||||
* 3. Add a new `Run Script`, name it `Strip Frameworks`
|
||||
* 4. Add the following command `"${PROJECT_DIR}/../../node_modules/cordova-plugin-purchases/src/ios/strip-frameworks.sh"` (quotes included)
|
||||
*
|
||||
* ![](https://media.giphy.com/media/39zTmnsW1CIrJNk5AM/giphy.gif)
|
||||
*
|
||||
* ## Next Steps
|
||||
* - Head over to our **[online documentation](https://docs.revenuecat.com/docs)** for complete setup guides
|
||||
* - If you haven't already, make sure your products are configured correctly in the RevenueCat dashboard by checking out our [guide on entitlements](https://docs.revenuecat.com/docs/entitlements)
|
||||
* - If you want to use your own user identifiers, read about [setting app user ids](https://docs.revenuecat.com/docs/user-ids)
|
||||
* - If you're moving to RevenueCat from another system, see our guide on [migrating your existing subscriptions](https://docs.revenuecat.com/docs/migrating-existing-subscriptions)
|
||||
* - Once you're ready to test your integration, you can follow our guides on [testing purchases](https://docs.revenuecat.com/docs/testing-purchases)
|
||||
*
|
||||
* ## Reporting Issues
|
||||
*
|
||||
* You can use Github Issues to report any bugs and issues with _Purchases_. Here is some advice for users that want to report an issue:
|
||||
*
|
||||
* 1. Make sure that you are using the latest version of _Purchases_. The issue that you are about to report may be already fixed in the latest master branch version: https://github.com/revenuecat/cordova-plugin-purchases/tree/master.
|
||||
* 2. Providing reproducible steps for the issue will shorten the time it takes for it to be fixed - a Gist is always welcomed!
|
||||
* 3. Since some issues are Sandbox specific, specifying what environment you encountered the issue might help.
|
||||
*
|
||||
* ## Technical Support or Questions
|
||||
*
|
||||
* If you have questions or need help integrating _Purchases_ please [contact us](https://www.revenuecat.com/contact) or email _support@revenuecat.com_ instead of opening an issue.
|
||||
*
|
||||
* ## Feature Requests
|
||||
*
|
||||
* If there is something you'd like to see included or feel anything is missing you can add a feature to our [public roadmap](https://trello.com/b/RZRnWRbI/revenuecat-product-roadmap). If the feature already exists, or you see something else you'd like, upvote it.
|
||||
*
|
||||
* ## Pricing
|
||||
*
|
||||
* _Purchases_ SDK is free to use but some features require a paid plan. You can find more about that on our website on the [pricing plan page](https://www.revenuecat.com/pricing).
|
||||
*
|
||||
* @interfaces
|
||||
* RCPurchaserInfo
|
||||
* RCProduct
|
||||
* RCMakePurchaseResponse
|
||||
* RCError
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Purchases',
|
||||
plugin: 'cordova-plugin-purchases',
|
||||
pluginRef: 'Purchases', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/RevenueCat/cordova-plugin-purchases', // the github repository URL for the plugin
|
||||
platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class Purchases extends IonicNativePlugin {
|
||||
/**
|
||||
* Sets up Purchases with your API key and an app user id.
|
||||
* @param apiKey {string} RevenueCat API Key. Needs to be a String
|
||||
* @param appUserID {string?} A unique id for identifying the user
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setup(apiKey: string, appUserID: string): void {}
|
||||
|
||||
/**
|
||||
* Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
|
||||
* If a user tries to purchase a product that is active on the current app store account, we will treat it as a restore and alias
|
||||
* the new ID with the previous id.
|
||||
* @param allowSharing {boolean} true if enabled, false to diabled
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setAllowSharingStoreAccount(allowSharing: boolean): void {}
|
||||
|
||||
/**
|
||||
* Add a dict of attribution information
|
||||
* @param data { Object.<string, any> } Attribution data from any of the attribution networks in ATTRIBUTION_NETWORKS
|
||||
* @param network {ATTRIBUTION_NETWORKS} Which network, see ATTRIBUTION_NETWORKS
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
addAttributionData(
|
||||
data: { [key: string]: any },
|
||||
network: ATTRIBUTION_NETWORKS
|
||||
): void {}
|
||||
|
||||
/**
|
||||
* Gets the map of entitlements -> offerings -> products
|
||||
*
|
||||
* @return {Observable<Map<String, Map<String, Product>>>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
getEntitlements(): Observable<Map<String, Map<String, RCProduct>>> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the product info
|
||||
* @param productIdentifiers {string[]} Array of product identifiers
|
||||
* @param type {ProductType} Optional type of products to fetch, can be inapp or subs. Subs by default
|
||||
*
|
||||
* @return {Observable<Array>} Will return an [RCError] if the products are not properly configured in RevenueCat or if there is another error retrieving them.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2,
|
||||
observable: true
|
||||
})
|
||||
getProducts(
|
||||
productIdentifiers: string[],
|
||||
type: ProductType = ProductType.SUBS
|
||||
): Observable<[RCProduct]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a purchase
|
||||
* @param productIdentifier {string} The product identifier of the product you want to purchase.
|
||||
* @param oldSkus {string[]} Optional array of skus you wish to upgrade from.
|
||||
* @param type {String} Optional type of product, can be inapp or subs. Subs by default
|
||||
*
|
||||
* @return {Observable<MakePurchaseResponse>} An [RCError] is thrown when user cancels. On error `usercancelled` will be true if user cancelled
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2,
|
||||
observable: true
|
||||
})
|
||||
makePurchase(
|
||||
productIdentifier: string,
|
||||
oldSkus: string[] = [],
|
||||
type: ProductType = ProductType.SUBS
|
||||
): Observable<RCMakePurchaseResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
restoreTransactions(): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the appUserID that is currently in placed in the SDK
|
||||
*
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAppUserID(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will alias two appUserIDs together.
|
||||
* @param newAppUserID {String} The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
createAlias(newAppUserID: string): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will identify the current user with an appUserID. Typically this would be used after a logout to identify a new user without calling configure
|
||||
* @param newAppUserID {String} The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
identify(newAppUserID: string): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
reset(): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current purchaser info. This call will return the cached purchaser info unless the cache is stale, in which case,
|
||||
* it will make a network call to retrieve it from the servers.
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
|
||||
*/
|
||||
@Cordova({ observable: true })
|
||||
getPurchaserInfo(): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an observable that can be used to receive updates on the purchaser info
|
||||
*
|
||||
* @return {Observable<PurchaserInfo>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onPurchaserInfoUpdated',
|
||||
element: 'window'
|
||||
})
|
||||
onPurchaserInfoUpdated(): Observable<RCPurchaserInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/Disables debugs logs
|
||||
* @param enabled {boolean} true to enable debug logs, false to disable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setDebugLogsEnabled(enabled: boolean): void {}
|
||||
}
|
||||
|
||||
export enum ProductType {
|
||||
SUBS = 'subs',
|
||||
INAPP = 'inapp'
|
||||
}
|
||||
|
||||
export enum ATTRIBUTION_NETWORKS {
|
||||
APPLE_SEARCH_ADS = 0,
|
||||
ADJUST = 1,
|
||||
APPSFLYER = 2,
|
||||
BRANCH = 3,
|
||||
TENJIN = 4
|
||||
}
|
||||
|
||||
export interface RCProduct {
|
||||
identifier: string;
|
||||
description: string;
|
||||
title: string;
|
||||
price: number;
|
||||
price_string: string;
|
||||
intro_price?: string;
|
||||
intro_price_string?: string;
|
||||
intro_price_period?: string;
|
||||
intro_price_cycles?: number;
|
||||
currency_code: string;
|
||||
}
|
||||
|
||||
export interface RCPurchaserInfo {
|
||||
activeEntitlements: string[];
|
||||
activeSubscriptions: string[];
|
||||
allPurchasedProductIdentifiers: string[];
|
||||
latestExpirationDate?: string;
|
||||
allExpirationDates: { [key: string]: string | null };
|
||||
expirationsForActiveEntitlements: { [key: string]: string | null };
|
||||
}
|
||||
|
||||
export interface RCMakePurchaseResponse {
|
||||
productIdentifier: string;
|
||||
purchaserInfo: RCPurchaserInfo;
|
||||
}
|
||||
|
||||
export interface RCError {
|
||||
code: number;
|
||||
message: string;
|
||||
underlyingErrorMessage?: string;
|
||||
}
|
139
src/@ionic-native/plugins/spotify-auth/index.ts
Normal file
139
src/@ionic-native/plugins/spotify-auth/index.ts
Normal file
@ -0,0 +1,139 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* OAuth configuration data.
|
||||
*/
|
||||
export interface Config {
|
||||
/** The client ID as per the Spotify dev console. */
|
||||
clientId: string;
|
||||
|
||||
/** The redirect URI as entered in the Spotify dev console. */
|
||||
redirectUrl: string;
|
||||
|
||||
/**
|
||||
* Safety margin time (in milliseconds) for the token refresh.
|
||||
*
|
||||
* The plugin applies a safety margin to the token lifetime in order
|
||||
* to give the token user enough time to perform all operations needed.
|
||||
*
|
||||
* Otherwise the plugin might hand out a token that is already expired
|
||||
* before it could ever be used.
|
||||
*
|
||||
* The safety margin defaults to 30s.
|
||||
*/
|
||||
refreshSafetyMargin?: number;
|
||||
|
||||
/** Requested OAuth scopes. */
|
||||
scopes: string[];
|
||||
|
||||
/** The token exchange URL. */
|
||||
tokenExchangeUrl: string;
|
||||
|
||||
/** The token refresh URL. */
|
||||
tokenRefreshUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The authorization data.
|
||||
*/
|
||||
export interface AuthorizationData {
|
||||
/** A valid access token. */
|
||||
accessToken: string;
|
||||
|
||||
/** The encrypted refresh token. */
|
||||
encryptedRefreshToken: string;
|
||||
|
||||
/** The date (from UTC, in milliseconds) when the given access token expires. */
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Spotify Auth
|
||||
* @description
|
||||
* Cordova plugin for authenticating with Spotify
|
||||
* > https://github.com/Festify/cordova-spotify-oauth
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SpotifyAuth } from '@ionic-native/spotify-auth';
|
||||
*
|
||||
* // [...]
|
||||
*
|
||||
* constructor(private spotifyAuth: SpotifyAuth) { }
|
||||
*
|
||||
* // [...]
|
||||
*
|
||||
* const config = {
|
||||
* clientId: "<SPOTIFY CLIENT ID>",
|
||||
* redirectUrl: "<REDIRECT URL, MUST MATCH WITH AUTH ENDPOINT AND SPOTIFY DEV CONSOLE>",
|
||||
* scopes: ["streaming"], // see Spotify Dev console for all scopes
|
||||
* tokenExchangeUrl: "<URL OF TOKEN EXCHANGE HTTP ENDPOINT>",
|
||||
* tokenRefreshUrl: "<URL OF TOKEN REFRESH HTTP ENDPOINT>",
|
||||
* };
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.spotifyAuth.authorize(config)
|
||||
* .then(({ accessToken, expiresAt }) => {
|
||||
* console.log(`Got an access token, its ${accessToken}!`);
|
||||
* console.log(`Its going to expire in ${expiresAt - Date.now()}ms.`);
|
||||
* });
|
||||
*
|
||||
* // [...]
|
||||
*
|
||||
* this.spotifyAuth.forget().then(() => console.log("We're logged out!"));
|
||||
*
|
||||
* // [...]
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SpotifyAuth',
|
||||
plugin: 'cordova-spotify-oauth',
|
||||
pluginRef: 'cordova.plugins.spotifyAuth',
|
||||
repo: 'https://github.com/Festify/cordova-spotify-oauth',
|
||||
install: 'ionic cordova plugin add cordova-spotify-oauth --variable LOCAL_STORAGE_KEY="SpotifyOAuthData"',
|
||||
installVariables: ['LOCAL_STORAGE_KEY'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SpotifyAuth extends IonicNativePlugin {
|
||||
/**
|
||||
* Obtains valid authorization data.
|
||||
*
|
||||
* This method performs the necessary steps in order to obtain a valid
|
||||
* access token. It performs the OAuth dance prompting the user to log in,
|
||||
* exchanges the obtained authorization code for an access and a refresh
|
||||
* token, caches those, and returns both to the developer.
|
||||
*
|
||||
* When it is invoked again, it will first check whether the cached access
|
||||
* token is still valid (including a configurable safety margin) and the
|
||||
* scopes equal, and return the token directly if that is the case. Otherwise,
|
||||
* the method will transparently refresh the token (or obtain a new one if
|
||||
* the scopes changed) and return that.
|
||||
*
|
||||
* Bottom line - always call this if you need a valid access token in your code.
|
||||
*
|
||||
* @param cfg {Config} configuration
|
||||
* @return {Promise<AuthorizationData>}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: false
|
||||
})
|
||||
authorize(cfg: Config): Promise<AuthorizationData> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all cached data so that `authorize` performs the full
|
||||
* oauth dance again.
|
||||
*
|
||||
* This is akin to a "logout".
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
forget(): void { }
|
||||
}
|
Loading…
Reference in New Issue
Block a user