mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
283 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb7d3ef3e0 | ||
|
|
5e83a09056 | ||
|
|
b85393de89 | ||
|
|
68c535fd79 | ||
|
|
1c09ee1fbc | ||
|
|
8b921165bb | ||
|
|
0c837de499 | ||
|
|
a44500d206 | ||
|
|
e063613c8c | ||
|
|
416071a5a1 | ||
|
|
93fdb7eabb | ||
|
|
466437a683 | ||
|
|
a34723b53c | ||
|
|
b9bd5100a2 | ||
|
|
51bafccf38 | ||
|
|
c3127d35bb | ||
|
|
1322c1b089 | ||
|
|
9bf7895386 | ||
|
|
538dcb98eb | ||
|
|
3da0efe38e | ||
|
|
b983de2145 | ||
|
|
9f98f8ef46 | ||
|
|
3e2964b385 | ||
|
|
77ab2c21da | ||
|
|
94025a7fd2 | ||
|
|
8c021bcaa0 | ||
|
|
da7a3707fa | ||
|
|
cb293639bc | ||
|
|
16f0712462 | ||
|
|
e9b2b93486 | ||
|
|
a8258ec998 | ||
|
|
09747cd746 | ||
|
|
2f89ae0e84 | ||
|
|
ac748abf78 | ||
|
|
1279114b73 | ||
|
|
7c30718369 | ||
|
|
9c75a06131 | ||
|
|
1e38a6c005 | ||
|
|
23639ee859 | ||
|
|
be20c51996 | ||
|
|
1615b74065 | ||
|
|
5638f90783 | ||
|
|
47b6164e99 | ||
|
|
229f5509e9 | ||
|
|
70c15c31ca | ||
|
|
a98ccc726f | ||
|
|
538ebfe9fe | ||
|
|
8e98481609 | ||
|
|
0ec46b03b5 | ||
|
|
f10f152d2c | ||
|
|
d746a98ef4 | ||
|
|
dbf95ea4bd | ||
|
|
911537b61b | ||
|
|
db55342329 | ||
|
|
d54ce83c8f | ||
|
|
2e926f4a94 | ||
|
|
292a9f08e9 | ||
|
|
b2cd106aae | ||
|
|
ab681cccbe | ||
|
|
9008aa264b | ||
|
|
33ca56a151 | ||
|
|
d8892e195b | ||
|
|
0ab14a085e | ||
|
|
a88cf7034b | ||
|
|
c44071d117 | ||
|
|
fb275e0d9f | ||
|
|
5c7d7ac527 | ||
|
|
1134ac96b6 | ||
|
|
e902856089 | ||
|
|
67adb23a14 | ||
|
|
028a568515 | ||
|
|
7a8d30f4e1 | ||
|
|
9541009742 | ||
|
|
9dee2fbc0c | ||
|
|
60b9c69763 | ||
|
|
b98fa28b4b | ||
|
|
603aa9f6d2 | ||
|
|
f4fa8c31f0 | ||
|
|
8e787fdd5f | ||
|
|
c5ec7c33b5 | ||
|
|
c6dbf343fb | ||
|
|
fa311e6a7c | ||
|
|
04347c3df8 | ||
|
|
8adb36e2a0 | ||
|
|
c700c31127 | ||
|
|
5981622f3a | ||
|
|
77d6308bca | ||
|
|
92e0bb55c3 | ||
|
|
452aa5d8c9 | ||
|
|
2ddb8be775 | ||
|
|
ebf07161b6 | ||
|
|
6ddd2aa184 | ||
|
|
9974a1fbd8 | ||
|
|
67edb835f2 | ||
|
|
5b6cb6e19f | ||
|
|
9a5a62bc3a | ||
|
|
d192dee1ee | ||
|
|
0d6997cbdd | ||
|
|
49325e8b93 | ||
|
|
de07df6f20 | ||
|
|
ca60c5b912 | ||
|
|
54d1a9891b | ||
|
|
2c57bc965c | ||
|
|
d62779a2a6 | ||
|
|
009a20608e | ||
|
|
ca14bf6a75 | ||
|
|
49fe24dee2 | ||
|
|
d9d89341d2 | ||
|
|
bbf75bcbd7 | ||
|
|
9441928884 | ||
|
|
8eb656cce8 | ||
|
|
bf0486cb8b | ||
|
|
e681761f56 | ||
|
|
84ec3fa8d2 | ||
|
|
c618ceb693 | ||
|
|
46a9b6d50d | ||
|
|
44fe04bbbd | ||
|
|
3385c1b6dc | ||
|
|
a1b0f885a7 | ||
|
|
56e8eaeb5d | ||
|
|
ba77fd70c3 | ||
|
|
1841220359 | ||
|
|
c44fb75adc | ||
|
|
ad6badef1f | ||
|
|
7bcf1bfc74 | ||
|
|
0c36988544 | ||
|
|
71e49da8ad | ||
|
|
c28df732d5 | ||
|
|
d5dfdf83f3 | ||
|
|
e42f4d0079 | ||
|
|
cabe327e9b | ||
|
|
98d22a3079 | ||
|
|
3fffab6d6c | ||
|
|
60defd3e50 | ||
|
|
c79ffc4434 | ||
|
|
ec5e27be4b | ||
|
|
cf347cd369 | ||
|
|
28f316e408 | ||
|
|
9986e0d0b3 | ||
|
|
8b809de568 | ||
|
|
fa1f718412 | ||
|
|
3fabc4d72c | ||
|
|
3a11d290e5 | ||
|
|
700fb47b73 | ||
|
|
61dc8aa18e | ||
|
|
c3f92e92c2 | ||
|
|
54d2c46742 | ||
|
|
114a74d3ba | ||
|
|
b2d29dbde5 | ||
|
|
36bfe38a4c | ||
|
|
d4e2c10006 | ||
|
|
ae6a3cda7a | ||
|
|
d5ac89996f | ||
|
|
a4216fd8ca | ||
|
|
a38adf53c3 | ||
|
|
bd7ebaee3b | ||
|
|
d92fb1da8b | ||
|
|
acb7cd862d | ||
|
|
1976c38dc7 | ||
|
|
e522a25968 | ||
|
|
ad84e758be | ||
|
|
427527a129 | ||
|
|
3ba72e9f15 | ||
|
|
a693740f1a | ||
|
|
2a98be594a | ||
|
|
0787f69884 | ||
|
|
dadaf5831e | ||
|
|
2f9c5e6674 | ||
|
|
d02688971d | ||
|
|
95ca373e10 | ||
|
|
4abb6ec78e | ||
|
|
59a382d6df | ||
|
|
80d9fe2211 | ||
|
|
8b48d6c275 | ||
|
|
585d4ff37b | ||
|
|
6ba1d4908b | ||
|
|
3a8e958684 | ||
|
|
1358411b80 | ||
|
|
e26783b8c6 | ||
|
|
fff1dc45e2 | ||
|
|
4aec187e8c | ||
|
|
d9188446a0 | ||
|
|
7ae6e10375 | ||
|
|
ea53a1923a | ||
|
|
f45f34442a | ||
|
|
49de11e761 | ||
|
|
c29aaca857 | ||
|
|
9241339b2c | ||
|
|
9c8b0ceda6 | ||
|
|
78c226e83d | ||
|
|
ef148d2a68 | ||
|
|
7fa2f7f364 | ||
|
|
5ef96d4558 | ||
|
|
e39810b7d0 | ||
|
|
f211da7280 | ||
|
|
c1398eb54b | ||
|
|
1e1aaad7aa | ||
|
|
54ef50178b | ||
|
|
6f7171d26b | ||
|
|
cf75a53438 | ||
|
|
8ab1d13fb3 | ||
|
|
dd250a6d17 | ||
|
|
9082c5efbf | ||
|
|
b19f6d1ccd | ||
|
|
abc90f2e6a | ||
|
|
717c1438c4 | ||
|
|
67e0713f18 | ||
|
|
693d344dea | ||
|
|
914d1442b6 | ||
|
|
c4acbfe095 | ||
|
|
a26b8879f3 | ||
|
|
2e82320b4c | ||
|
|
e6700a360e | ||
|
|
3fdc4a8acd | ||
|
|
82e7bd65a6 | ||
|
|
9ab73602af | ||
|
|
9f557bee8a | ||
|
|
9c8259f659 | ||
|
|
db99482157 | ||
|
|
bb321057d2 | ||
|
|
853f425383 | ||
|
|
7cb3bc7542 | ||
|
|
3da2831779 | ||
|
|
1072ab115b | ||
|
|
efb2ee7880 | ||
|
|
5b98a80828 | ||
|
|
785646800b | ||
|
|
8d6c2dfb9a | ||
|
|
b7a562053a | ||
|
|
d76ad8803e | ||
|
|
13216d1f04 | ||
|
|
00e68ca990 | ||
|
|
c987a06f91 | ||
|
|
87049e9582 | ||
|
|
bab2971c58 | ||
|
|
fd0ac37ffc | ||
|
|
b64d61828a | ||
|
|
08d66ead9b | ||
|
|
9bd8997a31 | ||
|
|
156328c9de | ||
|
|
93696d53f7 | ||
|
|
78b3ec5b1f | ||
|
|
f07431a14c | ||
|
|
8439faf6b8 | ||
|
|
51ab03d097 | ||
|
|
abd910de67 | ||
|
|
24184a5a6a | ||
|
|
0b39ff8b7d | ||
|
|
6ad54ecf86 | ||
|
|
3dd863cb49 | ||
|
|
b719a0372b | ||
|
|
bdef1daba5 | ||
|
|
695099b2b0 | ||
|
|
28f4680575 | ||
|
|
40a7b138e2 | ||
|
|
fa624df1da | ||
|
|
5577c51dbc | ||
|
|
1ab76ae693 | ||
|
|
98bd5cee38 | ||
|
|
f6903cdcdf | ||
|
|
b5cc14c546 | ||
|
|
8988fad713 | ||
|
|
7b8b2d7136 | ||
|
|
dd2ccef0c7 | ||
|
|
e46f10878e | ||
|
|
2dacec0cb5 | ||
|
|
0c5fadee86 | ||
|
|
01b30c68e1 | ||
|
|
e5b0365d0c | ||
|
|
867400d1ac | ||
|
|
88f6ecf250 | ||
|
|
e6beaa49a4 | ||
|
|
fa03fa544f | ||
|
|
c22747fa2e | ||
|
|
fd8f80e92b | ||
|
|
17f2fcb829 | ||
|
|
6a412155a3 | ||
|
|
489d860264 | ||
|
|
ca43394185 | ||
|
|
b3eed47cbb | ||
|
|
71916a85dd | ||
|
|
62d8645468 | ||
|
|
970eb755b6 |
327
CHANGELOG.md
327
CHANGELOG.md
@@ -1,3 +1,288 @@
|
||||
<a name="2.4.1"></a>
|
||||
## [2.4.1](https://github.com/driftyco/ionic-native/compare/v2.4.0...v2.4.1) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **screen-orientation:** lockOrientation returns a promise ([1c09ee1](https://github.com/driftyco/ionic-native/commit/1c09ee1)), closes [#939](https://github.com/driftyco/ionic-native/issues/939)
|
||||
|
||||
|
||||
|
||||
<a name="2.4.0"></a>
|
||||
# [2.4.0](https://github.com/driftyco/ionic-native/compare/v2.3.3...v2.4.0) (2017-01-24)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.3"></a>
|
||||
## [2.3.3](https://github.com/driftyco/ionic-native/compare/v2.3.2...v2.3.3) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** fix event listeners ([416071a](https://github.com/driftyco/ionic-native/commit/416071a)), closes [#999](https://github.com/driftyco/ionic-native/issues/999)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pinterest:** add pinterest plugin ([466437a](https://github.com/driftyco/ionic-native/commit/466437a))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.2"></a>
|
||||
## [2.3.2](https://github.com/driftyco/ionic-native/compare/v2.3.1...v2.3.2) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** fix GoogleMapsLaLngBounds ([c3127d3](https://github.com/driftyco/ionic-native/commit/c3127d3)), closes [#972](https://github.com/driftyco/ionic-native/issues/972)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.1"></a>
|
||||
## [2.3.1](https://github.com/driftyco/ionic-native/compare/v2.3.0...v2.3.1) (2017-01-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add clearAllNotifications() ([8c021bc](https://github.com/driftyco/ionic-native/commit/8c021bc))
|
||||
* **battery-status:** add missing pluginRef ([3da0efe](https://github.com/driftyco/ionic-native/commit/3da0efe))
|
||||
* **core:** fix exception in CordovaProperty ([#998](https://github.com/driftyco/ionic-native/issues/998)) ([cb29363](https://github.com/driftyco/ionic-native/commit/cb29363)), closes [#992](https://github.com/driftyco/ionic-native/issues/992)
|
||||
* **core:** fix plugin check ([da7a370](https://github.com/driftyco/ionic-native/commit/da7a370))
|
||||
* **plugin:** adds subscribe() and unsubscribe() ([94025a7](https://github.com/driftyco/ionic-native/commit/94025a7))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** add PluginConfig interface ([b983de2](https://github.com/driftyco/ionic-native/commit/b983de2)), closes [#996](https://github.com/driftyco/ionic-native/issues/996)
|
||||
* **google-maps:** add base class functions ([#993](https://github.com/driftyco/ionic-native/issues/993)) ([9f98f8e](https://github.com/driftyco/ionic-native/commit/9f98f8e))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.0"></a>
|
||||
# [2.3.0](https://github.com/driftyco/ionic-native/compare/v2.2.17...v2.3.0) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **native-geocoder:** fix callback order ([dbf95ea](https://github.com/driftyco/ionic-native/commit/dbf95ea))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **backlight:** add Backlight plugin ([#973](https://github.com/driftyco/ionic-native/issues/973)) ([1279114](https://github.com/driftyco/ionic-native/commit/1279114))
|
||||
* **broadcaster:** add Broadcaster plugin ([#877](https://github.com/driftyco/ionic-native/issues/877)) ([1e38a6c](https://github.com/driftyco/ionic-native/commit/1e38a6c))
|
||||
* **fingerprint-aio:** add cordova-plugin-fingerprint-aio ([#845](https://github.com/driftyco/ionic-native/issues/845)) ([1615b74](https://github.com/driftyco/ionic-native/commit/1615b74))
|
||||
* **firebase:** add firebase plugin ([#914](https://github.com/driftyco/ionic-native/issues/914)) ([8e98481](https://github.com/driftyco/ionic-native/commit/8e98481)), closes [#608](https://github.com/driftyco/ionic-native/issues/608)
|
||||
* **launch-review:** add LaunchReview plugin ([#949](https://github.com/driftyco/ionic-native/issues/949)) ([9c75a06](https://github.com/driftyco/ionic-native/commit/9c75a06))
|
||||
* **nativegeocoder:** add NativeGeocoder plugin ([#800](https://github.com/driftyco/ionic-native/issues/800)) ([911537b](https://github.com/driftyco/ionic-native/commit/911537b))
|
||||
* **navigationbar:** add NavigationBar plugin ([#826](https://github.com/driftyco/ionic-native/issues/826)) ([70c15c3](https://github.com/driftyco/ionic-native/commit/70c15c3))
|
||||
* **rollbar:** add Rollbar plugin ([#832](https://github.com/driftyco/ionic-native/issues/832)) ([229f550](https://github.com/driftyco/ionic-native/commit/229f550))
|
||||
* **serial:** add Serial plugin ([#952](https://github.com/driftyco/ionic-native/issues/952)) ([ac748ab](https://github.com/driftyco/ionic-native/commit/ac748ab))
|
||||
* **speech-recognition:** add SpeechRecognition plugin ([#897](https://github.com/driftyco/ionic-native/issues/897)) ([7c30718](https://github.com/driftyco/ionic-native/commit/7c30718))
|
||||
* **stripe:** add stripe plugin ([#913](https://github.com/driftyco/ionic-native/issues/913)) ([0ec46b0](https://github.com/driftyco/ionic-native/commit/0ec46b0))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.17"></a>
|
||||
## [2.2.17](https://github.com/driftyco/ionic-native/compare/v2.2.16...v2.2.17) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **app-rate:** onRateDialogShow callback ([#985](https://github.com/driftyco/ionic-native/issues/985)) ([ab681cc](https://github.com/driftyco/ionic-native/commit/ab681cc))
|
||||
* **core:** increase deviceready timeout for sanity ([0ab14a0](https://github.com/driftyco/ionic-native/commit/0ab14a0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **barcodescanner:** add missing options ([#966](https://github.com/driftyco/ionic-native/issues/966)) ([e902856](https://github.com/driftyco/ionic-native/commit/e902856)), closes [#965](https://github.com/driftyco/ionic-native/issues/965)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.16"></a>
|
||||
## [2.2.16](https://github.com/driftyco/ionic-native/compare/v2.2.15...v2.2.16) (2017-01-11)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.15"></a>
|
||||
## [2.2.15](https://github.com/driftyco/ionic-native/compare/v2.2.14...v2.2.15) (2017-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **apprate:** captialize URL in storeAppURL property ([b98fa28](https://github.com/driftyco/ionic-native/commit/b98fa28))
|
||||
* **ble:** stopScan takes no args when used as clear function ([#944](https://github.com/driftyco/ionic-native/issues/944)) ([6ddd2aa](https://github.com/driftyco/ionic-native/commit/6ddd2aa))
|
||||
* **onesignal:** OSNotification.app_id is optional ([#946](https://github.com/driftyco/ionic-native/issues/946)) ([ebf0716](https://github.com/driftyco/ionic-native/commit/ebf0716))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.14"></a>
|
||||
## [2.2.14](https://github.com/driftyco/ionic-native/compare/v2.2.13...v2.2.14) (2017-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** fix startTrackerWithId when interval is not provided ([49fe24d](https://github.com/driftyco/ionic-native/commit/49fe24d))
|
||||
* **google-plus:** fixes login without options ([ca14bf6](https://github.com/driftyco/ionic-native/commit/ca14bf6)), closes [#932](https://github.com/driftyco/ionic-native/issues/932)
|
||||
* **inappbrowser:** fix insertCSS method name ([de07df6](https://github.com/driftyco/ionic-native/commit/de07df6)), closes [#921](https://github.com/driftyco/ionic-native/issues/921)
|
||||
* **mixpanel:** fix issue when not passing eventProperties ([#927](https://github.com/driftyco/ionic-native/issues/927)) ([bbf75bc](https://github.com/driftyco/ionic-native/commit/bbf75bc))
|
||||
* **nfc:** add missing param for addMimeTypeListener ([#937](https://github.com/driftyco/ionic-native/issues/937)) ([ca60c5b](https://github.com/driftyco/ionic-native/commit/ca60c5b))
|
||||
* **push:** fix typing for additionalData ([0d6997c](https://github.com/driftyco/ionic-native/commit/0d6997c)), closes [#868](https://github.com/driftyco/ionic-native/issues/868)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add altitudeAccuracy into response typings ([#922](https://github.com/driftyco/ionic-native/issues/922)) ([8eb656c](https://github.com/driftyco/ionic-native/commit/8eb656c))
|
||||
* **market:** add search method, return promises ([d62779a](https://github.com/driftyco/ionic-native/commit/d62779a))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.13"></a>
|
||||
## [2.2.13](https://github.com/driftyco/ionic-native/compare/v2.2.12...v2.2.13) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob:** add adId prop to AdMobOptions ([d5dfdf8](https://github.com/driftyco/ionic-native/commit/d5dfdf8))
|
||||
* **background-mode:** isEnabled and isActive return booleans ([ba77fd7](https://github.com/driftyco/ionic-native/commit/ba77fd7)), closes [#908](https://github.com/driftyco/ionic-native/issues/908)
|
||||
* **diagnostic:** add missing types ([1841220](https://github.com/driftyco/ionic-native/commit/1841220)), closes [#905](https://github.com/driftyco/ionic-native/issues/905)
|
||||
* **diagnostic:** add permissionStatus types ([#890](https://github.com/driftyco/ionic-native/issues/890)) ([3385c1b](https://github.com/driftyco/ionic-native/commit/3385c1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-fingerprint-auth:** update to v1.2.1 ([#910](https://github.com/driftyco/ionic-native/issues/910)) ([a1b0f88](https://github.com/driftyco/ionic-native/commit/a1b0f88))
|
||||
* **nfc:** add new functions ([#853](https://github.com/driftyco/ionic-native/issues/853)) ([c44fb75](https://github.com/driftyco/ionic-native/commit/c44fb75))
|
||||
* **onesignal:** improve typings ([#888](https://github.com/driftyco/ionic-native/issues/888)) ([56e8eae](https://github.com/driftyco/ionic-native/commit/56e8eae))
|
||||
* **sim:** add new methods ([#894](https://github.com/driftyco/ionic-native/issues/894)) ([0c36988](https://github.com/driftyco/ionic-native/commit/0c36988))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.12"></a>
|
||||
## [2.2.12](https://github.com/driftyco/ionic-native/compare/v2.2.11...v2.2.12) (2016-12-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **camera-preview:** parameter size is optional ([#871](https://github.com/driftyco/ionic-native/issues/871)) ([61dc8aa](https://github.com/driftyco/ionic-native/commit/61dc8aa))
|
||||
* **diagnostic:** permissionStatus gets values from plugin in runtime ([9986e0d](https://github.com/driftyco/ionic-native/commit/9986e0d)), closes [#872](https://github.com/driftyco/ionic-native/issues/872)
|
||||
* **network:** update API ([ec5e27b](https://github.com/driftyco/ionic-native/commit/ec5e27b))
|
||||
* **sms:** fix callback index when omitting options param ([114a74d](https://github.com/driftyco/ionic-native/commit/114a74d)), closes [#858](https://github.com/driftyco/ionic-native/issues/858)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **admob:** update api and docs ([6ba1d49](https://github.com/driftyco/ionic-native/commit/6ba1d49))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.11"></a>
|
||||
## [2.2.11](https://github.com/driftyco/ionic-native/compare/v2.2.10...v2.2.11) (2016-12-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cordova-property:** fixes static properties of classes ([7ae6e10](https://github.com/driftyco/ionic-native/commit/7ae6e10))
|
||||
* **device:** fixes device plugin ([d918844](https://github.com/driftyco/ionic-native/commit/d918844))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* device: device property no longer exists
|
||||
|
||||
|
||||
|
||||
<a name="2.2.10"></a>
|
||||
## [2.2.10](https://github.com/driftyco/ionic-native/compare/v2.2.9...v2.2.10) (2016-12-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **contacts:** fix few bugs in Contacts ([#846](https://github.com/driftyco/ionic-native/issues/846)) ([b19f6d1](https://github.com/driftyco/ionic-native/commit/b19f6d1))
|
||||
* **sqlite:** add static constructor, and fix resolve type ([#697](https://github.com/driftyco/ionic-native/issues/697)) ([9082c5e](https://github.com/driftyco/ionic-native/commit/9082c5e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **actionsheet:** add ActionSheetOptions interface ([f211da7](https://github.com/driftyco/ionic-native/commit/f211da7))
|
||||
* **googlemap:** add disableAutoPan to GoogleMapsMarkerOptions ([cf75a53](https://github.com/driftyco/ionic-native/commit/cf75a53)), closes [#844](https://github.com/driftyco/ionic-native/issues/844)
|
||||
* **googlemaps:** add markerClick and infoClick to MarkerOptions ([6f7171d](https://github.com/driftyco/ionic-native/commit/6f7171d))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.9"></a>
|
||||
## [2.2.9](https://github.com/driftyco/ionic-native/compare/v2.2.8...v2.2.9) (2016-12-01)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.8"></a>
|
||||
## [2.2.8](https://github.com/driftyco/ionic-native/compare/v2.2.7...v2.2.8) (2016-12-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add return ([3fdc4a8](https://github.com/driftyco/ionic-native/commit/3fdc4a8))
|
||||
* **card-io:** fix typo in options ([e6700a3](https://github.com/driftyco/ionic-native/commit/e6700a3))
|
||||
* **globalization:** add missing parameter to numberToString function ([1072ab1](https://github.com/driftyco/ionic-native/commit/1072ab1)), closes [#835](https://github.com/driftyco/ionic-native/issues/835)
|
||||
* **headercolor:** solve typo in usage and chore ([bab2971](https://github.com/driftyco/ionic-native/commit/bab2971))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **card-io:** add typing for response ([2e82320](https://github.com/driftyco/ionic-native/commit/2e82320))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.7"></a>
|
||||
## [2.2.7](https://github.com/driftyco/ionic-native/compare/v2.2.5...v2.2.7) (2016-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **3dTouch:** fixes onHomeIconPressed ([#813](https://github.com/driftyco/ionic-native/issues/813)) ([695099b](https://github.com/driftyco/ionic-native/commit/695099b))
|
||||
* **camera-preview:** formatting. Closes [#790](https://github.com/driftyco/ionic-native/issues/790) ([5577c51](https://github.com/driftyco/ionic-native/commit/5577c51))
|
||||
* **datepicker:** fix allowOldDates option ([#761](https://github.com/driftyco/ionic-native/issues/761)) ([fa03fa5](https://github.com/driftyco/ionic-native/commit/fa03fa5))
|
||||
* **diagnostics:** fix [#776](https://github.com/driftyco/ionic-native/issues/776) ([#777](https://github.com/driftyco/ionic-native/issues/777)) ([01b30c6](https://github.com/driftyco/ionic-native/commit/01b30c6))
|
||||
* **file:** correct writeFile flags ([9bd8997](https://github.com/driftyco/ionic-native/commit/9bd8997)), closes [#789](https://github.com/driftyco/ionic-native/issues/789)
|
||||
* **googlemap:** fix typoe googledesic to geodesic ([78b3ec5](https://github.com/driftyco/ionic-native/commit/78b3ec5)), closes [#765](https://github.com/driftyco/ionic-native/issues/765)
|
||||
* **native-audio:** completeCallback is optional on play method ([b719a03](https://github.com/driftyco/ionic-native/commit/b719a03)), closes [#792](https://github.com/driftyco/ionic-native/issues/792)
|
||||
* **nfc:** don't bind to name field, fix [#740](https://github.com/driftyco/ionic-native/issues/740) ([#749](https://github.com/driftyco/ionic-native/issues/749)) ([ca43394](https://github.com/driftyco/ionic-native/commit/ca43394))
|
||||
* **plugin:** don't bind to name field. Fixes [#740](https://github.com/driftyco/ionic-native/issues/740) ([71916a8](https://github.com/driftyco/ionic-native/commit/71916a8))
|
||||
* **video-player:** scalingMode is number ([f07431a](https://github.com/driftyco/ionic-native/commit/f07431a)), closes [#774](https://github.com/driftyco/ionic-native/issues/774)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **camera-preview:** add disable method ([6ad54ec](https://github.com/driftyco/ionic-native/commit/6ad54ec))
|
||||
* **google-analytics:** new interval period parameter ([abd910d](https://github.com/driftyco/ionic-native/commit/abd910d)), closes [#816](https://github.com/driftyco/ionic-native/issues/816)
|
||||
* **google-map:** add get and set methods to Marker class ([51ab03d](https://github.com/driftyco/ionic-native/commit/51ab03d)), closes [#798](https://github.com/driftyco/ionic-native/issues/798)
|
||||
* **headercolor:** add HeaderColor plugin ([93696d5](https://github.com/driftyco/ionic-native/commit/93696d5)), closes [#760](https://github.com/driftyco/ionic-native/issues/760)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.5"></a>
|
||||
## [2.2.5](https://github.com/driftyco/ionic-native/compare/v2.2.4...v2.2.5) (2016-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **3dtouch:** add missing property ([#739](https://github.com/driftyco/ionic-native/issues/739)) ([757d096](https://github.com/driftyco/ionic-native/commit/757d096))
|
||||
* **geolocation:** fix watchPosition return type ([d5310b0](https://github.com/driftyco/ionic-native/commit/d5310b0)), closes [#741](https://github.com/driftyco/ionic-native/issues/741)
|
||||
* **nfc:** fix Ndef class ([ac181c5](https://github.com/driftyco/ionic-native/commit/ac181c5)), closes [#713](https://github.com/driftyco/ionic-native/issues/713)
|
||||
* **sqlite:** check if plugin exists before opening database ([6f47371](https://github.com/driftyco/ionic-native/commit/6f47371))
|
||||
* **sqlite:** check if plugin exists before opening database ([c98b4f4](https://github.com/driftyco/ionic-native/commit/c98b4f4))
|
||||
* **sqlite:** fix callback issue with transaction method ([a72cd59](https://github.com/driftyco/ionic-native/commit/a72cd59)), closes [#732](https://github.com/driftyco/ionic-native/issues/732)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **diagnostic:** add missing functions ([eb03de9](https://github.com/driftyco/ionic-native/commit/eb03de9)), closes [#743](https://github.com/driftyco/ionic-native/issues/743)
|
||||
* **filepath:** add cordova-plugin-filepath ([#714](https://github.com/driftyco/ionic-native/issues/714)) ([0660a3b](https://github.com/driftyco/ionic-native/commit/0660a3b))
|
||||
* **plugins:** add name field ([9677656](https://github.com/driftyco/ionic-native/commit/9677656))
|
||||
* **sms:** add hasPermission method ([8fbf1f2](https://github.com/driftyco/ionic-native/commit/8fbf1f2)), closes [#721](https://github.com/driftyco/ionic-native/issues/721)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.4"></a>
|
||||
## [2.2.4](https://github.com/driftyco/ionic-native/compare/v2.2.3...v2.2.4) (2016-10-15)
|
||||
|
||||
@@ -70,7 +355,6 @@
|
||||
|
||||
* **native-transitions:** add missing interface properties ([35c8bbd](https://github.com/driftyco/ionic-native/commit/35c8bbd))
|
||||
* **onesignal:** update to match latest api ([#671](https://github.com/driftyco/ionic-native/issues/671)) ([7c6e6d8](https://github.com/driftyco/ionic-native/commit/7c6e6d8)), closes [#667](https://github.com/driftyco/ionic-native/issues/667)
|
||||
* **thmeable-browser:** fix the name of the plugin ([#663](https://github.com/driftyco/ionic-native/issues/663)) ([1368175](https://github.com/driftyco/ionic-native/commit/1368175))
|
||||
|
||||
|
||||
### Features
|
||||
@@ -80,23 +364,15 @@
|
||||
|
||||
|
||||
<a name="2.1.9"></a>
|
||||
## [2.1.9](https://github.com/driftyco/ionic-native/compare/v2.1.8...v2.1.9) (2016-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **paypal:** add optional details param to paypalpayment ([7200845](https://github.com/driftyco/ionic-native/commit/7200845))
|
||||
* **paypal:** problems with selection of PayPal environment ([#662](https://github.com/driftyco/ionic-native/issues/662)) ([3dd6a92](https://github.com/driftyco/ionic-native/commit/3dd6a92))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.8"></a>
|
||||
## [2.1.8](https://github.com/driftyco/ionic-native/compare/v2.1.7...v2.1.8) (2016-10-08)
|
||||
## [2.1.9](https://github.com/driftyco/ionic-native/compare/v2.1.7...v2.1.9) (2016-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** fixes GoogleMapsLatLng class ([11653ce](https://github.com/driftyco/ionic-native/commit/11653ce))
|
||||
* **paypal:** add optional details param to paypalpayment ([7200845](https://github.com/driftyco/ionic-native/commit/7200845))
|
||||
* **paypal:** problems with selection of PayPal environment ([#662](https://github.com/driftyco/ionic-native/issues/662)) ([3dd6a92](https://github.com/driftyco/ionic-native/commit/3dd6a92))
|
||||
* **thmeable-browser:** fix the name of the plugin ([#663](https://github.com/driftyco/ionic-native/issues/663)) ([1368175](https://github.com/driftyco/ionic-native/commit/1368175))
|
||||
|
||||
|
||||
|
||||
@@ -111,27 +387,13 @@
|
||||
|
||||
|
||||
<a name="2.1.6"></a>
|
||||
## [2.1.6](https://github.com/driftyco/ionic-native/compare/v2.1.5...v2.1.6) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **paypal:** fix helper classes ([f002657](https://github.com/driftyco/ionic-native/commit/f002657))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.5"></a>
|
||||
## [2.1.5](https://github.com/driftyco/ionic-native/compare/v2.1.4...v2.1.5) (2016-10-06)
|
||||
|
||||
|
||||
|
||||
<a name="2.1.4"></a>
|
||||
## [2.1.4](https://github.com/driftyco/ionic-native/compare/v2.1.3...v2.1.4) (2016-10-06)
|
||||
## [2.1.6](https://github.com/driftyco/ionic-native/compare/v2.1.3...v2.1.6) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** specify successIndex and errorIndex for methods with optional params ([6f23bef](https://github.com/driftyco/ionic-native/commit/6f23bef))
|
||||
* **paypal:** fix helper classes ([f002657](https://github.com/driftyco/ionic-native/commit/f002657))
|
||||
|
||||
|
||||
|
||||
@@ -148,7 +410,7 @@
|
||||
|
||||
|
||||
<a name="2.1.2"></a>
|
||||
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.1...v2.1.2) (2016-10-06)
|
||||
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.2) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
@@ -162,11 +424,6 @@
|
||||
|
||||
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.1) (2016-10-03)
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/driftyco/ionic-native/compare/v2.0.3...v2.1.0) (2016-10-03)
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Let us know or submit a PR! Take a look at [the Developer Guide](https://github.
|
||||
|
||||
# Credits
|
||||
|
||||
Ibrahim Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
Ibby Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
|
||||
Tim Lancina - [@timlancina](http://twitter.com/timlancina)
|
||||
|
||||
|
||||
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.2.5",
|
||||
"version": "2.4.1",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/es5/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@@ -9,40 +9,40 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"rxjs": "^5.0.0-beta.6"
|
||||
"rxjs": "5.0.0-beta.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.0.1",
|
||||
"browserify": "^13.3.0",
|
||||
"canonical-path": "0.0.2",
|
||||
"conventional-changelog-cli": "^1.2.0",
|
||||
"conventional-github-releaser": "^1.1.3",
|
||||
"cpr": "^1.0.0",
|
||||
"cz-conventional-changelog": "^1.1.6",
|
||||
"cpr": "^2.0.2",
|
||||
"cz-conventional-changelog": "^1.2.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"dgeni": "^0.4.2",
|
||||
"dgeni-packages": "^0.10.18",
|
||||
"es6-shim": "~0.35.1",
|
||||
"glob": "^6.0.4",
|
||||
"es6-shim": "~0.35.2",
|
||||
"glob": "^7.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-tslint": "^6.1.2",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"jasmine-core": "~2.5.0",
|
||||
"karma": "~1.2.0",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"jasmine-core": "~2.5.2",
|
||||
"karma": "~1.3.0",
|
||||
"karma-browserify": "~5.1.0",
|
||||
"karma-jasmine": "~1.0.2",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-phantomjs-launcher": "~1.0.2",
|
||||
"lodash": "3.10.1",
|
||||
"lodash": "4.17.4",
|
||||
"minimist": "^1.1.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"node-html-encoder": "0.0.2",
|
||||
"q": "1.4.1",
|
||||
"semver": "^5.0.1",
|
||||
"tsify": "~1.0.4",
|
||||
"semver": "^5.3.0",
|
||||
"tsify": "~3.0.0",
|
||||
"tslint": "^3.15.1",
|
||||
"tslint-ionic-rules": "0.0.5",
|
||||
"typescript": "^2.0.1",
|
||||
"tslint-ionic-rules": "0.0.7",
|
||||
"typescript": "~2.0.10",
|
||||
"watchify": "~3.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -50,7 +50,6 @@
|
||||
"test:watch": "npm test -- --watch",
|
||||
"start": "npm run test:watch",
|
||||
"lint": "gulp lint",
|
||||
"watch": "tsc -w",
|
||||
"build": "npm run lint && npm run build:js && npm run build:esm && npm run build:bundle && npm run build:minify",
|
||||
"build:js": "tsc -p tsconfig-es5.json",
|
||||
"build:esm": "tsc -p tsconfig-esm.json",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sitePath": "../ionic-site",
|
||||
"v2DocsDir": "docs/v2/native",
|
||||
"docsDest": "../ionic-site/docs/v2/native"
|
||||
"docsDest": "../ionic-site/content/docs/v2/native"
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ module.exports = function(currentVersion) {
|
||||
|
||||
versions = [];
|
||||
// new version, add it to the versions list
|
||||
if (currentVersion != 'nightly' && !_.contains(versions, currentVersion)) {
|
||||
if (currentVersion != 'nightly' && !_.includes(versions, currentVersion)) {
|
||||
versions.unshift(currentVersion);
|
||||
}
|
||||
//First semver valid version is latest
|
||||
@@ -85,7 +85,7 @@ module.exports = function(currentVersion) {
|
||||
// We don't separate by versions so always put the docs in the root
|
||||
var folder = '';
|
||||
return {
|
||||
href: path.join('/' + config.v2DocsDir, folder),
|
||||
href: '/' + config.v2DocsDir.replace('content/',''),
|
||||
folder: folder,
|
||||
name: version
|
||||
};
|
||||
@@ -99,12 +99,11 @@ module.exports = function(currentVersion) {
|
||||
|
||||
renderDocsProcessor.extraData.version = versionData;
|
||||
renderDocsProcessor.extraData.versionInfo = versionInfo;
|
||||
|
||||
computePathsProcessor.pathTemplates = [{
|
||||
docTypes: ['class', 'var', 'function', 'let'],
|
||||
getOutputPath: function(doc) {
|
||||
var docPath = doc.name + '/index.md';
|
||||
var path = config.v2DocsDir + '/' + docPath;
|
||||
var path = 'content/' + config.v2DocsDir + '/' + docPath;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,17 @@ function run {
|
||||
./git/clone.sh --repository="ionic-site" \
|
||||
--directory="$SITE_DIR" \
|
||||
--branch="master"
|
||||
ls -al $SITE_DIR
|
||||
cd $SITE_DIR
|
||||
ls -al
|
||||
else
|
||||
echo "using existing"
|
||||
cd $SITE_DIR
|
||||
git reset --hard
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf content/docs/v2/native/*/ || true
|
||||
|
||||
}
|
||||
|
||||
source $(dirname $0)/../utils.inc.sh
|
||||
|
||||
@@ -5,6 +5,15 @@ module.exports = function collectInputsOutputs() {
|
||||
$process: function(docs) {
|
||||
docs.forEach(function(doc) {
|
||||
|
||||
if (doc.statics && doc.statics.length) {
|
||||
for (var i in doc.statics) {
|
||||
// identify properties to differentiate from methods
|
||||
if (typeof doc.statics[i].parameters == 'undefined') {
|
||||
doc.statics[i].isProperty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doc.members && doc.members.length) {
|
||||
var members = [];
|
||||
var inputs = [];
|
||||
|
||||
@@ -19,14 +19,17 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
docs.forEach(function(doc, i) {
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
|
||||
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
|
||||
.replace('/index.md', '');
|
||||
.replace('/index.md', '')
|
||||
.replace('content/', '');
|
||||
|
||||
docs[i].demo = !!docs[i].demo;
|
||||
});
|
||||
|
||||
docs.push({
|
||||
docType: 'native_menu-menu',
|
||||
id: 'native_menu-menu',
|
||||
template: 'native_menu.template.html',
|
||||
outputPath: '_includes/v2_fluid/native_menu.html'
|
||||
outputPath: 'content/_includes/v2_fluid/native_menu.html'
|
||||
});
|
||||
|
||||
// returning docs will replace docs object in the next process
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = function latestVersion(renderDocsProcessor) {
|
||||
$process: function(docs) {
|
||||
var versionData = renderDocsProcessor.extraData.version;
|
||||
|
||||
var docsBase = 'dist/ionic-site/docs/v2/';
|
||||
var docsBase = 'dist/ionic-site/content/docs/v2/';
|
||||
var versionDir = path.resolve(docsBase, versionData.latest.name);
|
||||
var latestDir = path.resolve(docsBase, 'api');
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'beta', transforms: function(doc, tag, value) {
|
||||
// make the value true or undefined instead of '' or undefined
|
||||
return typeof value !== 'undefined';
|
||||
}},
|
||||
{'name': 'usage'},
|
||||
{'name': 'classes'}, // related classes
|
||||
{'name': 'interfaces'} // related interfaces
|
||||
|
||||
27
scripts/docs/templates/common.template.html
vendored
27
scripts/docs/templates/common.template.html
vendored
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: "v2_fluid/docs_base"
|
||||
version: "<$ version.current.name $>"
|
||||
versionHref: "<$ version.current.href $>"
|
||||
versionHref: "<$ version.current.href.replace('content/','') $>"
|
||||
path: "<$ doc.path $>"
|
||||
category: native
|
||||
id: "<$ doc.name|lower|replace(' ','-') $>"
|
||||
@@ -30,7 +30,7 @@ docType: "<$ doc.docType $>"
|
||||
<@ if param.optional @><div><em>(optional)</em></div><@ endif @>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.returnType | escape $>
|
||||
<code><$ param.returnType | escape $></code>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.description | marked $>
|
||||
@@ -200,7 +200,9 @@ docType: "<$ doc.docType $>"
|
||||
Delegate: <$ doc.delegate $>
|
||||
</small>
|
||||
<@ endif @>
|
||||
|
||||
<@- if doc.beta == true -@>
|
||||
<span class="beta" title="beta">β</span>
|
||||
<@- endif -@>
|
||||
</h1>
|
||||
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
@@ -213,6 +215,15 @@ docType: "<$ doc.docType $>"
|
||||
<@- if doc.decorators @>
|
||||
|
||||
<@ for prop in doc.decorators[0].argumentInfo @>
|
||||
|
||||
<@ if doc.beta == true @>
|
||||
<p class="beta-notice">
|
||||
This plugin is still in beta stage and may not work as expected. Please
|
||||
submit any issues to the <a target="_blank"
|
||||
href="<$ prop.repo $>/issues">plugin repo</a>.
|
||||
</p>
|
||||
<@ endif @>
|
||||
|
||||
<pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif -@></code></pre>
|
||||
<p>Repo:
|
||||
<a href="<$ prop.repo $>">
|
||||
@@ -244,7 +255,7 @@ docType: "<$ doc.docType $>"
|
||||
<!-- @platforms tag end -->
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
<@ endif -@><!-- if doc.decorators -->
|
||||
|
||||
<!-- @usage tag -->
|
||||
<@ if doc.usage @>
|
||||
@@ -308,13 +319,13 @@ docType: "<$ doc.docType $>"
|
||||
<!-- other classes -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'classes' -@>
|
||||
<h2><a class="anchor" name="related-classes" href="#related-classes"></a>Related Classes</h2>
|
||||
<!--<h2><a class="anchor" name="related-classes" href="#related-classes"></a>Related Classes</h2>-->
|
||||
<@ set classes = tag.description.split('\n') @>
|
||||
<@ for item in classes -@>
|
||||
<@ if item.length > 1 @>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == item @>
|
||||
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||
<h2><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h2>
|
||||
<$ documentClass(export) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
@@ -327,11 +338,11 @@ docType: "<$ doc.docType $>"
|
||||
<!-- interfaces -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'interfaces' @>
|
||||
<h2><a class="anchor" name="interfaces" href="#interfaces"></a>Interfaces</h2>
|
||||
<!--<h2><a class="anchor" name="interfaces" href="#interfaces"></a>Interfaces</h2>-->
|
||||
<@ set interfaces = tag.description.split('\n') @>
|
||||
<@ for item in interfaces -@>
|
||||
<@ if item.length > 1 @>
|
||||
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||
<h2><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h2>
|
||||
<$ interfaceTable(item) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">β</span></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
@@ -23,10 +23,10 @@ function run {
|
||||
# CD in to the site dir to commit updated docs
|
||||
cd $SITE_DIR
|
||||
|
||||
CHANGES=$(git status --porcelain)
|
||||
|
||||
# if no changes, don't commit
|
||||
if [[ "$CHANGES" == "" ]]; then
|
||||
CHANGED=$(git diff-index --name-only HEAD --)
|
||||
if [ -z "$CHANGED" ];
|
||||
then
|
||||
echo "-- No changes detected for the following commit, docs not updated."
|
||||
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
||||
else
|
||||
@@ -39,7 +39,7 @@ function run {
|
||||
git fetch
|
||||
git rebase
|
||||
|
||||
git push origin master
|
||||
git push origin master || :
|
||||
|
||||
echo "-- Updated docs for $VERSION_NAME succesfully!"
|
||||
fi
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'PluginName',
|
||||
pluginName: 'PluginName',
|
||||
plugin: '',
|
||||
pluginRef: '',
|
||||
repo: ''
|
||||
|
||||
@@ -29,7 +29,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'PluginName',
|
||||
pluginName: 'PluginName',
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
|
||||
41
src/index.ts
41
src/index.ts
@@ -1,6 +1,6 @@
|
||||
import { initAngular1 } from './ng1';
|
||||
|
||||
const DEVICE_READY_TIMEOUT = 2000;
|
||||
const DEVICE_READY_TIMEOUT = 5000;
|
||||
|
||||
declare var window;
|
||||
|
||||
@@ -13,12 +13,14 @@ import { AppVersion } from './plugins/appversion';
|
||||
import { Badge } from './plugins/badge';
|
||||
import { BackgroundGeolocation } from './plugins/background-geolocation';
|
||||
import { BackgroundMode } from './plugins/backgroundmode';
|
||||
import { Backlight } from './plugins/backlight';
|
||||
import { BarcodeScanner } from './plugins/barcodescanner';
|
||||
import { Base64ToGallery } from './plugins/base64togallery';
|
||||
import { BatteryStatus } from './plugins/batterystatus';
|
||||
import { Brightness } from './plugins/brightness';
|
||||
import { BLE } from './plugins/ble';
|
||||
import { BluetoothSerial } from './plugins/bluetoothserial';
|
||||
import { Broadcaster } from './plugins/broadcaster';
|
||||
import { Calendar } from './plugins/calendar';
|
||||
import { CallNumber } from './plugins/call-number';
|
||||
import { Camera } from './plugins/camera';
|
||||
@@ -46,6 +48,8 @@ import { FileChooser } from './plugins/file-chooser';
|
||||
import { FileOpener } from './plugins/file-opener';
|
||||
import { FilePath } from './plugins/filepath';
|
||||
import { Transfer } from './plugins/filetransfer';
|
||||
import { FingerprintAIO } from './plugins/fingerprint-aio';
|
||||
import { Firebase } from './plugins/firebase';
|
||||
import { Flashlight } from './plugins/flashlight';
|
||||
import { Geofence } from './plugins/geofence';
|
||||
import { Geolocation } from './plugins/geolocation';
|
||||
@@ -53,6 +57,7 @@ import { Globalization } from './plugins/globalization';
|
||||
import { GooglePlus } from './plugins/google-plus';
|
||||
import { GoogleMap } from './plugins/googlemap';
|
||||
import { GoogleAnalytics } from './plugins/googleanalytics';
|
||||
import { HeaderColor } from './plugins/headercolor';
|
||||
import { Hotspot } from './plugins/hotspot';
|
||||
import { HTTP } from './plugins/http';
|
||||
import { Httpd } from './plugins/httpd';
|
||||
@@ -66,12 +71,15 @@ import { Instagram } from './plugins/instagram';
|
||||
import { IsDebug } from './plugins/is-debug';
|
||||
import { Keyboard } from './plugins/keyboard';
|
||||
import { LaunchNavigator } from './plugins/launchnavigator';
|
||||
import { LaunchReview } from './plugins/launch-review';
|
||||
import { LocalNotifications } from './plugins/localnotifications';
|
||||
import { LocationAccuracy } from './plugins/location-accuracy';
|
||||
import { MediaCapture } from './plugins/media-capture';
|
||||
import { NativeAudio } from './plugins/native-audio';
|
||||
import { NativeGeocoder } from './plugins/native-geocoder';
|
||||
import { NativePageTransitions } from './plugins/native-page-transitions';
|
||||
import { NativeStorage } from './plugins/nativestorage';
|
||||
import { NavigationBar } from './plugins/navigationbar';
|
||||
import { Market } from './plugins/market';
|
||||
import { MediaPlugin } from './plugins/media';
|
||||
import { Mixpanel } from './plugins/mixpanel';
|
||||
@@ -83,22 +91,27 @@ import { PhotoViewer } from './plugins/photo-viewer';
|
||||
import { ScreenOrientation } from './plugins/screen-orientation';
|
||||
import { PayPal } from './plugins/pay-pal';
|
||||
import { PinDialog } from './plugins/pin-dialog';
|
||||
import { Pinterest } from './plugins/pinterest';
|
||||
import { PowerManagement } from './plugins/power-management';
|
||||
import { Printer } from './plugins/printer';
|
||||
import { Push } from './plugins/push';
|
||||
import { Rollbar } from './plugins/rollbar';
|
||||
import { SafariViewController } from './plugins/safari-view-controller';
|
||||
import { Screenshot } from './plugins/screenshot';
|
||||
import { SecureStorage } from './plugins/securestorage';
|
||||
import { Serial } from './plugins/serial';
|
||||
import { Shake } from './plugins/shake';
|
||||
import { Sim } from './plugins/sim';
|
||||
import { SMS } from './plugins/sms';
|
||||
import { SocialSharing } from './plugins/socialsharing';
|
||||
import { SpeechRecognition } from './plugins/speech-recognition';
|
||||
import { SpinnerDialog } from './plugins/spinnerdialog';
|
||||
import { Splashscreen } from './plugins/splashscreen';
|
||||
import { SQLite } from './plugins/sqlite';
|
||||
import { StatusBar } from './plugins/statusbar';
|
||||
import { Stepcounter } from './plugins/stepcounter';
|
||||
import { StreamingMedia } from './plugins/streaming-media';
|
||||
import { Stripe } from './plugins/stripe';
|
||||
import { ThreeDeeTouch } from './plugins/3dtouch';
|
||||
import { Toast } from './plugins/toast';
|
||||
import { TouchID } from './plugins/touchid';
|
||||
@@ -121,6 +134,7 @@ export * from './plugins/apprate';
|
||||
export * from './plugins/appversion';
|
||||
export * from './plugins/background-geolocation';
|
||||
export * from './plugins/backgroundmode';
|
||||
export * from './plugins/backlight';
|
||||
export * from './plugins/badge';
|
||||
export * from './plugins/barcodescanner';
|
||||
export * from './plugins/base64togallery';
|
||||
@@ -128,6 +142,7 @@ export * from './plugins/batterystatus';
|
||||
export * from './plugins/ble';
|
||||
export * from './plugins/bluetoothserial';
|
||||
export * from './plugins/brightness';
|
||||
export * from './plugins/broadcaster';
|
||||
export * from './plugins/calendar';
|
||||
export * from './plugins/call-number';
|
||||
export * from './plugins/camera';
|
||||
@@ -154,7 +169,9 @@ export * from './plugins/file';
|
||||
export * from './plugins/file-chooser';
|
||||
export * from './plugins/file-opener';
|
||||
export * from './plugins/filetransfer';
|
||||
export * from './plugins/firebase';
|
||||
export * from './plugins/filepath';
|
||||
export * from './plugins/fingerprint-aio';
|
||||
export * from './plugins/flashlight';
|
||||
export * from './plugins/geofence';
|
||||
export * from './plugins/geolocation';
|
||||
@@ -162,6 +179,7 @@ export * from './plugins/globalization';
|
||||
export * from './plugins/google-plus';
|
||||
export * from './plugins/googleanalytics';
|
||||
export * from './plugins/googlemap';
|
||||
export * from './plugins/headercolor';
|
||||
export * from './plugins/hotspot';
|
||||
export * from './plugins/http';
|
||||
export * from './plugins/httpd';
|
||||
@@ -175,6 +193,7 @@ export * from './plugins/instagram';
|
||||
export * from './plugins/is-debug';
|
||||
export * from './plugins/keyboard';
|
||||
export * from './plugins/launchnavigator';
|
||||
export * from './plugins/launch-review';
|
||||
export * from './plugins/localnotifications';
|
||||
export * from './plugins/location-accuracy';
|
||||
export * from './plugins/market';
|
||||
@@ -183,32 +202,39 @@ export * from './plugins/media-capture';
|
||||
export * from './plugins/mixpanel';
|
||||
export * from './plugins/music-controls';
|
||||
export * from './plugins/native-audio';
|
||||
export * from './plugins/native-geocoder';
|
||||
export * from './plugins/native-page-transitions';
|
||||
export * from './plugins/nativestorage';
|
||||
export * from './plugins/navigationbar';
|
||||
export * from './plugins/network';
|
||||
export * from './plugins/nfc';
|
||||
export * from './plugins/onesignal';
|
||||
export * from './plugins/pay-pal';
|
||||
export * from './plugins/photo-viewer';
|
||||
export * from './plugins/pin-dialog';
|
||||
export * from './plugins/pinterest';
|
||||
export * from './plugins/plugin';
|
||||
export * from './plugins/power-management';
|
||||
export * from './plugins/printer';
|
||||
export * from './plugins/push';
|
||||
export * from './plugins/rollbar';
|
||||
export * from './plugins/safari-view-controller';
|
||||
export * from './plugins/screen-orientation';
|
||||
export * from './plugins/screenshot';
|
||||
export * from './plugins/securestorage';
|
||||
export * from './plugins/serial';
|
||||
export * from './plugins/shake';
|
||||
export * from './plugins/sim';
|
||||
export * from './plugins/sms';
|
||||
export * from './plugins/socialsharing';
|
||||
export * from './plugins/speech-recognition';
|
||||
export * from './plugins/spinnerdialog';
|
||||
export * from './plugins/splashscreen';
|
||||
export * from './plugins/sqlite';
|
||||
export * from './plugins/statusbar';
|
||||
export * from './plugins/stepcounter';
|
||||
export * from './plugins/streaming-media';
|
||||
export * from './plugins/stripe';
|
||||
export * from './plugins/text-to-speech';
|
||||
export * from './plugins/themeable-browser';
|
||||
export * from './plugins/toast';
|
||||
@@ -233,12 +259,14 @@ window['IonicNative'] = {
|
||||
Badge,
|
||||
BackgroundGeolocation,
|
||||
BackgroundMode,
|
||||
Backlight,
|
||||
BarcodeScanner,
|
||||
Base64ToGallery,
|
||||
BatteryStatus,
|
||||
Brightness,
|
||||
BLE,
|
||||
BluetoothSerial,
|
||||
Broadcaster,
|
||||
Calendar,
|
||||
CallNumber,
|
||||
Camera,
|
||||
@@ -265,13 +293,16 @@ window['IonicNative'] = {
|
||||
FileChooser,
|
||||
FileOpener,
|
||||
FilePath,
|
||||
FingerprintAIO,
|
||||
Flashlight,
|
||||
Firebase,
|
||||
Geofence,
|
||||
Geolocation,
|
||||
Globalization,
|
||||
GooglePlus,
|
||||
GoogleMap,
|
||||
GoogleAnalytics,
|
||||
HeaderColor,
|
||||
Hotspot,
|
||||
HTTP,
|
||||
Httpd,
|
||||
@@ -285,6 +316,7 @@ window['IonicNative'] = {
|
||||
IsDebug,
|
||||
Keyboard,
|
||||
LaunchNavigator,
|
||||
LaunchReview,
|
||||
LocalNotifications,
|
||||
LocationAccuracy,
|
||||
Market,
|
||||
@@ -293,8 +325,10 @@ window['IonicNative'] = {
|
||||
Mixpanel,
|
||||
MusicControls,
|
||||
NativeAudio,
|
||||
NativeGeocoder,
|
||||
NativePageTransitions,
|
||||
NativeStorage,
|
||||
NavigationBar,
|
||||
Network,
|
||||
PayPal,
|
||||
NFC,
|
||||
@@ -304,10 +338,13 @@ window['IonicNative'] = {
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
Pinterest,
|
||||
PowerManagement,
|
||||
Rollbar,
|
||||
SafariViewController,
|
||||
Screenshot,
|
||||
SecureStorage,
|
||||
Serial,
|
||||
Shake,
|
||||
Sim,
|
||||
SMS,
|
||||
@@ -316,8 +353,10 @@ window['IonicNative'] = {
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
SpeechRecognition,
|
||||
Stepcounter,
|
||||
StreamingMedia,
|
||||
Stripe,
|
||||
ThreeDeeTouch,
|
||||
Toast,
|
||||
TouchID,
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window: any;
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
|
||||
/**
|
||||
* Type that can be used in the onHomeIconPressed callback
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* Title
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* Subtitle
|
||||
*/
|
||||
subtitle?: string;
|
||||
|
||||
/**
|
||||
* Icon type. Case insensitive
|
||||
*/
|
||||
iconType?: string;
|
||||
|
||||
/**
|
||||
* Icon template
|
||||
*/
|
||||
iconTemplate?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
|
||||
/**
|
||||
* Touch force
|
||||
*/
|
||||
force: number;
|
||||
|
||||
/**
|
||||
* Timestamp of action
|
||||
*/
|
||||
timestamp: number;
|
||||
|
||||
/**
|
||||
* X coordinate of action
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* Y coordinate of action
|
||||
*/
|
||||
y: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name 3DTouch
|
||||
* @description
|
||||
@@ -63,9 +115,12 @@ declare var window: any;
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ThreeDeeTouchQuickAction
|
||||
* ThreeDeeTouchForceTouch
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'ThreeDeeTouch',
|
||||
pluginName: 'ThreeDeeTouch',
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
@@ -108,7 +163,7 @@ export class ThreeDeeTouch {
|
||||
*/
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) {
|
||||
if (window.ThreeDeeTouch) {
|
||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
} else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
@@ -135,18 +190,3 @@ export class ThreeDeeTouch {
|
||||
static disableLinkPreview(): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
iconTemplate?: string;
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
force: number;
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface ActionSheetOptions {
|
||||
|
||||
/**
|
||||
* The labels for the buttons. Uses the index x
|
||||
*/
|
||||
buttonLabels: string[];
|
||||
|
||||
/**
|
||||
* The title for the actionsheet
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Theme to be used on Android
|
||||
*/
|
||||
androidTheme?: number;
|
||||
|
||||
/**
|
||||
* Enable a cancel on Android
|
||||
*/
|
||||
androidEnableCancelButton?: boolean;
|
||||
|
||||
/**
|
||||
* Enable a cancel on Windows Phone
|
||||
*/
|
||||
winphoneEnableCancelButton?: boolean;
|
||||
|
||||
/**
|
||||
* Add a cancel button with text
|
||||
*/
|
||||
addCancelButtonWithLabel?: string;
|
||||
|
||||
/**
|
||||
* Add a destructive button with text
|
||||
*/
|
||||
addDestructiveButtonWithLabel?: string;
|
||||
|
||||
/**
|
||||
* On an iPad, set the X,Y position
|
||||
*/
|
||||
position?: number[];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Action Sheet
|
||||
@@ -12,7 +55,6 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { ActionSheet } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
* 'title': 'What do you want with this image?',
|
||||
@@ -23,25 +65,11 @@ import { Cordova, Plugin } from './plugin';
|
||||
* console.log('Button pressed: ' + buttonIndex);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* ActionSheet options
|
||||
*
|
||||
* | Option | Type | Description |
|
||||
* |-------------------------------|-----------|----------------------------------------------|
|
||||
* | title |`string` | The title for the actionsheet |
|
||||
* | buttonLabels |`string[]` | the labels for the buttons. Uses the index x |
|
||||
* | androidTheme |`number` | Theme to be used on Android |
|
||||
* | androidEnableCancelButton |`boolean` | Enable a cancel on Android |
|
||||
* | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone |
|
||||
* | addCancelButtonWithLabel |`string` | Add a cancel button with text |
|
||||
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
|
||||
* | position |`number[]` | On an iPad, set the X,Y position |
|
||||
*
|
||||
*
|
||||
* @interfaces
|
||||
* ActionSheetOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'ActionSheet',
|
||||
pluginName: 'ActionSheet',
|
||||
plugin: 'cordova-plugin-actionsheet',
|
||||
pluginRef: 'plugins.actionsheet',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
|
||||
@@ -51,26 +79,17 @@ export class ActionSheet {
|
||||
|
||||
/**
|
||||
* Show a native ActionSheet component. See below for options.
|
||||
* @param {options} Options See table below
|
||||
* @returns {Promise} Returns a Promise that resolves with the index of the
|
||||
* @param options {ActionSheetOptions} Options See table below
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the index of the
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options?: {
|
||||
buttonLabels: string[],
|
||||
title?: string,
|
||||
androidTheme?: number,
|
||||
androidEnableCancelButton?: boolean,
|
||||
winphoneEnableCancelButton?: boolean,
|
||||
addCancelButtonWithLabel?: string,
|
||||
addDestructiveButtonWithLabel?: string,
|
||||
position?: number[]
|
||||
}): Promise<any> { return; }
|
||||
static show(options?: ActionSheetOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Progamtically hide the native ActionSheet
|
||||
* @returns {Promise} Returns a Promise that resolves when the actionsheet is closed
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the actionsheet is closed
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
|
||||
@@ -1,14 +1,114 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
|
||||
|
||||
export interface AdMobOptions {
|
||||
|
||||
/**
|
||||
* Banner ad ID
|
||||
*/
|
||||
adId?: string;
|
||||
|
||||
/**
|
||||
* Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM`
|
||||
*/
|
||||
adSize?: AdMobAdSize;
|
||||
|
||||
/**
|
||||
* Banner width, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Banner height, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
/**
|
||||
* Allow banner to overlap webview, or else it will push webview up or down to avoid overlap. Defaults to false.
|
||||
*/
|
||||
overlap?: boolean;
|
||||
|
||||
/**
|
||||
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
/**
|
||||
* X in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Y in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Set to true to receive test ad for testing purposes
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
|
||||
/**
|
||||
* Auto show interstitial ad when loaded. Set to false if hope to control the show timing with prepareInterstitial/showInterstitial
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
|
||||
/**
|
||||
* Re-create the banner on web view orientation change (not screen orientation), or else just move the banner. Default:true.
|
||||
*/
|
||||
orientationRenew?: boolean;
|
||||
|
||||
/**
|
||||
* Set extra color style for Ad
|
||||
*/
|
||||
adExtras?: AdMobAdExtras;
|
||||
|
||||
}
|
||||
|
||||
export interface AdMobAdExtras {
|
||||
|
||||
color_bg: string;
|
||||
|
||||
color_bg_top: string;
|
||||
|
||||
color_border: string;
|
||||
|
||||
color_link: string;
|
||||
|
||||
color_text: string;
|
||||
|
||||
color_url: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdMob
|
||||
* @description Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @description
|
||||
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @usage
|
||||
* Please refer the the plugin's original repository for detailed usage.
|
||||
* ```typescript
|
||||
* import { AdMob } from 'ionic-native';
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* AdMob.onAdDismiss()
|
||||
* .subscribe(() => { console.log('User dismissed ad'); });
|
||||
* }
|
||||
*
|
||||
* onClick() {
|
||||
* AdMob.prepareInterstitial('YOUR_ADID')
|
||||
* .then(() => { AdMob.showInterstitial(); });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AdMobOptions
|
||||
* AdMobAdExtras
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'AdMob',
|
||||
pluginName: 'AdMob',
|
||||
plugin: 'cordova-plugin-admobpro',
|
||||
pluginRef: 'AdMob',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',
|
||||
@@ -16,17 +116,33 @@ import { Observable } from 'rxjs/Observable';
|
||||
})
|
||||
export class AdMob {
|
||||
|
||||
// Static Methods
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static AD_POSITION = {
|
||||
NO_CHANGE: 0,
|
||||
TOP_LEFT: 1,
|
||||
TOP_CENTER: 2,
|
||||
TOP_RIGHT: 3,
|
||||
LEFT: 4,
|
||||
CENTER: 5,
|
||||
RIGHT: 6,
|
||||
BOTTOM_LEFT: 7,
|
||||
BOTTOM_CENTER: 8,
|
||||
BOTTOM_RIGHT: 9,
|
||||
POS_XY: 10
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
* Create a banner
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the banner is created
|
||||
*/
|
||||
@Cordova()
|
||||
static createBanner(adIdOrOptions: any): Promise<any> { return; }
|
||||
static createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* Destroy the banner, remove it from screen.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -34,18 +150,18 @@ export class AdMob {
|
||||
static removeBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param position
|
||||
* Show banner at position
|
||||
* @param position {number} Position. Use `AdMob.AD_POSITION` to set values.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showBanner(position: any): void { }
|
||||
static showBanner(position: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* Show banner at custom position
|
||||
* @param x {number} Offset from screen left.
|
||||
* @param y {number} Offset from screen top.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -53,7 +169,7 @@ export class AdMob {
|
||||
static showBannerAtXY(x: number, y: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Hide the banner, remove it from screen, but can show it later
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -61,32 +177,28 @@ export class AdMob {
|
||||
static hideBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
* Prepare interstitial banner
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when interstitial is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareInterstitial(adIdOrOptions: any): Promise<any> { return; }
|
||||
static prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show interstitial
|
||||
* Show interstitial ad when it's ready
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showInterstitial(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static isInterstitialReady(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Prepare a reward video ad
|
||||
* @param adIdOrOptions
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the ad is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> { return; }
|
||||
static prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show a reward video ad
|
||||
@@ -98,10 +210,11 @@ export class AdMob {
|
||||
|
||||
/**
|
||||
* Sets the values for configuration and targeting
|
||||
* @param options Returns a promise that resolves if the options are set successfully
|
||||
* @param options {AdMobOptions} Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the options have been set
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptions(options: any): Promise<any> { return; }
|
||||
static setOptions(options: AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get user ad settings
|
||||
@@ -110,71 +223,54 @@ export class AdMob {
|
||||
@Cordova()
|
||||
static getAdSettings(): Promise<any> { return; }
|
||||
|
||||
// Events
|
||||
|
||||
/**
|
||||
* Triggered when failed to receive Ad
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerFailedToReceive'
|
||||
event: 'onAdFailLoad'
|
||||
})
|
||||
static onBannerFailedToReceive(): Observable<any> { return; }
|
||||
static onAdFailLoad(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when Ad received
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerReceive'
|
||||
event: 'onAdLoaded'
|
||||
})
|
||||
static onBannerReceive(): Observable<any> { return; }
|
||||
static onAdLoaded(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when Ad will be showed on screen
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerPresent'
|
||||
event: 'onAdPresent'
|
||||
})
|
||||
static onBannerPresent(): Observable<any> { return; }
|
||||
static onAdPresent(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when user click the Ad, and will jump out of your App
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerLeaveApp'
|
||||
event: 'onAdLeaveApp'
|
||||
})
|
||||
static onBannerLeaveApp(): Observable<any> { return; }
|
||||
static onAdLeaveApp(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when dismiss the Ad and back to your App
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerDismiss'
|
||||
event: 'onAdDismiss'
|
||||
})
|
||||
static onBannerDismiss(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialFailedToReceive'
|
||||
})
|
||||
static onInterstitialFailedToReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialReceive'
|
||||
})
|
||||
static onInterstitialReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialPresent'
|
||||
})
|
||||
static onInterstitialPresent(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialLeaveApp'
|
||||
})
|
||||
static onInterstitialLeaveApp(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialDismiss'
|
||||
})
|
||||
static onInterstitialDismiss(): Observable<any> { return; }
|
||||
static onAdDismiss(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,68 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface AndroidFingerprintAuthOptions {
|
||||
|
||||
/**
|
||||
* Required
|
||||
* Used as the alias for your key in the Android Key Store.
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Used to create credential string for encrypted token and as alias to retrieve the cipher.
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* Used to create credential string for encrypted token
|
||||
*/
|
||||
password?: string;
|
||||
|
||||
/**
|
||||
* Required for decrypt()
|
||||
* Encrypted user credentials to decrypt upon successful authentication.
|
||||
*/
|
||||
token?: string;
|
||||
|
||||
/**
|
||||
* Set to true to remove the "USE BACKUP" button
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
|
||||
/**
|
||||
* Change the language. (en_US or es)
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
/**
|
||||
* The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts.
|
||||
*/
|
||||
maxAttempts?: number;
|
||||
|
||||
/**
|
||||
* Require the user to authenticate with a fingerprint to authorize every use of the key.
|
||||
* New fingerprint enrollment will invalidate key and require backup authenticate to
|
||||
* re-enable the fingerprint authentication dialog.
|
||||
*/
|
||||
userAuthRequired?: boolean;
|
||||
|
||||
/**
|
||||
* Set the title of the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogTitle?: string;
|
||||
|
||||
/**
|
||||
* Set the message of the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogMessage?: string;
|
||||
|
||||
/**
|
||||
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogHint?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Android Fingerprint Auth
|
||||
* @description
|
||||
@@ -12,15 +76,20 @@ import { Cordova, Plugin } from './plugin';
|
||||
* if(result.isAvailable){
|
||||
* // it is available
|
||||
*
|
||||
* AndroidFingerprintAuth.show({ clientId: "myAppName", clientSecret: "so_encrypted_much_secure_very_secret" })
|
||||
* AndroidFingerprintAuth.encrypt({ clientId: "myAppName", username: "myUsername", password: "myPassword" })
|
||||
* .then(result => {
|
||||
* if(result.withFingerprint) {
|
||||
* console.log('Successfully authenticated with fingerprint!');
|
||||
* } else if(result.withPassword) {
|
||||
* if (result.withFingerprint) {
|
||||
* console.log("Successfully encrypted credentials.");
|
||||
* console.log("Encrypted credentials: " + result.token);
|
||||
* } else if (result.withBackup) {
|
||||
* console.log('Successfully authenticated with backup password!');
|
||||
* } else console.log('Didn\'t authenticate!');
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* .catch(error => {
|
||||
* if (error === "Cancelled") {
|
||||
* console.log("Fingerprint authentication cancelled");
|
||||
* } else console.error(error)
|
||||
* });
|
||||
*
|
||||
* } else {
|
||||
* // fingerprint auth isn't available
|
||||
@@ -28,51 +97,71 @@ import { Cordova, Plugin } from './plugin';
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* AndroidFingerprintAuthOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'AndroidFingerprintAuth',
|
||||
pluginName: 'AndroidFingerprintAuth',
|
||||
plugin: 'cordova-plugin-android-fingerprint-auth',
|
||||
pluginRef: 'FingerprintAuth',
|
||||
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'
|
||||
})
|
||||
export class AndroidFingerprintAuth {
|
||||
|
||||
/**
|
||||
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
|
||||
* @param params {any}
|
||||
* @param options {AndroidFingerprintAuthOptions} Options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static show(params: {
|
||||
static encrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Used as the alias for your key in the Android Key Store.
|
||||
* Biometric authentication
|
||||
*/
|
||||
clientId: string;
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
* Used to encrypt the token returned upon successful fingerprint authentication.
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
clientSecret: string;
|
||||
withBackup: boolean;
|
||||
/**
|
||||
* Set to true to remove the "USE BACKUP" button
|
||||
* base64encoded string representation of user credentials
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
token: string;
|
||||
}> {return; }
|
||||
|
||||
/**
|
||||
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
|
||||
* @param options {AndroidFingerprintAuthOptions} Options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static decrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Change the language. (en_US or es)
|
||||
* Biometric authentication
|
||||
*/
|
||||
locale?: string
|
||||
}): Promise<{
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
* Base64 encoded string
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withFingerprint: string;
|
||||
withBackup: boolean;
|
||||
/**
|
||||
*
|
||||
* FingerprintAuth.CipherMode.DECRYPT
|
||||
* Decrypted password
|
||||
*/
|
||||
withPassword: boolean;
|
||||
password: string;
|
||||
}> {return; }
|
||||
|
||||
/**
|
||||
* Check if service is available
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> {return; }
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> { return; }
|
||||
|
||||
/**
|
||||
* Delete the cipher used for encryption and decryption by username
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(options: {clientId: string; username: string; }): Promise<{deleted: boolean}> { return; }
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AppAvailability } from 'ionic-native';
|
||||
* import { AppAvailability, Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let app;
|
||||
*
|
||||
* if (device.platform === 'iOS') {
|
||||
* if (Device.platform === 'iOS') {
|
||||
* app = 'twitter://';
|
||||
* } else if (device.platform === 'Android') {
|
||||
* } else if (Device.platform === 'Android') {
|
||||
* app = 'com.twitter.android';
|
||||
* }
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'AppAvailability',
|
||||
pluginName: 'AppAvailability',
|
||||
plugin: 'cordova-plugin-appavailability',
|
||||
pluginRef: 'appAvailability',
|
||||
repo: 'https://github.com/ohh2ahh/AppAvailability',
|
||||
|
||||
@@ -1,8 +1,94 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface AppRatePreferences {
|
||||
|
||||
/**
|
||||
* Custom BCP 47 language tag
|
||||
*/
|
||||
useLanguage?: string;
|
||||
|
||||
/**
|
||||
* Custom application title
|
||||
*/
|
||||
displayAppName?: string;
|
||||
|
||||
/**
|
||||
* Show dialog again when application version will be updated. Defaults to `true`
|
||||
*/
|
||||
promptAgainForEachNewVersion?: boolean;
|
||||
|
||||
/**
|
||||
* count of runs of application before dialog will be displayed. Defaults to `3`
|
||||
*/
|
||||
usesUntilPrompt?: number;
|
||||
|
||||
/**
|
||||
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
|
||||
*/
|
||||
openStoreInApp?: boolean;
|
||||
|
||||
/**
|
||||
* use custom view for rate dialog. Defaults to `false`
|
||||
*/
|
||||
useCustomRateDialog?: boolean;
|
||||
|
||||
/**
|
||||
* Custom locale object
|
||||
*/
|
||||
customLocale?: any;
|
||||
|
||||
/**
|
||||
* Callbacks for events
|
||||
*/
|
||||
callbacks?: AppRateCallbacks;
|
||||
|
||||
/**
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppURL?: AppRateStoreAppUrls;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateCallbacks {
|
||||
|
||||
/**
|
||||
* call back function. called when user clicked on rate-dialog buttons
|
||||
*/
|
||||
onButtonClicked?: Function;
|
||||
|
||||
/**
|
||||
* call back function. called when rate-dialog showing
|
||||
*/
|
||||
onRateDialogShow?: Function;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateStoreAppUrls {
|
||||
|
||||
/**
|
||||
* application id in AppStore
|
||||
*/
|
||||
ios?: string;
|
||||
|
||||
/**
|
||||
* application URL in GooglePlay
|
||||
*/
|
||||
android?: string;
|
||||
|
||||
/**
|
||||
* application URL in AppWorld
|
||||
*/
|
||||
blackberry?: string;
|
||||
|
||||
/**
|
||||
* application URL in WindowsStore
|
||||
*/
|
||||
windows8?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name App Rate
|
||||
* @description
|
||||
@@ -19,32 +105,17 @@ declare var window;
|
||||
* android: 'market://details?id=<package_name>',
|
||||
* };
|
||||
*
|
||||
* AppRate.promptForRating();
|
||||
* AppRate.promptForRating(false);
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* @interfaces
|
||||
* AppRatePreferences
|
||||
* AppRateStoreAppUrls
|
||||
* AppRateCallbacks
|
||||
*
|
||||
* Rating dialog preferences
|
||||
*
|
||||
* | Option | Type | Default | Description |
|
||||
* |------------------------------|------------|---------|----------------------------------------------------------------------------------------|
|
||||
* | useLanguage | `String` | null | custom BCP 47 language tag |
|
||||
* | displayAppName | `String` | '' | custom application title |
|
||||
* | promptAgainForEachNewVersion | `Boolean` | true | show dialog again when application version will be updated |
|
||||
* | usesUntilPrompt | `Integer` | 3 | count of runs of application before dialog will be displayed |
|
||||
* | openStoreInApp | `Boolean` | false | leave app or no when application page opened in app store (now supported only for iOS) |
|
||||
* | useCustomRateDialog | `Boolean` | false | use custom view for rate dialog |
|
||||
* | callbacks.onButtonClicked | `Function` | null | call back function. called when user clicked on rate-dialog buttons |
|
||||
* | callbacks.onRateDialogShow | `Function` | null | call back function. called when rate-dialog showing |
|
||||
* | storeAppURL.ios | `String` | null | application id in AppStore |
|
||||
* | storeAppURL.android | `String` | null | application URL in GooglePlay |
|
||||
* | storeAppURL.blackberry | `String` | null | application URL in AppWorld |
|
||||
* | storeAppURL.windows8 | `String` | null | application URL in WindowsStore |
|
||||
* | customLocale | `Object` | null | custom locale object |
|
||||
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'AppRate',
|
||||
pluginName: 'AppRate',
|
||||
plugin: 'cordova-plugin-apprate',
|
||||
pluginRef: 'AppRate',
|
||||
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
|
||||
@@ -57,7 +128,7 @@ export class AppRate {
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get preferences() { return window.AppRate.preferences; }
|
||||
static preferences: AppRatePreferences;
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
|
||||
@@ -19,37 +19,38 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'AppVersion',
|
||||
pluginName: 'AppVersion',
|
||||
plugin: 'cordova-plugin-app-version',
|
||||
pluginRef: 'cordova.getAppVersion',
|
||||
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class AppVersion {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAppName(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the package name of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPackageName(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the build identifier of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getVersionCode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the version of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getVersionNumber(): Promise<any> { return; }
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Cordova, Plugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface Location {
|
||||
export interface BackgroundGeolocationResponse {
|
||||
|
||||
/**
|
||||
* ID of location as stored in DB (or null)
|
||||
@@ -49,6 +49,11 @@ export interface Location {
|
||||
*/
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
* bearing, in degrees.
|
||||
*/
|
||||
@@ -65,7 +70,7 @@ export interface Location {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
|
||||
@@ -268,11 +273,11 @@ export interface Config {
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* Location
|
||||
* Config
|
||||
* BackgroundGeolocationResponse
|
||||
* BackgroundGeolocationConfig
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BackgroundGeolocation',
|
||||
pluginName: 'BackgroundGeolocation',
|
||||
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
||||
pluginRef: 'backgroundGeolocation',
|
||||
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
|
||||
@@ -341,17 +346,19 @@ export class BackgroundGeolocation {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configure(callback: Function, errorCallback: Function, options: Config): any { return; }
|
||||
static configure(callback: Function, errorCallback: Function, options: BackgroundGeolocationConfig): any { return; }
|
||||
|
||||
/**
|
||||
* Turn ON the background-geolocation system.
|
||||
* The user will be tracked whenever they suspend the app.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static start(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Turn OFF background-tracking
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stop(): Promise<any> { return; }
|
||||
@@ -372,23 +379,26 @@ export class BackgroundGeolocation {
|
||||
|
||||
/**
|
||||
* Setup configuration
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static setConfig(options: Config): Promise<any> { return; }
|
||||
static setConfig(options: BackgroundGeolocationConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns current stationaryLocation if available. null if not
|
||||
* NOTE: IOS, WP only
|
||||
* @returns {Promise<Location>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getStationaryLocation(): Promise<Location> { return; }
|
||||
static getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
||||
|
||||
/**
|
||||
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
|
||||
* your #success callback will be executed with #location param containing #radius of region
|
||||
* NOTE: IOS, WP only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static onStationary(): Promise<any> { return; }
|
||||
@@ -418,6 +428,7 @@ export class BackgroundGeolocation {
|
||||
* If user enable or disable location services then success callback will be executed.
|
||||
* In case or error (SettingNotFoundException) fail callback will be executed.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static watchLocationMode(): Promise<boolean> { return; }
|
||||
@@ -437,12 +448,14 @@ export class BackgroundGeolocation {
|
||||
* or
|
||||
* - option.debug is true
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getValidLocations(): Promise<any> { return; }
|
||||
@@ -450,6 +463,7 @@ export class BackgroundGeolocation {
|
||||
/**
|
||||
* Delete stored location by given locationId.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteLocation(locationId: number): Promise<any> { return; }
|
||||
@@ -457,6 +471,7 @@ export class BackgroundGeolocation {
|
||||
/**
|
||||
* Delete all stored locations.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteAllLocations(): Promise<any> { return; }
|
||||
@@ -474,6 +489,7 @@ export class BackgroundGeolocation {
|
||||
* NOTE: iOS only
|
||||
*
|
||||
* @param {number} See above.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static switchMode(modeId: number): Promise<any> { return; }
|
||||
@@ -483,7 +499,9 @@ export class BackgroundGeolocation {
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
|
||||
*
|
||||
* @param {number} Limits the number of entries
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLogEntries(limit: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -2,39 +2,62 @@ import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface BackgroundModeConfiguration {
|
||||
|
||||
/**
|
||||
* Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
* Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Background Mode
|
||||
* @description
|
||||
* Cordova plugin to prevent the app from going to sleep while in background.
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
|
||||
*@usage
|
||||
* ```typescript
|
||||
* import { BackgroundMode } from 'ionic-native';
|
||||
*
|
||||
* BackgroundMode.enable();
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* Configuration options
|
||||
*
|
||||
* | Property | Type | Description |
|
||||
* |----------|-----------|------------------------------------------------------------------------------|
|
||||
* | title | `string` | Title of the background task. Optional |
|
||||
* | ticker | `string` | The text that scrolls itself on the statusbar. Optional |
|
||||
* | text | `string` | Description of the background task. Optional |
|
||||
* | silent | `boolean` | If the plugin will display a notification or not. Default is false. Optional |
|
||||
* | resume | `boolean` | Bring the app into the foreground if the notification is tapped. Optional |
|
||||
*
|
||||
*
|
||||
* @interfaces
|
||||
* BackgroundModeConfiguration
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BackgroundMode',
|
||||
pluginName: 'BackgroundMode',
|
||||
plugin: 'cordova-plugin-background-mode',
|
||||
pluginRef: 'cordova.plugins.backgroundMode',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Enable the background mode.
|
||||
* Once called, prevents the app from being paused while in background.
|
||||
@@ -49,21 +72,25 @@ export class BackgroundMode {
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
@Cordova()
|
||||
static disable(): void { }
|
||||
static disable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {boolean} returns a true of false if the background mode is enabled.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is enabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isEnabled(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
* @returns {boolean} returns tru or flase if the background mode is active.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is active.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isActive(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
@@ -73,7 +100,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: Configure): void { }
|
||||
static setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
@@ -83,55 +110,27 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static configure(options?: Configure): void { }
|
||||
static configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Called when background mode is activated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is activated
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode is deactivated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is deactivated
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static ondeactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode fails
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode fails
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onfailure(): Observable<any> { return; };
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface Configure {
|
||||
/**
|
||||
*Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
*The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
*Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
*Boolean, if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
*Boolean. By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
}
|
||||
|
||||
44
src/plugins/backlight.ts
Normal file
44
src/plugins/backlight.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Backlight
|
||||
* @description
|
||||
* This plugin adds turning on/off the device backlight.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Backlight } from 'ionic-native';
|
||||
*
|
||||
* // Turn backlight on
|
||||
* Backlight.on().then(() => console.log('backlight on'));
|
||||
*
|
||||
* // Turn backlight off
|
||||
* Backlight.off().then(() => console.log('backlight off'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Backlight',
|
||||
plugin: 'cordova-plugin-backlight',
|
||||
pluginRef: 'cordova.plugins.Backlight',
|
||||
repo: 'https://github.com/mebibou/cordova-plugin-backlight',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class Backlight {
|
||||
|
||||
/**
|
||||
* This function turns backlight on
|
||||
* @return {Promise<any>} Returns a promise that resolves when the backlight is on
|
||||
*/
|
||||
@Cordova()
|
||||
static on(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This function turns backlight off
|
||||
* @return {Promise<any>} Returns a promise that resolves when the backlight is off
|
||||
*/
|
||||
@Cordova()
|
||||
static off(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Badge',
|
||||
pluginName: 'Badge',
|
||||
plugin: 'cordova-plugin-badge',
|
||||
pluginRef: 'cordova.plugins.notification.badge',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-badge',
|
||||
@@ -28,6 +28,7 @@ export class Badge {
|
||||
|
||||
/**
|
||||
* Clear the badge of the app icon.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(): Promise<boolean> { return; }
|
||||
@@ -35,14 +36,14 @@ export class Badge {
|
||||
/**
|
||||
* Set the badge of the app icon.
|
||||
* @param {number} badgeNumber The new badge number.
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static set(badgeNumber: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the badge of the app icon.
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> { return; }
|
||||
@@ -50,7 +51,7 @@ export class Badge {
|
||||
/**
|
||||
* Increase the badge number.
|
||||
* @param {number} increaseBy Count to add to the current badge number
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static increase(increaseBy: number): Promise<any> { return; }
|
||||
@@ -58,20 +59,21 @@ export class Badge {
|
||||
/**
|
||||
* Decrease the badge number.
|
||||
* @param {number} decreaseBy Count to subtract from the current badge number
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static decrease(decreaseBy: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determine if the app has permission to show badges.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to set badge notifications
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<any> { return; }
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface BarcodeScannerOptions {
|
||||
|
||||
/**
|
||||
* Prefer front camera. Supported on iOS and Android.
|
||||
*/
|
||||
preferFrontCamera?: boolean;
|
||||
|
||||
/**
|
||||
* Show flip camera button. Supported on iOS and Android.
|
||||
*/
|
||||
showFlipCameraButton?: boolean;
|
||||
|
||||
/**
|
||||
* Show torch button. Supported on iOS and Android.
|
||||
*/
|
||||
showTorchButton?: boolean;
|
||||
|
||||
/**
|
||||
* Disable animations. Supported on iOS only.
|
||||
*/
|
||||
disableAnimations?: boolean;
|
||||
|
||||
/**
|
||||
* Prompt text. Supported on Android only.
|
||||
*/
|
||||
prompt?: string;
|
||||
|
||||
/**
|
||||
* Formats separated by commas. Defaults to all formats except `PDF_417` and `RSS_EXPANDED`.
|
||||
*/
|
||||
formats?: string;
|
||||
|
||||
/**
|
||||
* Orientation. Supported on Android only. Can be set to `portrait` or `landscape`. Defaults to none so the user can rotate the phone and pick an orientation.
|
||||
*/
|
||||
orientation?: string;
|
||||
|
||||
/**
|
||||
* Launch with the torch switched on (if available). Supported on Android only.
|
||||
*/
|
||||
torchOn?: boolean;
|
||||
|
||||
/**
|
||||
* Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only.
|
||||
*/
|
||||
resultDisplayDuration?: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Barcode Scanner
|
||||
* @description
|
||||
@@ -18,9 +67,11 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* BarcodeScannerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BarcodeScanner',
|
||||
pluginName: 'BarcodeScanner',
|
||||
plugin: 'phonegap-plugin-barcodescanner',
|
||||
pluginRef: 'cordova.plugins.barcodeScanner',
|
||||
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',
|
||||
@@ -37,21 +88,23 @@ export class BarcodeScanner {
|
||||
PHONE_TYPE: 'PHONE_TYPE',
|
||||
SMS_TYPE: 'SMS_TYPE'
|
||||
};
|
||||
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
* @param options {Object} Optional options to pass to the scanner
|
||||
* @return Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
* @param options {BarcodeScannerOptions} Optional options to pass to the scanner
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static scan(options?: any): Promise<any> { return; }
|
||||
static scan(options?: BarcodeScannerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Encodes data into a barcode.
|
||||
* NOTE: not well supported on Android
|
||||
* @param type {string} Type of encoding
|
||||
* @param data {any} Data to encode
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static encode(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Base64 To Gallery
|
||||
* @description This plugin allows you to save base64 data as a png image into the device
|
||||
@@ -14,7 +15,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Base64ToGallery',
|
||||
pluginName: 'Base64ToGallery',
|
||||
plugin: 'cordova-base64-to-gallery',
|
||||
pluginRef: 'cordova',
|
||||
repo: 'https://github.com/Nexxa/cordova-base64-to-gallery',
|
||||
@@ -26,7 +27,7 @@ export class Base64ToGallery {
|
||||
* Converts a base64 string to an image file in the device gallery
|
||||
* @param {string} data The actual base64 string that you want to save
|
||||
* @param {any} options (optional) An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
|
||||
* @returns {Promise} returns a promise that resolves when the image is saved.
|
||||
* @returns {Promise<any>} returns a promise that resolves when the image is saved.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface BatteryStatusResponse {
|
||||
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Battery Status
|
||||
* @description
|
||||
@@ -22,10 +36,13 @@ import { Observable } from 'rxjs/Observable';
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* BatteryStatusResponse
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BatteryStatus',
|
||||
pluginName: 'BatteryStatus',
|
||||
plugin: 'cordova-plugin-battery-status',
|
||||
pluginRef: 'navigator.battery',
|
||||
repo: 'https://github.com/apache/cordova-plugin-battery-status',
|
||||
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']
|
||||
})
|
||||
@@ -33,44 +50,32 @@ export class BatteryStatus {
|
||||
|
||||
/**
|
||||
* Watch the change in battery level
|
||||
* @returns {Observable} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange(): Observable<StatusObject> { return; }
|
||||
static onChange(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
static onLow(): Observable<StatusObject> { return; }
|
||||
static onLow(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
static onCritical(): Observable<StatusObject> { return; }
|
||||
static onCritical(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface StatusObject {
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
}
|
||||
|
||||
@@ -160,13 +160,14 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BLE',
|
||||
pluginName: 'BLE',
|
||||
plugin: 'cordova-plugin-ble-central',
|
||||
pluginRef: 'ble',
|
||||
repo: 'https://github.com/don/cordova-plugin-ble-central',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class BLE {
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
@@ -178,7 +179,7 @@ export class BLE {
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param {number} seconds Number of seconds to run discovery
|
||||
* @return Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
@@ -199,12 +200,12 @@ export class BLE {
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
@@ -212,12 +213,12 @@ export class BLE {
|
||||
* Scans for BLE devices. This function operates similarly to the `startScan` function, but allows you to specify extra options (like allowing duplicate device reports).
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param options {any}
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
@@ -373,7 +374,7 @@ export class BLE {
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {string} serviceUUID UUID of the BLE service
|
||||
* @param {string} characteristicUUID UUID of the BLE characteristic
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopNotification(
|
||||
@@ -393,7 +394,7 @@ export class BLE {
|
||||
* );
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnected(deviceId: string): Promise<any> { return; }
|
||||
@@ -401,7 +402,7 @@ export class BLE {
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
*
|
||||
* @return {Promise<void>} Returns a Promise that resolves if Bluetooth is enabled, and rejects if disabled.
|
||||
* @returns {Promise<void>} Returns a Promise that resolves if Bluetooth is enabled, and rejects if disabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<void> { return; }
|
||||
@@ -409,7 +410,7 @@ export class BLE {
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static showBluetoothSettings(): Promise<any> { return; }
|
||||
@@ -417,8 +418,9 @@ export class BLE {
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'BluetoothSerial',
|
||||
pluginName: 'BluetoothSerial',
|
||||
repo: 'https://github.com/don/BluetoothSerial',
|
||||
plugin: 'cordova-plugin-bluetooth-serial',
|
||||
pluginRef: 'bluetoothSerial',
|
||||
@@ -39,7 +39,7 @@ export class BluetoothSerial {
|
||||
/**
|
||||
* Connect to a Bluetooth device
|
||||
* @param {string} macAddress_or_uuid Identifier of the remote device
|
||||
* @returns {Observable} Subscribe to connect, unsubscribe to disconnect.
|
||||
* @returns {Observable<any>} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -51,7 +51,7 @@ export class BluetoothSerial {
|
||||
/**
|
||||
* Connect insecurely to a Bluetooth device
|
||||
* @param {string} macAddress Identifier of the remote device
|
||||
* @returns {Observable} Subscribe to connect, unsubscribe to disconnect.
|
||||
* @returns {Observable<any>} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
@@ -63,7 +63,7 @@ export class BluetoothSerial {
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
* @param {any} data ArrayBuffer of data
|
||||
* @returns {Promise} returns a promise when data has been written
|
||||
* @returns {Promise<any>} returns a promise when data has been written
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -72,7 +72,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Gets the number of bytes of data available
|
||||
* @returns {Promise} returns a promise that contains the available bytes
|
||||
* @returns {Promise<any>} returns a promise that contains the available bytes
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -80,7 +80,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
* @returns {Promise} returns a promise with data from the buffer
|
||||
* @returns {Promise<any>} returns a promise with data from the buffer
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -90,7 +90,7 @@ export class BluetoothSerial {
|
||||
/**
|
||||
* Reads data from the buffer until it reaches a delimiter
|
||||
* @param {string} delimiter string that you want to search until
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -100,7 +100,7 @@ export class BluetoothSerial {
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @param {string} delimiter the string you want to watch for
|
||||
* @returns {Observable} returns an observable.
|
||||
* @returns {Observable<any>} returns an observable.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -111,7 +111,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @returns {Observable} returns an observable
|
||||
* @returns {Observable<any>} returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -122,7 +122,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
* @returns {Promise} returns a promise when completed
|
||||
* @returns {Promise<any>} returns a promise when completed
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -131,7 +131,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -140,7 +140,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -149,7 +149,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -158,7 +158,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -167,7 +167,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -176,7 +176,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -185,7 +185,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
* @returns {Promise} returns a promise
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -194,7 +194,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
|
||||
* @returns {Observable} Returns an observable
|
||||
* @returns {Observable<any>} Returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
|
||||
@@ -18,7 +18,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Brightness',
|
||||
pluginName: 'Brightness',
|
||||
plugin: 'cordova-plugin-brightness',
|
||||
pluginRef: 'cordova.plugins.brightness',
|
||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||
@@ -30,7 +30,7 @@ export class Brightness {
|
||||
* Sets the brightness of the display.
|
||||
*
|
||||
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
static setBrightness(value: number): Promise<any> { return; }
|
||||
@@ -38,7 +38,7 @@ export class Brightness {
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves with the
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
51
src/plugins/broadcaster.ts
Normal file
51
src/plugins/broadcaster.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Broadcaster
|
||||
* @description
|
||||
* This plugin adds exchanging events between native code and your app.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Broadcaster } from 'ionic-native';
|
||||
*
|
||||
* // Listen to events from Native
|
||||
* Broadcaster.addEventListener('eventName').then((event) => console.log(event));
|
||||
*
|
||||
* // Send event to Native
|
||||
* Broadcaster.fireNativeEvent('eventName', {}).then(() => console.log('success'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Broadcaster',
|
||||
plugin: 'cordova-plugin-broadcaster',
|
||||
pluginRef: 'broadcaster',
|
||||
repo: 'https://github.com/bsorrentino/cordova-broadcaster',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Broadcaster {
|
||||
|
||||
/**
|
||||
* This function listen to an event sent from the native code
|
||||
* @param eventName {string}
|
||||
* @return {Observable<any>} Returns an observable to watch when an event is received
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'removeEventListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addEventListener(eventName: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* This function sends data to the native code
|
||||
* @param eventName {string}
|
||||
* @param eventData {any}
|
||||
* @return {Promise<any>} Returns a promise that resolves when an event is successfully fired
|
||||
*/
|
||||
@Cordova()
|
||||
static fireNativeEvent(eventName: string, eventData: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,19 +1,55 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface CalendarOptions {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
firstReminderMinutes?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
secondReminderMinutes?: number;
|
||||
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
recurrenceInterval?: number; // only used when recurrence is set
|
||||
|
||||
/**
|
||||
* Recurrence. Can be set to `daily`, `weekly`, `monthly` or `yearly`
|
||||
*/
|
||||
recurrence?: string;
|
||||
|
||||
/**
|
||||
* Recurrence interval. Valid only when `recurrence` option is set.
|
||||
*/
|
||||
recurrenceInterval?: number;
|
||||
|
||||
/**
|
||||
* Recurrence end date. Valid only when `recurrence` option is set.
|
||||
*/
|
||||
recurrenceEndDate?: Date;
|
||||
|
||||
/**
|
||||
* Calendar name. Ths is supported by `iOS` only.
|
||||
*/
|
||||
calendarName?: string;
|
||||
|
||||
/**
|
||||
* Calendar id
|
||||
*/
|
||||
calendarId?: number;
|
||||
|
||||
/**
|
||||
* URL
|
||||
*/
|
||||
url?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,10 +71,11 @@ export interface CalendarOptions {
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CalendarOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Calendar',
|
||||
pluginName: 'Calendar',
|
||||
plugin: 'cordova-plugin-calendar',
|
||||
pluginRef: 'plugins.calendar',
|
||||
repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin',
|
||||
@@ -99,17 +136,15 @@ export class Calendar {
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @return {Promise} Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createCalendar(
|
||||
nameOrOptions: string | { calendarName: string, calendarColor: string }
|
||||
): Promise<any> { return; }
|
||||
static createCalendar(nameOrOptions: string | any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
* @param {string} name Name of the calendar to delete.
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteCalendar(name: string): Promise<any> { return; }
|
||||
@@ -117,31 +152,12 @@ export class Calendar {
|
||||
/**
|
||||
* Returns the default calendar options.
|
||||
*
|
||||
* @return Returns an object with the default calendar options:
|
||||
* firstReminderMinutes: 60,
|
||||
* secondReminderMinutes: null,
|
||||
* recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
* recurrenceInterval: 1, // only used when recurrence is set
|
||||
* recurrenceEndDate: null,
|
||||
* calendarName: null,
|
||||
* calendarId: null,
|
||||
* url: null
|
||||
* @return {CalendarOptions} Returns an object with the default calendar options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static getCalendarOptions(): CalendarOptions {
|
||||
return {
|
||||
firstReminderMinutes: 60,
|
||||
secondReminderMinutes: null,
|
||||
recurrence: null,
|
||||
recurrenceInterval: 1,
|
||||
recurrenceEndDate: null,
|
||||
calendarName: null,
|
||||
calendarId: null,
|
||||
url: null
|
||||
};
|
||||
}
|
||||
static getCalendarOptions(): CalendarOptions { return; }
|
||||
|
||||
/**
|
||||
* Silently create an event.
|
||||
@@ -150,7 +166,7 @@ export class Calendar {
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEvent(
|
||||
@@ -170,7 +186,7 @@ export class Calendar {
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventWithOptions(
|
||||
@@ -190,7 +206,7 @@ export class Calendar {
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventInteractively(
|
||||
@@ -210,7 +226,7 @@ export class Calendar {
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventInteractivelyWithOptions(
|
||||
@@ -241,7 +257,7 @@ export class Calendar {
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static findEvent(
|
||||
@@ -260,7 +276,7 @@ export class Calendar {
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise that resolves with the event, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the event, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static findEventWithOptions(
|
||||
@@ -277,23 +293,27 @@ export class Calendar {
|
||||
*
|
||||
* @param {Date} [startDate] The start date
|
||||
* @param {Date} [endDate] The end date
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get a list of all calendars.
|
||||
* @return A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
* @returns {Promise<any>} A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static listCalendars(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -311,7 +331,9 @@ export class Calendar {
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static modifyEvent(
|
||||
title?: string,
|
||||
location?: string,
|
||||
@@ -342,7 +364,9 @@ export class Calendar {
|
||||
* @param {CalendarOptions} [newOptions] New event options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
@@ -388,7 +412,9 @@ export class Calendar {
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
|
||||
@@ -16,17 +16,19 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'CallNumber',
|
||||
pluginName: 'CallNumber',
|
||||
plugin: 'call-number',
|
||||
pluginRef: 'plugins.CallNumber',
|
||||
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CallNumber {
|
||||
|
||||
/**
|
||||
* Calls a phone number
|
||||
* @param numberToCall {string} The phone number to call as a string
|
||||
* @param bypassAppChooser {boolean} Set to true to bypass the app chooser and go directly to dialer
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -34,4 +36,5 @@ export class CallNumber {
|
||||
static callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +1,37 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CameraPreviewRect {
|
||||
|
||||
x: number;
|
||||
|
||||
y: number;
|
||||
|
||||
width: number;
|
||||
|
||||
height: number;
|
||||
|
||||
}
|
||||
|
||||
export interface CameraPreviewSize {
|
||||
|
||||
maxWidth: number;
|
||||
|
||||
maxHeight: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
*
|
||||
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/westonganger/cordova-plugin-camera-preview).
|
||||
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { CameraPreview } from 'ionic-native';
|
||||
* import { CameraPreview, CameraPreviewRect } from 'ionic-native';
|
||||
*
|
||||
* // camera options (Size and location)
|
||||
* let cameraRect: CameraPreviewRect = {
|
||||
@@ -38,9 +46,10 @@ export interface CameraPreviewSize {
|
||||
* CameraPreview.startCamera(
|
||||
* cameraRect, // position and size of preview
|
||||
* 'front', // default camera
|
||||
* true, // tape to take picture
|
||||
* true, // tap to take picture
|
||||
* false, // disable drag
|
||||
* true // send the preview to the back of the screen so we can add overlaying elements
|
||||
* false, // keep preview in front. Set to true (back of the screen) to apply overlaying elements
|
||||
* 1 // set the preview alpha
|
||||
* );
|
||||
*
|
||||
* // Set the handler to run every time we take a picture
|
||||
@@ -67,12 +76,15 @@ export interface CameraPreviewSize {
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CameraPreviewRect
|
||||
* CameraPreviewSize
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'CameraPreview',
|
||||
pluginName: 'CameraPreview',
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
pluginRef: 'cordova.plugins.camerapreview',
|
||||
repo: 'https://github.com/westonganger/cordova-plugin-camera-preview',
|
||||
repo: 'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class CameraPreview {
|
||||
@@ -89,7 +101,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { };
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { }
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance.
|
||||
@@ -97,7 +109,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static stopCamera(): void { };
|
||||
static stopCamera(): void { }
|
||||
|
||||
/**
|
||||
* Take the picture, the parameter size is optional
|
||||
@@ -106,15 +118,16 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static takePicture(size: CameraPreviewSize): void { };
|
||||
static takePicture(size?: CameraPreviewSize): void { }
|
||||
|
||||
/**
|
||||
* Register a callback function that receives the original picture and the image captured from the preview box.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static setOnPictureTakenHandler(): Observable<any> { return; };
|
||||
static setOnPictureTakenHandler(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
@@ -122,7 +135,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static switchCamera(): void { };
|
||||
static switchCamera(): void { }
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
@@ -130,7 +143,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static show(): void { };
|
||||
static show(): void { }
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
@@ -138,7 +151,15 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide(): void { };
|
||||
static hide(): void { }
|
||||
|
||||
/**
|
||||
* Disables the camera preview
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disable(): void { }
|
||||
|
||||
/**
|
||||
* Set camera color effect.
|
||||
@@ -146,5 +167,6 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static setColorEffect(effect: string): void { };
|
||||
static setColorEffect(effect: string): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ export interface CameraOptions {
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in Camera.Direction. Default is BACK.
|
||||
* FRONT: 0
|
||||
* BACK: 1
|
||||
* BACK: 0
|
||||
* FRONT: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
@@ -110,18 +110,19 @@ export interface CameraPopoverOptions {
|
||||
* CameraPopoverOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Camera',
|
||||
pluginName: 'Camera',
|
||||
plugin: 'cordova-plugin-camera',
|
||||
pluginRef: 'navigator.camera',
|
||||
repo: 'https://github.com/apache/cordova-plugin-camera',
|
||||
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
|
||||
})
|
||||
export class Camera {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
public static DestinationType = {
|
||||
static DestinationType = {
|
||||
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
|
||||
DATA_URL: 0,
|
||||
/** Return file uri (content://media/external/images/media/2 for Android) */
|
||||
@@ -134,7 +135,7 @@ export class Camera {
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
public static EncodingType = {
|
||||
static EncodingType = {
|
||||
/** Return JPEG encoded image */
|
||||
JPEG: 0,
|
||||
/** Return PNG encoded image */
|
||||
@@ -144,7 +145,7 @@ export class Camera {
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
public static MediaType = {
|
||||
static MediaType = {
|
||||
/** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
|
||||
PICTURE: 0,
|
||||
/** Allow selection of video only, ONLY RETURNS URL */
|
||||
@@ -157,7 +158,7 @@ export class Camera {
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
public static PictureSourceType = {
|
||||
static PictureSourceType = {
|
||||
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
|
||||
PHOTOLIBRARY: 0,
|
||||
/** Take picture from camera */
|
||||
@@ -171,7 +172,7 @@ export class Camera {
|
||||
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
|
||||
* @enum {number}
|
||||
*/
|
||||
public static PopoverArrowDirection = {
|
||||
static PopoverArrowDirection = {
|
||||
ARROW_UP: 1,
|
||||
ARROW_DOWN: 2,
|
||||
ARROW_LEFT: 4,
|
||||
@@ -183,7 +184,7 @@ export class Camera {
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
public static Direction = {
|
||||
static Direction = {
|
||||
/** Use the back-facing camera */
|
||||
BACK: 0,
|
||||
/** Use the front-facing camera */
|
||||
@@ -192,8 +193,8 @@ export class Camera {
|
||||
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions?} options Options that you want to pass to the camera. Encoding type, quality, etc. Optional
|
||||
* @return {Promise} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
* @param {CameraOptions?} options optional. Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-).
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -203,7 +204,7 @@ export class Camera {
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
|
||||
@@ -1,6 +1,134 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface CardIOOptions {
|
||||
|
||||
/**
|
||||
* Set to true to require expiry date
|
||||
*/
|
||||
requireExpiry?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the card CVV
|
||||
*/
|
||||
requireCVV?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the card billing postal code.
|
||||
*/
|
||||
requirePostalCode?: boolean;
|
||||
|
||||
/**
|
||||
* Removes the keyboard button from the scan screen.
|
||||
*/
|
||||
supressManual?: boolean;
|
||||
|
||||
/**
|
||||
* The postal code will only collect numeric input. Set this if you know the expected country's postal code has only numeric postal codes.
|
||||
*/
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
|
||||
/**
|
||||
* The theme for the card.io Activity's will be set to the theme of the application.
|
||||
*/
|
||||
keepApplicationTheme?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the cardholder name
|
||||
*/
|
||||
requireCardholderName?: boolean;
|
||||
|
||||
/**
|
||||
* Used to display instructions to the user while they are scanning their card.
|
||||
*/
|
||||
scanInstructions?: string;
|
||||
|
||||
/**
|
||||
* If set, the card will not be scanned with the camera.
|
||||
*/
|
||||
noCamera?: boolean;
|
||||
|
||||
/**
|
||||
* If scanExpiry is true, an attempt to extract the expiry from the card image will be made.
|
||||
*/
|
||||
scanExpiry?: boolean;
|
||||
|
||||
/**
|
||||
* The preferred language for all strings appearing in the user interface. If not set, or if set to null, defaults to the device's current language setting.
|
||||
*/
|
||||
languageOrLocale?: string;
|
||||
|
||||
/**
|
||||
* Changes the color of the guide overlay on the camera. The color is provided in hexadecimal format (e.g. `#FFFFFF`)
|
||||
*/
|
||||
guideColor?: string;
|
||||
|
||||
/**
|
||||
* The user will not be prompted to confirm their card number after processing.
|
||||
*/
|
||||
supressConfirmation?: boolean;
|
||||
|
||||
/**
|
||||
* The card.io logo will not be shown overlaid on the camera.
|
||||
*/
|
||||
hideCardIOLogo?: boolean;
|
||||
|
||||
/**
|
||||
* The card.io logo will be shown instead of the PayPal logo.
|
||||
*/
|
||||
useCardIOLogo?: boolean;
|
||||
|
||||
/**
|
||||
* Once a card image has been captured but before it has been processed, this value will determine whether to continue processing as usual.
|
||||
*/
|
||||
supressScan?: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOResponse {
|
||||
|
||||
/**
|
||||
* Card type
|
||||
*/
|
||||
cardType: string;
|
||||
|
||||
/**
|
||||
* Masked card number, showing only last 4 digits
|
||||
*/
|
||||
redactedCardNumber: string;
|
||||
|
||||
/**
|
||||
* Full card number
|
||||
*/
|
||||
cardNumber: string;
|
||||
|
||||
/**
|
||||
* Expiry month
|
||||
*/
|
||||
expiryMonth: number;
|
||||
|
||||
/**
|
||||
* Expiry year
|
||||
*/
|
||||
expiryYear: number;
|
||||
|
||||
/**
|
||||
* CVV
|
||||
*/
|
||||
cvv: string;
|
||||
|
||||
/**
|
||||
* Postal code
|
||||
*/
|
||||
postalCode: string;
|
||||
|
||||
/**
|
||||
* Cardholder name
|
||||
*/
|
||||
cardholderName: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name CardIO
|
||||
* @description
|
||||
@@ -23,19 +151,24 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CardIOOptions
|
||||
* CardIOResponse
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'CardIO',
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
pluginName: 'CardIO',
|
||||
plugin: 'card.io.cordova.mobilesdk',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CardIO {
|
||||
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static canScan(): Promise<boolean> { return; }
|
||||
@@ -43,33 +176,16 @@ export class CardIO {
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param {CardIOOptions} options Options for configuring the plugin
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<any> { return; }
|
||||
static scan(options?: CardIOOptions): Promise<CardIOResponse> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve the version of the card.io library. Useful when contacting support.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
requireExpiry?: boolean;
|
||||
requireCCV?: boolean;
|
||||
requirePostalCode?: boolean;
|
||||
supressManual?: boolean;
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
keepApplicationTheme?: boolean;
|
||||
requireCardholderName?: boolean;
|
||||
scanInstructions?: string;
|
||||
noCamera?: boolean;
|
||||
scanExpiry?: boolean;
|
||||
languageOrLocale?: string;
|
||||
guideColor?: string;
|
||||
supressConfirmation?: boolean;
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Clipboard
|
||||
* @description
|
||||
@@ -28,7 +27,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Clipboard',
|
||||
pluginName: 'Clipboard',
|
||||
plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git',
|
||||
pluginRef: 'cordova.plugins.clipboard',
|
||||
repo: 'https://github.com/VersoSolutions/CordovaClipboard',
|
||||
@@ -39,14 +38,14 @@ export class Clipboard {
|
||||
/**
|
||||
* Copies the given text
|
||||
* @param {string} text Text that gets copied on the system clipboard
|
||||
* @returns {Promise<T>} Returns a promise after the text has been copied
|
||||
* @returns {Promise<any>} Returns a promise after the text has been copied
|
||||
*/
|
||||
@Cordova()
|
||||
static copy(text: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Pastes the text stored in clipboard
|
||||
* @returns {Promise<T>} Returns a promise after the text has been pasted
|
||||
* @returns {Promise<any>} Returns a promise after the text has been pasted
|
||||
*/
|
||||
@Cordova()
|
||||
static paste(): Promise<any> { return; }
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
// below are taken from
|
||||
// https://raw.githubusercontent.com/Microsoft/cordova-plugin-code-push/master/typings/codePush.d.ts
|
||||
// and adjusted to remove warnings and access control
|
||||
|
||||
namespace Http {
|
||||
export const enum Verb {
|
||||
GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
|
||||
@@ -420,7 +416,7 @@ export interface DownloadProgress {
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'CodePush',
|
||||
pluginName: 'CodePush',
|
||||
plugin: 'cordova-plugin-code-push',
|
||||
pluginRef: 'codePush',
|
||||
repo: 'https://github.com/Microsoft/cordova-plugin-code-push',
|
||||
@@ -433,6 +429,7 @@ export class CodePush {
|
||||
*
|
||||
* @param packageSuccess Callback invoked with the currently deployed package information.
|
||||
* @param packageError Optional callback invoked in case of an error.
|
||||
* @returns {Promise<ILocalPackage>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentPackage(): Promise<ILocalPackage> {
|
||||
@@ -442,6 +439,7 @@ export class CodePush {
|
||||
/**
|
||||
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
|
||||
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
|
||||
* @returns {Promise<ILocalPackage>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPendingPackage(): Promise<ILocalPackage> {
|
||||
@@ -456,6 +454,7 @@ export class CodePush {
|
||||
* A null package means the application is up to date for the current native application version.
|
||||
* @param queryError Optional callback invoked in case of an error.
|
||||
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
|
||||
* @returns {Promise<IRemotePackage>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -471,6 +470,7 @@ export class CodePush {
|
||||
*
|
||||
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
|
||||
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static notifyApplicationReady(): Promise<void> {
|
||||
@@ -480,6 +480,7 @@ export class CodePush {
|
||||
/**
|
||||
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
|
||||
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static restartApplication(): Promise<void> {
|
||||
@@ -504,6 +505,7 @@ export class CodePush {
|
||||
* @param syncCallback Optional callback to be called with the status of the sync operation.
|
||||
* @param syncOptions Optional SyncOptions parameter configuring the behavior of the sync operation.
|
||||
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
|
||||
* @returns {Observable<SyncStatus>}
|
||||
*
|
||||
*/
|
||||
@Cordova({
|
||||
|
||||
@@ -1,38 +1,54 @@
|
||||
import { Cordova, CordovaInstance, InstanceProperty, Plugin } from './plugin';
|
||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise } from './plugin';
|
||||
|
||||
declare var window: any,
|
||||
navigator: any;
|
||||
|
||||
export type ContactFieldType = 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'familyName' | 'formatted' | 'givenName' | 'honorificPrefix' | 'honorificSuffix' | 'id' | 'ims' | 'locality' | 'middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface IContactProperties {
|
||||
|
||||
/** A globally unique identifier. */
|
||||
id?: string;
|
||||
|
||||
/** The name of this Contact, suitable for display to end users. */
|
||||
displayName?: string;
|
||||
|
||||
/** An object containing all components of a persons name. */
|
||||
name?: IContactName;
|
||||
|
||||
/** A casual name by which to address the contact. */
|
||||
nickname?: string;
|
||||
|
||||
/** An array of all the contact's phone numbers. */
|
||||
phoneNumbers?: IContactField[];
|
||||
|
||||
/** An array of all the contact's email addresses. */
|
||||
emails?: IContactField[];
|
||||
|
||||
/** An array of all the contact's addresses. */
|
||||
addresses?: IContactAddress[];
|
||||
|
||||
/** An array of all the contact's IM addresses. */
|
||||
ims?: IContactField[];
|
||||
|
||||
/** An array of all the contact's organizations. */
|
||||
organizations?: IContactOrganization[];
|
||||
|
||||
/** The birthday of the contact. */
|
||||
birthday?: Date;
|
||||
|
||||
/** A note about the contact. */
|
||||
note?: string;
|
||||
|
||||
/** An array of the contact's photos. */
|
||||
photos?: IContactField[];
|
||||
|
||||
/** An array of all the user-defined categories associated with the contact. */
|
||||
categories?: IContactField[];
|
||||
|
||||
/** An array of web pages associated with the contact. */
|
||||
urls?: IContactField[];
|
||||
}
|
||||
@@ -42,20 +58,20 @@ export interface IContactProperties {
|
||||
*/
|
||||
export class Contact implements IContactProperties {
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty get id(): string { return; }
|
||||
@InstanceProperty get displayName(): string { return; }
|
||||
@InstanceProperty get name(): IContactName {return; }
|
||||
@InstanceProperty get nickname(): string { return; }
|
||||
@InstanceProperty get phoneNumbers(): IContactField[] { return; }
|
||||
@InstanceProperty get emails(): IContactField[] { return; }
|
||||
@InstanceProperty get addresses(): IContactAddress[] { return; }
|
||||
@InstanceProperty get ims(): IContactField[] { return; }
|
||||
@InstanceProperty get organizations(): IContactOrganization[] { return; }
|
||||
@InstanceProperty get birthday(): Date { return; }
|
||||
@InstanceProperty get note(): string { return; }
|
||||
@InstanceProperty get photos(): IContactField[] { return; }
|
||||
@InstanceProperty get categories(): IContactField[] { return; }
|
||||
@InstanceProperty get urls(): IContactField[] { return; }
|
||||
@InstanceProperty id: string;
|
||||
@InstanceProperty displayName: string;
|
||||
@InstanceProperty name: IContactName;
|
||||
@InstanceProperty nickname: string;
|
||||
@InstanceProperty phoneNumbers: IContactField[];
|
||||
@InstanceProperty emails: IContactField[];
|
||||
@InstanceProperty addresses: IContactAddress[];
|
||||
@InstanceProperty ims: IContactField[];
|
||||
@InstanceProperty organizations: IContactOrganization[];
|
||||
@InstanceProperty birthday: Date;
|
||||
@InstanceProperty note: string;
|
||||
@InstanceProperty photos: IContactField[];
|
||||
@InstanceProperty categories: IContactField[];
|
||||
@InstanceProperty urls: IContactField[];
|
||||
|
||||
constructor() {
|
||||
this._objectInstance = navigator.contacts.create();
|
||||
@@ -73,8 +89,14 @@ export class Contact implements IContactProperties {
|
||||
@CordovaInstance()
|
||||
remove(): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
save(): Promise<any> { return; }
|
||||
save(): Promise<any> {
|
||||
return getPromise((resolve, reject) => {
|
||||
this._objectInstance.save((contact) => {
|
||||
this._objectInstance = contact;
|
||||
resolve(this);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,49 +142,37 @@ export interface IContactName {
|
||||
* @private
|
||||
*/
|
||||
export class ContactName implements IContactName {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(formatted?: string, familyName?: string, givenName?: string, middleName?: string, honorificPrefix?: string, honorificSuffix?: string) {
|
||||
this._objectInstance = new window.ContactName(formatted, familyName, givenName, middleName, honorificPrefix, honorificSuffix);
|
||||
}
|
||||
|
||||
@InstanceProperty get formatted(): string { return; }
|
||||
@InstanceProperty get familyName(): string { return; }
|
||||
@InstanceProperty get givenName(): string { return; }
|
||||
@InstanceProperty get middleName(): string { return; }
|
||||
@InstanceProperty get honorificPrefix(): string { return; }
|
||||
@InstanceProperty get honorificSuffix(): string { return; }
|
||||
constructor(public formatted?: string,
|
||||
public familyName?: string,
|
||||
public givenName?: string,
|
||||
public middleName?: string,
|
||||
public honorificPrefix?: string,
|
||||
public honorificSuffix?: string) {}
|
||||
}
|
||||
|
||||
export interface IContactField {
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type: string;
|
||||
type?: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value: string;
|
||||
value?: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref: boolean;
|
||||
pref?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactField implements IContactField {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(type?: string, value?: string, pref?: boolean) {
|
||||
this._objectInstance = new window.ContactField(type, value, pref);
|
||||
}
|
||||
|
||||
@InstanceProperty get type(): string { return; }
|
||||
@InstanceProperty get value(): string { return; }
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
constructor(public type?: string,
|
||||
public value?: string,
|
||||
public pref?: boolean) {}
|
||||
}
|
||||
|
||||
export interface IContactAddress {
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
type?: string;
|
||||
type?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
@@ -181,42 +191,21 @@ export interface IContactAddress {
|
||||
* @private
|
||||
*/
|
||||
export class ContactAddress implements IContactAddress {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(pref?: boolean,
|
||||
type?: string,
|
||||
formatted?: string,
|
||||
streetAddress?: string,
|
||||
locality?: string,
|
||||
region?: string,
|
||||
postalCode?: string,
|
||||
country?: string) {
|
||||
this._objectInstance = new window.ContactAddress(pref, type, formatted, streetAddress, locality, region, postalCode, country);
|
||||
}
|
||||
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
@InstanceProperty get type(): string { return; }
|
||||
/** The full address formatted for display. */
|
||||
@InstanceProperty get formatted(): string { return; }
|
||||
/** The full street address. */
|
||||
@InstanceProperty get streetAddress(): string { return; }
|
||||
/** The city or locality. */
|
||||
@InstanceProperty get locality(): string { return; }
|
||||
/** The state or region. */
|
||||
@InstanceProperty get region(): string { return; }
|
||||
/** The zip code or postal code. */
|
||||
@InstanceProperty get postalCode(): string { return; }
|
||||
/** The country name. */
|
||||
@InstanceProperty get country(): string { return; }
|
||||
constructor(public pref?: boolean,
|
||||
public type?: string,
|
||||
public formatted?: string,
|
||||
public streetAddress?: string,
|
||||
public locality?: string,
|
||||
public region?: string,
|
||||
public postalCode?: string,
|
||||
public country?: string) {}
|
||||
}
|
||||
|
||||
export interface IContactOrganization {
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
type?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
@@ -229,29 +218,22 @@ export interface IContactOrganization {
|
||||
* @private
|
||||
*/
|
||||
export class ContactOrganization implements IContactOrganization {
|
||||
private _objectInstance: any;
|
||||
constructor() {
|
||||
this._objectInstance = new window.ContactOrganization();
|
||||
}
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
@InstanceProperty get type(): string { return; }
|
||||
/** The name of the organization. */
|
||||
@InstanceProperty get name(): string { return; }
|
||||
/** The department the contract works for. */
|
||||
@InstanceProperty get department(): string { return; }
|
||||
/** The contact's title at the organization. */
|
||||
@InstanceProperty get title(): string { return; }
|
||||
constructor(
|
||||
public type?: string,
|
||||
public name?: string,
|
||||
public department?: string,
|
||||
public title?: string,
|
||||
public pref?: boolean
|
||||
) {}
|
||||
}
|
||||
|
||||
/** Search options to filter navigator.contacts. */
|
||||
export interface IContactFindOptions {
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** Determines if the find operation returns multiple navigator.contacts. */
|
||||
/** Determines if the find operation returns multiple navigator.contacts. Defaults to false. */
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
/** Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
@@ -263,31 +245,10 @@ export interface IContactFindOptions {
|
||||
* @private
|
||||
*/
|
||||
export class ContactFindOptions implements IContactFindOptions {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor() {
|
||||
this._objectInstance = new window.ContactFindOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* The search string used to find navigator.contacts. (Default: "")
|
||||
*/
|
||||
@InstanceProperty get filter(): string { return; }
|
||||
|
||||
/**
|
||||
* Determines if the find operation returns multiple navigator.contacts. (Default: false)
|
||||
*/
|
||||
@InstanceProperty get multiple(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields.
|
||||
*/
|
||||
@InstanceProperty get desiredFields(): any { return; }
|
||||
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
*/
|
||||
@InstanceProperty get hasPhoneNumber(): boolean { return; }
|
||||
constructor(public filter?: string,
|
||||
public multiple?: boolean,
|
||||
public desiredFields?: string[],
|
||||
public hasPhoneNumber?: boolean) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,33 +259,39 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { Contact } from 'ionic-native';
|
||||
* import { Contacts, Contact, ContactField, ContactName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let contact = new Contact();
|
||||
* contact.displayName = 'Mr. Ionitron';
|
||||
* let contact: Contact = Contacts.create();
|
||||
*
|
||||
* contact.name = new ContactName(null, 'Smith', 'John');
|
||||
* contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
|
||||
* contact.save().then(
|
||||
* () => console.log('Contact saved!', contact),
|
||||
* (error: any) => console.error('Error saving contact.', error)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IContactProperties
|
||||
* @classes
|
||||
* ContactFindOptions
|
||||
* ContactOrganization
|
||||
* ContactAddress
|
||||
* IContactError
|
||||
* IContactName
|
||||
* IContactField
|
||||
* IContactAddress
|
||||
* IContactOrganization
|
||||
* IContactFindOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Contacts',
|
||||
pluginName: 'Contacts',
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
pluginRef: 'navigator.contacts',
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts'
|
||||
})
|
||||
export class Contacts {
|
||||
|
||||
/**
|
||||
* Create a single contact.
|
||||
* @return Returns a object Contact
|
||||
* @returns {Contact} Returns a Contact object
|
||||
*/
|
||||
static create(): Contact {
|
||||
return new Contact();
|
||||
@@ -332,29 +299,38 @@ export class Contacts {
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
* A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
|
||||
* A contactFields value of "*" searches all contact fields.
|
||||
*
|
||||
* @param options {Object} the options to query with:
|
||||
* filter: The search string used to find navigator.contacts. (string) (Default: "")
|
||||
* multiple: Determines if the find operation returns multiple navigator.contacts. (Boolean) (Default: false)
|
||||
* desiredFields: Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. (DOMString[]) [Optional]
|
||||
* hasPhoneNumber(Android only): Filters the search to only return contacts with a phone number informed. (Boolean) (Default: false)
|
||||
*
|
||||
* @return Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
* @param fields {ContactFieldType[]} Contact fields to be used as a search qualifier
|
||||
* @param options {IContactFindOptions} Optional options for the query
|
||||
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static find(fields: string[], options?: any): Promise<any> { return; }
|
||||
static find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.find(fields, (contacts) => {
|
||||
resolve(contacts.map(processContact));
|
||||
}, reject, options);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a single Contact.
|
||||
* @return Returns a Promise that resolves with the selected Contact
|
||||
* @returns {Promise<Contact>} Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
@Cordova()
|
||||
static pickContact(): Promise<any> { return; }
|
||||
static pickContact(): Promise<Contact> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function processContact(contact) {
|
||||
let newContact = new Contact();
|
||||
for (let prop in contact) {
|
||||
if (typeof contact[prop] === 'function') continue;
|
||||
newContact[prop] = contact[prop];
|
||||
}
|
||||
return newContact;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Crop
|
||||
* @description Crops images
|
||||
@@ -16,20 +17,22 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Crop',
|
||||
pluginName: 'Crop',
|
||||
plugin: 'cordova-plugin-crop',
|
||||
pluginRef: 'plugins',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop'
|
||||
})
|
||||
export class Crop {
|
||||
|
||||
/**
|
||||
* Crops an image
|
||||
* @param pathToImage
|
||||
* @param options
|
||||
* @return {Promise<string>} Returns a promise that resolves with the new image path, or rejects if failed to crop.
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the new image path, or rejects if failed to crop.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static crop(pathToImage: string, options?: {quality: number}): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
* The mode of the date picker
|
||||
@@ -35,71 +34,88 @@ export interface DatePickerOptions {
|
||||
* Label of BUTTON_POSITIVE (done button) on Android
|
||||
*/
|
||||
okText?: string;
|
||||
|
||||
/**
|
||||
* Label of BUTTON_NEGATIVE (cancel button). If empty, uses android.R.string.cancel.
|
||||
*/
|
||||
cancelText?: string;
|
||||
|
||||
/**
|
||||
* Label of today button. If empty, doesn't show the option to select current date.
|
||||
*/
|
||||
todayText?: string;
|
||||
|
||||
/**
|
||||
* Label of now button. If empty, doesn't show the option to select current time.
|
||||
*/
|
||||
nowText?: string;
|
||||
|
||||
/**
|
||||
* Shows time dialog in 24 hours format.
|
||||
*/
|
||||
is24Hour?: boolean;
|
||||
|
||||
/**
|
||||
* Choose the Android theme for the picker. You can use the DatePicker.ANDROID_THEMES property.
|
||||
* Values: 1: THEME_TRADITIONAL | 2: THEME_HOLO_DARK | 3: THEME_HOLO_LIGHT | 4: THEME_DEVICE_DEFAULT_DARK | 5: THEME_DEVICE_DEFAULT_LIGHT
|
||||
*/
|
||||
androidTheme?: number;
|
||||
|
||||
/**
|
||||
* Shows or hide dates earlier then selected date.
|
||||
*/
|
||||
allowOldDate?: boolean;
|
||||
allowOldDates?: boolean;
|
||||
|
||||
/**
|
||||
* Shows or hide dates after selected date.
|
||||
*/
|
||||
allowFutureDates?: boolean;
|
||||
|
||||
/**
|
||||
* Label of done button.
|
||||
*/
|
||||
doneButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* Hex color of done button.
|
||||
*/
|
||||
doneButtonColor?: string;
|
||||
|
||||
/**
|
||||
* Label of cancel button.
|
||||
*/
|
||||
cancelButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* Hex color of cancel button.
|
||||
*/
|
||||
cancelButtonColor?: string;
|
||||
|
||||
/**
|
||||
* X position of date picker. The position is absolute to the root view of the application.
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Y position of date picker. The position is absolute to the root view of the application.
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Interval between options in the minute section of the date picker.
|
||||
*/
|
||||
minuteInterval?: number;
|
||||
|
||||
/**
|
||||
* Force the UIPopoverArrowDirection enum. The value any will revert to default UIPopoverArrowDirectionAny and let the app choose the proper direction itself.
|
||||
*/
|
||||
popoverArrowDirection?: string;
|
||||
|
||||
/**
|
||||
* Force locale for datePicker.
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,10 +123,6 @@ export interface DatePickerOptions {
|
||||
* @description
|
||||
* The DatePicker plugin allows the user to fetch date or time using native dialogs.
|
||||
*
|
||||
* Platforms supported: iOS, Android, Windows
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-datepicker`. For more info, please see the [DatePicker plugin docs](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { DatePicker } from 'ionic-native';
|
||||
@@ -128,10 +140,11 @@ export interface DatePickerOptions {
|
||||
* DatePickerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'DatePicker',
|
||||
pluginName: 'DatePicker',
|
||||
plugin: 'cordova-plugin-datepicker',
|
||||
pluginRef: 'datePicker',
|
||||
repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker'
|
||||
repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
export class DatePicker {
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name DB Meter
|
||||
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
|
||||
@@ -31,7 +30,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'DBMeter',
|
||||
pluginName: 'DBMeter',
|
||||
plugin: 'cordova-plugin-dbmeter',
|
||||
pluginRef: 'DBMeter',
|
||||
repo: 'https://github.com/akofman/cordova-plugin-dbmeter',
|
||||
@@ -41,7 +40,7 @@ export class DBMeter {
|
||||
|
||||
/**
|
||||
* Starts listening
|
||||
* @return {Observable<string>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -58,14 +57,14 @@ export class DBMeter {
|
||||
|
||||
/**
|
||||
* Check if the DB Meter is listening
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||
*/
|
||||
@Cordova()
|
||||
static isListening(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Delete the DB Meter instance
|
||||
* @return {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||
* @returns {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(): Promise<any> { return; }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface DeeplinkMatch {
|
||||
|
||||
/**
|
||||
* The route info for the matched route
|
||||
*/
|
||||
@@ -19,6 +19,7 @@ export interface DeeplinkMatch {
|
||||
* the route was matched (for example, Facebook sometimes adds extra data)
|
||||
*/
|
||||
$link: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,14 +53,25 @@ export interface DeeplinkMatch {
|
||||
* Deeplinks.routeWithNavController(this.navController, {
|
||||
'/about-us': AboutPage,
|
||||
'/products/:productId': ProductPage
|
||||
});
|
||||
}).subscribe((match) => {
|
||||
// match.$route - the route we matched, which is the matched entry from the arguments to route()
|
||||
// match.$args - the args passed in the link
|
||||
// match.$link - the full link data
|
||||
console.log('Successfully matched route', match);
|
||||
}, (nomatch) => {
|
||||
// nomatch.$link - the full link data
|
||||
console.error('Got a deeplink that didn\'t match', nomatch);
|
||||
});
|
||||
* ```
|
||||
*
|
||||
* See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
|
||||
* retrieve the `NavController` reference at runtime.
|
||||
*
|
||||
* @interfaces
|
||||
* DeeplinkMatch
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Deeplinks',
|
||||
pluginName: 'Deeplinks',
|
||||
plugin: 'ionic-plugin-deeplinks',
|
||||
pluginRef: 'IonicDeeplink',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
|
||||
@@ -75,7 +87,7 @@ export class Deeplinks {
|
||||
* paths takes an object of the form { 'path': data }. If a deeplink
|
||||
* matches the path, the resulting path-data pair will be returned in the
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
* @returns {Observable} Returns an Observable that is called each time a deeplink comes through, and
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that is called each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -98,7 +110,7 @@ export class Deeplinks {
|
||||
* matches the path, the resulting path-data pair will be returned in the
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
*
|
||||
* @returns {Observable} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
*/
|
||||
@Cordova({
|
||||
|
||||
@@ -25,7 +25,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'DeviceFeedback',
|
||||
pluginName: 'DeviceFeedback',
|
||||
plugin: 'cordova-plugin-velda-devicefeedback',
|
||||
pluginRef: 'plugins.deviceFeedback',
|
||||
repo: 'https://github.com/VVelda/device-feedback',
|
||||
@@ -48,6 +48,7 @@ export class DeviceFeedback {
|
||||
|
||||
/**
|
||||
* Check if haptic and acoustic feedback is enabled by user settings.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isFeedbackEnabled(): Promise<{ haptic: boolean; acoustic: boolean; }> { return; }
|
||||
|
||||
@@ -1,31 +1,6 @@
|
||||
import { CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window: {
|
||||
device: Device
|
||||
};
|
||||
|
||||
export interface Device {
|
||||
/** Get the version of Cordova running on the device. */
|
||||
cordova: string;
|
||||
/**
|
||||
* The device.model returns the name of the device's model or product. The value is set
|
||||
* by the device manufacturer and may be different across versions of the same product.
|
||||
*/
|
||||
model: string;
|
||||
/** Get the device's operating system name. */
|
||||
platform: string;
|
||||
/** Get the device's Universally Unique Identifier (UUID). */
|
||||
uuid: string;
|
||||
/** Get the operating system version. */
|
||||
version: string;
|
||||
/** Get the device's manufacturer. */
|
||||
manufacturer: string;
|
||||
/** Whether the device is running on a simulator. */
|
||||
isVirtual: boolean;
|
||||
/** Get the device hardware serial number. */
|
||||
serial: string;
|
||||
}
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name Device
|
||||
@@ -37,23 +12,50 @@ export interface Device {
|
||||
* import { Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* console.log('Device UUID is: ' + Device.device.uuid);
|
||||
* console.log('Device UUID is: ' + Device.uuid);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Device',
|
||||
pluginName: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device'
|
||||
})
|
||||
export class Device {
|
||||
|
||||
/** Get the version of Cordova running on the device. */
|
||||
@CordovaProperty
|
||||
static cordova: string;
|
||||
|
||||
/**
|
||||
* Returns the whole device object.
|
||||
*
|
||||
* @returns {Object} The device object.
|
||||
* The device.model returns the name of the device's model or product. The value is set
|
||||
* by the device manufacturer and may be different across versions of the same product.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get device() { return window.device; }
|
||||
static model: string;
|
||||
|
||||
/** Get the device's operating system name. */
|
||||
@CordovaProperty
|
||||
static platform: string;
|
||||
|
||||
/** Get the device's Universally Unique Identifier (UUID). */
|
||||
@CordovaProperty
|
||||
static uuid: string;
|
||||
|
||||
/** Get the operating system version. */
|
||||
@CordovaProperty
|
||||
static version: string;
|
||||
|
||||
/** Get the device's manufacturer. */
|
||||
@CordovaProperty
|
||||
static manufacturer: string;
|
||||
|
||||
/** Whether the device is running on a simulator. */
|
||||
@CordovaProperty
|
||||
static isVirtual: boolean;
|
||||
|
||||
/** Get the device hardware serial number. */
|
||||
@CordovaProperty
|
||||
static serial: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
@Plugin({
|
||||
name: 'DeviceAccounts',
|
||||
pluginName: 'DeviceAccounts',
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
pluginRef: 'plugins.DeviceAccounts',
|
||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
||||
@@ -12,24 +11,28 @@ export class DeviceAccounts {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getByType(type: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmails(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> { return; }
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface AccelerationData {
|
||||
export interface DeviceMotionAccelerationData {
|
||||
|
||||
/**
|
||||
* Amount of acceleration on the x-axis. (in m/s^2)
|
||||
@@ -26,7 +25,7 @@ export interface AccelerationData {
|
||||
|
||||
}
|
||||
|
||||
export interface AccelerometerOptions {
|
||||
export interface DeviceMotionAccelerometerOptions {
|
||||
|
||||
/**
|
||||
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
|
||||
@@ -60,9 +59,12 @@ export interface AccelerometerOptions {
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceMotionAccelerationData
|
||||
* DeviceMotionAccelerometerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'DeviceMotion',
|
||||
pluginName: 'DeviceMotion',
|
||||
plugin: 'cordova-plugin-device-motion',
|
||||
pluginRef: 'navigator.accelerometer',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-motion'
|
||||
@@ -71,21 +73,21 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Get the current acceleration along the x, y, and z axes.
|
||||
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
|
||||
* @returns {Promise<DeviceMotionAccelerationData>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> { return; }
|
||||
static getCurrentAcceleration(): Promise<DeviceMotionAccelerationData> { return; }
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
* @param {AccelerometerOptions} options list of options for the accelerometer.
|
||||
* @returns {Observable<AccelerationData>} Observable returns an observable that you can subscribe to
|
||||
* @returns {Observable<DeviceMotionAccelerationData>} Observable returns an observable that you can subscribe to
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
|
||||
static watchAcceleration(options?: DeviceMotionAccelerometerOptions): Observable<DeviceMotionAccelerationData> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CompassHeading {
|
||||
export interface DeviceOrientationCompassHeading {
|
||||
|
||||
/**
|
||||
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
|
||||
@@ -26,7 +25,7 @@ export interface CompassHeading {
|
||||
|
||||
}
|
||||
|
||||
export interface CompassOptions {
|
||||
export interface DeviceOrientationCompassOptions {
|
||||
|
||||
/**
|
||||
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
|
||||
@@ -65,9 +64,12 @@ export interface CompassOptions {
|
||||
* // Stop watching heading change
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceOrientationCompassOptions
|
||||
* DeviceOrientationCompassHeading
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'DeviceOrientation',
|
||||
pluginName: 'DeviceOrientation',
|
||||
plugin: 'cordova-plugin-device-orientation',
|
||||
pluginRef: 'navigator.compass',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation'
|
||||
@@ -76,23 +78,23 @@ export class DeviceOrientation {
|
||||
|
||||
/**
|
||||
* Get the current compass heading.
|
||||
* @returns {Promise<CompassHeading>}
|
||||
* @returns {Promise<DeviceOrientationCompassHeading>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentHeading(): Promise<CompassHeading> { return; }
|
||||
static getCurrentHeading(): Promise<DeviceOrientationCompassHeading> { return; }
|
||||
|
||||
/**
|
||||
* Get the device current heading at a regular interval
|
||||
*
|
||||
* Stop the watch by unsubscribing from the observable
|
||||
* @param {CompassOptions} options Options for compass. Frequency and Filter. Optional
|
||||
* @returns {Observable<CompassHeading>} Returns an observable that contains the compass heading
|
||||
* @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: 'clearWatch'
|
||||
})
|
||||
static watchHeading(options?: CompassOptions): Observable<CompassHeading> { return; }
|
||||
static watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import {Cordova, Plugin, CordovaProperty} from './plugin';
|
||||
|
||||
/**
|
||||
* @name Diagnostic
|
||||
@@ -27,9 +27,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }).catch(e => console.error(e));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Diagnostic',
|
||||
pluginName: 'Diagnostic',
|
||||
plugin: 'cordova.plugins.diagnostic',
|
||||
pluginRef: 'cordova.plugins.diagnostic',
|
||||
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
|
||||
@@ -63,18 +64,19 @@ export class Diagnostic {
|
||||
BODY_SENSORS: 'BODY_SENSORS'
|
||||
};
|
||||
|
||||
static permissionStatus = {
|
||||
GRANTED: 'GRANTED',
|
||||
GRANTED_WHEN_IN_USE: 'GRANTED_WHEN_IN_USE', // iOS
|
||||
RESTRICTED: 'RESTRICTED', // iOS
|
||||
DENIED: 'DENIED',
|
||||
DENIED_ALWAYS: 'DENIED_ALWAYS', // android
|
||||
NOT_REQUESTED: 'NOT_REQUESTED'
|
||||
@CordovaProperty
|
||||
static permissionStatus: {
|
||||
GRANTED: string;
|
||||
DENIED: string;
|
||||
NOT_REQUESTED: string;
|
||||
DENIED_ALWAYS: string;
|
||||
RESTRICTED: string;
|
||||
GRANTED_WHEN_IN_USE: string;
|
||||
};
|
||||
|
||||
static locationAuthorizationMode = {
|
||||
ALWAYS: 'ALWAYS',
|
||||
WHEN_IN_USE: 'WHEN_IN_USE'
|
||||
ALWAYS: 'always',
|
||||
WHEN_IN_USE: 'when_in_use'
|
||||
};
|
||||
|
||||
static permissionGroups = {
|
||||
@@ -174,6 +176,7 @@ export class Diagnostic {
|
||||
* Enables/disables WiFi on the device.
|
||||
* Requires `ACCESS_WIFI_STATE` and `CHANGE_WIFI_STATE` permissions on Android
|
||||
* @param state {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
|
||||
static setWifiState(state: boolean): Promise<any> { return; }
|
||||
@@ -182,6 +185,7 @@ export class Diagnostic {
|
||||
* Enables/disables Bluetooth on the device.
|
||||
* Requires `BLUETOOTH` and `BLUETOOTH_ADMIN` permissions on Android
|
||||
* @param state {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
|
||||
static setBluetoothState(state: boolean): Promise<any> { return; }
|
||||
@@ -215,7 +219,7 @@ export class Diagnostic {
|
||||
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
|
||||
static requestLocationAuthorization(mode?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -297,7 +301,7 @@ export class Diagnostic {
|
||||
*
|
||||
* Notes for iOS:
|
||||
* - This relates to Calendar Events (not Calendar Reminders)
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isCalendarAuthorized(): Promise<boolean> { return; }
|
||||
@@ -366,7 +370,7 @@ export class Diagnostic {
|
||||
/**
|
||||
* Checks if high-accuracy locations are available to the app from GPS hardware.
|
||||
* Returns true if Location mode is enabled and is set to "Device only" or "High accuracy" AND if the app is authorised to use location.
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isGpsLocationAvailable(): Promise<boolean> { return; }
|
||||
@@ -376,6 +380,7 @@ export class Diagnostic {
|
||||
* Returns true if Location mode is enabled and is set to either:
|
||||
* - Device only = GPS hardware only (high accuracy)
|
||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isGpsLocationEnabled(): Promise<any> { return; }
|
||||
@@ -446,7 +451,7 @@ export class Diagnostic {
|
||||
* Note that only one request can be made concurrently because the native API cannot handle concurrent requests,
|
||||
* so the plugin will invoke the error callback if attempting to make more than one simultaneous request.
|
||||
* Multiple permission requests should be grouped into a single call since the native API is setup to handle batch requests of multiple permission groups.
|
||||
* @return {boolean}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static isRequestingPermission(): boolean { return; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface PromptCallback {
|
||||
export interface DialogsPromptCallback {
|
||||
|
||||
/**
|
||||
* The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
|
||||
@@ -12,6 +12,7 @@ export interface PromptCallback {
|
||||
* The text entered in the prompt dialog box. (String)
|
||||
*/
|
||||
input1: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +31,11 @@ export interface PromptCallback {
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DialogsPromptCallback
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Dialogs',
|
||||
pluginName: 'Dialogs',
|
||||
plugin: 'cordova-plugin-dialogs',
|
||||
pluginRef: 'navigator.notification',
|
||||
repo: 'https://github.com/apache/cordova-plugin-dialogs.git'
|
||||
@@ -79,7 +82,7 @@ export class Dialogs {
|
||||
* @param {string} title Dialog title. (Optional, defaults to Prompt)
|
||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"])
|
||||
* @param {string} defaultText Default textbox input value. (Optional, Default: empty string)
|
||||
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
* @returns {Promise<DialogsPromptCallback>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -90,7 +93,7 @@ export class Dialogs {
|
||||
title: string = 'Prompt',
|
||||
buttonLabels: Array<string> = ['OK', 'Cancel'],
|
||||
defaultText: string = ''
|
||||
): Promise<any> { return; }
|
||||
): Promise<DialogsPromptCallback> { return; }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,30 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface EmailComposerOptions {
|
||||
|
||||
app?: string;
|
||||
|
||||
to?: string | Array<string>;
|
||||
|
||||
cc?: string | Array<string>;
|
||||
|
||||
bcc?: string | Array<string>;
|
||||
|
||||
attachments?: Array<any>;
|
||||
|
||||
subject?: string;
|
||||
|
||||
body?: string;
|
||||
|
||||
isHtml?: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Email Composer
|
||||
* @description
|
||||
*
|
||||
@@ -42,9 +63,11 @@ declare var cordova: any;
|
||||
* EmailComposer.open(email);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* EmailComposerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'EmailComposer',
|
||||
pluginName: 'EmailComposer',
|
||||
plugin: 'cordova-plugin-email',
|
||||
pluginRef: 'cordova.plugins.email',
|
||||
repo: 'https://github.com/hypery2k/cordova-email-plugin',
|
||||
@@ -56,7 +79,7 @@ export class EmailComposer {
|
||||
* Verifies if sending emails is supported on the device.
|
||||
*
|
||||
* @param app {string?} An optional app id or uri scheme.
|
||||
* @returns {Promise<boolean>} Resolves if available, rejects if not available
|
||||
* @returns {Promise<any>} Resolves if available, rejects if not available
|
||||
*/
|
||||
static isAvailable(app?: string): Promise<any> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
@@ -92,7 +115,7 @@ export class EmailComposer {
|
||||
/**
|
||||
* Displays the email composer pre-filled with data.
|
||||
*
|
||||
* @param email {Email} Email
|
||||
* @param options {EmailComposerOptions} Email
|
||||
* @param scope {any?} An optional scope for the promise
|
||||
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
|
||||
*/
|
||||
@@ -100,17 +123,6 @@ export class EmailComposer {
|
||||
successIndex: 1,
|
||||
errorIndex: 3
|
||||
})
|
||||
static open(email: Email, scope?: any): Promise<any> { return; }
|
||||
static open(options: EmailComposerOptions, scope?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface Email {
|
||||
app?: string;
|
||||
to?: string | Array<string>;
|
||||
cc?: string | Array<string>;
|
||||
bcc?: string | Array<string>;
|
||||
attachments?: Array<any>;
|
||||
subject?: string;
|
||||
body?: string;
|
||||
isHtml?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface EstimoteBeaconRegion {
|
||||
|
||||
state?: string;
|
||||
|
||||
major: number;
|
||||
|
||||
minor: number;
|
||||
|
||||
identifier?: string;
|
||||
|
||||
uuid: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name EstimoteBeacons
|
||||
*
|
||||
* @description
|
||||
* This plugin enables communication between a phone and Estimote Beacons peripherals.
|
||||
*
|
||||
* @interfaces
|
||||
* EstimoteBeaconRegion
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'EstimoteBeacons',
|
||||
pluginName: 'EstimoteBeacons',
|
||||
plugin: 'cordova-plugin-estimote',
|
||||
pluginRef: 'estimote.beacons',
|
||||
repo: 'https://github.com/evothings/phonegap-estimotebeacons',
|
||||
@@ -40,6 +56,7 @@ export class EstimoteBeacons {
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorBlueberryPie = 3;
|
||||
|
||||
/**
|
||||
* Beacon colour.
|
||||
*/
|
||||
@@ -88,7 +105,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWhenInUseAuthorization(): Promise<any> { return; }
|
||||
@@ -109,7 +126,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestAlwaysAuthorization(): Promise<any> { return; }
|
||||
@@ -128,7 +145,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static authorizationStatus(): Promise<any> { return; }
|
||||
@@ -148,7 +165,7 @@ export class EstimoteBeacons {
|
||||
* @param major {number} Major value to advertise (mandatory).
|
||||
* @param minor {number} Minor value to advertise (mandatory).
|
||||
* @param regionId {string} Identifier of the region used to advertise (mandatory).
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
clearFunction: 'stopAdvertisingAsBeacon'
|
||||
@@ -166,7 +183,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopAdvertisingAsBeacon(): Promise<any> { return; }
|
||||
@@ -181,7 +198,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.enableAnalytics(true).then(() => { console.log('Analytics enabled'); });
|
||||
* ```
|
||||
* @param enable {number} Boolean value to turn analytics on or off (mandatory).
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enableAnalytics(enable: boolean): Promise<any> { return; }
|
||||
@@ -195,7 +212,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
* EstimoteBeacons.isAnalyticsEnabled().then((enabled) => { console.log('Analytics enabled: ' + enabled); });
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAnalyticsEnabled(): Promise<any> { return; }
|
||||
@@ -209,7 +226,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
* EstimoteBeacons.isAuthorized().then((isAuthorized) => { console.log('App ID and App Token is set: ' + isAuthorized); });
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAuthorized(): Promise<any> { return; }
|
||||
@@ -225,7 +242,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
* @param appID {string} The App ID (mandatory).
|
||||
* @param appToken {string} The App Token (mandatory).
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setupAppIDAndAppToken(appID: string, appToken: string): Promise<any> { return; }
|
||||
@@ -243,7 +260,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @return Returns an Observable that notifies of each beacon discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each beacon discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -263,7 +280,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopEstimoteBeaconDiscovery(): Promise<any> { return; }
|
||||
@@ -282,7 +299,7 @@ export class EstimoteBeacons {
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @return Returns an Observable that notifies of each beacon discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each beacon discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -305,7 +322,7 @@ export class EstimoteBeacons {
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
@@ -316,6 +333,7 @@ export class EstimoteBeacons {
|
||||
* {@link EstimoteBeacons.startRangingBeaconsInRegion}.
|
||||
* To use secure beacons set the App ID and App Token using
|
||||
* {@link EstimoteBeacons.setupAppIDAndAppToken}.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -328,6 +346,7 @@ export class EstimoteBeacons {
|
||||
* Stop ranging secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* {@link EstimoteBeacons.stopRangingBeaconsInRegion}.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
@@ -347,7 +366,7 @@ export class EstimoteBeacons {
|
||||
* are inside a region when the user turns display on, see
|
||||
* {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation}
|
||||
* for further details (optional, defaults to false, iOS only).
|
||||
* @return Returns an Observable that notifies of each region state discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each region state discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -367,7 +386,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.stopMonitoringForRegion(region).then(() => { console.log('monitoring is stopped'); });
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
@@ -381,6 +400,7 @@ export class EstimoteBeacons {
|
||||
* @see {@link EstimoteBeacons.startMonitoringForRegion}
|
||||
* @param region {EstimoteBeaconRegion} Region
|
||||
* @param notifyEntryStateOnDisplay {boolean}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -391,12 +411,12 @@ export class EstimoteBeacons {
|
||||
})
|
||||
static startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Stop monitoring secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* {@link EstimoteBeacons.stopMonitoringForRegion}.
|
||||
* @param region {EstimoteBeaconRegion} Region
|
||||
* @param region {EstimoteBeaconRegion} Region
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
@@ -416,7 +436,7 @@ export class EstimoteBeacons {
|
||||
* });
|
||||
* ```
|
||||
* @param beacon {Beacon} Beacon to connect to.
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToBeacon(beacon: any): Promise<any> { return; }
|
||||
@@ -428,7 +448,7 @@ export class EstimoteBeacons {
|
||||
* ```
|
||||
* EstimoteBeacons.disconnectConnectedBeacon();
|
||||
* ```
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnectConnectedBeacon(): Promise<any> { return; }
|
||||
@@ -442,7 +462,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.writeConnectedProximityUUID(ESTIMOTE_PROXIMITY_UUID);
|
||||
*
|
||||
* @param uuid {string} String to write as new UUID
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedProximityUUID(uuid: any): Promise<any> { return; }
|
||||
@@ -456,7 +476,7 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.writeConnectedMajor(1);
|
||||
*
|
||||
* @param major {number} number to write as new major
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedMajor(major: number): Promise<any> { return; }
|
||||
@@ -470,17 +490,10 @@ export class EstimoteBeacons {
|
||||
* EstimoteBeacons.writeConnectedMinor(1);
|
||||
*
|
||||
* @param minor {number} number to write as new minor
|
||||
* @return returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedMinor(minor: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface EstimoteBeaconRegion {
|
||||
state?: string;
|
||||
major: number;
|
||||
minor: number;
|
||||
identifier?: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
|
||||
status: string;
|
||||
|
||||
authResponse: {
|
||||
|
||||
session_key: boolean;
|
||||
|
||||
accessToken: string;
|
||||
|
||||
expiresIn: number;
|
||||
|
||||
sig: string;
|
||||
|
||||
secret: string;
|
||||
|
||||
userID: string;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Facebook
|
||||
* @description
|
||||
@@ -78,7 +100,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Facebook',
|
||||
pluginName: 'Facebook',
|
||||
plugin: 'cordova-plugin-facebook4',
|
||||
pluginRef: 'facebookConnectPlugin',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
|
||||
@@ -90,6 +112,7 @@ export class Facebook {
|
||||
* Browser wrapper
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
@@ -114,7 +137,7 @@ export class Facebook {
|
||||
* ```
|
||||
*
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in.
|
||||
* @return {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
*/
|
||||
@Cordova()
|
||||
static login(permissions: string[]): Promise<FacebookLoginResponse> { return; }
|
||||
@@ -123,7 +146,7 @@ export class Facebook {
|
||||
* Logout of Facebook.
|
||||
*
|
||||
* For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout)
|
||||
* @return Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
@@ -152,7 +175,7 @@ export class Facebook {
|
||||
*
|
||||
* For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus)
|
||||
*
|
||||
* @return Returns a Promise that resolves with a status, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a status, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static getLoginStatus(): Promise<any> { return; }
|
||||
@@ -160,7 +183,7 @@ export class Facebook {
|
||||
/**
|
||||
* Get a Facebook access token for using Facebook services.
|
||||
*
|
||||
* @return Returns a Promise that resolves with an access token, or rejects with an error
|
||||
* @returns {Promise<string>} Returns a Promise that resolves with an access token, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static getAccessToken(): Promise<string> { return; }
|
||||
@@ -179,8 +202,8 @@ export class Facebook {
|
||||
* ```
|
||||
*
|
||||
* For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui)
|
||||
* @options {Object} options The dialog options
|
||||
* @return Returns a Promise that resolves with success data, or rejects with an error
|
||||
* @param {Object} options The dialog options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with success data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static showDialog(options: any): Promise<any> { return; }
|
||||
@@ -196,7 +219,7 @@ export class Facebook {
|
||||
*
|
||||
* @param {string} requestPath Graph API endpoint you want to call
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request.
|
||||
* @return Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static api(requestPath: string, permissions: string[]): Promise<any> { return; }
|
||||
@@ -207,7 +230,7 @@ export class Facebook {
|
||||
* @param {string} name Name of the event
|
||||
* @param {Object} [params] An object containing extra data to log with the event
|
||||
* @param {number} [valueToSum] any value to be added to added to a sum on each event
|
||||
* @return
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logEvent(
|
||||
@@ -221,7 +244,7 @@ export class Facebook {
|
||||
*
|
||||
* @param {number} value Value of the purchase.
|
||||
* @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217)
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logPurchase(value: number, currency: string): Promise<any> { return; }
|
||||
@@ -239,7 +262,7 @@ export class Facebook {
|
||||
* url: [App Link](https://developers.facebook.com/docs/applinks) to your app
|
||||
* picture: image to be displayed in the App Invite dialog
|
||||
*
|
||||
* @return Returns a Promise that resolves with the result data, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static appInvite(options: {
|
||||
@@ -248,15 +271,3 @@ export class Facebook {
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
status: string;
|
||||
authResponse: {
|
||||
session_key: boolean;
|
||||
accessToken: string;
|
||||
expiresIn: number;
|
||||
sig: string;
|
||||
secret: string;
|
||||
userID: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileChooser
|
||||
* @description
|
||||
@@ -10,22 +11,25 @@ import { Plugin, Cordova } from './plugin';
|
||||
* import {FileChooser} from 'ionic-native';
|
||||
*
|
||||
* FileChooser.open()
|
||||
* .then(uri => console.log(uri);
|
||||
* .catch(e => console.log(e);
|
||||
* .then(uri => console.log(uri));
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'FileChooser',
|
||||
pluginName: 'FileChooser',
|
||||
plugin: 'http://github.com/don/cordova-filechooser.git',
|
||||
pluginRef: 'fileChooser',
|
||||
repo: 'https://github.com/don/cordova-filechooser',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FileChooser {
|
||||
|
||||
/**
|
||||
* Open a file
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static open(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileOpener
|
||||
* @description
|
||||
@@ -13,16 +14,18 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'FileOpener',
|
||||
pluginName: 'FileOpener',
|
||||
plugin: 'cordova-plugin-file-opener2',
|
||||
pluginRef: 'cordova.plugins.fileOpener2',
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
|
||||
})
|
||||
export class FileOpener {
|
||||
|
||||
/**
|
||||
* Open an file
|
||||
* @param filePath {string} File Path
|
||||
* @param fileMIMEType {string} File MIME Type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
@@ -34,6 +37,7 @@ export class FileOpener {
|
||||
/**
|
||||
* Uninstalls a package
|
||||
* @param packageId {string} Package ID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
@@ -45,6 +49,7 @@ export class FileOpener {
|
||||
/**
|
||||
* Check if an app is already installed
|
||||
* @param packageId {string} Package ID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
@@ -52,4 +57,5 @@ export class FileOpener {
|
||||
errorName: 'error'
|
||||
})
|
||||
static appIsInstalled(packageId: string): Promise<any> {return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface Entry {
|
||||
/** The full absolute path from the root to the entry. */
|
||||
fullPath: string;
|
||||
/** The file system on which the entry resides. */
|
||||
fileSystem: FileSystem;
|
||||
filesystem: FileSystem;
|
||||
nativeURL: string;
|
||||
/**
|
||||
* Look up metadata about this entry.
|
||||
@@ -171,6 +171,7 @@ export interface Flags {
|
||||
}
|
||||
|
||||
export interface WriteOptions {
|
||||
create?: boolean;
|
||||
replace?: boolean;
|
||||
append?: boolean;
|
||||
truncate?: number; // if present, number of bytes to truncate file to before writing
|
||||
@@ -360,7 +361,7 @@ declare var FileError: {
|
||||
* It also implements the FileWriter spec : http://dev.w3.org/2009/dap/file-system/file-writer.html
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'File',
|
||||
pluginName: 'File',
|
||||
plugin: 'cordova-plugin-file',
|
||||
pluginRef: 'cordova.file',
|
||||
repo: 'https://github.com/apache/cordova-plugin-file'
|
||||
@@ -384,14 +385,14 @@ export class File {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get free disk space
|
||||
* @returns {Promise<number>} Returns a promise that resolves with the remaining free disk space
|
||||
* Get free disk space in Bytes
|
||||
* @returns {Promise<number>} Returns a promise that resolves with the remaining free disk space in Bytes
|
||||
*/
|
||||
static getFreeDiskSpace(): Promise<number> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
if (!cordova || !cordova.exec) {
|
||||
pluginWarn({
|
||||
name: 'File',
|
||||
pluginName: 'File',
|
||||
plugin: 'cordova-plugin-file'
|
||||
});
|
||||
reject({ error: 'plugin_not_installed' });
|
||||
@@ -406,7 +407,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} dir Name of directory to check
|
||||
* @return {Promise<boolean|FileError>} Returns a Promise that resolves to true if the directory exists or rejects with an error.
|
||||
* @returns {Promise<boolean|FileError>} Returns a Promise that resolves to true if the directory exists or rejects with an error.
|
||||
*/
|
||||
static checkDir(path: string, dir: string): Promise<boolean|FileError> {
|
||||
if ((/^\//.test(dir))) {
|
||||
@@ -430,7 +431,7 @@ export class File {
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} dirName Name of directory to create
|
||||
* @param {boolean} replace If true, replaces file with same name. If false returns error
|
||||
* @return {Promise<DirectoryEntry|FileError>} Returns a Promise that resolves with a DirectoryEntry or rejects with an error.
|
||||
* @returns {Promise<DirectoryEntry|FileError>} Returns a Promise that resolves with a DirectoryEntry or rejects with an error.
|
||||
*/
|
||||
static createDir(path: string, dirName: string, replace: boolean): Promise<DirectoryEntry|FileError> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
@@ -458,7 +459,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path The path to the directory
|
||||
* @param {string} dirName The directory name
|
||||
* @return {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
* @returns {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
*/
|
||||
static removeDir(path: string, dirName: string): Promise<RemoveResult|FileError> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
@@ -483,7 +484,7 @@ export class File {
|
||||
* @param {string} dirName The source directory name
|
||||
* @param {string} newPath The destionation path to the directory
|
||||
* @param {string} newDirName The destination directory name
|
||||
* @return {Promise<DirectoryEntry|Entry|FileError>} Returns a Promise that resolves to the new DirectoryEntry object or rejects with an error.
|
||||
* @returns {Promise<DirectoryEntry|Entry|FileError>} Returns a Promise that resolves to the new DirectoryEntry object or rejects with an error.
|
||||
*/
|
||||
static moveDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<DirectoryEntry|Entry|FileError> {
|
||||
newDirName = newDirName || dirName;
|
||||
@@ -513,7 +514,7 @@ export class File {
|
||||
* @param {string} dirName Name of directory to copy
|
||||
* @param {string} newPath Base FileSystem of new location
|
||||
* @param {string} newDirName New name of directory to copy to (leave blank to remain the same)
|
||||
* @return {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry object or rejects with an error.
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry object or rejects with an error.
|
||||
*/
|
||||
static copyDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<Entry|FileError> {
|
||||
if ((/^\//.test(newDirName))) {
|
||||
@@ -539,7 +540,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} dirName Name of directory
|
||||
* @return {Promise<Entry[]>} Returns a Promise that resolves to an array of Entry objects or rejects with an error.
|
||||
* @returns {Promise<Entry[]>} Returns a Promise that resolves to an array of Entry objects or rejects with an error.
|
||||
*/
|
||||
static listDir(path: string, dirName: string): Promise<Entry[]> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
@@ -563,7 +564,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} dirName Name of directory
|
||||
* @return {Promise<RemoveResult>} Returns a Promise that resolves with a RemoveResult or rejects with an error.
|
||||
* @returns {Promise<RemoveResult>} Returns a Promise that resolves with a RemoveResult or rejects with an error.
|
||||
*/
|
||||
static removeRecursively(path: string, dirName: string): Promise<RemoveResult> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
@@ -586,7 +587,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} file Name of file to check
|
||||
* @return {Promise<boolean|FileError>} Returns a Promise that resolves with a boolean or rejects with an error.
|
||||
* @returns {Promise<boolean|FileError>} Returns a Promise that resolves with a boolean or rejects with an error.
|
||||
*/
|
||||
static checkFile(path: string, file: string): Promise<boolean|FileError> {
|
||||
if ((/^\//.test(file))) {
|
||||
@@ -615,7 +616,7 @@ export class File {
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} fileName Name of file to create
|
||||
* @param {boolean} replace If true, replaces file with same name. If false returns error
|
||||
* @return {Promise<FileEntry|FileError>} Returns a Promise that resolves to a FileEntry or rejects with an error.
|
||||
* @returns {Promise<FileEntry|FileError>} Returns a Promise that resolves to a FileEntry or rejects with an error.
|
||||
*/
|
||||
static createFile(path: string, fileName: string, replace: boolean): Promise<FileEntry|FileError> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
@@ -643,7 +644,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} fileName Name of file to remove
|
||||
* @return {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
* @returns {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
*/
|
||||
static removeFile(path: string, fileName: string): Promise<RemoveResult|FileError> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
@@ -667,19 +668,19 @@ export class File {
|
||||
* @param {string} fileName path relative to base path
|
||||
* @param {string | Blob} text content or blob to write
|
||||
* @param {WriteOptions} options replace file if set to true. See WriteOptions for more information.
|
||||
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to updated file entry or rejects with an error.
|
||||
*/
|
||||
static writeFile(path: string, fileName: string,
|
||||
text: string | Blob, options: WriteOptions): Promise<void> {
|
||||
text: string | Blob, options: WriteOptions = {}): Promise<any> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
let err = new FileError(5);
|
||||
const err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject(err);
|
||||
}
|
||||
|
||||
let getFileOpts: Flags = {
|
||||
create: true,
|
||||
exclusive: options.replace
|
||||
const getFileOpts: Flags = {
|
||||
create: !options.append,
|
||||
exclusive: !options.replace
|
||||
};
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -687,10 +688,21 @@ export class File {
|
||||
return File.getFile(fse, fileName, getFileOpts);
|
||||
})
|
||||
.then((fe) => {
|
||||
return File.createWriter(fe);
|
||||
})
|
||||
.then((writer) => {
|
||||
return File.writeFileEntry(fe, text, options);
|
||||
});
|
||||
}
|
||||
|
||||
/** Write content to FileEntry.
|
||||
*
|
||||
* @private
|
||||
* @param {FileEntry} fe file entry object
|
||||
* @param {string | Blob} text content or blob to write
|
||||
* @param {WriteOptions} options replace file if set to true. See WriteOptions for more information.
|
||||
* @returns {Promise<FileEntry>} Returns a Promise that resolves to updated file entry or rejects with an error.
|
||||
*/
|
||||
private static writeFileEntry(fe: FileEntry, text: string | Blob, options: WriteOptions) {
|
||||
return File.createWriter(fe)
|
||||
.then((writer) => {
|
||||
if (options.append) {
|
||||
writer.seek(writer.length);
|
||||
}
|
||||
@@ -700,9 +712,11 @@ export class File {
|
||||
}
|
||||
|
||||
return File.write(writer, text);
|
||||
});
|
||||
})
|
||||
.then(() => fe);
|
||||
}
|
||||
|
||||
|
||||
/** Write to an existing file.
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
@@ -711,22 +725,7 @@ export class File {
|
||||
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
|
||||
*/
|
||||
static writeExistingFile(path: string, fileName: string, text: string | Blob): Promise<void> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
.then((fse) => {
|
||||
return File.getFile(fse, fileName, {create: false});
|
||||
})
|
||||
.then((fe) => {
|
||||
return File.createWriter(fe);
|
||||
})
|
||||
.then((writer) => {
|
||||
return File.write(writer, text);
|
||||
});
|
||||
return File.writeFile(path, fileName, text, { create: false });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -734,7 +733,7 @@ export class File {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} file Name of file, relative to path.
|
||||
* @return {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string or rejects with an error.
|
||||
* @returns {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string or rejects with an error.
|
||||
*/
|
||||
static readAsText(path: string, file: string): Promise<string|FileError> {
|
||||
if ((/^\//.test(file))) {
|
||||
@@ -775,7 +774,7 @@ export class File {
|
||||
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} file Name of file, relative to path.
|
||||
* @return {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as data URL or rejects with an error.
|
||||
* @returns {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as data URL or rejects with an error.
|
||||
*/
|
||||
static readAsDataURL(path: string, file: string): Promise<string|FileError> {
|
||||
if ((/^\//.test(file))) {
|
||||
@@ -817,7 +816,7 @@ export class File {
|
||||
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} file Name of file, relative to path.
|
||||
* @return {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string rejects with an error.
|
||||
* @returns {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string rejects with an error.
|
||||
*/
|
||||
static readAsBinaryString(path: string, file: string): Promise<string|FileError> {
|
||||
if ((/^\//.test(file))) {
|
||||
@@ -858,7 +857,7 @@ export class File {
|
||||
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} file Name of file, relative to path.
|
||||
* @return {Promise<ArrayBuffer|FileError>} Returns a Promise that resolves with the contents of the file as ArrayBuffer or rejects with an error.
|
||||
* @returns {Promise<ArrayBuffer|FileError>} Returns a Promise that resolves with the contents of the file as ArrayBuffer or rejects with an error.
|
||||
*/
|
||||
static readAsArrayBuffer(path: string, file: string): Promise<ArrayBuffer|FileError> {
|
||||
if ((/^\//.test(file))) {
|
||||
@@ -901,7 +900,7 @@ export class File {
|
||||
* @param {string} fileName Name of file to move
|
||||
* @param {string} newPath Base FileSystem of new location
|
||||
* @param {string} newFileName New name of file to move to (leave blank to remain the same)
|
||||
* @return {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry or rejects with an error.
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry or rejects with an error.
|
||||
*/
|
||||
static moveFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<Entry|FileError> {
|
||||
newFileName = newFileName || fileName;
|
||||
@@ -931,7 +930,7 @@ export class File {
|
||||
* @param {string} fileName Name of file to copy
|
||||
* @param {string} newPath Base FileSystem of new location
|
||||
* @param {string} newFileName New name of file to copy to (leave blank to remain the same)
|
||||
* @return {Promise<Entry|FileError>} Returns a Promise that resolves to an Entry or rejects with an error.
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to an Entry or rejects with an error.
|
||||
*/
|
||||
static copyFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<Entry|FileError> {
|
||||
newFileName = newFileName || fileName;
|
||||
|
||||
@@ -19,17 +19,20 @@ declare var window: any;
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'FilePath',
|
||||
pluginName: 'FilePath',
|
||||
plugin: 'cordova-plugin-filepath',
|
||||
pluginRef: 'window.FilePath',
|
||||
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FilePath {
|
||||
|
||||
/**
|
||||
* Resolve native path for given content URL/path.
|
||||
* @param {String} path Content URL/path.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static resolveNativePath(path: string): Promise<string> {return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var FileTransfer;
|
||||
|
||||
export interface FileUploadOptions {
|
||||
@@ -46,6 +45,7 @@ export interface FileUploadOptions {
|
||||
* Content-Type is present, multipart form data will NOT be used.
|
||||
*/
|
||||
headers?: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileUploadResult {
|
||||
@@ -69,6 +69,7 @@ export interface FileUploadResult {
|
||||
* The HTTP response headers by the server.
|
||||
*/
|
||||
headers: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileTransferError {
|
||||
@@ -103,6 +104,7 @@ export interface FileTransferError {
|
||||
* Either e.getMessage or e.toString.
|
||||
*/
|
||||
exception: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,9 +173,13 @@ export interface FileTransferError {
|
||||
* cd files
|
||||
* ls
|
||||
* ```
|
||||
* @interfaces
|
||||
* FileUploadOptions
|
||||
* FileUploadResult
|
||||
* FileTransferError
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'FileTransfer',
|
||||
pluginName: 'FileTransfer',
|
||||
plugin: 'cordova-plugin-file-transfer',
|
||||
pluginRef: 'FileTransfer',
|
||||
repo: 'https://github.com/apache/cordova-plugin-file-transfer'
|
||||
@@ -211,13 +217,13 @@ export class Transfer {
|
||||
* @param {string} url URL of the server to receive the file, as encoded by encodeURI().
|
||||
* @param {FileUploadOptions} options Optional parameters.
|
||||
* @param {boolean} trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS.
|
||||
* @return Returns a Promise that resolves to a FileUploadResult and rejects with FileTransferError.
|
||||
* @returns {Promise<FileUploadResult>} Returns a Promise that resolves to a FileUploadResult and rejects with FileTransferError.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult | FileTransferError> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,7 +234,7 @@ export class Transfer {
|
||||
* @param {stirng} target Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device.
|
||||
* @param {boolean} trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS.
|
||||
* @param {object} Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).
|
||||
* @return Returns a Promise that resolves to a FileEntry object.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to a FileEntry object.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
|
||||
62
src/plugins/fingerprint-aio.ts
Normal file
62
src/plugins/fingerprint-aio.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
|
||||
export interface FingerprintOptions {
|
||||
/**
|
||||
* Key for platform keychain
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Secret password. Only for android
|
||||
*/
|
||||
clientSecret?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name FingerprintAIO
|
||||
* @description
|
||||
* Use simple fingerprint authentication on Android and iOS.
|
||||
* Requires Cordova plugin: cordova-plugin-fingerprint-aio. For more info about plugin, vist: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FingerprintAIO } from 'ionic-native';
|
||||
*
|
||||
* FingerprintAIO.show({
|
||||
* clientId: "Fingerprint-Demo",
|
||||
* clientSecret: "password" //Only necessary for Android
|
||||
* })
|
||||
* .then((result: any) => console.log(any))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* FingerprintOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FingerprintAIO',
|
||||
plugin: 'cordova-plugin-fingerprint-aio',
|
||||
pluginRef: 'Fingerprint',
|
||||
repo: 'https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class FingerprintAIO {
|
||||
|
||||
/**
|
||||
* Check if fingerprint authentication is available
|
||||
* @return {Promise<any>} Returns a promise with result
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show authentication dialogue
|
||||
* @param options {FingerprintOptions} options for platform specific fingerprint API
|
||||
* @return {Promise<any>} Returns a promise that resolves when authentication was successfull
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: FingerprintOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
201
src/plugins/firebase.ts
Normal file
201
src/plugins/firebase.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Firebase
|
||||
* @description
|
||||
* This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported (including iOS 10).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Firebase } from 'ionic-native';
|
||||
*
|
||||
* Firebase.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));
|
||||
*
|
||||
* Firebase.onTokenRefresh()
|
||||
* .subscribe((token: string) => console.log(`Got a new token ${token}`));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Firebase',
|
||||
plugin: 'cordova-plugin-firebase',
|
||||
pluginRef: 'FirebasePlugin',
|
||||
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Firebase {
|
||||
|
||||
/**
|
||||
* Get the device token
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getToken(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when a token is refreshed
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onTokenRefresh(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when the user opens a notification
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onNotificationOpen(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Grant permission to recieve push notifications
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static grantPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
* @param badgeNumber {number}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setBadgeNumber(badgeNumber: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get icon badge number
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getBadgeNumber(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to a topic
|
||||
* @param topic {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static subscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Unsubscribe from a topic
|
||||
* @param topic {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static unsubscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
* @param type {string}
|
||||
* @param data {Object}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logEvent(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a user id for use in Analytics
|
||||
* @param userId {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(userId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a user property for use in Analytics
|
||||
* @param name {string}
|
||||
* @param value {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app
|
||||
* @param cacheExpirationSeconds
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static fetch(cacheExpirationSeconds?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Activate the Remote Config fetched config
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static activateFetched(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config value
|
||||
* @param key {string}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static getValue(key: string, namespace?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config byte array
|
||||
* @param key {string}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static getByteArray(key: string, namespace?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the current state of the FirebaseRemoteConfig singleton object
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static getInfo(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Change the settings for the FirebaseRemoteConfig object's operations
|
||||
* @param settings {Object}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setConfigSettings(settings: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set defaults in the Remote Config
|
||||
* @param defaults {Object}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static setDefaults(defaults: any, namespace: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Flashlight
|
||||
* @description This plugin allows you to switch the flashlight / torch of the device on and off.
|
||||
@@ -16,7 +15,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Flashlight',
|
||||
pluginName: 'Flashlight',
|
||||
plugin: 'cordova-plugin-flashlight',
|
||||
pluginRef: 'window.plugins.flashlight',
|
||||
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git'
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name Geofence
|
||||
* @description Monitors circular geofences around latitude/longitude coordinates, and sends a notification to the user when the boundary of a geofence is crossed. Notifications can be sent when the user enters and/or exits a geofence.
|
||||
@@ -71,10 +74,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* Try running `ionic platform rm <platform>` then run `ionic platform add <platform>` to recreate the
|
||||
* platform directories.
|
||||
*/
|
||||
declare var window: any;
|
||||
|
||||
@Plugin({
|
||||
name: 'Geofence',
|
||||
pluginName: 'Geofence',
|
||||
plugin: 'cordova-plugin-geofence',
|
||||
pluginRef: 'geofence',
|
||||
repo: 'https://github.com/cowbell/cordova-plugin-geofence/',
|
||||
@@ -94,7 +95,7 @@ export class Geofence {
|
||||
/**
|
||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static initialize(): Promise<void> { return; };
|
||||
@@ -102,7 +103,7 @@ export class Geofence {
|
||||
/**
|
||||
* Adds a new geofence or array of geofences. For geofence object, see above.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
|
||||
@@ -111,7 +112,7 @@ export class Geofence {
|
||||
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
|
||||
* geofence was created.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static remove(geofenceId: string | Array<string>): Promise<void> { return; };
|
||||
@@ -119,7 +120,7 @@ export class Geofence {
|
||||
/**
|
||||
* Removes all geofences.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static removeAll(): Promise<void> { return; };
|
||||
@@ -127,7 +128,7 @@ export class Geofence {
|
||||
/**
|
||||
* Returns an array of geofences currently being monitored.
|
||||
*
|
||||
* @return {Promise<Array<string>>}
|
||||
* @returns {Promise<Array<string>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getWatched(): Promise<string> { return; };
|
||||
@@ -135,7 +136,7 @@ export class Geofence {
|
||||
/**
|
||||
* Called when a geofence is crossed in the direction specified by `TransitType`.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
static onTransitionReceived(): Observable<any> {
|
||||
|
||||
@@ -149,7 +150,7 @@ export class Geofence {
|
||||
/**
|
||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||
*
|
||||
* @return {Promise<Object>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
static onNotificationClicked(): Observable<any> {
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
export interface Coordinates {
|
||||
|
||||
/**
|
||||
* a double representing the position's latitude in decimal degrees.
|
||||
*/
|
||||
@@ -48,6 +48,7 @@ export interface Coordinates {
|
||||
* This value can be null.
|
||||
*/
|
||||
speed: number;
|
||||
|
||||
}
|
||||
|
||||
export interface Geoposition {
|
||||
@@ -63,6 +64,7 @@ export interface Geoposition {
|
||||
}
|
||||
|
||||
export interface PositionError {
|
||||
|
||||
/**
|
||||
* A code that indicates the error that occurred
|
||||
*/
|
||||
@@ -72,9 +74,11 @@ export interface PositionError {
|
||||
* A message that can describe the error that occurred
|
||||
*/
|
||||
message: string;
|
||||
|
||||
}
|
||||
|
||||
export interface GeolocationOptions {
|
||||
|
||||
/**
|
||||
* Is a positive long value indicating the maximum age in milliseconds of a
|
||||
* possible cached position that is acceptable to return. If set to 0, it
|
||||
@@ -102,8 +106,8 @@ export interface GeolocationOptions {
|
||||
* @type {boolean}
|
||||
*/
|
||||
enableHighAccuracy?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Geolocation
|
||||
@@ -139,17 +143,18 @@ export interface GeolocationOptions {
|
||||
* GeolocationOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Geolocation',
|
||||
pluginName: 'Geolocation',
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation'
|
||||
})
|
||||
export class Geolocation {
|
||||
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
* @returns {Promise<Geoposition>} Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -172,9 +177,9 @@ export class Geolocation {
|
||||
* ```
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
static watchPosition(options?: GeolocationOptions): Observable<Geoposition & PositionError> {
|
||||
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||
return new Observable<Geoposition>(
|
||||
(observer: any) => {
|
||||
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
@@ -182,4 +187,5 @@ export class Geolocation {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,23 +11,24 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Globalization',
|
||||
pluginName: 'Globalization',
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
|
||||
})
|
||||
export class Globalization {
|
||||
|
||||
/**
|
||||
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
|
||||
* @return {Promise<{value: string}>}
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPreferredLanguage(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
|
||||
* @return {Promise<{value: string}>}
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocaleName(): Promise<{ value: string }> { return; }
|
||||
@@ -36,7 +37,7 @@ export class Globalization {
|
||||
* Converts date to string
|
||||
* @param {Date} date Date you wish to convert
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
* @returns {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -48,7 +49,7 @@ export class Globalization {
|
||||
* Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object.
|
||||
* @param {string} dateString Date as a string to be converted
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
* @returns {Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -59,7 +60,7 @@ export class Globalization {
|
||||
/**
|
||||
* Returns a pattern string to format and parse dates according to the client's user preferences.
|
||||
* @param options Object with the format length and selector
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
* @returns {Promise<{pattern: string}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -69,7 +70,7 @@ export class Globalization {
|
||||
/**
|
||||
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
|
||||
* @param options Object with type (narrow or wide) and item (month or days).
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
* @returns {Promise<{value: Array<string>}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -79,33 +80,34 @@ export class Globalization {
|
||||
/**
|
||||
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
|
||||
* @param {data} date Date to process
|
||||
* @returns {Promise<dst>} reutrns a promise with the value
|
||||
* @returns {Promise<{dst: string}>} reutrns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static isDayLightSavingsTime(date: Date): Promise<{ dst: string }> { return; }
|
||||
|
||||
/**
|
||||
* Returns the first day of the week according to the client's user preferences and calendar.
|
||||
* @returns {Promise<value>} reutrns a promise with the value
|
||||
* @returns {Promise<{value: string}>} returns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static getFirstDayOfWeek(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
* Returns a number formatted as a string according to the client's user preferences.
|
||||
* @param options
|
||||
* @param numberToConvert {Number} The number to convert
|
||||
* @param options {Object} Object with property `type` that can be set to: decimal, percent, or currency.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static numberToString(options: { type: string }): Promise<{ value: string }> { return; }
|
||||
static numberToString(numberToConvert: number, options: { type: string }): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} stringToConvert String you want to conver to a number
|
||||
* @param options The type of number you want to return. Can be decimal, percent, or currency.
|
||||
* @returns {Promise} Returns a promise with the value.
|
||||
* @returns {Promise<{ value: number | string }>} Returns a promise with the value.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -116,7 +118,7 @@ export class Globalization {
|
||||
/**
|
||||
* Returns a pattern string to format and parse numbers according to the client's user preferences.
|
||||
* @param options Can be decimal, percent, or currency.
|
||||
* @returns {Promise} returns a promise with the value.
|
||||
* @returns {Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -126,7 +128,7 @@ export class Globalization {
|
||||
/**
|
||||
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
|
||||
* @param {string} currencyCode Currency Code.A
|
||||
* @returns {Promise} returns a promise with the value
|
||||
* @returns {Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> { return; }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
* @description
|
||||
@@ -8,11 +7,14 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
* GooglePlus.login()
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'GooglePlus',
|
||||
pluginName: 'GooglePlus',
|
||||
plugin: 'cordova-plugin-googleplus',
|
||||
pluginRef: 'window.plugins.googleplus',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
|
||||
@@ -21,30 +23,37 @@ import { Cordova, Plugin } from './plugin';
|
||||
})
|
||||
export class GooglePlus {
|
||||
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
/**
|
||||
@@ -11,28 +10,47 @@ declare var window;
|
||||
* - A Cordova 3.0+ project for iOS and/or Android
|
||||
* - A Mobile App property through the Google Analytics Admin Console
|
||||
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GoogleAnalytics } from 'ionic-native';
|
||||
*
|
||||
* GoogleAnalytics.startTrackerWithId('YOUR_TRACKER_ID')
|
||||
* .then(() => {
|
||||
* console.log('Google analytics is ready now');
|
||||
* // Tracker is ready
|
||||
* // You can now track pages or set additional information such as AppVersion or UserId
|
||||
* })
|
||||
* .catch(e => console.log('Error starting GoogleAnalytics', e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'GoogleAnalytics',
|
||||
pluginName: 'GoogleAnalytics',
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'ga',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
export class GoogleAnalytics {
|
||||
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
* @return {Promise<any>}
|
||||
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static startTrackerWithId(id: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more
|
||||
* @param allow {boolean}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAllowIDFACollection(allow: boolean): Promise<any> { return; }
|
||||
@@ -41,7 +59,7 @@ export class GoogleAnalytics {
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id User ID
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
@@ -49,7 +67,7 @@ export class GoogleAnalytics {
|
||||
/**
|
||||
* Set a anonymize Ip address
|
||||
* @param anonymize {boolean} Set to true to anonymize the IP Address
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAnonymizeIp(anonymize: boolean): Promise<any> { return; }
|
||||
@@ -57,7 +75,7 @@ export class GoogleAnalytics {
|
||||
/**
|
||||
* Sets the app version
|
||||
* @param appVersion {string} App version
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAppVersion(appVersion: string): Promise<any> { return; }
|
||||
@@ -65,14 +83,14 @@ export class GoogleAnalytics {
|
||||
/**
|
||||
* Set OptOut
|
||||
* @param optout {boolean}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptOut(optout: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
@@ -81,7 +99,7 @@ export class GoogleAnalytics {
|
||||
* Track custom metric
|
||||
* @param key {string}
|
||||
* @param value {any}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
@@ -96,7 +114,7 @@ export class GoogleAnalytics {
|
||||
* @param title {string} Screen title
|
||||
* @param campaignUrl {string} Campaign url for measuring referrals
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 3,
|
||||
@@ -109,7 +127,7 @@ export class GoogleAnalytics {
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param key {string}
|
||||
* @param value {string}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
@@ -122,7 +140,7 @@ export class GoogleAnalytics {
|
||||
* @param label {string}
|
||||
* @param value {number}
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 5,
|
||||
@@ -134,7 +152,7 @@ export class GoogleAnalytics {
|
||||
* Track an exception
|
||||
* @param description {string}
|
||||
* @param fatal {boolean}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
@@ -145,7 +163,7 @@ export class GoogleAnalytics {
|
||||
* @param intervalInMilliseconds {number}
|
||||
* @param variable {string}
|
||||
* @param label {string}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
@@ -159,7 +177,7 @@ export class GoogleAnalytics {
|
||||
* @param tax {number}
|
||||
* @param shipping {number}
|
||||
* @param currencyCode {string}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
@@ -174,7 +192,7 @@ export class GoogleAnalytics {
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
@@ -182,8 +200,9 @@ export class GoogleAnalytics {
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param shouldEnable {boolean}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
36
src/plugins/headercolor.ts
Normal file
36
src/plugins/headercolor.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Headerolor
|
||||
* @description
|
||||
* Cordova plugin to change color of header in multitask view
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { HeaderColor } from 'ionic-native';
|
||||
*
|
||||
* HeaderColor.tint("#becb29");
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HeaderColor',
|
||||
plugin: 'cordova-plugin-headercolor',
|
||||
pluginRef: 'plugins.headerColor',
|
||||
repo: 'https://github.com/tomloprod/cordova-plugin-headercolor',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class HeaderColor {
|
||||
|
||||
/**
|
||||
* Set a color to the task header
|
||||
* @param color {string} The hex value of the color
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static tint(color: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,6 +1,109 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface HotspotConnectionInfo {
|
||||
|
||||
/**
|
||||
* The service set identifier (SSID) of the current 802.11 network.
|
||||
*/
|
||||
SSID: string;
|
||||
|
||||
/**
|
||||
* The basic service set identifier (BSSID) of the current access point.
|
||||
*/
|
||||
BSSID: string;
|
||||
|
||||
/**
|
||||
* The current link speed in Mbps
|
||||
*/
|
||||
linkSpeed: string;
|
||||
|
||||
/**
|
||||
* The IP Address
|
||||
*/
|
||||
IPAddress: string;
|
||||
|
||||
/**
|
||||
* Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
|
||||
*/
|
||||
networkID: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HotspotNetwork {
|
||||
|
||||
/**
|
||||
* Human readable network name
|
||||
*/
|
||||
SSID: string;
|
||||
|
||||
/**
|
||||
* MAC Address of the access point
|
||||
*/
|
||||
BSSID: string;
|
||||
|
||||
/**
|
||||
* The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.
|
||||
*/
|
||||
frequency: number;
|
||||
|
||||
/**
|
||||
* The detected signal level in dBm, also known as the RSSI.
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* Timestamp in microseconds (since boot) when this result was last seen.
|
||||
*/
|
||||
timestamp: number;
|
||||
|
||||
/**
|
||||
* Describes the authentication, key management, and encryption schemes supported by the access point.
|
||||
*/
|
||||
capabilities: string;
|
||||
|
||||
}
|
||||
export interface HotspotNetworkConfig {
|
||||
|
||||
/**
|
||||
* Device IP Address
|
||||
*/
|
||||
deviceIPAddress: string;
|
||||
|
||||
/**
|
||||
* Device MAC Address
|
||||
*/
|
||||
deviceMacAddress: string;
|
||||
|
||||
/**
|
||||
* Gateway IP Address
|
||||
*/
|
||||
gatewayIPAddress: string;
|
||||
|
||||
/**
|
||||
* Gateway MAC Address
|
||||
*/
|
||||
gatewayMacAddress: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HotspotDevice {
|
||||
|
||||
/**
|
||||
* ip
|
||||
* Hotspot IP Address
|
||||
*/
|
||||
ip: string;
|
||||
|
||||
/**
|
||||
* mac
|
||||
* Hotspot MAC Address
|
||||
*/
|
||||
mac: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* @usage
|
||||
@@ -13,9 +116,14 @@ import { Cordova, Plugin } from './plugin';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HotspotConnectionInfo
|
||||
* HotspotNetwork
|
||||
* HotspotNetworkConfig
|
||||
* HotspotDevice
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Hotspot',
|
||||
pluginName: 'Hotspot',
|
||||
plugin: 'cordova-plugin-hotspot',
|
||||
pluginRef: 'cordova.plugins.hotspot',
|
||||
repo: 'https://github.com/hypery2k/cordova-hotspot-plugin',
|
||||
@@ -23,9 +131,15 @@ import { Cordova, Plugin } from './plugin';
|
||||
})
|
||||
export class Hotspot {
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static toggleWifi(): Promise<boolean> { return; }
|
||||
|
||||
@@ -36,7 +150,7 @@ export class Hotspot {
|
||||
* @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
|
||||
* @param {string} password - password for your new Access Point
|
||||
*
|
||||
* @return {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
|
||||
* @returns {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
|
||||
*/
|
||||
@Cordova()
|
||||
static createHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
|
||||
@@ -44,7 +158,7 @@ export class Hotspot {
|
||||
/**
|
||||
* Turns on Access Point
|
||||
*
|
||||
* @return {Promise<boolean>} - true if AP is started
|
||||
* @returns {Promise<boolean>} - true if AP is started
|
||||
*/
|
||||
@Cordova()
|
||||
static startHotspot(): Promise<boolean> { return; }
|
||||
@@ -56,7 +170,7 @@ export class Hotspot {
|
||||
* @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
|
||||
* @param {string} password - password for your new Access Point
|
||||
*
|
||||
* @return {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
|
||||
* @returns {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
|
||||
*/
|
||||
@Cordova()
|
||||
static configureHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
|
||||
@@ -64,7 +178,7 @@ export class Hotspot {
|
||||
/**
|
||||
* Turns off Access Point
|
||||
*
|
||||
* @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
|
||||
* @returns {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static stopHotspot(): Promise<boolean> { return; }
|
||||
@@ -72,11 +186,14 @@ export class Hotspot {
|
||||
/**
|
||||
* Checks if hotspot is enabled
|
||||
*
|
||||
* @return {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
|
||||
* @returns {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static isHotspotEnabled(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotDevice>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
|
||||
|
||||
@@ -88,7 +205,7 @@ export class Hotspot {
|
||||
* @param {string} password
|
||||
* password to use
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -106,7 +223,7 @@ export class Hotspot {
|
||||
* @param {string[]} encryption
|
||||
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -122,7 +239,7 @@ export class Hotspot {
|
||||
* @param {string} password
|
||||
* Password for network
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that adding the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -134,45 +251,81 @@ export class Hotspot {
|
||||
* @param {string} ssid
|
||||
* SSID of network
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that removing the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static removeWifiNetwork(ssid: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnectedToInternet(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnectedToInternetViaWifi(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiOn(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiSupported(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiDirectSupported(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scanWifi(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopWifiPeriodicallyScan(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<HotspotNetworkConfig>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getNetConfig(): Promise<HotspotNetworkConfig> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<HotspotConnectionInfo>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> { return; }
|
||||
static getConnectionInfo(): Promise<HotspotConnectionInfo> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static pingHost(ip: string): Promise<string> { return; }
|
||||
|
||||
@@ -181,7 +334,7 @@ export class Hotspot {
|
||||
*
|
||||
* @param {string} ip - IP Address that you want the MAC Address of
|
||||
*
|
||||
* @return {Promise<string>} - A Promise for the MAC Address
|
||||
* @returns {Promise<string>} - A Promise for the MAC Address
|
||||
*/
|
||||
@Cordova()
|
||||
static getMacAddressOfHost(ip: string): Promise<string> { return; }
|
||||
@@ -191,7 +344,7 @@ export class Hotspot {
|
||||
*
|
||||
* @param {string} ip - IP Address you want to test
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
*/
|
||||
@Cordova()
|
||||
static isDnsLive(ip: string): Promise<boolean> { return; }
|
||||
@@ -201,7 +354,7 @@ export class Hotspot {
|
||||
*
|
||||
* @param {string} ip - IP Address you want to test
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
*/
|
||||
@Cordova()
|
||||
static isPortLive(ip: string): Promise<boolean> { return; }
|
||||
@@ -209,100 +362,9 @@ export class Hotspot {
|
||||
/**
|
||||
* Checks if device is rooted
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the device is rooted
|
||||
* @returns {Promise<boolean>} - A Promise for whether the device is rooted
|
||||
*/
|
||||
@Cordova()
|
||||
static isRooted(): Promise<boolean> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ConnectionInfo {
|
||||
/**
|
||||
* SSID
|
||||
* The service set identifier (SSID) of the current 802.11 network.
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* BSSID
|
||||
* The basic service set identifier (BSSID) of the current access point.
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* linkSpeed
|
||||
* The current link speed in Mbps
|
||||
*/
|
||||
linkSpeed: string;
|
||||
/**
|
||||
* IPAddress
|
||||
* The IP Address
|
||||
*/
|
||||
IPAddress: string;
|
||||
/**
|
||||
* networkID
|
||||
* Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
|
||||
*/
|
||||
networkID: string;
|
||||
}
|
||||
|
||||
export interface HotspotNetwork {
|
||||
/**
|
||||
* SSID
|
||||
* Human readable network name
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* BSSID
|
||||
* MAC Address of the access point
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* frequency
|
||||
* The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.
|
||||
*/
|
||||
frequency: number;
|
||||
/**
|
||||
* level
|
||||
* The detected signal level in dBm, also known as the RSSI.
|
||||
*/
|
||||
level: number;
|
||||
/**
|
||||
* timestamp
|
||||
* Timestamp in microseconds (since boot) when this result was last seen.
|
||||
*/
|
||||
timestamp: number;
|
||||
/**
|
||||
* capabilities
|
||||
* Describes the authentication, key management, and encryption schemes supported by the access point.
|
||||
*/
|
||||
capabilities: string;
|
||||
}
|
||||
export interface HotspotNetworkConfig {
|
||||
/**
|
||||
* deviceIPAddress - Device IP Address
|
||||
*/
|
||||
deviceIPAddress: string;
|
||||
/**
|
||||
* deviceMacAddress - Device MAC Address
|
||||
*/
|
||||
deviceMacAddress: string;
|
||||
/**
|
||||
* gatewayIPAddress - Gateway IP Address
|
||||
*/
|
||||
gatewayIPAddress: string;
|
||||
/**
|
||||
* gatewayMacAddress - Gateway MAC Address
|
||||
*/
|
||||
gatewayMacAddress: string;
|
||||
}
|
||||
export interface HotspotDevice {
|
||||
/**
|
||||
* ip
|
||||
* Hotspot IP Address
|
||||
*/
|
||||
ip: string;
|
||||
/**
|
||||
* mac
|
||||
* Hotspot MAC Address
|
||||
*/
|
||||
mac: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The headers of the response
|
||||
*/
|
||||
headers: any;
|
||||
/**
|
||||
* Error response from the server. This property usually exists when a promise returned by a request method rejects.
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name HTTP
|
||||
* @description
|
||||
@@ -33,7 +53,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* HTTPResponse
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'HTTP',
|
||||
pluginName: 'HTTP',
|
||||
plugin: 'cordova-plugin-http',
|
||||
pluginRef: 'cordovaHTTP',
|
||||
repo: 'https://github.com/wymsee/cordova-HTTP',
|
||||
@@ -45,7 +65,7 @@ export class HTTP {
|
||||
* This returns an object representing a basic HTTP Authorization header of the form.
|
||||
* @param username {string} Username
|
||||
* @param password {string} Password
|
||||
* @return {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
|
||||
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getBasicAuthHeader(username: string, password: string): { Authorization: string; } { return; }
|
||||
@@ -73,7 +93,7 @@ export class HTTP {
|
||||
*
|
||||
* As an alternative, you can store your .cer files in the www/certificates folder.
|
||||
* @param enable {boolean} Set to true to enable
|
||||
* @return {Promise<any>} returns a promise that will resolve on success, and reject on failure
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static enableSSLPinning(enable: boolean): Promise<void> { return; }
|
||||
@@ -81,7 +101,7 @@ export class HTTP {
|
||||
/**
|
||||
* Accept all SSL certificates. Or disabled accepting all certificates. Defaults to false.
|
||||
* @param accept {boolean} Set to true to accept
|
||||
* @return {Promise<any>} returns a promise that will resolve on success, and reject on failure
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static acceptAllCerts(accept: boolean): Promise<void> { return; }
|
||||
@@ -89,7 +109,7 @@ export class HTTP {
|
||||
/**
|
||||
* Whether or not to validate the domain name in the certificate. This defaults to true.
|
||||
* @param validate {boolean} Set to true to validate
|
||||
* @return {Promise<any>} returns a promise that will resolve on success, and reject on failure
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static validateDomainName(validate: boolean): Promise<void> { return; }
|
||||
@@ -99,7 +119,7 @@ export class HTTP {
|
||||
* @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
|
||||
* @return {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
@@ -109,7 +129,7 @@ export class HTTP {
|
||||
* @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
|
||||
* @return {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
@@ -121,7 +141,7 @@ export class HTTP {
|
||||
* @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
|
||||
* @return {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<HTTPResponse> { return; }
|
||||
@@ -132,27 +152,8 @@ export class HTTP {
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The path to donwload the file to, including the file name.
|
||||
* @return {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> { return; }
|
||||
}
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The headers of the response
|
||||
*/
|
||||
headers: any;
|
||||
/**
|
||||
* Error response from the server. This property usually exists when a promise returned by a request method rejects.
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface HttpdOptions {
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Httpd
|
||||
@@ -21,9 +38,11 @@ import { Observable } from 'rxjs/Observable';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HttpdOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Httpd',
|
||||
pluginName: 'Httpd',
|
||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
||||
pluginRef: 'cordova.plugins.CorHttpd',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||
@@ -33,14 +52,14 @@ export class Httpd {
|
||||
|
||||
/**
|
||||
* Starts a web server.
|
||||
* @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server.
|
||||
* @param options {HttpdOptions}
|
||||
* @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options?: any): Observable<string> { return; }
|
||||
static startServer(options?: HttpdOptions): Observable<string> { return; }
|
||||
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
@@ -58,23 +77,3 @@ export class Httpd {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* These options are used for the Httpd.startServer() function.
|
||||
*/
|
||||
export interface HttpdOptions {
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface Beacon {
|
||||
@@ -103,7 +102,7 @@ export interface CircularRegion {
|
||||
|
||||
export type Region = BeaconRegion | CircularRegion;
|
||||
|
||||
export interface PluginResult {
|
||||
export interface IBeaconPluginResult {
|
||||
|
||||
/**
|
||||
* The name of the delegate function that produced the PluginResult object.
|
||||
@@ -136,11 +135,11 @@ export interface PluginResult {
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface Delegate {
|
||||
export interface IBeaconDelegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
* @return Returns a string.
|
||||
* @returns {Observable<string>} Returns a string.
|
||||
*/
|
||||
didChangeAuthorizationStatus(): Observable<string>;
|
||||
|
||||
@@ -151,9 +150,9 @@ export interface Delegate {
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didDetermineStateForRegion(): Observable<PluginResult>;
|
||||
didDetermineStateForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
@@ -163,9 +162,9 @@ export interface Delegate {
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didEnterRegion(): Observable<PluginResult>;
|
||||
didEnterRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
@@ -175,51 +174,51 @@ export interface Delegate {
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didExitRegion(): Observable<PluginResult>;
|
||||
didExitRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* each time that the device ranges beacons. Modern Android and iOS devices range
|
||||
* aproximately once per second.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didRangeBeaconsInRegion(): Observable<PluginResult>;
|
||||
didRangeBeaconsInRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins monitoring a region.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didStartMonitoringForRegion(): Observable<PluginResult>;
|
||||
didStartMonitoringForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device fails to monitor a region.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
monitoringDidFailForRegionWithError(): Observable<PluginResult>;
|
||||
monitoringDidFailForRegionWithError(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins advertising as an iBeacon.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidStartAdvertising(): Observable<PluginResult>;
|
||||
peripheralManagerDidStartAdvertising(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the state of the peripheral manager's state updates.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidUpdateState(): Observable<PluginResult>;
|
||||
peripheralManagerDidUpdateState(): Observable<IBeaconPluginResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,9 +265,16 @@ export interface Delegate {
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* Beacon
|
||||
* BeaconRegion
|
||||
* CircularRegion
|
||||
* IBeaconPluginResult
|
||||
* IBeaconDelegate
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'IBeacon',
|
||||
pluginName: 'IBeacon',
|
||||
plugin: 'cordova-plugin-ibeacon',
|
||||
pluginRef: 'cordova.plugins.locationManager',
|
||||
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
|
||||
@@ -280,87 +286,87 @@ export class IBeacon {
|
||||
* Instances of this class are delegates between the {@link LocationManager} and
|
||||
* the code that consumes the messages generated on in the native layer.
|
||||
*
|
||||
* @returns {Delegate} An instance of the type {@type Delegate}.
|
||||
* @returns {IBeaconDelegate} An instance of the type {@type Delegate}.
|
||||
*/
|
||||
static Delegate(): Delegate {
|
||||
static Delegate(): IBeaconDelegate {
|
||||
let delegate = new cordova.plugins.locationManager.Delegate();
|
||||
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didChangeAuthorizationStatus = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didDetermineStateForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didEnterRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didEnterRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didExitRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didExitRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didRangeBeaconsInRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didStartMonitoringForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.monitoringDidFailForRegionWithError = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidStartAdvertising = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidUpdateState = cb;
|
||||
}
|
||||
);
|
||||
@@ -380,44 +386,44 @@ export class IBeacon {
|
||||
* @param {Number} minor The minor value that you use to identify a specific beacon.
|
||||
* @param {BOOL} notifyEntryStateOnDisplay
|
||||
*
|
||||
* @return Returns the BeaconRegion that was created
|
||||
* @returns {BeaconRegion} Returns the BeaconRegion that was created
|
||||
*/
|
||||
static BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
|
||||
return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the Delegate
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
static getDelegate(): Delegate { return; }
|
||||
static getDelegate(): IBeaconDelegate { return; }
|
||||
|
||||
/**
|
||||
* @param {Delegate} delegate An instance of a delegate to register with the native layer.
|
||||
* @param {IBeaconDelegate} delegate An instance of a delegate to register with the native layer.
|
||||
*
|
||||
* @return Returns the Delegate
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
static setDelegate(delegate: Delegate): Delegate { return; }
|
||||
static setDelegate(delegate: IBeaconDelegate): IBeaconDelegate { return; }
|
||||
|
||||
/**
|
||||
* Signals the native layer that the client side is ready to consume messages.
|
||||
* Readiness here means that it has a {Delegate} set by the consumer javascript
|
||||
* Readiness here means that it has a {IBeaconDelegate} set by the consumer javascript
|
||||
* code.
|
||||
*
|
||||
* The {LocationManager.setDelegate()} will implicitly call this method as well,
|
||||
* therefore the only case when you have to call this manually is if you don't
|
||||
* wish to specify a {Delegate} of yours.
|
||||
* wish to specify a {IBeaconDelegate} of yours.
|
||||
*
|
||||
* The purpose of this signaling mechanism is to make the events work when the
|
||||
* app is being woken up by the Operating System to give it a chance to handle
|
||||
* region monitoring events for example.
|
||||
*
|
||||
* If you don't set a {Delegate} and don't call this method manually, an error
|
||||
* If you don't set a {IBeaconDelegate} and don't call this method manually, an error
|
||||
* message get emitted in the native runtime and the DOM as well after a certain
|
||||
* period of time.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the request and started to send events.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -425,7 +431,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Determines if bluetooth is switched on, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether bluetooth is active.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -434,7 +440,7 @@ export class IBeacon {
|
||||
/**
|
||||
* Enables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns Returns a promise which is resolved when Bluetooth
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -443,7 +449,7 @@ export class IBeacon {
|
||||
/**
|
||||
* Disables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns Returns a promise which is resolved when Bluetooth
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -463,7 +469,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<string>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -480,7 +486,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -496,7 +502,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -514,7 +520,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -531,7 +537,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -540,7 +546,7 @@ export class IBeacon {
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the
|
||||
* @returns {Promise<any>} Returns a promise which is resolved with the
|
||||
* requested authorization status.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -553,7 +559,7 @@ export class IBeacon {
|
||||
* <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestAlwaysAuthorization">requestAlwaysAuthorization</a>
|
||||
*
|
||||
* If you are using this plugin on Android devices only, you will never have to use this, nor {@code requestAlwaysAuthorization}
|
||||
* @returns Returns a promise that is resolved when the request dialog is shown.
|
||||
* @returns {Promise<void>} Returns a promise that is resolved when the request dialog is shown.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static requestWhenInUseAuthorization(): Promise<void> { return; }
|
||||
@@ -562,7 +568,7 @@ export class IBeacon {
|
||||
/**
|
||||
* See the docuemntation of {@code requestWhenInUseAuthorization} for further details.
|
||||
*
|
||||
* @returns Returns a promise which is resolved when the native layer
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when the native layer
|
||||
* shows the request dialog.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -570,7 +576,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* @returns {Promise<Region[]>} Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being monitored by the native layer.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -578,7 +584,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* @returns {Promise<Region[]>} Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being ranged by the native layer.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -586,7 +592,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Determines if ranging is available or not, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether ranging is available or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -598,7 +604,7 @@ export class IBeacon {
|
||||
* @param {Region} region An instance of {Region} which will be checked
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether the region type is supported or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -611,14 +617,14 @@ export class IBeacon {
|
||||
* this application, it will be replaced with the new identifier.
|
||||
*
|
||||
* This call will accept a valid beacon even when no BlueTooth is available,
|
||||
* and will start when BlueTooth is powered on. See {Delegate.}
|
||||
* and will start when BlueTooth is powered on. See {IBeaconDelegate.}
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be advertised
|
||||
* by the operating system.
|
||||
* @param {Integer} measuredPower: Optional parameter, if left empty, the device will
|
||||
* use it's own default value.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the advertising request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -629,7 +635,7 @@ export class IBeacon {
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in isAdvertising.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop advertising.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -637,7 +643,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Determines if advertising is available or not, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is available or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -645,7 +651,7 @@ export class IBeacon {
|
||||
|
||||
/**
|
||||
* Determines if advertising is currently active, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is active.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -655,7 +661,7 @@ export class IBeacon {
|
||||
* Disables debug logging in the native layer. Use this method if you want
|
||||
* to prevent this plugin from writing to the device logs.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -666,7 +672,7 @@ export class IBeacon {
|
||||
* to allow the plugin the posting local notifications.
|
||||
* This can be very helpful when debugging how to apps behave when launched into the background.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to enabled.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -676,7 +682,7 @@ export class IBeacon {
|
||||
* Disables the posting of debug notifications in the native layer. Use this method if you want
|
||||
* to prevent the plugin from posting local notifications.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to disabled.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -686,7 +692,7 @@ export class IBeacon {
|
||||
* Enables debug logging in the native layer. Use this method if you want
|
||||
* a debug the inner workings of this plugin.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
@@ -698,7 +704,7 @@ export class IBeacon {
|
||||
*
|
||||
* @param {String} message The message to append to the device logs.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the log
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with the log
|
||||
* message received by the native layer for appending. The returned message
|
||||
* is expected to be equivalent to the one provided in the original call.
|
||||
*/
|
||||
|
||||
@@ -46,16 +46,16 @@ export interface ImagePickerOptions {
|
||||
* ImagePickerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'ImagePicker',
|
||||
plugin: 'cordova-plugin-image-picker',
|
||||
pluginName: 'ImagePicker',
|
||||
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||
pluginRef: 'window.imagePicker',
|
||||
repo: 'https://github.com/wymsee/cordova-imagePicker'
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker'
|
||||
})
|
||||
export class ImagePicker {
|
||||
/**
|
||||
* Pick pictures from the library.
|
||||
* @param {ImagePickerOptions} options
|
||||
* @return Returns a Promise that resolves the image file URI
|
||||
* @returns {Promise<any>} Returns a Promise that resolves the image file URI
|
||||
* otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
|
||||
@@ -65,14 +65,19 @@ export interface ImageResizerOptions {
|
||||
* () => { console.log('Error occured'); }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ImageResizerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'ImageResizer',
|
||||
pluginName: 'ImageResizer',
|
||||
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
|
||||
pluginRef: 'ImageResizer',
|
||||
repo: 'https://github.com/protonet/cordova-plugin-image-resizer'
|
||||
})
|
||||
export class ImageResizer {
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static resize(options: ImageResizerOptions): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -29,19 +29,17 @@ export interface InAppBrowserEvent extends Event {
|
||||
* browser.insertCSS(...);
|
||||
* browser.close();
|
||||
* ```
|
||||
* @interfaces
|
||||
* InAppBrowserEvent
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'InAppBrowser',
|
||||
pluginName: 'InAppBrowser',
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser',
|
||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser'
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
static open(url: string, target?: string, options?: string): void {
|
||||
console.warn('Native: Your current usage of the InAppBrowser plugin is depreciated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.');
|
||||
}
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
/**
|
||||
@@ -76,25 +74,24 @@ export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param script {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeScript(script: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param css Details of the script to run, specifying either a file or code key.
|
||||
* @param css {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
|
||||
|
||||
insertCSS(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
* @param event Event name
|
||||
* @returns {Observable<any>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
||||
* @param {string} name of the event
|
||||
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
||||
*/
|
||||
on(event: string): Observable<InAppBrowserEvent> {
|
||||
return new Observable<InAppBrowserEvent>((observer) => {
|
||||
@@ -102,4 +99,5 @@ export class InAppBrowser {
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'InAppPurchase',
|
||||
pluginName: 'InAppPurchase',
|
||||
plugin: 'cordova-plugin-inapppurchase',
|
||||
pluginRef: 'inAppPurchase',
|
||||
platforms: ['Android', 'iOS'],
|
||||
@@ -62,7 +62,7 @@ export class InAppPurchase {
|
||||
/**
|
||||
* Retrieves a list of full product data from Apple/Google. This method must be called before making purchases.
|
||||
* @param {array<string>} productId an array of product ids.
|
||||
* @returns {Promise} Returns a Promise that resolves with an array of objects.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with an array of objects.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
@@ -72,7 +72,7 @@ export class InAppPurchase {
|
||||
/**
|
||||
* Buy a product that matches the productId.
|
||||
* @param {string} productId A string that matches the product you want to buy.
|
||||
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
||||
* @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
@@ -82,7 +82,7 @@ export class InAppPurchase {
|
||||
/**
|
||||
* Same as buy, but for subscription based products.
|
||||
* @param {string} productId A string that matches the product you want to subscribe to.
|
||||
* @returns {Promise} Returns a Promise that resolves with the transaction details.
|
||||
* @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
@@ -94,6 +94,7 @@ export class InAppPurchase {
|
||||
* @param {string} productType
|
||||
* @param {string} receipt
|
||||
* @param {string} signature
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
@@ -102,7 +103,7 @@ export class InAppPurchase {
|
||||
|
||||
/**
|
||||
* Restore all purchases from the store
|
||||
* @returns {Promise} Returns a promise with an array of purchases.
|
||||
* @returns {Promise<any>} Returns a promise with an array of purchases.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
|
||||
@@ -26,7 +26,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Insomnia',
|
||||
pluginName: 'Insomnia',
|
||||
plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git',
|
||||
pluginRef: 'plugins.insomnia',
|
||||
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
|
||||
@@ -36,14 +36,14 @@ export class Insomnia {
|
||||
|
||||
/**
|
||||
* Keeps awake the application
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static keepAwake(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Allows the application to sleep again
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static allowSleepAgain(): Promise<any> { return; }
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Instagram',
|
||||
pluginName: 'Instagram',
|
||||
plugin: 'cordova-instagram-plugin',
|
||||
pluginRef: 'Instagram',
|
||||
repo: 'https://github.com/vstirbu/InstagramPlugin'
|
||||
@@ -25,7 +25,7 @@ export class Instagram {
|
||||
/**
|
||||
* Detect if the Instagram application is installed on the device.
|
||||
*
|
||||
* @return {Promise<boolean|string>} Returns a promise that returns a boolean value if installed, or the app version on android
|
||||
* @returns {Promise<boolean|string>} Returns a promise that returns a boolean value if installed, or the app version on android
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
@@ -38,7 +38,7 @@ export class Instagram {
|
||||
*
|
||||
* @param canvasIdOrDataUrl The canvas element id or the dataURL of the image to share
|
||||
* @param caption The caption of the image
|
||||
* @return {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
* @returns {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
@@ -48,7 +48,7 @@ export class Instagram {
|
||||
/**
|
||||
* Share a library asset or video
|
||||
* @param assetLocalIdentifier A local fileURI
|
||||
* @return {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
* @returns {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
|
||||
@@ -17,7 +17,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'IsDebug',
|
||||
pluginName: 'IsDebug',
|
||||
plugin: 'cordova-plugin-is-debug',
|
||||
pluginRef: 'cordova.plugins.IsDebug',
|
||||
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
|
||||
@@ -26,7 +26,7 @@ export class IsDebug {
|
||||
|
||||
/**
|
||||
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIsDebug(): Promise<boolean> {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Keyboard',
|
||||
pluginName: 'Keyboard',
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
|
||||
@@ -58,6 +58,7 @@ export class Keyboard {
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
@@ -68,6 +69,7 @@ export class Keyboard {
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
|
||||
36
src/plugins/launch-review.ts
Normal file
36
src/plugins/launch-review.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name LaunchReview
|
||||
* @description
|
||||
*
|
||||
* This launches the native store app in order for the user to leave a review.
|
||||
* On Android, the plugin opens the the app's storepage in the Play Store where the user can leave a review by pressing the stars to give a rating.
|
||||
* On iOS, the plugin opens the app's storepage in the App Store and focuses the Review tab, where the user can leave a review by pressing "Write a review".
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { LaunchReview } from 'ionic-native';
|
||||
*
|
||||
* const appId: string = 'yourAppId';
|
||||
* LaunchReview.launch(appId)
|
||||
* .then(() => console.log('Successfully launched store app');
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LaunchReview',
|
||||
plugin: 'cordova-launch-review',
|
||||
pluginRef: 'LaunchReview',
|
||||
repo: 'https://github.com/dpa99c/cordova-launch-review',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class LaunchReview {
|
||||
|
||||
/**
|
||||
* Launch store app using given app ID
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static launch(appId: string): Promise<void> { return; }
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
/**
|
||||
@@ -80,9 +79,11 @@ export interface LaunchNavigatorOptions {
|
||||
* error => console.log('Error launching navigator', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* LaunchNavigatorOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'LaunchNavigator',
|
||||
pluginName: 'LaunchNavigator',
|
||||
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
|
||||
pluginRef: 'launchnavigator',
|
||||
repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git'
|
||||
@@ -107,12 +108,14 @@ export class LaunchNavigator {
|
||||
/**
|
||||
* Determines if the given app is installed and available on the current device.
|
||||
* @param app {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAppAvailable(app: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns a list indicating which apps are installed and available on the current device.
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
static availableApps(): Promise<string[]> { return; }
|
||||
@@ -120,6 +123,7 @@ export class LaunchNavigator {
|
||||
/**
|
||||
* Returns the display name of the specified app.
|
||||
* @param app {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getAppDisplayName(app: string): string { return; }
|
||||
@@ -127,6 +131,7 @@ export class LaunchNavigator {
|
||||
/**
|
||||
* Returns list of supported apps on a given platform.
|
||||
* @param platform {string}
|
||||
* @returns {string[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getAppsForPlatform(platform: string): string[] { return; }
|
||||
@@ -135,6 +140,7 @@ export class LaunchNavigator {
|
||||
* Indicates if an app on a given platform supports specification of transport mode.
|
||||
* @param app {string} specified as a string, you can use one of the constants, e.g `LaunchNavigator.APP.GOOGLE_MAPS`
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsTransportMode(app: string, platform: string): boolean { return; }
|
||||
@@ -143,6 +149,7 @@ export class LaunchNavigator {
|
||||
* Returns the list of transport modes supported by an app on a given platform.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {string[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getTransportModes(app: string, platform: string): string[] { return; }
|
||||
@@ -152,6 +159,7 @@ export class LaunchNavigator {
|
||||
* Note that currently only Google Maps on Android does.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsLaunchMode(app: string, platform: string): boolean { return; }
|
||||
@@ -160,16 +168,31 @@ export class LaunchNavigator {
|
||||
* Indicates if an app on a given platform supports specification of start location.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsStart(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsStartName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsDestName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param destination {string | number[]}
|
||||
* @param options {LaunchNavigatorOptions}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
|
||||
|
||||
|
||||
@@ -1,230 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
* @description
|
||||
* This plugin allows you to display local notifications on the device
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { LocalNotifications } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: 'Single Notification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret: key }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: 'Multi Notification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: 'Local Notification Example',
|
||||
* text: 'Multi Notification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: 'Delayed Notification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
|
||||
})
|
||||
export class LocalNotifications {
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: Notification | Array<Notification>): void { }
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: Notification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
* @returns {Promise} Returns a promise when the notification had been cleared
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears all notifications
|
||||
* @returns {Promise} Returns a promise when all notifications have cleared
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
* @returns {Promise} Returns a promise when the notification is canceled
|
||||
*/
|
||||
@Cordova()
|
||||
static cancel(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels all notifications
|
||||
* @returns {Promise} Returns a promise when all notifications are canceled
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static cancelAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks presence of a notification
|
||||
* @param notificationId
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static isPresent(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks is a notification is scheduled
|
||||
* @param notificationId
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static isScheduled(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if a notification is triggered
|
||||
* @param notificationId
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static isTriggered(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Get all the notification ids
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggeredIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of scheduled notifications
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduledIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static get(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered(notificationId: any): Promise<Notification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<Notification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<Notification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<Notification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Informs if the app has the permission to show notifications.
|
||||
* @returns {Promise} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<boolean> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
export interface ILocalNotification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
@@ -306,3 +82,227 @@ export interface Notification {
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
* @description
|
||||
* This plugin allows you to display local notifications on the device
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { LocalNotifications } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: 'Single ILocalNotification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret: key }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: 'Multi ILocalNotification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: 'Local ILocalNotification Example',
|
||||
* text: 'Multi ILocalNotification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: 'Delayed ILocalNotification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* ILocalNotification
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
|
||||
})
|
||||
export class LocalNotifications {
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options {Notification | Array<ILocalNotification>} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options {ILocalNotification} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: ILocalNotification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
* @param notificationId {any} A single notification id, or an array of notification ids.
|
||||
* @returns {Promise<any>} Returns a promise when the notification had been cleared
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications have cleared
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels single or multiple notifications
|
||||
* @param notificationId {any} A single notification id, or an array of notification ids.
|
||||
* @returns {Promise<any>} Returns a promise when the notification is canceled
|
||||
*/
|
||||
@Cordova()
|
||||
static cancel(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications are canceled
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static cancelAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks presence of a notification
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isPresent(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks is a notification is scheduled
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isScheduled(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if a notification is triggered
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isTriggered(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Get all the notification ids
|
||||
* @returns {Promise<Array<number>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
* @returns {Promise<Array<number>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggeredIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of scheduled notifications
|
||||
* @returns {Promise<Array<number>>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduledIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Informs if the app has the permission to show notifications.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<boolean> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'LocationAccuracy',
|
||||
pluginName: 'LocationAccuracy',
|
||||
plugin: 'cordova-plugin-request-location-accuracy',
|
||||
pluginRef: 'cordova.plugins.locationAccuracy',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'
|
||||
|
||||
@@ -13,18 +13,36 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Market',
|
||||
pluginName: 'Market',
|
||||
plugin: 'cordova-plugin-market',
|
||||
pluginRef: 'plugins.market',
|
||||
pluginRef: 'cordova.plugins.market',
|
||||
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
|
||||
})
|
||||
export class Market {
|
||||
|
||||
/**
|
||||
* Opens an app in Google Play / App Store
|
||||
* @param appId {string} Package name
|
||||
* @param callbacks {Object} Optional callbacks
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static open(appId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Search apps by keyword
|
||||
* @param keyword {string} Keyword
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure',
|
||||
platforms: ['Android']
|
||||
})
|
||||
static search(keyword: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,109 +1,8 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
* MediaCapture.captureImage(options)
|
||||
* .then(
|
||||
* (data: MediaFile[]) => console.log(data),
|
||||
* (err: CaptureError) => console.error(err)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'MediaCapture',
|
||||
plugin: 'cordova-plugin-media-capture',
|
||||
pluginRef: 'navigator.device.capture',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media-capture'
|
||||
})
|
||||
export class MediaCapture {
|
||||
/**
|
||||
* The audio recording formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedImageModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedImageModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The recording image sizes and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedAudioModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedAudioModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The recording video resolutions and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedVideoModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedVideoModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the audio recorder application and return information about captured audio clip files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* Start the camera application and return information about captured image files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureImage(options?: CaptureImageOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* Start the video recorder application and return information about captured video clip files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is successful
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureresult'
|
||||
})
|
||||
static onPendingCaptureResult(): Observable<MediaFile[]> { return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is unsuccessful
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureerror'
|
||||
})
|
||||
static onPendingCaptureError(): Observable<CaptureError> { return; }
|
||||
|
||||
}
|
||||
/**
|
||||
* Encapsulates properties of a media capture file.
|
||||
*/
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
@@ -116,7 +15,7 @@ export interface MediaFile {
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
@@ -132,9 +31,7 @@ export interface MediaFile {
|
||||
*/
|
||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
||||
}
|
||||
/**
|
||||
* Encapsulates format information about a media file.
|
||||
*/
|
||||
|
||||
export interface MediaFileData {
|
||||
/**
|
||||
* The actual format of the audio and video content.
|
||||
@@ -157,15 +54,11 @@ export interface MediaFileData {
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates the error code resulting from a failed media capture operation.
|
||||
*/
|
||||
|
||||
export interface CaptureError {
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Encapsulates audio capture configuration options.
|
||||
*/
|
||||
|
||||
export interface CaptureAudioOptions {
|
||||
/**
|
||||
* Maximum number of audio clips. Defaults to 1.
|
||||
@@ -177,18 +70,14 @@ export interface CaptureAudioOptions {
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates image capture configuration options.
|
||||
*/
|
||||
|
||||
export interface CaptureImageOptions {
|
||||
/**
|
||||
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates video capture configuration options.
|
||||
*/
|
||||
|
||||
export interface CaptureVideoOptions {
|
||||
/**
|
||||
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
|
||||
@@ -203,14 +92,12 @@ export interface CaptureVideoOptions {
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates a set of media capture parameters that a device supports.
|
||||
*/
|
||||
|
||||
export interface ConfigurationData {
|
||||
/**
|
||||
* The ASCII-encoded lowercase string representing the media type.
|
||||
*/
|
||||
type: string;
|
||||
type: string;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
@@ -220,3 +107,108 @@ export interface ConfigurationData {
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
* MediaCapture.captureImage(options)
|
||||
* .then(
|
||||
* (data: MediaFile[]) => console.log(data),
|
||||
* (err: CaptureError) => console.error(err)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MediaFile
|
||||
* MediaFileData
|
||||
* CaptureError
|
||||
* CaptureAudioOptions
|
||||
* CaptureImageOptions
|
||||
* CaptureVideoOptions
|
||||
* ConfigurationData
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MediaCapture',
|
||||
plugin: 'cordova-plugin-media-capture',
|
||||
pluginRef: 'navigator.device.capture',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media-capture'
|
||||
})
|
||||
export class MediaCapture {
|
||||
/**
|
||||
* The recording image sizes and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static supportedImageModes: ConfigurationData[];
|
||||
|
||||
/**
|
||||
* The audio recording formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static supportedAudioModes: ConfigurationData[];
|
||||
|
||||
/**
|
||||
* The recording video resolutions and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static supportedVideoModes: ConfigurationData[];
|
||||
|
||||
/**
|
||||
* Start the audio recorder application and return information about captured audio clip files.
|
||||
* @param options
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* Start the camera application and return information about captured image files.
|
||||
* @param options
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureImage(options?: CaptureImageOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* Start the video recorder application and return information about captured video clip files.
|
||||
* @param options
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[] | CaptureError> { return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is successful
|
||||
* @returns {Observable<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureresult'
|
||||
})
|
||||
static onPendingCaptureResult(): Observable<MediaFile[]> { return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is unsuccessful
|
||||
* @returns {Observable<CaptureError>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureerror'
|
||||
})
|
||||
static onPendingCaptureError(): Observable<CaptureError> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,11 @@ export interface MediaError {
|
||||
*
|
||||
*
|
||||
* // Create a MediaPlugin instance. Expects path to file or url as argument
|
||||
* var file = new MediaPlugin('path/to/file.mp3');
|
||||
* // We can optionally pass a second argument to track the status of the media
|
||||
*
|
||||
* const onStatusUpdate = (status) => console.log(status);
|
||||
*
|
||||
* const file = new MediaPlugin('path/to/file.mp3', onStatusUpdate);
|
||||
*
|
||||
* // Catch the Success & Error Output
|
||||
* // Platform Quirks
|
||||
@@ -68,7 +72,7 @@ export interface MediaError {
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'MediaPlugin',
|
||||
pluginName: 'MediaPlugin',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media',
|
||||
plugin: 'cordova-plugin-media',
|
||||
pluginRef: 'Media'
|
||||
@@ -132,7 +136,7 @@ export class MediaPlugin {
|
||||
});
|
||||
} else {
|
||||
pluginWarn({
|
||||
name: 'MediaPlugin',
|
||||
pluginName: 'MediaPlugin',
|
||||
plugin: 'cordova-plugin-media'
|
||||
});
|
||||
}
|
||||
@@ -140,21 +144,21 @@ export class MediaPlugin {
|
||||
|
||||
/**
|
||||
* Get the current amplitude of the current recording.
|
||||
* @returns {Promise} Returns a promise with the amplitude of the current recording
|
||||
* @returns {Promise<any>} Returns a promise with the amplitude of the current recording
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getCurrentAmplitude(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the current position within an audio file. Also updates the Media object's position parameter.
|
||||
* @returns {Promise} Returns a promise with the position of the current recording
|
||||
* @returns {Promise<any>} Returns a promise with the position of the current recording
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getCurrentPosition(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
|
||||
* @returns {Promise} Returns a promise with the duration of the current recording
|
||||
* @returns {number} Returns a promise with the duration of the current recording
|
||||
*/
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
@@ -199,7 +203,7 @@ export class MediaPlugin {
|
||||
|
||||
/**
|
||||
* Set the volume for an audio file.
|
||||
* @param volume The volume to set for playback. The value must be within the range of 0.0 to 1.0.
|
||||
* @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
|
||||
@@ -16,9 +16,11 @@ declare var mixpanel: any;
|
||||
* .catch(onError);
|
||||
*
|
||||
* ```
|
||||
* @classes
|
||||
* MixpanelPeople
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Mixpanel',
|
||||
pluginName: 'Mixpanel',
|
||||
plugin: 'cordova-plugin-mixpanel',
|
||||
pluginRef: 'mixpanel',
|
||||
repo: 'https://github.com/samzilverberg/cordova-mixpanel-plugin'
|
||||
@@ -41,7 +43,7 @@ export class Mixpanel {
|
||||
static distinctId(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static flush(): Promise<any> { return; }
|
||||
@@ -52,7 +54,7 @@ export class Mixpanel {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static identify(distinctId): Promise<any> { return; }
|
||||
static identify(distinctId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -64,7 +66,7 @@ export class Mixpanel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param superProperties
|
||||
* @param superProperties {any}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -79,10 +81,14 @@ export class Mixpanel {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param eventName
|
||||
* @param eventProperties
|
||||
* @param eventName {string}
|
||||
* @param eventProperties {any} optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static track(eventName: string, eventProperties?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasClose: boolean;
|
||||
ticker: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name MusicControls
|
||||
* @description
|
||||
@@ -71,14 +84,17 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MusicControlsOptions
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'MusicControls',
|
||||
pluginName: 'MusicControls',
|
||||
plugin: 'cordova-plugin-music-controls',
|
||||
pluginRef: 'MusicControls',
|
||||
repo: 'https://github.com/homerours/cordova-music-controls-plugin'
|
||||
})
|
||||
export class MusicControls {
|
||||
|
||||
/**
|
||||
* Create the media controls
|
||||
* @param options {MusicControlsOptions}
|
||||
@@ -115,15 +131,5 @@ export class MusicControls {
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static updateIsPlaying(isPlaying: boolean): void {}
|
||||
}
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasClose: boolean;
|
||||
ticker: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ import { Plugin, Cordova } from './plugin';
|
||||
* NativeAudio.preloadComplex('uniqueId2', 'path/to/file2.mp3', 1, 1, 0).then(onSuccess, onError);
|
||||
*
|
||||
* NativeAudio.play('uniqueId1').then(onSuccess, onError);
|
||||
*
|
||||
* // can optionally pass a callback to be called when the file is done playing
|
||||
* NativeAudio.play('uniqueId1', () => console.log('uniqueId1 is done playing'));
|
||||
*
|
||||
* NativeAudio.loop('uniqueId2').then(onSuccess, onError);
|
||||
*
|
||||
* NativeAudio.setVolumeForComplexAsset('uniqueId2', 0.6).then(onSuccess,onError);
|
||||
@@ -21,7 +25,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'NativeAudio',
|
||||
pluginName: 'NativeAudio',
|
||||
plugin: 'cordova-plugin-nativeaudio',
|
||||
pluginRef: 'plugins.NativeAudio',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-plugin-nativeaudio'
|
||||
@@ -51,17 +55,19 @@ export class NativeAudio {
|
||||
/**
|
||||
* Plays an audio asset
|
||||
* @param id {string} unique ID for the audio file
|
||||
* @param completeCallback {Function} callback to be invoked when audio is done playing
|
||||
* @param completeCallback {Function} optional. Callback to be invoked when audio is done playing
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static play(id: string, completeCallback: Function): Promise<any> {return; }
|
||||
static play(id: string, completeCallback?: Function): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Stops playing an audio
|
||||
* @param id {string} unique ID for the audio file
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stop(id: string): Promise<any> {return; }
|
||||
@@ -77,6 +83,7 @@ export class NativeAudio {
|
||||
/**
|
||||
* Unloads an audio file from memory
|
||||
* @param id {string} unique ID for the audio file
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static unload(id: string): Promise<any> {return; }
|
||||
@@ -85,6 +92,7 @@ export class NativeAudio {
|
||||
* Changes the volume for preloaded complex assets.
|
||||
* @param id {string} unique ID for the audio file
|
||||
* @param volume {number} the volume of the audio asset (0.1 to 1.0)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setVolumeForComplexAsset(id: string, volume: number): Promise<any> {return; }
|
||||
|
||||
98
src/plugins/native-geocoder.ts
Normal file
98
src/plugins/native-geocoder.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name NativeGeocoder
|
||||
* @description
|
||||
* Cordova plugin for native forward and reverse geocoding
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from 'ionic-native';
|
||||
*
|
||||
* NativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
||||
* .then((result: NativeGeocoderReverseResult) => console.log("The address is " + result.address + " in " + result.countryCode))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* NativeGeocoder.forwardGeocode("Berlin")
|
||||
* .then((coordinates: NativeGeocoderForwardResult) => console.log("The coordinates are latitude=" + coordinates.latitude + " and longitude=" + coordinates.longitude))
|
||||
* .catch((error: any) => console.log(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* NativeGeocoderReverseResult
|
||||
* NativeGeocoderForwardResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NativeGeocoder',
|
||||
plugin: 'cordova-plugin-nativegeocoder',
|
||||
pluginRef: 'nativegeocoder',
|
||||
repo: 'https://github.com/sebastianbaar/cordova-plugin-nativegeocoder',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class NativeGeocoder {
|
||||
|
||||
/**
|
||||
* Reverse geocode a given latitude and longitude to find location address
|
||||
* @param latitude {number} The latitude
|
||||
* @param longitude {number} The longitude
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static reverseGeocode(latitude: number, longitude: number): Promise<NativeGeocoderReverseResult> { return; }
|
||||
|
||||
/**
|
||||
* Forward geocode a given address to find coordinates
|
||||
* @param addressString {string} The address to be geocoded
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates format information about a reverse geocoding result.
|
||||
*/
|
||||
export interface NativeGeocoderReverseResult {
|
||||
/**
|
||||
* The street.
|
||||
*/
|
||||
street: string;
|
||||
/**
|
||||
* The house number.
|
||||
*/
|
||||
houseNumber: string;
|
||||
/**
|
||||
* The postal code.
|
||||
*/
|
||||
postalCode: string;
|
||||
/**
|
||||
* The city.
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* The country name.
|
||||
*/
|
||||
countryName: string;
|
||||
/**
|
||||
* The country code.
|
||||
*/
|
||||
countryCode: string;
|
||||
}
|
||||
/**
|
||||
* Encapsulates format information about a forward geocoding result.
|
||||
*/
|
||||
export interface NativeGeocoderForwardResult {
|
||||
/**
|
||||
* The latitude.
|
||||
*/
|
||||
latitude: string;
|
||||
/**
|
||||
* The longitude.
|
||||
*/
|
||||
longitude: string;
|
||||
}
|
||||
@@ -1,4 +1,20 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface NativeTransitionOptions {
|
||||
direction?: string;
|
||||
duration?: number;
|
||||
slowdownfactor?: number;
|
||||
slidePixels?: number;
|
||||
iosdelay?: number;
|
||||
androiddelay?: number;
|
||||
winphonedelay?: number;
|
||||
fixedPixelsTop?: number;
|
||||
fixedPixelsBottom?: number;
|
||||
action?: string;
|
||||
origin?: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name NativePageTransitions
|
||||
* @description
|
||||
@@ -6,9 +22,9 @@ import { Plugin, Cordova } from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {NativePageTransitions, TransitionOptions} from 'ionic-native';
|
||||
* import {NativePageTransitions, NativeTransitionOptions} from 'ionic-native';
|
||||
*
|
||||
* let options: TransitionOptions = {
|
||||
* let options: NativeTransitionOptions = {
|
||||
* direction: 'up',
|
||||
* duration: 500,
|
||||
* slowdownfactor: 3,
|
||||
@@ -27,7 +43,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'NativePageTransitions',
|
||||
pluginName: 'NativePageTransitions',
|
||||
plugin: 'com.telerik.plugins.nativepagetransitions',
|
||||
pluginRef: 'plugins.nativepagetransitions',
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/NativePageTransitions',
|
||||
@@ -36,55 +52,46 @@ import { Plugin, Cordova } from './plugin';
|
||||
export class NativePageTransitions {
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static slide(options: TransitionOptions): Promise<any> { return; }
|
||||
static slide(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Perform a flip animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static flip(options: TransitionOptions): Promise<any> { return; }
|
||||
static flip(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Perform a fade animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS', 'Android']})
|
||||
static fade(options: TransitionOptions): Promise<any> { return; }
|
||||
static fade(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS', 'Android']})
|
||||
static drawer(options: TransitionOptions): Promise<any> { return; }
|
||||
static drawer(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS']})
|
||||
static curl(options: TransitionOptions): Promise<any> { return; }
|
||||
static curl(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface TransitionOptions {
|
||||
direction?: string;
|
||||
duration?: number;
|
||||
slowdownfactor?: number;
|
||||
slidePixels?: number;
|
||||
iosdelay?: number;
|
||||
androiddelay?: number;
|
||||
winphonedelay?: number;
|
||||
fixedPixelsTop?: number;
|
||||
fixedPixelsBottom?: number;
|
||||
action?: string;
|
||||
origin?: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'NativeStorage',
|
||||
pluginName: 'NativeStorage',
|
||||
plugin: 'cordova-plugin-nativestorage',
|
||||
pluginRef: 'NativeStorage',
|
||||
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'
|
||||
@@ -33,6 +33,7 @@ export class NativeStorage {
|
||||
* Stores a value
|
||||
* @param reference {string}
|
||||
* @param value
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setItem(reference: string, value: any): Promise<any> {return; }
|
||||
@@ -40,6 +41,7 @@ export class NativeStorage {
|
||||
/**
|
||||
* Gets a stored item
|
||||
* @param reference {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getItem(reference: string): Promise<any> {return; }
|
||||
@@ -47,12 +49,14 @@ export class NativeStorage {
|
||||
/**
|
||||
* Removes a single stored item
|
||||
* @param reference {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static remove(reference: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Removes all stored values.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(): Promise<any> {return; }
|
||||
|
||||
50
src/plugins/navigationbar.ts
Normal file
50
src/plugins/navigationbar.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name NavigationBar
|
||||
* @description
|
||||
* The NavigationBar plugin can you to hide and auto hide the android navigation bar.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NavigationBar } from 'ionic-native';
|
||||
*
|
||||
* let autoHide: boolean = true;
|
||||
* NavigationBar.hide(autoHide);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NavigationBar',
|
||||
plugin: 'cordova-plugin-navigationbar',
|
||||
pluginRef: 'navigationbar',
|
||||
repo: 'https://github.com/cranberrygame/cordova-plugin-navigationbar',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class NavigationBar {
|
||||
|
||||
/**
|
||||
* hide automatically (or not) the navigation bar.
|
||||
* @param autohide {boolean}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static setUp(autohide?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Hide the navigation bar.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static hideNavigationBar(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import {Cordova, CordovaProperty, Plugin, CordovaFunctionOverride} from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ declare var navigator: any;
|
||||
*
// before we determine the connection type. Might need to wait
|
||||
* // prior to doing any api requests as well.
|
||||
* setTimeout(() => {
|
||||
* if (Network.connection === 'wifi') {
|
||||
* if (Network.type === 'wifi') {
|
||||
* console.log('we got a wifi connection, woohoo!');
|
||||
* }
|
||||
* }, 3000);
|
||||
@@ -40,10 +40,10 @@ declare var navigator: any;
|
||||
*
|
||||
* ```
|
||||
* @advanced
|
||||
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
* The `type` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'Network',
|
||||
pluginName: 'Network',
|
||||
plugin: 'cordova-plugin-network-information',
|
||||
repo: 'https://github.com/apache/cordova-plugin-network-information',
|
||||
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser'],
|
||||
@@ -52,10 +52,32 @@ declare var navigator: any;
|
||||
export class Network {
|
||||
|
||||
/**
|
||||
* Return the network connection type
|
||||
* Connection type
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get connection(): string { return navigator.connection.type; }
|
||||
static type: string;
|
||||
|
||||
/**
|
||||
* Downlink Max Speed
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static downlinkMax: string;
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onchange(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection type changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static ontypechange(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when the device goes offline
|
||||
|
||||
@@ -24,7 +24,7 @@ declare let window: any;
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'NFC',
|
||||
pluginName: 'NFC',
|
||||
plugin: 'phonegap-nfc',
|
||||
pluginRef: 'nfc',
|
||||
repo: 'https://github.com/chariotsolutions/phonegap-nfc'
|
||||
@@ -34,7 +34,7 @@ export class NFC {
|
||||
* Registers an event listener for any NDEF tag.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @return {Promise<any>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -47,40 +47,40 @@ export class NFC {
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
* @param mimeType
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 4,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @return {Promise<any>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param mimeType
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 4,
|
||||
clearFunction: 'removeMimeTypeListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addMimeTypeListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
static addMimeTypeListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for formatable NDEF tags.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @return {Promise<any>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
@@ -92,13 +92,13 @@ export class NFC {
|
||||
/**
|
||||
* Qrites an NdefMessage to a NFC tag.
|
||||
* @param message {any[]}
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static write(message: any[]): Promise<any> {return; }
|
||||
/**
|
||||
* Makes a NFC tag read only. **Warning** this is permanent.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static makeReadyOnly(): Promise<any> {return; }
|
||||
@@ -106,14 +106,14 @@ export class NFC {
|
||||
/**
|
||||
* Shares an NDEF Message via peer-to-peer.
|
||||
* @param message An array of NDEF Records.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static share(message: any[]): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Stop sharing NDEF data via peer-to-peer.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static unshare(): Promise<any> {return; }
|
||||
@@ -127,31 +127,52 @@ export class NFC {
|
||||
/**
|
||||
* Send a file to another device via NFC handover.
|
||||
* @param uris A URI as a String, or an array of URIs.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static handover(uris: string[]): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Stop sharing NDEF data via NFC handover.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopHandover(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Show the NFC settings on the device.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static showSettings(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Check if NFC is available and enabled on this device.
|
||||
* @return {Promise<any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enabled(): Promise<any> {return; }
|
||||
/**
|
||||
* Convert bytes to string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToString(bytes: number[]): string {return; }
|
||||
/**
|
||||
* Convert string to bytes
|
||||
* @param str {string}
|
||||
* @returns {number[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static stringToBytes(str: string): number[] {return; };
|
||||
/**
|
||||
* Convert bytes to hex string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToHexString(bytes: number[]): string {return; };
|
||||
|
||||
}
|
||||
/**
|
||||
@@ -161,7 +182,7 @@ export class Ndef {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static name = 'NFC';
|
||||
static pluginName = 'NFC';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -1,233 +1,32 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
|
||||
* OneSignal is a simple implementation for delivering push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { OneSignal } from 'ionic-native';
|
||||
*
|
||||
* OneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');
|
||||
*
|
||||
* OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
|
||||
*
|
||||
* OneSignal.handleNotificationReceived().subscribe(() => {
|
||||
* // do something when notification is received
|
||||
* });
|
||||
*
|
||||
* OneSignal.handleNotificationOpened().subscribe(() => {
|
||||
* // do something when a notification is opened
|
||||
* });
|
||||
*
|
||||
* OneSignal.endInit();
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'OneSignal',
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
export interface OSNotification {
|
||||
/**
|
||||
* constants to use in inFocusDisplaying()
|
||||
* Was app in focus.
|
||||
*/
|
||||
static OSInFocusDisplayOption = {
|
||||
None: 0,
|
||||
InAppAlert : 1,
|
||||
Notification : 2
|
||||
};
|
||||
|
||||
isAppInFocus: boolean;
|
||||
/**
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the endInit function.
|
||||
*
|
||||
* @param {string} appId Your AppId from your OneSignal app
|
||||
* @param {string} googleProjectNumber The Google Project Number (which you can get from the Google Developer Portal) and the autoRegister option.
|
||||
* Was notification shown to the user. Will be false for silent notifications.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static startInit(appId: string, googleProjectNumber: string): any { return; }
|
||||
|
||||
shown: boolean;
|
||||
/**
|
||||
* Callback to run when a notification is received
|
||||
* @return {Observable<any>}
|
||||
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationReceived(): Observable<any> { return; }
|
||||
|
||||
androidNotificationId?: number;
|
||||
/**
|
||||
* Callback to run when a notification is opened
|
||||
* @return {Observable<any>}
|
||||
* Payload received from OneSignal.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationOpened(): Observable<any> { return; }
|
||||
|
||||
payload: OSNotificationPayload;
|
||||
/**
|
||||
*
|
||||
* @param settings
|
||||
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static iOSSettings(settings: {
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
}): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
static endInit(): any { return; }
|
||||
|
||||
displayType: OSDisplayType;
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves when tags are recieved.
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
@Cordova()
|
||||
static getTags(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {string} Key of your choosing to create or update.
|
||||
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTag(key: string, value: string): void { }
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
|
||||
/**
|
||||
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
|
||||
*
|
||||
* @param {string} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {Array<string>} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only use if you passed false to autoRegister when calling init.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerForPushNotifications(): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {number} displayOption Options are 0 = None, 1 = InAppAlert, and 2 = Notification.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static inFocusDisplaying(displayOption: number): void { }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
static postNotification(notificationObj: OneSignalNotification): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static promptLocation(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param email {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static syncHashedEmail(email: string): void { }
|
||||
|
||||
/**
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
|
||||
* The higher the value the more information is shown.
|
||||
*
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setLogLevel(logLevel: {
|
||||
logLevel: number,
|
||||
visualLevel: number
|
||||
}): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface OneSignalNotification {
|
||||
app_id: string;
|
||||
groupedNotifications?: OSNotificationPayload[];
|
||||
app_id?: string;
|
||||
contents: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
@@ -288,3 +87,429 @@ export interface OneSignalNotification {
|
||||
priority?: number;
|
||||
ios_category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
|
||||
*/
|
||||
export enum OSLockScreenVisibility {
|
||||
/**
|
||||
* Fully visible (default)
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
* Contents are hidden
|
||||
*/
|
||||
Private = 0,
|
||||
/**
|
||||
* Not shown
|
||||
*/
|
||||
Secret = -1
|
||||
}
|
||||
|
||||
/**
|
||||
* How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used.
|
||||
*/
|
||||
export enum OSDisplayType {
|
||||
/**
|
||||
* notification is silent, or inFocusDisplaying is disabled.
|
||||
*/
|
||||
None = 0,
|
||||
/**
|
||||
* (**DEFAULT**) - native alert dialog display.
|
||||
*/
|
||||
InAppAlert = 1,
|
||||
/**
|
||||
* native notification display.
|
||||
*/
|
||||
Notification = 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Contents and settings of the notification the user received.
|
||||
*/
|
||||
export interface OSNotificationPayload {
|
||||
/**
|
||||
* OneSignal notification UUID.
|
||||
*/
|
||||
notificationID: string;
|
||||
/**
|
||||
* Title of the notification.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Body of the notification.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data
|
||||
* or with the 'data' field on the REST API.
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* **ANDROID** - Small icon resource name set on the notification.
|
||||
*/
|
||||
smallIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Large icon set on the notification.
|
||||
*/
|
||||
largeIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Big picture image set on the notification.
|
||||
*/
|
||||
bigPicture?: string;
|
||||
/**
|
||||
* **ANDROID** - Accent color shown around small notification icon on Android 5+ devices. ARGB format.
|
||||
*/
|
||||
smallIconAccentColor?: string;
|
||||
/**
|
||||
* URL to open when opening the notification.
|
||||
*/
|
||||
launchUrl?: string;
|
||||
/**
|
||||
* Sound resource to play when the notification is shown.
|
||||
*/
|
||||
sound: string;
|
||||
/**
|
||||
* **ANDROID** - Devices that have a notification LED will blink in this color. ARGB format.
|
||||
*/
|
||||
ledColor?: string;
|
||||
lockScreenVisibility?: OSLockScreenVisibility;
|
||||
/**
|
||||
* **ANDROID** - Notifications with this same key will be grouped together as a single summary notification.
|
||||
*/
|
||||
groupKey?: string;
|
||||
/**
|
||||
* **ANDROID** - Summary text displayed in the summary notification.
|
||||
*/
|
||||
groupMessage?: string;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
actionButtons: OSActionButton[];
|
||||
/**
|
||||
* **ANDROID** - The Google project number the notification was sent under.
|
||||
*/
|
||||
fromProjectNumber?: string;
|
||||
/**
|
||||
* **ANDROID** - If a background image was set this object will be available.
|
||||
*/
|
||||
backgroundImageLayout?: OSBackgroundImageLayout;
|
||||
priority?: number;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
rawPayload: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
export interface OSActionButton {
|
||||
/**
|
||||
* Id assigned to the button.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Text show on the button to the user.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* **ANDROID** - Icon shown on the button.
|
||||
*/
|
||||
icon: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - If a background image was set, this object will be available.
|
||||
*/
|
||||
export interface OSBackgroundImageLayout {
|
||||
/**
|
||||
* Image URL or name used as the background image.
|
||||
*/
|
||||
image: string;
|
||||
/**
|
||||
* Text color of the title on the notification. ARGB Format.
|
||||
*/
|
||||
titleTextColor: string;
|
||||
/**
|
||||
* Text color of the body on the notification. ARGB Format.
|
||||
*/
|
||||
bodyTextColor: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The information returned from a notification the user received.
|
||||
*/
|
||||
export interface OSNotificationOpenedResult {
|
||||
action: {
|
||||
/**
|
||||
* Was the notification opened normally (`Opened`) or was a button pressed on the notification (`ActionTaken`).
|
||||
*/
|
||||
type: OSActionType;
|
||||
/**
|
||||
* If `type` == `ActionTaken` then this will contain the id of the button pressed.
|
||||
*/
|
||||
actionID?: string;
|
||||
};
|
||||
notification: OSNotification;
|
||||
}
|
||||
|
||||
export enum OSActionType {
|
||||
Opened = 0,
|
||||
ActionTake = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
|
||||
* OneSignal is a simple implementation for delivering push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { OneSignal } from 'ionic-native';
|
||||
*
|
||||
* OneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');
|
||||
*
|
||||
* OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
|
||||
*
|
||||
* OneSignal.handleNotificationReceived().subscribe(() => {
|
||||
* // do something when notification is received
|
||||
* });
|
||||
*
|
||||
* OneSignal.handleNotificationOpened().subscribe(() => {
|
||||
* // do something when a notification is opened
|
||||
* });
|
||||
*
|
||||
* OneSignal.endInit();
|
||||
* ```
|
||||
* @interfaces
|
||||
* OSNotification
|
||||
* OSLockScreenVisibility
|
||||
* OSDisplayType
|
||||
* OSNotificationPayload
|
||||
* OSActionButton
|
||||
* OSBackgroundImageLayout
|
||||
* OSNotificationOpenedResult
|
||||
* OSActionType
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OneSignal',
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'FireOS']
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
/**
|
||||
* constants to use in inFocusDisplaying()
|
||||
*/
|
||||
static OSInFocusDisplayOption = {
|
||||
None: 0,
|
||||
InAppAlert : 1,
|
||||
Notification : 2
|
||||
};
|
||||
|
||||
/**
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the `endInit` function.
|
||||
*
|
||||
* @param {string} appId Your OneSignal app id
|
||||
* @param {string} googleProjectNumber **ANDROID** - your Google project number; only required for Android GCM/FCM pushes.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static startInit(appId: string, googleProjectNumber?: string): any { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is received, whether it was displayed or not.
|
||||
*
|
||||
* @return {Observable<OneSignalReceivedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationReceived(): Observable<OSNotification> { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
|
||||
* center (**iOS**), or when closing an Alert notification shown in the app (if InAppAlert is enabled in
|
||||
* inFocusDisplaying).
|
||||
*
|
||||
* @return {Observable<OneSignalOpenedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; }
|
||||
|
||||
/**
|
||||
* **iOS** - Settings for iOS apps
|
||||
*
|
||||
* @param settings
|
||||
* kOSSettingsKeyAutoPrompt: boolean = true
|
||||
* Auto prompt user for notification permissions.
|
||||
*
|
||||
* kOSSettingsKeyInAppLaunchURL: boolean = false
|
||||
* Launch notifications with a launch URL as an in app webview.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static iOSSettings(settings: {
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
}): any { return; }
|
||||
|
||||
/**
|
||||
* Must be called after `startInit` to complete initialization of OneSignal.
|
||||
*
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static endInit(): any { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
static getTags(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise<Object>} Returns a Promise that resolves if the device was successfully registered.
|
||||
*
|
||||
* userId {string} OneSignal userId is a UUID formatted string. (unique per device per app)
|
||||
*
|
||||
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<{userId: string; pushToken: string}> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {string} Key of your choosing to create or update.
|
||||
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTag(key: string, value: string): void { }
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
|
||||
/**
|
||||
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
|
||||
*
|
||||
* @param {string} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {Array<string>} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerForPushNotifications(): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {DisplayType} displayOption
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static inFocusDisplaying(displayOption: OSDisplayType): any { return; }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
static postNotification(notificationObj: OSNotification): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static promptLocation(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param email {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static syncHashedEmail(email: string): void { }
|
||||
|
||||
/**
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
|
||||
* The higher the value the more information is shown.
|
||||
*
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setLogLevel(logLevel: {
|
||||
logLevel: number,
|
||||
visualLevel: number
|
||||
}): void { }
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user