mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
308 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c3bb41387 | ||
|
|
a9f6cd42e4 | ||
|
|
8cd648db5c | ||
|
|
f3407e5582 | ||
|
|
d845519361 | ||
|
|
26db2cfcf9 | ||
|
|
d0c0413140 | ||
|
|
234165c294 | ||
|
|
9bf4ee3fac | ||
|
|
f8df8769c9 | ||
|
|
510cea67b7 | ||
|
|
55d6d11721 | ||
|
|
97ba9b4fe1 | ||
|
|
96369db3a9 | ||
|
|
961cff185d | ||
|
|
9a733c3b4a | ||
|
|
95ac7e1855 | ||
|
|
6683aa450c | ||
|
|
d0cb3049e5 | ||
|
|
8036d6392d | ||
|
|
8602fde936 | ||
|
|
0f8c3ce376 | ||
|
|
5880491c0e | ||
|
|
62c7a60aee | ||
|
|
6fdeeaf6f2 | ||
|
|
16ff420bfa | ||
|
|
0009cbf3a0 | ||
|
|
74971feb98 | ||
|
|
683b808f27 | ||
|
|
f11be169b0 | ||
|
|
3a4dc73229 | ||
|
|
b851de9cc8 | ||
|
|
b8c8a1aa8d | ||
|
|
8f1e729f0e | ||
|
|
b4583271b8 | ||
|
|
50c03b2a49 | ||
|
|
27fdce7af2 | ||
|
|
3500d80b9c | ||
|
|
f599b0418d | ||
|
|
384dfc263d | ||
|
|
12280dda2b | ||
|
|
5d091d21fb | ||
|
|
b83c1bf767 | ||
|
|
6ebd2703ee | ||
|
|
3dfea7d02d | ||
|
|
44b7e301b5 | ||
|
|
906401b236 | ||
|
|
ffdbab7b26 | ||
|
|
5144345c9e | ||
|
|
47f48bae8d | ||
|
|
754c5ecbcb | ||
|
|
86097b0ce6 | ||
|
|
d46067764b | ||
|
|
7f368b61be | ||
|
|
af4d5e8968 | ||
|
|
0378b1d7fd | ||
|
|
57e2691889 | ||
|
|
09a7dcf594 | ||
|
|
fd8107b79a | ||
|
|
4f86320696 | ||
|
|
39f1971471 | ||
|
|
60db10c1d3 | ||
|
|
2a32624d9d | ||
|
|
2fba915b88 | ||
|
|
318ad3f4e0 | ||
|
|
c1748bbc28 | ||
|
|
06fa7452dd | ||
|
|
2eea3df2c4 | ||
|
|
13484f9843 | ||
|
|
91ee5bde5f | ||
|
|
21d40888d8 | ||
|
|
f0e219570e | ||
|
|
104532e1d7 | ||
|
|
97cf22eedb | ||
|
|
9c5b593d6b | ||
|
|
26394865fc | ||
|
|
07c867d98e | ||
|
|
fc879926b2 | ||
|
|
281e37ee04 | ||
|
|
8de37939fb | ||
|
|
448ec7a72b | ||
|
|
da72500c4b | ||
|
|
0c466d9739 | ||
|
|
8e0027b974 | ||
|
|
234ed6e9e7 | ||
|
|
4426e59176 | ||
|
|
f22874342a | ||
|
|
6bcd5d3183 | ||
|
|
407659a3ef | ||
|
|
5ef669ae91 | ||
|
|
4a39ebd873 | ||
|
|
23b97f6b4a | ||
|
|
093c8a8231 | ||
|
|
85a3a40795 | ||
|
|
b4b7cfa473 | ||
|
|
884ce54181 | ||
|
|
70847d1b2b | ||
|
|
ff26f2a019 | ||
|
|
f4b8236c8d | ||
|
|
03ff0a58cf | ||
|
|
c7a888e2de | ||
|
|
439cceea23 | ||
|
|
83f57b9820 | ||
|
|
78fcdc8d80 | ||
|
|
53f7056b16 | ||
|
|
b7701cdb16 | ||
|
|
94a4519f2b | ||
|
|
6fe52b610b | ||
|
|
434a6c8ad3 | ||
|
|
97489ba573 | ||
|
|
f525a25b49 | ||
|
|
add49e8b4d | ||
|
|
4ab87d8abb | ||
|
|
69ff7afb48 | ||
|
|
62a30c7d8f | ||
|
|
dc37d8f71c | ||
|
|
8864d1360a | ||
|
|
613141998a | ||
|
|
c2fbb4fb64 | ||
|
|
f0cf86076c | ||
|
|
a03afcf0fa | ||
|
|
3abe0bb97d | ||
|
|
a5b4632ceb | ||
|
|
1c78f77c0f | ||
|
|
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 | ||
|
|
3fdc4a8acd | ||
|
|
db99482157 | ||
|
|
bab2971c58 | ||
|
|
93696d53f7 |
334
CHANGELOG.md
334
CHANGELOG.md
@@ -1,3 +1,334 @@
|
||||
<a name="2.9.0"></a>
|
||||
# [2.9.0](https://github.com/driftyco/ionic-native/compare/v2.8.1...v2.9.0) (2017-03-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background-geolocation:** configure returns an observable ([961cff1](https://github.com/driftyco/ionic-native/commit/961cff1))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-mode:** added moveToBackground and moveToForeground ([#1181](https://github.com/driftyco/ionic-native/issues/1181)) ([95ac7e1](https://github.com/driftyco/ionic-native/commit/95ac7e1))
|
||||
|
||||
|
||||
|
||||
<a name="2.8.1"></a>
|
||||
## [2.8.1](https://github.com/driftyco/ionic-native/compare/v2.8.0...v2.8.1) (2017-03-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bluetooth-serial:** add missing disconnect method ([74971fe](https://github.com/driftyco/ionic-native/commit/74971fe)), closes [#1151](https://github.com/driftyco/ionic-native/issues/1151)
|
||||
* **fingerprint-aio:** add useBackup property ([#1158](https://github.com/driftyco/ionic-native/issues/1158)) ([6fdeeaf](https://github.com/driftyco/ionic-native/commit/6fdeeaf))
|
||||
* **health:** fix return type ([0f8c3ce](https://github.com/driftyco/ionic-native/commit/0f8c3ce))
|
||||
* **paypal:** sku param is optional ([#1161](https://github.com/driftyco/ionic-native/issues/1161)) ([62c7a60](https://github.com/driftyco/ionic-native/commit/62c7a60))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **firebase:** add new setScreenName method ([0009cbf](https://github.com/driftyco/ionic-native/commit/0009cbf)), closes [#1149](https://github.com/driftyco/ionic-native/issues/1149)
|
||||
|
||||
|
||||
|
||||
<a name="2.8.0"></a>
|
||||
# [2.8.0](https://github.com/driftyco/ionic-native/compare/v2.7.0...v2.8.0) (2017-03-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **file:** fix return types ([b458327](https://github.com/driftyco/ionic-native/commit/b458327)), closes [#1139](https://github.com/driftyco/ionic-native/issues/1139)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **app-preferences:** added cordova-plugin-app-preferences support ([#1084](https://github.com/driftyco/ionic-native/issues/1084)) ([12280dd](https://github.com/driftyco/ionic-native/commit/12280dd))
|
||||
* **health:** add wrapper for cordova-plugin-health ([#1039](https://github.com/driftyco/ionic-native/issues/1039)) ([3500d80](https://github.com/driftyco/ionic-native/commit/3500d80))
|
||||
* **photo-library:** added cordova-plugin-photo-library ([#1102](https://github.com/driftyco/ionic-native/issues/1102)) ([384dfc2](https://github.com/driftyco/ionic-native/commit/384dfc2))
|
||||
|
||||
|
||||
|
||||
<a name="2.7.0"></a>
|
||||
# [2.7.0](https://github.com/driftyco/ionic-native/compare/v2.6.0...v2.7.0) (2017-03-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** dont check if method exists when overriding ([754c5ec](https://github.com/driftyco/ionic-native/commit/754c5ec)), closes [#1043](https://github.com/driftyco/ionic-native/issues/1043)
|
||||
* **file:** fix writeExistingFile ([47f48ba](https://github.com/driftyco/ionic-native/commit/47f48ba)), closes [#1044](https://github.com/driftyco/ionic-native/issues/1044)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-mode:** add missing functions ([906401b](https://github.com/driftyco/ionic-native/commit/906401b)), closes [#1078](https://github.com/driftyco/ionic-native/issues/1078)
|
||||
* **background-mode:** replace event listeners with on method ([ffdbab7](https://github.com/driftyco/ionic-native/commit/ffdbab7))
|
||||
* **diagnostic:** add new methods ([5144345](https://github.com/driftyco/ionic-native/commit/5144345)), closes [#1045](https://github.com/driftyco/ionic-native/issues/1045)
|
||||
|
||||
|
||||
|
||||
<a name="2.6.0"></a>
|
||||
# [2.6.0](https://github.com/driftyco/ionic-native/compare/v2.5.1...v2.6.0) (2017-03-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **apprate:** add missing Windows Store option ([#1072](https://github.com/driftyco/ionic-native/issues/1072)) ([439ccee](https://github.com/driftyco/ionic-native/commit/439ccee))
|
||||
* **background-geolocation:** configure returns a promise ([fc87992](https://github.com/driftyco/ionic-native/commit/fc87992)), closes [#1118](https://github.com/driftyco/ionic-native/issues/1118)
|
||||
* **contacts:** allow passing asterisk as contact field type ([9c5b593](https://github.com/driftyco/ionic-native/commit/9c5b593)), closes [#1093](https://github.com/driftyco/ionic-native/issues/1093)
|
||||
* **contacts:** allow passing asterisk as contact field type ([2639486](https://github.com/driftyco/ionic-native/commit/2639486))
|
||||
* **facebook:** fixes issue when not supplying default params ([#1088](https://github.com/driftyco/ionic-native/issues/1088)) ([85a3a40](https://github.com/driftyco/ionic-native/commit/85a3a40))
|
||||
* **file:** add missing exports ([#1101](https://github.com/driftyco/ionic-native/issues/1101)) ([23b97f6](https://github.com/driftyco/ionic-native/commit/23b97f6))
|
||||
* **file:** platform Browser will raise a an DOMException ([#1082](https://github.com/driftyco/ionic-native/issues/1082)) ([2fba915](https://github.com/driftyco/ionic-native/commit/2fba915))
|
||||
* **file:** remove FileError from return type ([#1086](https://github.com/driftyco/ionic-native/issues/1086)) ([c1748bb](https://github.com/driftyco/ionic-native/commit/c1748bb))
|
||||
* **imagepicker:** add outputType option ([#1098](https://github.com/driftyco/ionic-native/issues/1098)) ([b4b7cfa](https://github.com/driftyco/ionic-native/commit/b4b7cfa))
|
||||
* **media:** add missing pauseRecord and resumeRecord methods ([#1122](https://github.com/driftyco/ionic-native/issues/1122)) ([234ed6e](https://github.com/driftyco/ionic-native/commit/234ed6e))
|
||||
* **plugin:** revert changes to support stable version ([#1116](https://github.com/driftyco/ionic-native/issues/1116)) ([104532e](https://github.com/driftyco/ionic-native/commit/104532e)), closes [#1001](https://github.com/driftyco/ionic-native/issues/1001)
|
||||
* **push:** add the missing option clearBadge ([#1087](https://github.com/driftyco/ionic-native/issues/1087)) ([70847d1](https://github.com/driftyco/ionic-native/commit/70847d1))
|
||||
* **serial:** Serial.requestPermission() options are optional ([#1128](https://github.com/driftyco/ionic-native/issues/1128)) ([da72500](https://github.com/driftyco/ionic-native/commit/da72500))
|
||||
* **zip:** progress callback is optional ([#1049](https://github.com/driftyco/ionic-native/issues/1049)) ([83f57b9](https://github.com/driftyco/ionic-native/commit/83f57b9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **alipay:** add alipay support. ([#1097](https://github.com/driftyco/ionic-native/issues/1097)) ([2eea3df](https://github.com/driftyco/ionic-native/commit/2eea3df))
|
||||
* **app-update:** add cordova-plugin-app-update support ([#1105](https://github.com/driftyco/ionic-native/issues/1105)) ([21d4088](https://github.com/driftyco/ionic-native/commit/21d4088))
|
||||
* **appodeal:** adds Appodeal SDK wrappers for iOS and Android ([#1031](https://github.com/driftyco/ionic-native/issues/1031)) ([fd8107b](https://github.com/driftyco/ionic-native/commit/fd8107b))
|
||||
* **background-fetch:** Adding Background Fetch requested in [#990](https://github.com/driftyco/ionic-native/issues/990) ([#1013](https://github.com/driftyco/ionic-native/issues/1013)) ([57e2691](https://github.com/driftyco/ionic-native/commit/57e2691))
|
||||
* **browser-tab:** add browser tab plugin ([#1126](https://github.com/driftyco/ionic-native/issues/1126)) ([8de3793](https://github.com/driftyco/ionic-native/commit/8de3793)), closes [#1115](https://github.com/driftyco/ionic-native/issues/1115)
|
||||
* **couchbase-lite:** add CouchbaseLite cordova plugin ([#1025](https://github.com/driftyco/ionic-native/issues/1025)) ([09a7dcf](https://github.com/driftyco/ionic-native/commit/09a7dcf))
|
||||
* **file:** add system paths ([f0e2195](https://github.com/driftyco/ionic-native/commit/f0e2195))
|
||||
* **google-maps:** add constant for map type ([318ad3f](https://github.com/driftyco/ionic-native/commit/318ad3f))
|
||||
* **gyroscope:** add Gyroscope plugin ([#1004](https://github.com/driftyco/ionic-native/issues/1004)) ([0378b1d](https://github.com/driftyco/ionic-native/commit/0378b1d))
|
||||
* **inappbrowser:** add interface for IAB options ([#1065](https://github.com/driftyco/ionic-native/issues/1065)) ([f4b8236](https://github.com/driftyco/ionic-native/commit/f4b8236))
|
||||
* **local-notifications:** support for icon background color ([#1079](https://github.com/driftyco/ionic-native/issues/1079)) ([2a32624](https://github.com/driftyco/ionic-native/commit/2a32624))
|
||||
* **text-to-speech:** Add stop method ([#1063](https://github.com/driftyco/ionic-native/issues/1063)) ([4f86320](https://github.com/driftyco/ionic-native/commit/4f86320))
|
||||
* **unique-device-add:** add UniqueDeviceId plugin ([#1064](https://github.com/driftyco/ionic-native/issues/1064)) ([60db10c](https://github.com/driftyco/ionic-native/commit/60db10c))
|
||||
|
||||
|
||||
|
||||
<a name="2.5.1"></a>
|
||||
## [2.5.1](https://github.com/driftyco/ionic-native/compare/v2.5.0...v2.5.1) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **pin-dialog:** add missing errorIndex ([b7701cd](https://github.com/driftyco/ionic-native/commit/b7701cd))
|
||||
|
||||
|
||||
|
||||
<a name="2.5.0"></a>
|
||||
# [2.5.0](https://github.com/driftyco/ionic-native/compare/v2.4.1...v2.5.0) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **file-transfer:** fix return type of upload method ([a5b4632](https://github.com/driftyco/ionic-native/commit/a5b4632)), closes [#1002](https://github.com/driftyco/ionic-native/issues/1002)
|
||||
* **pinterest:** fix PinterestPin interface ([a03afcf](https://github.com/driftyco/ionic-native/commit/a03afcf))
|
||||
* **safari-view-controller:** fix issue caused by calling show without options ([dc37d8f](https://github.com/driftyco/ionic-native/commit/dc37d8f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add missing properties for Android ([f0cf860](https://github.com/driftyco/ionic-native/commit/f0cf860))
|
||||
* **barcodescanner:** add option disableSuccessBeep ([#1035](https://github.com/driftyco/ionic-native/issues/1035)) ([97489ba](https://github.com/driftyco/ionic-native/commit/97489ba))
|
||||
* **inappbrowser:** add hide function ([#1018](https://github.com/driftyco/ionic-native/issues/1018)) ([4ab87d8](https://github.com/driftyco/ionic-native/commit/4ab87d8))
|
||||
|
||||
|
||||
|
||||
<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)
|
||||
|
||||
@@ -27,8 +358,10 @@
|
||||
|
||||
### 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
|
||||
@@ -60,6 +393,7 @@
|
||||
* **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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[](https://circleci.com/gh/driftyco/ionic-native) [](http://commitizen.github.io/cz-cli/)
|
||||
[](https://circleci.com/gh/ionic-team/ionic-native) [](http://commitizen.github.io/cz-cli/)
|
||||
[](https://www.npmjs.com/package/ionic-native)
|
||||
|
||||
[](https://nodei.co/npm/ionic-native/)
|
||||
@@ -81,12 +81,12 @@ npm install ionic-native --save
|
||||
|
||||
|
||||
## Plugin Missing?
|
||||
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
||||
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
||||
|
||||
|
||||
# Credits
|
||||
|
||||
Ibrahim Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
Ibby Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
|
||||
Tim Lancina - [@timlancina](http://twitter.com/timlancina)
|
||||
|
||||
|
||||
5915
package-lock.json
generated
Normal file
5915
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.2.11",
|
||||
"version": "2.9.0",
|
||||
"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.1"
|
||||
},
|
||||
"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.9",
|
||||
"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;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ function run {
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf docs/v2/native/*/
|
||||
git rm -rf content/docs/v2/native/*/ || true
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
17
scripts/docs/templates/common.template.html
vendored
17
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(' ','-') $>"
|
||||
@@ -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 @>
|
||||
|
||||
@@ -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 @>
|
||||
|
||||
@@ -24,7 +24,8 @@ function run {
|
||||
cd $SITE_DIR
|
||||
|
||||
# if no changes, don't commit
|
||||
if ! git diff-index --quiet HEAD --
|
||||
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"
|
||||
|
||||
78
src/index.ts
78
src/index.ts
@@ -1,24 +1,31 @@
|
||||
import { initAngular1 } from './ng1';
|
||||
|
||||
const DEVICE_READY_TIMEOUT = 2000;
|
||||
const DEVICE_READY_TIMEOUT = 5000;
|
||||
|
||||
declare var window;
|
||||
|
||||
import { ActionSheet } from './plugins/actionsheet';
|
||||
import { AdMob } from './plugins/admob';
|
||||
import { Alipay } from './plugins/alipay';
|
||||
import { AndroidFingerprintAuth } from './plugins/android-fingerprint-auth';
|
||||
import { AppAvailability } from './plugins/appavailability';
|
||||
import { Appodeal } from './plugins/appodeal';
|
||||
import { AppRate } from './plugins/apprate';
|
||||
import { AppPreferences } from './plugins/apppreferences';
|
||||
import { AppUpdate } from './plugins/app-update';
|
||||
import { AppVersion } from './plugins/appversion';
|
||||
import { Badge } from './plugins/badge';
|
||||
import { BackgroundFetch } from './plugins/background-fetch';
|
||||
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 { BrowserTab } from './plugins/browser-tab';
|
||||
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';
|
||||
@@ -27,6 +34,7 @@ import { CardIO } from './plugins/card-io';
|
||||
import { Clipboard } from './plugins/clipboard';
|
||||
import { CodePush } from './plugins/code-push';
|
||||
import { Contacts } from './plugins/contacts';
|
||||
import { CouchbaseLite } from './plugins/couchbase-lite';
|
||||
import { Crop } from './plugins/crop';
|
||||
import { DatePicker } from './plugins/datepicker';
|
||||
import { DBMeter } from './plugins/dbmeter';
|
||||
@@ -46,6 +54,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 +63,9 @@ import { Globalization } from './plugins/globalization';
|
||||
import { GooglePlus } from './plugins/google-plus';
|
||||
import { GoogleMap } from './plugins/googlemap';
|
||||
import { GoogleAnalytics } from './plugins/googleanalytics';
|
||||
import { Gyroscope } from './plugins/gyroscope';
|
||||
import { HeaderColor } from './plugins/headercolor';
|
||||
import { Health } from './plugins/health';
|
||||
import { Hotspot } from './plugins/hotspot';
|
||||
import { HTTP } from './plugins/http';
|
||||
import { Httpd } from './plugins/httpd';
|
||||
@@ -66,12 +79,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';
|
||||
@@ -82,29 +98,37 @@ import { OneSignal } from './plugins/onesignal';
|
||||
import { PhotoViewer } from './plugins/photo-viewer';
|
||||
import { ScreenOrientation } from './plugins/screen-orientation';
|
||||
import { PayPal } from './plugins/pay-pal';
|
||||
import { Pedometer } from './plugins/pedometer';
|
||||
import { PhotoLibrary } from './plugins/photo-library';
|
||||
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';
|
||||
import { TextToSpeech } from './plugins/text-to-speech';
|
||||
import { ThemeableBrowser } from './plugins/themeable-browser';
|
||||
import { TwitterConnect } from './plugins/twitter-connect';
|
||||
import { UniqueDeviceID } from './plugins/unique-device-id';
|
||||
import { Vibration } from './plugins/vibration';
|
||||
import { VideoEditor } from './plugins/video-editor';
|
||||
import { VideoPlayer } from './plugins/video-player';
|
||||
@@ -115,12 +139,18 @@ import { Zip } from './plugins/zip';
|
||||
export * from './plugins/3dtouch';
|
||||
export * from './plugins/actionsheet';
|
||||
export * from './plugins/admob';
|
||||
export * from './plugins/alipay';
|
||||
export * from './plugins/android-fingerprint-auth';
|
||||
export * from './plugins/appavailability';
|
||||
export * from './plugins/apppreferences';
|
||||
export * from './plugins/appodeal';
|
||||
export * from './plugins/apprate';
|
||||
export * from './plugins/app-update';
|
||||
export * from './plugins/appversion';
|
||||
export * from './plugins/background-fetch';
|
||||
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 +158,8 @@ export * from './plugins/batterystatus';
|
||||
export * from './plugins/ble';
|
||||
export * from './plugins/bluetoothserial';
|
||||
export * from './plugins/brightness';
|
||||
export * from './plugins/browser-tab';
|
||||
export * from './plugins/broadcaster';
|
||||
export * from './plugins/calendar';
|
||||
export * from './plugins/call-number';
|
||||
export * from './plugins/camera';
|
||||
@@ -136,6 +168,7 @@ export * from './plugins/card-io';
|
||||
export * from './plugins/clipboard';
|
||||
export * from './plugins/code-push';
|
||||
export * from './plugins/contacts';
|
||||
export * from './plugins/couchbase-lite';
|
||||
export * from './plugins/crop';
|
||||
export * from './plugins/datepicker';
|
||||
export * from './plugins/dbmeter';
|
||||
@@ -154,7 +187,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 +197,9 @@ export * from './plugins/globalization';
|
||||
export * from './plugins/google-plus';
|
||||
export * from './plugins/googleanalytics';
|
||||
export * from './plugins/googlemap';
|
||||
export * from './plugins/gyroscope';
|
||||
export * from './plugins/headercolor';
|
||||
export * from './plugins/health';
|
||||
export * from './plugins/hotspot';
|
||||
export * from './plugins/http';
|
||||
export * from './plugins/httpd';
|
||||
@@ -175,6 +213,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,37 +222,47 @@ 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/pedometer';
|
||||
export * from './plugins/photo-library';
|
||||
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';
|
||||
export * from './plugins/touchid';
|
||||
export * from './plugins/twitter-connect';
|
||||
export * from './plugins/unique-device-id';
|
||||
export * from './plugins/vibration';
|
||||
export * from './plugins/video-editor';
|
||||
export * from './plugins/video-player';
|
||||
@@ -226,19 +275,27 @@ export * from './plugins/zip';
|
||||
window['IonicNative'] = {
|
||||
ActionSheet,
|
||||
AdMob,
|
||||
Alipay,
|
||||
AndroidFingerprintAuth,
|
||||
AppAvailability,
|
||||
AppPreferences,
|
||||
Appodeal,
|
||||
AppRate,
|
||||
AppUpdate,
|
||||
AppVersion,
|
||||
Badge,
|
||||
BackgroundGeolocation,
|
||||
BackgroundFetch,
|
||||
BackgroundMode,
|
||||
Backlight,
|
||||
BarcodeScanner,
|
||||
Base64ToGallery,
|
||||
BatteryStatus,
|
||||
Brightness,
|
||||
BrowserTab,
|
||||
BLE,
|
||||
BluetoothSerial,
|
||||
Broadcaster,
|
||||
Calendar,
|
||||
CallNumber,
|
||||
Camera,
|
||||
@@ -247,6 +304,7 @@ window['IonicNative'] = {
|
||||
Clipboard,
|
||||
CodePush,
|
||||
Contacts,
|
||||
CouchbaseLite,
|
||||
Crop,
|
||||
DatePicker,
|
||||
DBMeter,
|
||||
@@ -265,13 +323,18 @@ window['IonicNative'] = {
|
||||
FileChooser,
|
||||
FileOpener,
|
||||
FilePath,
|
||||
FingerprintAIO,
|
||||
Flashlight,
|
||||
Firebase,
|
||||
Geofence,
|
||||
Geolocation,
|
||||
Globalization,
|
||||
GooglePlus,
|
||||
GoogleMap,
|
||||
GoogleAnalytics,
|
||||
Gyroscope,
|
||||
HeaderColor,
|
||||
Health,
|
||||
Hotspot,
|
||||
HTTP,
|
||||
Httpd,
|
||||
@@ -285,6 +348,7 @@ window['IonicNative'] = {
|
||||
IsDebug,
|
||||
Keyboard,
|
||||
LaunchNavigator,
|
||||
LaunchReview,
|
||||
LocalNotifications,
|
||||
LocationAccuracy,
|
||||
Market,
|
||||
@@ -293,10 +357,14 @@ window['IonicNative'] = {
|
||||
Mixpanel,
|
||||
MusicControls,
|
||||
NativeAudio,
|
||||
NativeGeocoder,
|
||||
NativePageTransitions,
|
||||
NativeStorage,
|
||||
NavigationBar,
|
||||
Network,
|
||||
PayPal,
|
||||
Pedometer,
|
||||
PhotoLibrary,
|
||||
NFC,
|
||||
Printer,
|
||||
Push,
|
||||
@@ -304,10 +372,13 @@ window['IonicNative'] = {
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
Pinterest,
|
||||
PowerManagement,
|
||||
Rollbar,
|
||||
SafariViewController,
|
||||
Screenshot,
|
||||
SecureStorage,
|
||||
Serial,
|
||||
Shake,
|
||||
Sim,
|
||||
SMS,
|
||||
@@ -316,8 +387,10 @@ window['IonicNative'] = {
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
SpeechRecognition,
|
||||
Stepcounter,
|
||||
StreamingMedia,
|
||||
Stripe,
|
||||
ThreeDeeTouch,
|
||||
Toast,
|
||||
TouchID,
|
||||
@@ -325,6 +398,7 @@ window['IonicNative'] = {
|
||||
TextToSpeech,
|
||||
ThemeableBrowser,
|
||||
TwitterConnect,
|
||||
UniqueDeviceID,
|
||||
VideoEditor,
|
||||
VideoPlayer,
|
||||
Vibration,
|
||||
|
||||
@@ -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,6 +115,9 @@ declare var window: any;
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ThreeDeeTouchQuickAction
|
||||
* ThreeDeeTouchForceTouch
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ThreeDeeTouch',
|
||||
@@ -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
|
||||
@@ -52,38 +95,3 @@ export class ActionSheet {
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
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[];
|
||||
}
|
||||
|
||||
@@ -1,25 +1,111 @@
|
||||
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
|
||||
* ```typescript
|
||||
* import { AdMob } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* AdMob.onBannerDismiss()
|
||||
* .subscribe(() => { console.log('User returned from interstitial'); });
|
||||
* AdMob.onAdDismiss()
|
||||
* .subscribe(() => { console.log('User dismissed ad'); });
|
||||
* }
|
||||
*
|
||||
* public onClick() {
|
||||
*
|
||||
* onClick() {
|
||||
* AdMob.prepareInterstitial('YOUR_ADID')
|
||||
* .then(() => { AdMob.showInterstitial(); });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
* Please refer the the plugin's original repository for detailed usage.
|
||||
*
|
||||
* @interfaces
|
||||
* AdMobOptions
|
||||
* AdMobAdExtras
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMob',
|
||||
@@ -30,18 +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
|
||||
@@ -49,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
|
||||
@@ -68,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
|
||||
@@ -76,35 +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 { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the interstitial is ready
|
||||
*/
|
||||
@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
|
||||
@@ -116,11 +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
|
||||
@@ -129,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; }
|
||||
|
||||
}
|
||||
|
||||
111
src/plugins/alipay.ts
Normal file
111
src/plugins/alipay.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
/**
|
||||
* @link https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.wlOhAE&treeId=193&articleId=105465&docType=1
|
||||
*
|
||||
* All values need be urlencoded.
|
||||
*/
|
||||
export interface AlipayOrder {
|
||||
/**
|
||||
* appId assigned by Alipay
|
||||
*/
|
||||
app_id: string;
|
||||
|
||||
/**
|
||||
* Api name.
|
||||
* Should be: alipay.trade.app.pay
|
||||
*/
|
||||
method: string;
|
||||
|
||||
/**
|
||||
* Data format
|
||||
* Default: "JSON"
|
||||
*/
|
||||
format?: string;
|
||||
|
||||
/**
|
||||
* Charset
|
||||
* Possible values: "UTF-8", "GBK"
|
||||
* Default: "UTF-8"
|
||||
*/
|
||||
charset: string;
|
||||
|
||||
/**
|
||||
* Sign method
|
||||
* Default: 'RSA'
|
||||
*/
|
||||
sign_type: string;
|
||||
|
||||
/**
|
||||
* Sign value. Should be got from server side.
|
||||
* Default: 'RSA'
|
||||
*/
|
||||
sign: string;
|
||||
|
||||
/**
|
||||
* Timestamp, formated like "yyyy-MM-dd HH:mm:ss", e.g. 2014-07-24 03:07:50
|
||||
*/
|
||||
timestamp: string;
|
||||
|
||||
/**
|
||||
* Api version. Fixed value '1.0'
|
||||
*/
|
||||
version: string;
|
||||
|
||||
/**
|
||||
* Notify url.
|
||||
*/
|
||||
notify_url: string;
|
||||
|
||||
/**
|
||||
* biz content. formated in json. see alipay doc for detail.
|
||||
*/
|
||||
biz_content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Alipay
|
||||
* @description
|
||||
* This plugin is used for Alipay APP support. Integrated with the latest SDK.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-alipay-base`. For more info, please see the [Alipay plugin docs](https://github.com/xueron/cordova-alipay-base).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Alipay } from 'ionic-native';
|
||||
*
|
||||
* // Should get from server side with sign.
|
||||
* let alipayOrder = {
|
||||
...
|
||||
* };
|
||||
*
|
||||
* Alipay.pay(alipayOrder)
|
||||
* .then(result => {
|
||||
* console.log(result); // Success
|
||||
* })
|
||||
* .catch(error => {
|
||||
* console.log(error); // Failed
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AlipayOrder
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Alipay',
|
||||
plugin: 'cordova-alipay-base',
|
||||
pluginRef: 'Alipay.Base',
|
||||
repo: 'https://github.com/xueron/cordova-alipay-base',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
|
||||
})
|
||||
export class Alipay {
|
||||
/**
|
||||
* Open Alipay to perform App pay
|
||||
* @param order { AlipayOrder } alipay options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static pay(order: AlipayOrder): Promise<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,6 +97,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* AndroidFingerprintAuthOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidFingerprintAuth',
|
||||
@@ -36,37 +107,48 @@ import { Cordova, Plugin } from './plugin';
|
||||
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; }
|
||||
|
||||
/**
|
||||
@@ -74,6 +156,12 @@ export class AndroidFingerprintAuth {
|
||||
* @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; }
|
||||
}
|
||||
|
||||
49
src/plugins/app-update.ts
Normal file
49
src/plugins/app-update.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name AppUpdate
|
||||
* @description
|
||||
* This plugin does self-update for android
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* You should first host an XML file on your server with the following data in it:
|
||||
* ```xml
|
||||
* <update>
|
||||
* <version>302048</version>
|
||||
* <name>APK Name</name>
|
||||
* <url>https://your-remote-api.com/YourApp.apk</url>
|
||||
* </update>
|
||||
* ```
|
||||
*
|
||||
* Then use the following code:
|
||||
*
|
||||
* ```
|
||||
* import { AppUpdate } from 'ionic-native';
|
||||
*
|
||||
* let updateUrl = 'http://your-remote-api.com/update.xml';
|
||||
*
|
||||
* AppUpdate.checkAppUpdate(updateUrl);
|
||||
* ```
|
||||
*
|
||||
* The plugin will compare the app version and update it automatically if the API has a newer version to install.
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppUpdate',
|
||||
plugin: 'cordova-plugin-app-update',
|
||||
pluginRef: 'AppUpdate',
|
||||
repo: 'https://github.com/vaenow/cordova-plugin-app-update',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class AppUpdate {
|
||||
/**
|
||||
* Check and update
|
||||
* @param updateUrl {string} update api url
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static checkAppUpdate(updateUrl: string): Promise<any> { 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';
|
||||
* }
|
||||
*
|
||||
|
||||
443
src/plugins/appodeal.ts
Normal file
443
src/plugins/appodeal.ts
Normal file
@@ -0,0 +1,443 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name Appodeal
|
||||
* @description
|
||||
* Plugin to serve ads through native Appodeal SDKs
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Appodeal } from 'ionic-native';
|
||||
*
|
||||
* let appKey = '<your app key>';
|
||||
* Appodeal.initialize(appKey, Appodeal.AD_TYPES.REWARDED_VIDEO);
|
||||
* Appodeal.show(Appodeal.AD_TYPES.REWARDED_VIDEO);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Appodeal',
|
||||
plugin: 'https://github.com/appodeal/appodeal-cordova-plugin',
|
||||
pluginRef: 'Appodeal',
|
||||
repo: 'https://github.com/appodeal/appodeal-cordova-plugin.git',
|
||||
platforms: [ 'ios', 'android' ]
|
||||
})
|
||||
export class Appodeal {
|
||||
// available types of advertisements
|
||||
static readonly AD_TYPES = {
|
||||
INTERSTITIAL: 1,
|
||||
SKIPPABLE_VIDEO: 2,
|
||||
BANNER: 4,
|
||||
BANNER_BOTTOM: 8,
|
||||
BANNER_TOP: 16,
|
||||
REWARDED_VIDEO: 128,
|
||||
NON_SKIPPABLE_VIDEO: 256
|
||||
};
|
||||
|
||||
/**
|
||||
* initialize Appodeal SDK
|
||||
* @param {string} appKey
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static initialize(appKey: string, adType: number): void {};
|
||||
|
||||
/**
|
||||
* check if SDK has been initialized
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isInitialized(): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* show ad of specified type
|
||||
* @param {number} adType
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static show(adType: number): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* show ad of specified type with placement options
|
||||
* @param {number} adType
|
||||
* @param {any} placement
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static showWithPlacement(
|
||||
adType: number,
|
||||
placement: any
|
||||
): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* hide ad of specified type
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(adType: number): void {};
|
||||
|
||||
/**
|
||||
* confirm use of ads of specified type
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static confirm(adType: number): void {};
|
||||
|
||||
/**
|
||||
* check if ad of specified type has been loaded
|
||||
* @param {number} adType
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isLoaded(adType: number): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* check if ad of specified
|
||||
* @param {number} adType
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isPrecache(adType: number): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} adType
|
||||
* @param autoCache
|
||||
*/
|
||||
@Cordova()
|
||||
static setAutoCache(adType: number, autoCache: any): void {};
|
||||
|
||||
/**
|
||||
* forcefully cache an ad by type
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static cache(adType: number): void {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {boolean} set
|
||||
*/
|
||||
@Cordova()
|
||||
static setOnLoadedTriggerBoth(set: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable or disable Smart Banners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static setSmartBanners(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable or disable banner backgrounds
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static setBannerBackground(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable or disable banner animations
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static setBannerAnimation(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
@Cordova()
|
||||
static set728x90Banners(value: any): void {};
|
||||
|
||||
/**
|
||||
* enable or disable logging
|
||||
* @param {boolean} logging
|
||||
*/
|
||||
@Cordova()
|
||||
static setLogging(logging: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable or disable testing mode
|
||||
* @param {boolean} testing
|
||||
*/
|
||||
@Cordova()
|
||||
static setTesting(testing: boolean): void {};
|
||||
|
||||
/**
|
||||
* reset device ID
|
||||
*/
|
||||
@Cordova()
|
||||
static resetUUID(): void {};
|
||||
|
||||
/**
|
||||
* get version of Appdeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
static getVersion(): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} network
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static disableNetwork(network?: string, adType?: number): void {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} network
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
static disableNetworkType(network?: string, adType?: number): void {};
|
||||
|
||||
/**
|
||||
* disable Location permissions for Appodeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
static disableLocationPermissionCheck(): void {};
|
||||
|
||||
/**
|
||||
* disable Storage permissions for Appodeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
static disableWriteExternalStoragePermissionCheck(): void {};
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static enableInterstitialCallbacks(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static enableSkippableVideoCallbacks(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static enableNonSkippableVideoCallbacks(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static enableBannerCallbacks(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static enableRewardedVideoCallbacks(enabled: boolean): void {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} name - name of rule
|
||||
* @param {boolean} value
|
||||
*/
|
||||
@Cordova()
|
||||
static setCustomBooleanRule(name: string, value: boolean): void {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} name - name of rule
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
static setCustomIntegerRule(name: string, value: number): void {};
|
||||
|
||||
/**
|
||||
* set rule with float value
|
||||
* @param {string} name
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
static setCustomDoubleRule(name: string, value: number): void {};
|
||||
|
||||
/**
|
||||
* set rule with string value
|
||||
* @param {string} name - name of rule
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
static setCustomStringRule(name: string, value: string): void {};
|
||||
|
||||
/**
|
||||
* set ID preference in Appodeal for current user
|
||||
* @param id
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: any): void {};
|
||||
|
||||
/**
|
||||
* set Email preference in Appodeal for current user
|
||||
* @param email
|
||||
*/
|
||||
@Cordova()
|
||||
static setEmail(email: any): void {};
|
||||
|
||||
/**
|
||||
* set Birthday preference in Appodeal for current user
|
||||
* @param birthday
|
||||
*/
|
||||
@Cordova()
|
||||
static setBirthday(birthday: any): void {};
|
||||
|
||||
/**
|
||||
* et Age preference in Appodeal for current user
|
||||
* @param age
|
||||
*/
|
||||
@Cordova()
|
||||
static setAge(age: any): void {};
|
||||
|
||||
/**
|
||||
* set Gender preference in Appodeal for current user
|
||||
* @param gender
|
||||
*/
|
||||
@Cordova()
|
||||
static setGender(gender: any): void {};
|
||||
|
||||
/**
|
||||
* set Occupation preference in Appodeal for current user
|
||||
* @param occupation
|
||||
*/
|
||||
@Cordova()
|
||||
static setOccupation(occupation: any): void {};
|
||||
|
||||
/**
|
||||
* set Relation preference in Appodeal for current user
|
||||
* @param relation
|
||||
*/
|
||||
@Cordova()
|
||||
static setRelation(relation: any): void {};
|
||||
|
||||
/**
|
||||
* set Smoking preference in Appodeal for current user
|
||||
* @param smoking
|
||||
*/
|
||||
@Cordova()
|
||||
static setSmoking(smoking: any): void {};
|
||||
|
||||
/**
|
||||
* set Alcohol preference in Appodeal for current user
|
||||
* @param alcohol
|
||||
*/
|
||||
@Cordova()
|
||||
static setAlcohol(alcohol: any): void {};
|
||||
|
||||
/**
|
||||
* set Interests preference in Appodeal for current user
|
||||
* @param interests
|
||||
*/
|
||||
@Cordova()
|
||||
static setInterests(interests: any): void {};
|
||||
|
||||
/*********************
|
||||
* event Observables *
|
||||
*********************/
|
||||
|
||||
static onInterstitialLoaded(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onInterstitialLoaded');
|
||||
}
|
||||
|
||||
static onInterstitialFailedToLoad(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onInterstitialFailedToLoad');
|
||||
}
|
||||
|
||||
static onInterstitialShown(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onInterstitialShown');
|
||||
}
|
||||
|
||||
static onInterstitialClicked(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onInterstitialClicked');
|
||||
}
|
||||
|
||||
static onInterstitialClosed(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onInterstitialClosed');
|
||||
}
|
||||
|
||||
static onSkippableVideoLoaded(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onSkippableVideoLoaded');
|
||||
}
|
||||
|
||||
static onSkippableVideoFailedToLoad(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onSkippableVideoFailedToLoad');
|
||||
}
|
||||
|
||||
static onSkippableVideoShown(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onSkippableVideoShown');
|
||||
}
|
||||
|
||||
static onSkippableVideoFinished(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onSkippableVideoFinished');
|
||||
}
|
||||
|
||||
static onSkippableVideoClosed(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onSkippableVideoClosed');
|
||||
}
|
||||
|
||||
static onRewardedVideoLoaded(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onRewardedVideoLoaded');
|
||||
}
|
||||
|
||||
static onRewardedVideoFailedToLoad(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onRewardedVideoFailedToLoad');
|
||||
}
|
||||
|
||||
static onRewardedVideoShown(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onRewardedVideoShown');
|
||||
}
|
||||
|
||||
static onRewardedVideoFinished(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onRewardedVideoFinished');
|
||||
}
|
||||
|
||||
static onRewardedVideoClosed(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onRewardedVideoClosed');
|
||||
}
|
||||
|
||||
static onNonSkippableVideoLoaded(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onNonSkippableVideoLoaded');
|
||||
}
|
||||
|
||||
static onNonSkippableVideoFailedToLoad(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onNonSkippableVideoFailedToLoad');
|
||||
}
|
||||
|
||||
static onNonSkippableVideoShown(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onNonSkippableVideoShown');
|
||||
}
|
||||
|
||||
static onNonSkippableVideoFinished(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onNonSkippableVideoFinished');
|
||||
}
|
||||
|
||||
static onNonSkippableVideoClosed(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onNonSkippableVideoClosed');
|
||||
}
|
||||
|
||||
static onBannerClicked(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onBannerClicked');
|
||||
}
|
||||
|
||||
static onBannerFailedToLoad(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onBannerFailedToLoad');
|
||||
}
|
||||
|
||||
static onBannerLoaded(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onBannerLoaded');
|
||||
}
|
||||
|
||||
static onBannerShown(): Observable<any> {
|
||||
return Observable.fromEvent(document, 'onBannerShown');
|
||||
}
|
||||
}
|
||||
133
src/plugins/apppreferences.ts
Normal file
133
src/plugins/apppreferences.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name AppPreferences
|
||||
* @description
|
||||
* This plugin allows you to read and write app preferences
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { AppPreferences } from 'ionic-native';
|
||||
*
|
||||
* AppPreferences.fetch('key').then((res) => { console.log(res); });
|
||||
*
|
||||
*```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppPreferences',
|
||||
plugin: 'cordova-plugin-app-preferences', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'plugins.appPreferences', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/apla/me.apla.cordova.app-preferences', // the github repository URL for the plugin
|
||||
})
|
||||
export class AppPreferences {
|
||||
|
||||
/**
|
||||
* Get a preference value
|
||||
*
|
||||
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||
* @param {string} key Key
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static fetch(dict: string, key?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a preference value
|
||||
*
|
||||
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||
* @param {string} key Key
|
||||
* @param {string} value Value
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static store(dict: string, key: string, value?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove value from preferences
|
||||
*
|
||||
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||
* @param {string} key Key
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static remove(dict: string, key?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clear preferences
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show native preferences interface
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static show(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show native preferences interface
|
||||
*
|
||||
* @param {boolean} subscribe true value to subscribe, false - unsubscribe
|
||||
* @return {Observable<any>} Returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static watch(subscribe: boolean): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Return named configuration context
|
||||
* In iOS you'll get a suite configuration, on Android — named file
|
||||
* Supports: Android, iOS
|
||||
* @param {string} suiteName suite name
|
||||
* @returns {Object} Custom object, bound to that suite
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static suite(suiteName: string): Object { return; }
|
||||
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static iosSuite(suiteName: string): Object { return; }
|
||||
|
||||
/**
|
||||
* Return cloud synchronized configuration context
|
||||
* Currently supports Windows and iOS/macOS
|
||||
* @returns {Object} Custom object, bound to that suite
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows', 'Windows Phone 8']
|
||||
})
|
||||
static cloudSync(): Object { return; }
|
||||
|
||||
/**
|
||||
* Return default configuration context
|
||||
* Currently supports Windows and iOS/macOS
|
||||
* @returns {Object} Custom Object, bound to that suite
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows', 'Windows Phone 8']
|
||||
})
|
||||
static defaults(): Object { return; }
|
||||
|
||||
}
|
||||
@@ -1,8 +1,99 @@
|
||||
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 Windows Store
|
||||
*/
|
||||
windows?: string;
|
||||
|
||||
/**
|
||||
* application URL in AppWorld
|
||||
*/
|
||||
blackberry?: string;
|
||||
|
||||
/**
|
||||
* application URL in WindowsStore
|
||||
*/
|
||||
windows8?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name App Rate
|
||||
* @description
|
||||
@@ -17,38 +108,24 @@ declare var window;
|
||||
* AppRate.preferences.storeAppURL = {
|
||||
* ios: '<my_app_id>',
|
||||
* android: 'market://details?id=<package_name>',
|
||||
* windows: 'ms-windows-store://review/?ProductId=<Store_ID>'
|
||||
* };
|
||||
*
|
||||
* 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({
|
||||
pluginName: 'AppRate',
|
||||
plugin: 'cordova-plugin-apprate',
|
||||
pluginRef: 'AppRate',
|
||||
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS', 'Windows (experimental)']
|
||||
})
|
||||
export class AppRate {
|
||||
|
||||
@@ -57,7 +134,7 @@ export class AppRate {
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
static preferences;
|
||||
static preferences: AppRatePreferences;
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
|
||||
@@ -26,6 +26,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class AppVersion {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise<any>}
|
||||
|
||||
107
src/plugins/background-fetch.ts
Normal file
107
src/plugins/background-fetch.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
|
||||
export interface BackgroundFetchConfig {
|
||||
|
||||
/**
|
||||
* Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
|
||||
*/
|
||||
stopOnTerminate?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name BackgroundFetch
|
||||
* @description
|
||||
* iOS Background Fetch Implementation. See: https://developer.apple.com/reference/uikit/uiapplication#1657399
|
||||
* iOS Background Fetch is basically an API which wakes up your app about every 15 minutes (during the user's prime-time hours) and provides your app exactly 30s of background running-time. This plugin will execute your provided callbackFn whenever a background-fetch event occurs. There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible value of UIApplicationBackgroundFetchIntervalMinimum -- iOS determines the rate automatically based upon device usage and time-of-day (ie: fetch-rate is about ~15min during prime-time hours; less frequently when the user is presumed to be sleeping, at 3am for example).
|
||||
* For more detail, please see https://github.com/transistorsoft/cordova-plugin-background-fetch
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { BackgroundFetch } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // When device is ready :
|
||||
* platform.ready().then(() => {
|
||||
*
|
||||
* let config = {
|
||||
* stopOnTerminate: false, // Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
|
||||
* };
|
||||
*
|
||||
* BackgroundFetch.configure(() => {
|
||||
console.log('[js] BackgroundFetch initiated');
|
||||
|
||||
// perform some ajax request to server here
|
||||
|
||||
You MUST called #finish so that native-side can signal completion of the background-thread to the os.
|
||||
BackgroundFetch.finish();
|
||||
|
||||
* }, (error) => {
|
||||
* console.log('- BackgroundFetch failed', error);
|
||||
* }, config);
|
||||
*
|
||||
* });
|
||||
*
|
||||
* // Start the background-fetch API. Your callbackFn provided to #configure will be executed each time a background-fetch event occurs. NOTE the #configure method automatically calls #start. You do not have to call this method after you #configure the plugin
|
||||
* BackgroundFetch.start();
|
||||
*
|
||||
* // Stop the background-fetch API from firing fetch events. Your callbackFn provided to #configure will no longer be executed.
|
||||
* BackgroundFetch.stop();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* BackgroundFetchConfig
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundFetch',
|
||||
plugin: 'cordova-plugin-background-fetch',
|
||||
pluginRef: 'BackgroundFetch',
|
||||
repo: 'https://github.com/transistorsoft/cordova-plugin-background-fetch',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
export class BackgroundFetch {
|
||||
|
||||
|
||||
/**
|
||||
* Configures the plugin's fetch callbackFn
|
||||
*
|
||||
* @param {Function} callbackFn This callback will fire each time an iOS background-fetch event occurs (typically every 15 min).
|
||||
* @param {Function} errorCallback The failureFn will be called if the device doesn't support background-fetch.
|
||||
* @param {BackgroundFetchConfig} config Configuration for plugin
|
||||
* @return Location object, which tries to mimic w3c Coordinates interface.
|
||||
* See http://dev.w3.org/geo/api/spec-source.html#coordinates_interface
|
||||
* Callback to be executed every time a geolocation is recorded in the background.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configure(callbackFn: Function, errorCallback: Function, config: BackgroundFetchConfig): any { return; }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Start the background-fetch API.
|
||||
* Your callbackFn provided to #configure will be executed each time a background-fetch event occurs. NOTE the #configure method automatically calls #start. You do not have to call this method after you #configure the plugin
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static start(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop the background-fetch API from firing fetch events. Your callbackFn provided to #configure will no longer be executed.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stop(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* You MUST call this method in your fetch callbackFn provided to #configure in order to signal to iOS that your fetch action is complete. iOS provides only 30s of background-time for a fetch-event -- if you exceed this 30s, iOS will kill your app.
|
||||
*/
|
||||
@Cordova()
|
||||
static finish() { }
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface Location {
|
||||
export interface BackgroundGeolocationResponse {
|
||||
|
||||
/**
|
||||
* ID of location as stored in DB (or null)
|
||||
@@ -49,6 +50,11 @@ export interface Location {
|
||||
*/
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
* bearing, in degrees.
|
||||
*/
|
||||
@@ -65,7 +71,7 @@ export interface Location {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
|
||||
@@ -121,10 +127,14 @@ export interface Config {
|
||||
|
||||
/**
|
||||
* ANDROID, WP8 ONLY
|
||||
* The minimum time interval between location updates in seconds.
|
||||
* When using BackgroundGeolocation.LocationProvider.ANDROID_DISTANCE_FILTER_PROVIDER:
|
||||
* The minimum time interval between location updates in milliseconds.
|
||||
* @see Android docs (http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,%20float,%20android.location.Criteria,%20android.app.PendingIntent))
|
||||
* and the MS doc (http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geolocator.reportinterval)
|
||||
* for more information
|
||||
* When using BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER:
|
||||
* Rate in milliseconds at which your app prefers to receive location updates.
|
||||
* @see Android docs (https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#getInterval())
|
||||
*/
|
||||
interval?: number;
|
||||
|
||||
@@ -220,6 +230,28 @@ export interface Config {
|
||||
* Defaults to 10000
|
||||
*/
|
||||
maxLocations?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* Fastest rate in milliseconds at which your app can handle location updates.
|
||||
* @see Android docs (https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#getFastestInterval())
|
||||
*/
|
||||
fastestInterval?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* Rate in milliseconds at which activity recognition occurs. Larger values will result in fewer activity detections while improving battery life.
|
||||
*/
|
||||
activitiesInterval?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* stop() is forced, when the STILL activity is detected (default is true)
|
||||
*/
|
||||
stopOnStillActivity?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,8 +300,8 @@ export interface Config {
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* Location
|
||||
* Config
|
||||
* BackgroundGeolocationResponse
|
||||
* BackgroundGeolocationConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundGeolocation',
|
||||
@@ -331,17 +363,14 @@ export class BackgroundGeolocation {
|
||||
/**
|
||||
* Configure the plugin.
|
||||
*
|
||||
* @param {Function} callback callback will be called when background location is determined.
|
||||
* @param {Function} errorCallback callback to be executed every time a geolocation error occurs.
|
||||
* @param {Config} options An object of type Config
|
||||
* @return Location object, which tries to mimic w3c Coordinates interface.
|
||||
* See http://dev.w3.org/geo/api/spec-source.html#coordinates_interface
|
||||
* Callback to be executed every time a geolocation is recorded in the background.
|
||||
* @param options {BackgroundGeolocationConfig} options An object of type Config
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
callbackOrder: 'reverse',
|
||||
observable: true
|
||||
})
|
||||
static configure(callback: Function, errorCallback: Function, options: Config): any { return; }
|
||||
static configure(options: BackgroundGeolocationConfig): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Turn ON the background-geolocation system.
|
||||
@@ -360,50 +389,59 @@ export class BackgroundGeolocation {
|
||||
|
||||
/**
|
||||
* Inform the native plugin that you're finished, the background-task may be completed
|
||||
* NOTE: IOS, WP only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static finish() { }
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows Phone']
|
||||
})
|
||||
static finish(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Force the plugin to enter "moving" or "stationary" state
|
||||
* NOTE: IOS, WP only
|
||||
* @param isMoving {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static changePace(isMoving: boolean) { }
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows Phone']
|
||||
})
|
||||
static changePace(isMoving: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Setup configuration
|
||||
* @param options {BackgroundGeolocationConfig}
|
||||
* @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; }
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows Phone']
|
||||
})
|
||||
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()
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows Phone']
|
||||
})
|
||||
static onStationary(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if location is enabled on the device
|
||||
* @returns {Promise<number>} Returns a promise with int argument that takes values 0, 1 (true).
|
||||
* NOTE: ANDROID only
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static isLocationEnabled(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
@@ -422,18 +460,21 @@ export class BackgroundGeolocation {
|
||||
* Method can be used to detect user changes in location services settings.
|
||||
* 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()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static watchLocationMode(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Stop watching for location mode changes.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopWatchingLocationMode() { }
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static stopWatchingLocationMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Method will return all stored locations.
|
||||
@@ -442,10 +483,11 @@ export class BackgroundGeolocation {
|
||||
* by the system
|
||||
* or
|
||||
* - option.debug is true
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static getLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -457,18 +499,21 @@ export class BackgroundGeolocation {
|
||||
|
||||
/**
|
||||
* Delete stored location by given locationId.
|
||||
* NOTE: ANDROID only
|
||||
* @param locationId {number}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static deleteLocation(locationId: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete all stored locations.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static deleteAllLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -480,22 +525,23 @@ export class BackgroundGeolocation {
|
||||
*
|
||||
* BackgroundGeolocation.Mode.FOREGROUND
|
||||
* BackgroundGeolocation.Mode.BACKGROUND
|
||||
*
|
||||
* NOTE: iOS only
|
||||
*
|
||||
* @param {number} See above.
|
||||
**
|
||||
* @param modeId {number}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static switchMode(modeId: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Return all logged events. Useful for plugin debugging. Parameter limit limits number of returned entries.
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
|
||||
*
|
||||
* @param {number} Limits the number of entries
|
||||
* @param limit {number} Limits the number of entries
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLogEntries(limit: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,38 @@
|
||||
import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';
|
||||
|
||||
import { Cordova, 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
|
||||
@@ -13,19 +44,9 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* 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({
|
||||
pluginName: 'BackgroundMode',
|
||||
@@ -35,6 +56,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Enable the background mode.
|
||||
* Once called, prevents the app from being paused while in background.
|
||||
@@ -53,17 +75,21 @@ export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates 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 {Promise<boolean>} returns a promise that resolves with boolean that indicates 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 +99,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: Configure): Promise<any> { return; }
|
||||
static setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
@@ -83,58 +109,80 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static configure(options?: Configure): Promise<any> { return; }
|
||||
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; };
|
||||
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
|
||||
* @param event {string} Event name
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'un',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static on(event: string): 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; };
|
||||
* Android allows to programmatically move from foreground to background.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static moveToBackground(): void {}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
* Android allows to programmatically move from background to foreground.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static moveToForeground(): void {}
|
||||
|
||||
/**
|
||||
* Override the back button on Android to go to background instead of closing the app.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static overrideBackButton(): void {}
|
||||
|
||||
/**
|
||||
* Exclude the app from the recent task list works on Android 5.0+.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static excludeFromTaskList(): void {}
|
||||
|
||||
/**
|
||||
* The method works async instead of isActive() or isEnabled().
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static isScreenOff(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Turn screen on
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static wakeUp(): void {}
|
||||
|
||||
/**
|
||||
* Turn screen on and show app even locked
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static unlock(): void {}
|
||||
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
*
|
||||
* Badge.set(10);
|
||||
* Badge.increase();
|
||||
* Badge.increase(1);
|
||||
* Badge.clear();
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,59 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* Disable success beep. Supported on iOS only.
|
||||
*/
|
||||
disableSuccessBeep?: 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,6 +72,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* BarcodeScannerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BarcodeScanner',
|
||||
@@ -37,15 +93,16 @@ 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
|
||||
* @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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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({
|
||||
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<StatusObject>} 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;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class BLE {
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
@@ -204,7 +205,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
@@ -217,7 +218,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
@@ -421,4 +422,16 @@ export class BLE {
|
||||
*/
|
||||
@Cordova()
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Read the RSSI value on the device connection.
|
||||
*
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
*
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static readRSSI(
|
||||
deviceId: string,
|
||||
): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -60,6 +60,13 @@ export class BluetoothSerial {
|
||||
})
|
||||
static connectInsecure(macAddress: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Disconnect from the connected device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
* @param {any} data ArrayBuffer of data
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
57
src/plugins/browser-tab.ts
Normal file
57
src/plugins/browser-tab.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name BrowserTab
|
||||
* @description
|
||||
* This plugin provides an interface to in-app browser tabs that exist on some mobile platforms, specifically [Custom Tabs](http://developer.android.com/tools/support-library/features.html#custom-tabs) on Android (including the [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) implementation), and [SFSafariViewController](https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/) on iOS.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { BrowserTab } from 'ionic-native';
|
||||
*
|
||||
* BrowserTab.isAvailable()
|
||||
* .then((isAvailable: boolean) => {
|
||||
*
|
||||
* if (isAvailable) {
|
||||
*
|
||||
* BrowserTab.openUrl('https://ionic.io');
|
||||
*
|
||||
* } else {
|
||||
* // open url with InAppBrowser instead
|
||||
* }
|
||||
*
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BrowserTab',
|
||||
plugin: 'cordova-plugin-browsertab',
|
||||
pluginRef: 'cordova.plugins.browsertab',
|
||||
repo: 'https://github.com/google/cordova-plugin-browsertab',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class BrowserTab {
|
||||
|
||||
/**
|
||||
* Check if BrowserTab option is available
|
||||
* @return {Promise<any>} Returns a promise that resolves when check is successful and returns true or false
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Opens the provided URL using a browser tab
|
||||
* @param {string} url The URL you want to open
|
||||
* @return {Promise<any>} Returns a promise that resolves when check open was successful
|
||||
*/
|
||||
@Cordova()
|
||||
static openUrl(url: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Closes browser tab
|
||||
* @return {Promise<any>} Returns a promise that resolves when close was finished
|
||||
*/
|
||||
@Cordova()
|
||||
static close(): 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,7 +71,8 @@ export interface CalendarOptions {
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CalendarOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Calendar',
|
||||
@@ -102,9 +139,7 @@ export class Calendar {
|
||||
* @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)
|
||||
@@ -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.
|
||||
@@ -279,7 +295,9 @@ export class Calendar {
|
||||
* @param {Date} [endDate] The end date
|
||||
* @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; }
|
||||
|
||||
/**
|
||||
@@ -293,7 +311,9 @@ export class Calendar {
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @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,
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CallNumber {
|
||||
|
||||
/**
|
||||
* Calls a phone number
|
||||
* @param numberToCall {string} The phone number to call as a string
|
||||
@@ -35,4 +36,5 @@ export class CallNumber {
|
||||
static callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,62 +1,103 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CameraPreviewRect {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
export interface CameraPreviewDimensions {
|
||||
/** The width of the camera preview, default to window.screen.width */
|
||||
width?: number;
|
||||
|
||||
/** The height of the camera preview, default to window.screen.height */
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface CameraPreviewSize {
|
||||
maxWidth: number;
|
||||
maxHeight: number;
|
||||
export interface CameraPreviewOptions {
|
||||
/** The left edge in pixels, default 0 */
|
||||
x?: number;
|
||||
|
||||
/** The top edge in pixels, default 0 */
|
||||
y?: number;
|
||||
|
||||
/** The width in pixels, default window.screen.width */
|
||||
width?: number;
|
||||
|
||||
/** The height in pixels, default window.screen.height */
|
||||
height?: number;
|
||||
|
||||
/** Choose the camera to use 'front' or 'rear', default 'front' */
|
||||
camera?: string;
|
||||
|
||||
/** Tap to take a photo, default true (picture quality by default : 85) */
|
||||
tapPhoto?: boolean;
|
||||
|
||||
/** Preview box drag across the screen, default 'false' */
|
||||
previewDrag?: boolean;
|
||||
|
||||
/** Preview box to the back of the webview (true => back, false => front) , default false */
|
||||
toBack?: boolean;
|
||||
|
||||
/** Alpha channel of the preview box, float, [0,1], default 1 */
|
||||
alpha?: number;
|
||||
}
|
||||
|
||||
export interface PictureOptions {
|
||||
/** The width in pixels, default 0 */
|
||||
width?: number;
|
||||
/** The height in pixels, default 0 */
|
||||
height?: number;
|
||||
/** The picture quality, 0 - 100, default 85 */
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
*
|
||||
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
|
||||
*
|
||||
* Requires Cordova plugin: `https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git`. For more info, please see the [Cordova Camera Preview docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { CameraPreview, CameraPreviewRect } from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { CameraPreview, PictureOptions, CameraPreviewOptions, CameraPreviewDimensions, } from 'ionic-native';
|
||||
*
|
||||
* // camera options (Size and location)
|
||||
* let cameraRect: CameraPreviewRect = {
|
||||
* x: 100,
|
||||
* y: 100,
|
||||
* width: 200,
|
||||
* height: 200
|
||||
* // camera options (Size and location). In the following example, the preview uses the rear camera and display the preview in the back of the webview
|
||||
* public cameraPreviewOpts: CameraPreviewOptions = {
|
||||
* x: 0,
|
||||
* y: 0,
|
||||
* width: window.screen.width,
|
||||
* height: window.screen.height,
|
||||
* camera: 'rear',
|
||||
* tapPhoto: true,
|
||||
* previewDrag: true,
|
||||
* toBack: true,
|
||||
* alpha: 1
|
||||
* };
|
||||
*
|
||||
*
|
||||
* // start camera
|
||||
* CameraPreview.startCamera(
|
||||
* cameraRect, // position and size of preview
|
||||
* 'front', // default camera
|
||||
* true, // tap to take picture
|
||||
* false, // disable drag
|
||||
* 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
|
||||
* CameraPreview.setOnPictureTakenHandler().subscribe((result) => {
|
||||
* console.log(result);
|
||||
* // do something with the result
|
||||
* });
|
||||
* CameraPreview.startCamera(this.cameraPreviewOpts).then(
|
||||
* (res) => {
|
||||
* console.log(res)
|
||||
* },
|
||||
* (err) => {
|
||||
* console.log(err)
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // picture options
|
||||
* public pictureOpts: PictureOptions = {
|
||||
* width: 1280,
|
||||
* height: 1280,
|
||||
* quality: 85
|
||||
* }
|
||||
*
|
||||
* // take a picture
|
||||
* CameraPreview.takePicture({
|
||||
* maxWidth: 640,
|
||||
* maxHeight: 640
|
||||
* CameraPreview.takePicture(this.pictureOpts).then((imageData) => {
|
||||
* this.picture = 'data:image/jpeg;base64,' + imageData;
|
||||
* }, (err) => {
|
||||
* console.log(err);
|
||||
* this.picture = 'assets/img/test.jpg';
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Switch camera
|
||||
* CameraPreview.switchCamera();
|
||||
*
|
||||
@@ -68,93 +109,120 @@ export interface CameraPreviewSize {
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CameraPreviewOptions
|
||||
* PictureOptions
|
||||
* CameraPreviewDimensions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CameraPreview',
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
pluginRef: 'cordova.plugins.camerapreview',
|
||||
pluginRef: 'CameraPreview',
|
||||
repo: 'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class CameraPreview {
|
||||
|
||||
/**
|
||||
* Starts the camera preview instance.
|
||||
* @param {CameraPreviewRect} position and size of the preview window - {x: number, y: number, width: number, height: number}
|
||||
* @param {string} which camera to use - 'front' | 'back'
|
||||
* @param {boolean} enable tap to take picture
|
||||
* @param {boolean} enable preview box drag across the screen
|
||||
* @param {boolean} send preview box to the back of the webview
|
||||
* @param {number} alpha of the preview box
|
||||
* Starts the camera preview instance. (iOS & Android)
|
||||
* @param {CameraPreviewOptions} options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { }
|
||||
static startCamera(options: CameraPreviewOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance.
|
||||
* Stops the camera preview instance. (iOS & Android)
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
static stopCamera(): void { }
|
||||
static stopCamera(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Take the picture, the parameter size is optional
|
||||
* @param {CameraPreviewSize} optional - size of the picture to take
|
||||
* Switch from the rear camera and front camera, if available. (iOS & Android)
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
static takePicture(size: CameraPreviewSize): void { }
|
||||
static switchCamera(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register a callback function that receives the original picture and the image captured from the preview box.
|
||||
* @returns {Observable<any>}
|
||||
* Hide the camera preview box. (iOS & Android)
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
static setOnPictureTakenHandler(): Observable<any> { return; }
|
||||
static hide(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
* Show the camera preview box. (iOS & Android)
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
static switchCamera(): void { }
|
||||
static show(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
* Take the picture (base64), the parameter size is optional (iOS & Android)
|
||||
* @param {PictureOptions} optional - size and quality of the picture to take
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static show(): void { }
|
||||
static takePicture(opts?: PictureOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
*
|
||||
* Set camera color effect. (iOS partial & Android)
|
||||
* @static
|
||||
* @param {string} effect name : 'none' (iOS & Android), 'aqua' (Android), 'blackboard' (Android), 'mono' (iOS & Android), 'negative' (iOS & Android), 'posterize' (iOS & Android), 'sepia' (iOS & Android), 'solarize' (Android) or 'whiteboard' (Android)
|
||||
*
|
||||
* @memberOf CameraPreview
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static hide(): void { }
|
||||
static setColorEffect(effect: string): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Disables the camera preview
|
||||
* Set the zoom (Android)
|
||||
* @param Zoom value (integer)
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static disable(): void { }
|
||||
static setZoom(zoom?: number): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Set camera color effect.
|
||||
* Set the preview Size (Android)
|
||||
* @param dimensions
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static setColorEffect(effect: string): void { }
|
||||
static setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Set the flashmode (iOS partial & Android)
|
||||
* @param flashMode 'off' (iOS & Android), 'on' (iOS & Android), 'auto' (iOS & Android), 'torch' (Android)
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static setFlashMode(flashMode?: string): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ export interface CameraPopoverOptions {
|
||||
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
|
||||
})
|
||||
export class Camera {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
|
||||
@@ -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,15 +151,19 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CardIOOptions
|
||||
* CardIOResponse
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CardIO',
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
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.)
|
||||
@@ -57,33 +189,3 @@ export class CardIO {
|
||||
static version(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
requireExpiry?: boolean;
|
||||
requireCVV?: 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;
|
||||
}
|
||||
|
||||
export interface CardIOResponse {
|
||||
cardType: string;
|
||||
redactedCardNumber: string;
|
||||
cardNumber: string;
|
||||
expiryMonth: number;
|
||||
expiryYear: number;
|
||||
cvv: string;
|
||||
postalCode: string;
|
||||
cardholderName: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Clipboard
|
||||
* @description
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,38 +3,52 @@ 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';
|
||||
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[];
|
||||
}
|
||||
@@ -217,9 +231,9 @@ export class ContactOrganization implements IContactOrganization {
|
||||
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.
|
||||
@@ -245,10 +259,10 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { Contact } from 'ionic-native';
|
||||
* import { Contacts, Contact, ContactField, ContactName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let contact = new Contact();
|
||||
* let contact: Contact = Contacts.create();
|
||||
*
|
||||
* contact.name = new ContactName(null, 'Smith', 'John');
|
||||
* contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
|
||||
@@ -274,6 +288,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts'
|
||||
})
|
||||
export class Contacts {
|
||||
|
||||
/**
|
||||
* Create a single contact.
|
||||
* @returns {Contact} Returns a Contact object
|
||||
@@ -284,16 +299,8 @@ export class Contacts {
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
* @param fields {ContactFieldType[]} 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 {IContactFindOptions} 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)
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
static find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||
|
||||
35
src/plugins/couchbase-lite.ts
Normal file
35
src/plugins/couchbase-lite.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Couchbase Lite
|
||||
* @description
|
||||
* Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { CouchbaseLite } from 'ionic-native';
|
||||
*
|
||||
* CouchbaseLite.getURL()
|
||||
* .then((url: any) => console.log(url))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CouchbaseLite',
|
||||
plugin: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
||||
pluginRef: 'cblite',
|
||||
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
||||
})
|
||||
export class CouchbaseLite {
|
||||
|
||||
/**
|
||||
* Get the database url
|
||||
* @return {Promise<any>} Returns a promise that resolves with the local database url
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
static getURL(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Crop
|
||||
* @description Crops images
|
||||
@@ -22,6 +23,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop'
|
||||
})
|
||||
export class Crop {
|
||||
|
||||
/**
|
||||
* Crops an image
|
||||
* @param pathToImage
|
||||
@@ -32,4 +34,5 @@ export class Crop {
|
||||
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.
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,11 +53,22 @@ 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({
|
||||
pluginName: 'Deeplinks',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'DeviceAccounts',
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
|
||||
@@ -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
|
||||
@@ -42,17 +41,17 @@ export interface AccelerometerOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { DeviceMotion } from 'ionic-native';
|
||||
* import { DeviceMotion, DeviceMotionAccelerationData } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Get the device current acceleration
|
||||
* DeviceMotion.getCurrentAcceleration().then(
|
||||
* (acceleration: AccelerationData) => console.log(acceleration),
|
||||
* (acceleration: DeviceMotionAccelerationData) => console.log(acceleration),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch device acceleration
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: AccelerationData) => {
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: DeviceMotionAccelerationData) => {
|
||||
* console.log(acceleration);
|
||||
* });
|
||||
*
|
||||
@@ -60,6 +59,9 @@ export interface AccelerometerOptions {
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceMotionAccelerationData
|
||||
* DeviceMotionAccelerometerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceMotion',
|
||||
@@ -71,21 +73,21 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Get the current acceleration along the x, y, and z axes.
|
||||
* @returns {Promise<AccelerationData>} 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)
|
||||
@@ -47,24 +46,27 @@ export interface CompassOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* // CompassHeading is an interface for compass
|
||||
* import { DeviceOrientation, CompassHeading } from 'ionic-native';
|
||||
* // DeviceOrientationCompassHeading is an interface for compass
|
||||
* import { DeviceOrientation, DeviceOrientationCompassHeading } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Get the device current compass heading
|
||||
* DeviceOrientation.getCurrentHeading().then(
|
||||
* (data: CompassHeading) => console.log(data),
|
||||
* (data: DeviceOrientationCompassHeading) => console.log(data),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch the device compass heading change
|
||||
* var subscription = DeviceOrientation.watchHeading().subscribe(
|
||||
* (data: CompassHeading) => console.log(data)
|
||||
* (data: DeviceOrientationCompassHeading) => console.log(data)
|
||||
* );
|
||||
*
|
||||
* // Stop watching heading change
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceOrientationCompassOptions
|
||||
* DeviceOrientationCompassHeading
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceOrientation',
|
||||
@@ -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
|
||||
@@ -19,7 +19,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* Diagnostic.getBluetoothState()
|
||||
* .then((state) => {
|
||||
* if (state == Diagnostic.bluetoothStates.POWERED_ON){
|
||||
* if (state == Diagnostic.bluetoothState.POWERED_ON){
|
||||
* // do something
|
||||
* } else {
|
||||
* // do something else
|
||||
@@ -27,6 +27,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }).catch(e => console.error(e));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Diagnostic',
|
||||
@@ -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 = {
|
||||
@@ -107,6 +109,15 @@ export class Diagnostic {
|
||||
POWERING_ON: 'powering_on'
|
||||
};
|
||||
|
||||
@CordovaProperty
|
||||
static NFCState: {
|
||||
UNKNOWN: string;
|
||||
POWERED_OFF: string;
|
||||
POWERED_ON: string;
|
||||
POWERING_ON: string;
|
||||
POWERING_OFF: string;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Checks if app is able to access device location.
|
||||
@@ -188,6 +199,9 @@ export class Diagnostic {
|
||||
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
|
||||
static setBluetoothState(state: boolean): Promise<any> { return; }
|
||||
|
||||
|
||||
// ANDROID AND IOS ONLY
|
||||
|
||||
/**
|
||||
* Returns true if the device setting for location is on. On Android this returns true if Location Mode is switched on. On iOS this returns true if Location Services is switched on.
|
||||
* @returns {Promise<boolean>}
|
||||
@@ -365,6 +379,9 @@ export class Diagnostic {
|
||||
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
|
||||
static registerLocationStateChangeHandler(handler: Function): void { }
|
||||
|
||||
|
||||
// ANDROID ONLY
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -491,6 +508,96 @@ export class Diagnostic {
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static hasBluetoothLEPeripheralSupport(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use external storage.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isExternalStorageAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* CReturns the external storage authorization status for the application.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static getExternalStorageAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests external storage authorization for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static requestExternalStorageAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns details of external SD card(s): absolute path, is writable, free space.
|
||||
*
|
||||
* The intention of this method is to return the location and details of removable external SD cards.
|
||||
* This differs from the "external directories" returned by cordova-plugin-file which return mount points relating to non-removable (internal) storage.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#getexternalsdcarddetails)
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static getExternalSdCardDetails(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Switches to the wireless settings page in the Settings app. Allows configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
switchToWirelessSettings(): void { }
|
||||
|
||||
/**
|
||||
* Displays NFC settings to allow user to enable NFC.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
switchToNFCSettings(): void { }
|
||||
|
||||
/**
|
||||
* Checks if NFC hardware is present on device.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isNFCPresent(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device setting for NFC is switched on.
|
||||
* Note: this operation does not require NFC permission in the manifest.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isNFCEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if NFC is available to the app. Returns true if the device has NFC capabilities AND if NFC setting is switched on.
|
||||
* Note: this operation does not require NFC permission in the manifest.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isNFCAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Registers a function to be called when a change in NFC state occurs. Pass in a falsey value to de-register the currently registered function.
|
||||
* @param hander {Function} callback function to be called when NFC state changes
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
registerNFCStateChangeHandler(handler: Function): void { }
|
||||
|
||||
|
||||
|
||||
// IOS ONLY
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use the Camera Roll in Photos app.
|
||||
* @returns {Promise<boolean>}
|
||||
@@ -571,4 +678,40 @@ export class Diagnostic {
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static getBackgroundRefreshStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests Bluetooth authorization for the application.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestbluetoothauthorization)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static requestBluetoothAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if motion tracking is available on the current device.
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isMotionAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if it's possible to determine the outcome of a motion authorization request on the current device.
|
||||
* There's no direct way to determine if authorization was granted or denied, so the Pedometer API must be used to indirectly determine this:
|
||||
* therefore, if the device supports motion tracking but not Pedometer Event Tracking, the outcome of requesting motion detection cannot be determined.
|
||||
*
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isMotionRequestOutcomeAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests and checks motion authorization for the application: there is no way to independently request only or check only, so both must be done in one operation.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestandcheckmotionauthorization)
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static requestAndCheckMotionAuthorization(): Promise<any> { 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,6 +31,8 @@ export interface PromptCallback {
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DialogsPromptCallback
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Dialogs',
|
||||
@@ -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,6 +63,8 @@ declare var cordova: any;
|
||||
* EmailComposer.open(email);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* EmailComposerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'EmailComposer',
|
||||
@@ -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,12 +1,28 @@
|
||||
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({
|
||||
pluginName: 'EstimoteBeacons',
|
||||
@@ -40,6 +56,7 @@ export class EstimoteBeacons {
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorBlueberryPie = 3;
|
||||
|
||||
/**
|
||||
* Beacon colour.
|
||||
*/
|
||||
@@ -394,7 +411,6 @@ 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
|
||||
@@ -481,10 +497,3 @@ export class EstimoteBeacons {
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
@@ -210,7 +232,10 @@ export class Facebook {
|
||||
* @param {number} [valueToSum] any value to be added to added to a sum on each event
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 3,
|
||||
errorIndex: 4
|
||||
})
|
||||
static logEvent(
|
||||
name: string,
|
||||
params?: Object,
|
||||
@@ -249,15 +274,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,8 +11,8 @@ 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));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -23,10 +24,12 @@ import { Plugin, Cordova } from './plugin';
|
||||
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
|
||||
@@ -19,6 +20,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
|
||||
})
|
||||
export class FileOpener {
|
||||
|
||||
/**
|
||||
* Open an file
|
||||
* @param filePath {string} File Path
|
||||
@@ -55,4 +57,5 @@ export class FileOpener {
|
||||
errorName: 'error'
|
||||
})
|
||||
static appIsInstalled(packageId: string): Promise<any> {return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plugin, pluginWarn } from './plugin';
|
||||
import {CordovaProperty, Plugin, pluginWarn} from './plugin';
|
||||
|
||||
declare var window: any;
|
||||
declare var cordova: any;
|
||||
@@ -171,7 +171,6 @@ 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
|
||||
@@ -267,7 +266,7 @@ export interface FileWriter extends FileSaver {
|
||||
* Write the supplied data to the file at position.
|
||||
* @param {Blob} data The blob to write.
|
||||
*/
|
||||
write(data: Blob | string): void;
|
||||
write(data: ArrayBuffer | Blob | string): void;
|
||||
/**
|
||||
* The file position at which the next write will occur.
|
||||
* @param offset If nonnegative, an absolute byte offset into the file.
|
||||
@@ -283,7 +282,7 @@ export interface FileWriter extends FileSaver {
|
||||
}
|
||||
|
||||
/* FileWriter states */
|
||||
declare var FileWriter: {
|
||||
export declare var FileWriter: {
|
||||
INIT: number;
|
||||
WRITING: number;
|
||||
DONE: number
|
||||
@@ -308,7 +307,7 @@ export interface FileReader {
|
||||
readAsArrayBuffer(fe: File | Blob): void;
|
||||
}
|
||||
|
||||
declare var FileReader: {
|
||||
export declare var FileReader: {
|
||||
EMPTY: number;
|
||||
LOADING: number;
|
||||
DONE: number;
|
||||
@@ -322,7 +321,7 @@ export interface FileError {
|
||||
message: string;
|
||||
}
|
||||
|
||||
declare var FileError: {
|
||||
export declare var FileError: {
|
||||
new (code: number): FileError;
|
||||
NOT_FOUND_ERR: number;
|
||||
SECURITY_ERR: number;
|
||||
@@ -350,9 +349,9 @@ declare var FileError: {
|
||||
* ```
|
||||
* import { File } from 'ionic-native';
|
||||
*
|
||||
* declare var cordova: any;
|
||||
* const fs:string = cordova.file.dataDirectory;
|
||||
* File.checkDir(this.fs, 'mydir').then(_ => console.log('yay')).catch(err => console.log('boooh'));
|
||||
* const dataDirectory: string = File.dataDirectory;
|
||||
*
|
||||
* File.checkDir(dataDirectory, 'mydir').then(_ => console.log('yay')).catch(err => console.log('boooh'));
|
||||
* ```
|
||||
*
|
||||
* This plugin is based on several specs, including : The HTML5 File API http://www.w3.org/TR/FileAPI/
|
||||
@@ -367,6 +366,80 @@ declare var FileError: {
|
||||
repo: 'https://github.com/apache/cordova-plugin-file'
|
||||
})
|
||||
export class File {
|
||||
|
||||
/**
|
||||
* Read-only directory where the application is installed.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static applicationDirectory: string;
|
||||
|
||||
/**
|
||||
* Read-only directory where the application is installed.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static applicationStorageDirectory: string;
|
||||
|
||||
/**
|
||||
* Where to put app-specific data files.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static dataDirectory: string;
|
||||
|
||||
/**
|
||||
* Cached files that should survive app restarts.
|
||||
* Apps should not rely on the OS to delete files in here.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static cacheDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the application space on external storage.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static externalApplicationStorageDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: Where to put app-specific data files on external storage.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static externalDataDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the application cache on external storage.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static externalCacheDirectory: string;
|
||||
|
||||
/**
|
||||
* Android: the external storage (SD card) root.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static externalRootDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Temp directory that the OS can clear at will.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static tempDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Holds app-specific files that should be synced (e.g. to iCloud).
|
||||
*/
|
||||
@CordovaProperty
|
||||
static syncedDataDirectory: string;
|
||||
|
||||
/**
|
||||
* iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
|
||||
*/
|
||||
@CordovaProperty
|
||||
static documentsDirectory: string;
|
||||
|
||||
/**
|
||||
* BlackBerry10: Files globally available to all apps
|
||||
*/
|
||||
@CordovaProperty
|
||||
static sharedDirectory: string;
|
||||
|
||||
static cordovaFileError: {} = {
|
||||
1: 'NOT_FOUND_ERR',
|
||||
2: 'SECURITY_ERR',
|
||||
@@ -385,8 +458,8 @@ 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) => {
|
||||
@@ -407,13 +480,13 @@ 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
|
||||
* @returns {Promise<boolean|FileError>} Returns a Promise that resolves to true if the directory exists or rejects with an error.
|
||||
* @returns {Promise<boolean>} 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> {
|
||||
static checkDir(path: string, dir: string): Promise<boolean> {
|
||||
if ((/^\//.test(dir))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'directory cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
let fullpath = path + dir;
|
||||
@@ -431,13 +504,13 @@ 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
|
||||
* @returns {Promise<DirectoryEntry|FileError>} Returns a Promise that resolves with a DirectoryEntry or rejects with an error.
|
||||
* @returns {Promise<DirectoryEntry>} Returns a Promise that resolves with a DirectoryEntry or rejects with an error.
|
||||
*/
|
||||
static createDir(path: string, dirName: string, replace: boolean): Promise<DirectoryEntry|FileError> {
|
||||
static createDir(path: string, dirName: string, replace: boolean): Promise<DirectoryEntry> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'directory cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
let options: Flags = {
|
||||
@@ -459,13 +532,13 @@ export class File {
|
||||
*
|
||||
* @param {string} path The path to the directory
|
||||
* @param {string} dirName The directory name
|
||||
* @returns {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
* @returns {Promise<RemoveResult>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
*/
|
||||
static removeDir(path: string, dirName: string): Promise<RemoveResult|FileError> {
|
||||
static removeDir(path: string, dirName: string): Promise<RemoveResult> {
|
||||
if ((/^\//.test(dirName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'directory cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -484,15 +557,15 @@ 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
|
||||
* @returns {Promise<DirectoryEntry|Entry|FileError>} Returns a Promise that resolves to the new DirectoryEntry object or rejects with an error.
|
||||
* @returns {Promise<DirectoryEntry|Entry>} 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> {
|
||||
static moveDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<DirectoryEntry|Entry> {
|
||||
newDirName = newDirName || dirName;
|
||||
|
||||
if ((/^\//.test(newDirName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'directory cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return this.resolveDirectoryUrl(path)
|
||||
@@ -514,13 +587,13 @@ 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)
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry object or rejects with an error.
|
||||
* @returns {Promise<Entry>} 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> {
|
||||
static copyDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<Entry> {
|
||||
if ((/^\//.test(newDirName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'directory cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return this.resolveDirectoryUrl(path)
|
||||
@@ -587,13 +660,13 @@ 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
|
||||
* @returns {Promise<boolean|FileError>} Returns a Promise that resolves with a boolean or rejects with an error.
|
||||
* @returns {Promise<boolean>} Returns a Promise that resolves with a boolean or rejects with an error.
|
||||
*/
|
||||
static checkFile(path: string, file: string): Promise<boolean|FileError> {
|
||||
static checkFile(path: string, file: string): Promise<boolean> {
|
||||
if ((/^\//.test(file))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveLocalFilesystemUrl(path + file)
|
||||
@@ -616,13 +689,13 @@ 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
|
||||
* @returns {Promise<FileEntry|FileError>} Returns a Promise that resolves to a FileEntry or rejects with an error.
|
||||
* @returns {Promise<FileEntry>} Returns a Promise that resolves to a FileEntry or rejects with an error.
|
||||
*/
|
||||
static createFile(path: string, fileName: string, replace: boolean): Promise<FileEntry|FileError> {
|
||||
static createFile(path: string, fileName: string, replace: boolean): Promise<FileEntry> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
let options: Flags = {
|
||||
@@ -644,13 +717,13 @@ 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
|
||||
* @returns {Promise<RemoveResult|FileError>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
* @returns {Promise<RemoveResult>} Returns a Promise that resolves to a RemoveResult or rejects with an error.
|
||||
*/
|
||||
static removeFile(path: string, fileName: string): Promise<RemoveResult|FileError> {
|
||||
static removeFile(path: string, fileName: string): Promise<RemoveResult> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -671,7 +744,7 @@ export class File {
|
||||
* @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<any> {
|
||||
text: string | Blob | ArrayBuffer, options: WriteOptions = {}): Promise<any> {
|
||||
if ((/^\//.test(fileName))) {
|
||||
const err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
@@ -700,7 +773,7 @@ export class File {
|
||||
* @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) {
|
||||
private static writeFileEntry(fe: FileEntry, text: string | Blob | ArrayBuffer, options: WriteOptions) {
|
||||
return File.createWriter(fe)
|
||||
.then((writer) => {
|
||||
if (options.append) {
|
||||
@@ -725,7 +798,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> {
|
||||
return File.writeFile(path, fileName, text, { create: false });
|
||||
return File.writeFile(path, fileName, text, { replace: true });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -733,13 +806,13 @@ 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.
|
||||
* @returns {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string or rejects with an error.
|
||||
* @returns {Promise<string>} 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> {
|
||||
static readAsText(path: string, file: string): Promise<string> {
|
||||
if ((/^\//.test(file))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -774,13 +847,13 @@ 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.
|
||||
* @returns {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>} 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> {
|
||||
static readAsDataURL(path: string, file: string): Promise<string> {
|
||||
if ((/^\//.test(file))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -816,13 +889,13 @@ 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.
|
||||
* @returns {Promise<string|FileError>} Returns a Promise that resolves with the contents of the file as string rejects with an error.
|
||||
* @returns {Promise<string>} 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> {
|
||||
static readAsBinaryString(path: string, file: string): Promise<string> {
|
||||
if ((/^\//.test(file))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -857,13 +930,13 @@ 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.
|
||||
* @returns {Promise<ArrayBuffer|FileError>} Returns a Promise that resolves with the contents of the file as ArrayBuffer or rejects with an error.
|
||||
* @returns {Promise<ArrayBuffer>} 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> {
|
||||
static readAsArrayBuffer(path: string, file: string): Promise<ArrayBuffer> {
|
||||
if ((/^\//.test(file))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file-name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return File.resolveDirectoryUrl(path)
|
||||
@@ -900,15 +973,15 @@ 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)
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to the new Entry or rejects with an error.
|
||||
* @returns {Promise<Entry>} 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> {
|
||||
static moveFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<Entry> {
|
||||
newFileName = newFileName || fileName;
|
||||
|
||||
if ((/^\//.test(newFileName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return this.resolveDirectoryUrl(path)
|
||||
@@ -930,15 +1003,15 @@ 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)
|
||||
* @returns {Promise<Entry|FileError>} Returns a Promise that resolves to an Entry or rejects with an error.
|
||||
* @returns {Promise<Entry>} 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> {
|
||||
static copyFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<Entry> {
|
||||
newFileName = newFileName || fileName;
|
||||
|
||||
if ((/^\//.test(newFileName))) {
|
||||
let err = new FileError(5);
|
||||
err.message = 'file name cannot start with \/';
|
||||
return Promise.reject<FileError>(err);
|
||||
return Promise.reject<any>(err);
|
||||
}
|
||||
|
||||
return this.resolveDirectoryUrl(path)
|
||||
@@ -953,14 +1026,13 @@ export class File {
|
||||
});
|
||||
}
|
||||
|
||||
// these private methods help avoid cascading error handling
|
||||
// in the public ones, primarily simply wrapping callback
|
||||
// operations to return Promises that can then be chained.
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private static fillErrorMessage(err: FileError): void {
|
||||
err.message = File.cordovaFileError[err.code];
|
||||
try {
|
||||
err.message = File.cordovaFileError[err.code];
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1133,7 +1205,7 @@ export class File {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private static write(writer: FileWriter, gu: string | Blob): Promise<any> {
|
||||
private static write(writer: FileWriter, gu: string | Blob | ArrayBuffer): Promise<any> {
|
||||
if (gu instanceof Blob) {
|
||||
return this.writeFileInChunks(writer, gu);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ declare var window: any;
|
||||
* import {FilePath} from 'ionic-native';
|
||||
*
|
||||
* FilePath.resolveNativePath(path)
|
||||
* .then(filePath => console.log(filePath);
|
||||
* .catch(err => console.log(err);
|
||||
* .then(filePath => console.log(filePath))
|
||||
* .catch(err => console.log(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -26,6 +26,7 @@ declare var window: any;
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FilePath {
|
||||
|
||||
/**
|
||||
* Resolve native path for given content URL/path.
|
||||
* @param {String} path Content URL/path.
|
||||
@@ -33,4 +34,5 @@ export class FilePath {
|
||||
*/
|
||||
@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,6 +173,14 @@ export interface FileTransferError {
|
||||
* cd files
|
||||
* ls
|
||||
* ```
|
||||
*
|
||||
* To store files in a different/publicly accessible directory, please refer to the following link
|
||||
* https://github.com/apache/cordova-plugin-file#where-to-store-files
|
||||
*
|
||||
* @interfaces
|
||||
* FileUploadOptions
|
||||
* FileUploadResult
|
||||
* FileTransferError
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileTransfer',
|
||||
|
||||
68
src/plugins/fingerprint-aio.ts
Normal file
68
src/plugins/fingerprint-aio.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
|
||||
export interface FingerprintOptions {
|
||||
/**
|
||||
* Key for platform keychain
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Secret password. Only for android
|
||||
*/
|
||||
clientSecret?: string;
|
||||
|
||||
/**
|
||||
* Disable 'use backup' option. Only for android (optional)
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
* disableBackup:true //Only for Android(optional)
|
||||
* })
|
||||
* .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; }
|
||||
|
||||
}
|
||||
218
src/plugins/firebase.ts
Normal file
218
src/plugins/firebase.ts
Normal file
@@ -0,0 +1,218 @@
|
||||
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; }
|
||||
|
||||
/**
|
||||
* Check permission to recieve push notifications
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static hasPermission(): 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 the name of the current screen in Analytics
|
||||
* @param name {string} Screen name
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setScreenName(name: string): 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.
|
||||
|
||||
@@ -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,8 +74,6 @@ 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({
|
||||
pluginName: 'Geofence',
|
||||
plugin: 'cordova-plugin-geofence',
|
||||
|
||||
@@ -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
|
||||
@@ -145,6 +149,7 @@ export interface GeolocationOptions {
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation'
|
||||
})
|
||||
export class Geolocation {
|
||||
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
@@ -162,7 +167,7 @@ export class Geolocation {
|
||||
*
|
||||
* ```typescript
|
||||
* var subscription = Geolocation.watchPosition()
|
||||
* .filter((p) => p.code === undefined) //Filter Out Errors
|
||||
* .filter((p) => p.coords !== undefined) //Filter Out Errors
|
||||
* .subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
@@ -182,4 +187,5 @@ export class Geolocation {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
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 {
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
* @description
|
||||
@@ -8,6 +7,9 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
* GooglePlus.login()
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -21,34 +23,37 @@ import { Cordova, Plugin } from './plugin';
|
||||
})
|
||||
export class GooglePlus {
|
||||
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@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,6 +10,20 @@ 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({
|
||||
pluginName: 'GoogleAnalytics',
|
||||
@@ -20,6 +33,7 @@ declare var window;
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
export class GoogleAnalytics {
|
||||
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
@@ -27,7 +41,10 @@ export class GoogleAnalytics {
|
||||
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -108,7 +125,7 @@ export class GoogleAnalytics {
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param key {string}
|
||||
* @param key {number}
|
||||
* @param value {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@@ -187,4 +204,5 @@ export class GoogleAnalytics {
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Cordova, CordovaInstance, Plugin, InstanceProperty, getPlugin, pluginWarn } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
declare var plugin: any;
|
||||
|
||||
@@ -36,6 +37,18 @@ export const GoogleMapsAnimation = {
|
||||
DROP: 'DROP'
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export const GoogleMapsMapTypeId = {
|
||||
HYBRID: 'MAP_TYPE_HYBRID',
|
||||
NONE: 'MAP_TYPE_NONE',
|
||||
NORMAL: 'MAP_TYPE_NORMAL',
|
||||
ROADMAP: 'MAP_TYPE_ROADMAP',
|
||||
SATELLITE: 'MAP_TYPE_SATELLITE',
|
||||
TERAIN: 'MAP_TYPE_TERRAIN'
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Google Maps
|
||||
* @description This plugin uses the native Google Maps SDK
|
||||
@@ -47,7 +60,8 @@ export const GoogleMapsAnimation = {
|
||||
* GoogleMapsLatLng,
|
||||
* CameraPosition,
|
||||
* GoogleMapsMarkerOptions,
|
||||
* GoogleMapsMarker
|
||||
* GoogleMapsMarker,
|
||||
* GoogleMapsMapTypeId
|
||||
* } from 'ionic-native';
|
||||
*
|
||||
* export class MapPage {
|
||||
@@ -60,8 +74,9 @@ export const GoogleMapsAnimation = {
|
||||
*
|
||||
* loadMap() {
|
||||
* // make sure to create following structure in your view.html file
|
||||
* // and add a height (for example 100%) to it, else the map won't be visible
|
||||
* // <ion-content>
|
||||
* // <div #map id="map"></div>
|
||||
* // <div #map id="map" style="height:100%;"></div>
|
||||
* // </ion-content>
|
||||
*
|
||||
* // create a new map by passing HTMLElement
|
||||
@@ -69,9 +84,6 @@ export const GoogleMapsAnimation = {
|
||||
*
|
||||
* let map = new GoogleMap(element);
|
||||
*
|
||||
* // listen to MAP_READY event
|
||||
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
|
||||
*
|
||||
* // create LatLng object
|
||||
* let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
|
||||
*
|
||||
@@ -82,8 +94,12 @@ export const GoogleMapsAnimation = {
|
||||
* tilt: 30
|
||||
* };
|
||||
*
|
||||
* // move the map's camera to position
|
||||
* map.moveCamera(position);
|
||||
* // listen to MAP_READY event
|
||||
* map.one(GoogleMapsEvent.MAP_READY).then(() => {
|
||||
* // move the map's camera to position
|
||||
* map.moveCamera(position); // works on iOS and Android
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // create new marker
|
||||
* let markerOptions: GoogleMapsMarkerOptions = {
|
||||
@@ -96,7 +112,6 @@ export const GoogleMapsAnimation = {
|
||||
* marker.showInfoWindow();
|
||||
* });
|
||||
* }
|
||||
*
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@@ -118,7 +133,7 @@ export class GoogleMap {
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
constructor(element: string|HTMLElement, options?: any) {
|
||||
constructor(element: string | HTMLElement, options?: any) {
|
||||
if (!!getPlugin('plugin.google.maps.Map')) {
|
||||
if (typeof element === 'string') {
|
||||
element = document.getElementById(<string>element);
|
||||
@@ -132,12 +147,50 @@ export class GoogleMap {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(event: any): Observable<any> {
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
@@ -146,7 +199,7 @@ export class GoogleMap {
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
@@ -157,15 +210,21 @@ export class GoogleMap {
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(event: any): Promise<any> {
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(event, resolve)
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setDebuggable(isDebuggable: boolean): void { }
|
||||
|
||||
@@ -212,7 +271,7 @@ export class GoogleMap {
|
||||
setZoom(zoomLevel: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setMapTypeId(typeId: string): void { }
|
||||
setMapTypeId(mapTypeId: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setTilt(tiltLevel: number): void { }
|
||||
@@ -575,12 +634,26 @@ export class GoogleMapsMarker {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -588,7 +661,7 @@ export class GoogleMapsMarker {
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
@@ -596,9 +669,49 @@ export class GoogleMapsMarker {
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
/**
|
||||
* Return true if the marker is visible
|
||||
*/
|
||||
@@ -796,15 +909,84 @@ export class GoogleMapsCircle {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getCenter(): GoogleMapsLatLng { return; }
|
||||
|
||||
@@ -866,15 +1048,84 @@ export interface GoogleMapsPolylineOptions {
|
||||
export class GoogleMapsPolyline {
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@@ -937,15 +1188,84 @@ export class GoogleMapsPolygon {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@@ -1010,6 +1330,84 @@ export class GoogleMapsTileOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@@ -1061,6 +1459,84 @@ export class GoogleMapsGroundOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setBearing(bearing: number): void { }
|
||||
|
||||
@@ -1103,6 +1579,84 @@ export class GoogleMapsKmlOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void { }
|
||||
|
||||
@@ -1116,9 +1670,9 @@ export class GoogleMapsKmlOverlay {
|
||||
export class GoogleMapsLatLngBounds {
|
||||
private _objectInstance: any;
|
||||
|
||||
@InstanceProperty get northeast(): GoogleMapsLatLng { return; }
|
||||
@InstanceProperty get southwest(): GoogleMapsLatLng { return; }
|
||||
@InstanceProperty get type(): string { return; }
|
||||
@InstanceProperty northeast: GoogleMapsLatLng;
|
||||
@InstanceProperty southwest: GoogleMapsLatLng;
|
||||
@InstanceProperty type: string;
|
||||
|
||||
constructor(southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], northeast?: GoogleMapsLatLng) {
|
||||
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
|
||||
|
||||
100
src/plugins/gyroscope.ts
Normal file
100
src/plugins/gyroscope.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
import { Plugin, Cordova} from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
/**
|
||||
* Interface that represent output data
|
||||
*/
|
||||
export interface GyroscopeOrientation {
|
||||
/**
|
||||
* Represent x-axis
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* Represent y-axis
|
||||
*/
|
||||
y: number;
|
||||
|
||||
/**
|
||||
* Represent z-axis
|
||||
*/
|
||||
z: number;
|
||||
|
||||
/**
|
||||
* Represent timestamp of sensor read. Default is 10000ms
|
||||
*/
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface that represent option data
|
||||
*/
|
||||
export interface GyroscopeOptions {
|
||||
/**
|
||||
* Represent how often (in milliseconds) sensor should be read. Default is 10000 ms
|
||||
*/
|
||||
frequency: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Gyroscope
|
||||
* @description Read Gyroscope sensor data
|
||||
* @usage
|
||||
* ```
|
||||
* import { Gyroscope, GyroscopeOrientation, GyroscopeOptions } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let options: GyroscopeOptions = {
|
||||
* frequency: 1000
|
||||
* };
|
||||
*
|
||||
* Gyroscope.getCurrent(options)
|
||||
* .then((orientation: GyroscopeOrientation) => {
|
||||
* console.log(orientation.x, orientation.y, orientation.z, orientation.timestamp);
|
||||
* })
|
||||
* .catch()
|
||||
*
|
||||
*
|
||||
* Gyroscope.watch()
|
||||
* .subscribe((orientation: GyroscopeOrientation) => {
|
||||
* console.log(orientation.x, orientation.y, orientation.z, orientation.timestamp);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Gyroscope',
|
||||
plugin: 'cordova-plugin-gyroscope',
|
||||
pluginRef: 'navigator.gyroscope',
|
||||
repo: 'https://github.com/NeoLSN/cordova-plugin-gyroscope',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
|
||||
export class Gyroscope {
|
||||
|
||||
/**
|
||||
* Watching for gyroscope sensor changes
|
||||
* @param options {GyroscopeOptions} (optional)
|
||||
* @return {Observable<GyroscopeOrientation>} Returns an Observable that resolves GyroscopeOrientation
|
||||
*/
|
||||
static watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
|
||||
return new Observable<GyroscopeOrientation> (
|
||||
(observer: any) => {
|
||||
let watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
return () => navigator.gyroscope.clearWatch(watchId);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current data from gyroscope sensor
|
||||
* @param options {GyroscopeOptions} (optional)
|
||||
* @return {Promise<GyroscopeOrientation>} Returns a promise that resolves GyroscopeOrientation
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getCurrent(options?: GyroscopeOptions): Promise<GyroscopeOrientation> { return; }
|
||||
}
|
||||
36
src/plugins/headercolor.ts
Normal file
36
src/plugins/headercolor.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name HeaderColor
|
||||
* @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; }
|
||||
|
||||
}
|
||||
303
src/plugins/health.ts
Normal file
303
src/plugins/health.ts
Normal file
@@ -0,0 +1,303 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
export interface HealthQueryOptions {
|
||||
/**
|
||||
* Start date from which to get data
|
||||
*/
|
||||
startDate: Date;
|
||||
|
||||
/**
|
||||
* End date from which to get data
|
||||
*/
|
||||
endDate: Date;
|
||||
|
||||
/**
|
||||
* Datatype to be queried (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
dataType: string;
|
||||
|
||||
/**
|
||||
* Optional limit the number of values returned. Defaults to 1000
|
||||
*/
|
||||
limit?: number;
|
||||
|
||||
/**
|
||||
* Optional indicator to sort values ascending or descending
|
||||
*/
|
||||
ascending?: boolean;
|
||||
|
||||
/**
|
||||
* In Android, it is possible to query for "raw" steps or to select those as filtered by the Google Fit app.
|
||||
* In the latter case the query object must contain the field filtered: true.
|
||||
*/
|
||||
filtered?: boolean;
|
||||
}
|
||||
|
||||
export interface HealthQueryOptionsAggregated {
|
||||
/**
|
||||
* Start date from which to get data
|
||||
*/
|
||||
startDate: Date;
|
||||
|
||||
/**
|
||||
* End date from which to get data
|
||||
*/
|
||||
endDate: Date;
|
||||
|
||||
/**
|
||||
* Datatype to be queried (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
dataType: string;
|
||||
|
||||
/**
|
||||
* if specified, aggregation is grouped an array of "buckets" (windows of time),
|
||||
* supported values are: 'hour', 'day', 'week', 'month', 'year'.
|
||||
*/
|
||||
bucket: string;
|
||||
}
|
||||
|
||||
export interface HealthStoreOptions {
|
||||
/**
|
||||
* Start date from which to get data
|
||||
*/
|
||||
startDate: Date;
|
||||
|
||||
/**
|
||||
* End date from which to get data
|
||||
*/
|
||||
endDate: Date;
|
||||
|
||||
/**
|
||||
* Datatype to be queried (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
dataType: string;
|
||||
|
||||
/**
|
||||
* Value of corresponding Datatype (see "Overview of valid datatypes")
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/*
|
||||
* The source that produced this data. In iOS this is ignored and
|
||||
* set automatically to the name of your app.
|
||||
*/
|
||||
sourceName: string;
|
||||
|
||||
/*
|
||||
* The complete package of the source that produced this data.
|
||||
* In Android, if not specified, it's assigned to the package of the App. In iOS this is ignored and
|
||||
* set automatically to the bunde id of the app.
|
||||
*/
|
||||
sourceBundleId: string;
|
||||
}
|
||||
|
||||
export interface HealthData {
|
||||
/**
|
||||
* Start date from which to get data
|
||||
*/
|
||||
startDate: Date;
|
||||
|
||||
/**
|
||||
* End date from which to get data
|
||||
*/
|
||||
endDate: Date;
|
||||
|
||||
/**
|
||||
* Value of corresponding Datatype (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* Unit of corresponding value of Datatype (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
unit: string;
|
||||
|
||||
/**
|
||||
* The source that produced this data. In iOS this is ignored and
|
||||
* set automatically to the name of your app.
|
||||
*/
|
||||
sourceName: string;
|
||||
|
||||
/**
|
||||
* The complete package of the source that produced this data.
|
||||
* In Android, if not specified, it's assigned to the package of the App. In iOS this is ignored and
|
||||
* set automatically to the bunde id of the app.
|
||||
*/
|
||||
sourceBundleId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Health
|
||||
* @description
|
||||
* A plugin that abstracts fitness and health repositories like Apple HealthKit or Google Fit.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Health } from 'ionic-native';
|
||||
*
|
||||
* ```
|
||||
* See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.
|
||||
* @interfaces
|
||||
* HealthQueryOptions
|
||||
* HealthQueryOptionsAggregated
|
||||
* HealthStoreOptions
|
||||
* HealthData
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'Health',
|
||||
plugin: 'cordova-plugin-health',
|
||||
pluginRef: 'navigator.health',
|
||||
repo: 'https://github.com/dariosalvi78/cordova-plugin-health'
|
||||
})
|
||||
export class Health {
|
||||
|
||||
/**
|
||||
* Tells if either Google Fit or HealthKit are available.
|
||||
*
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static isAvailable(): Promise<boolean> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if recent Google Play Services and Google Fit are installed. If the play services are not installed,
|
||||
* or are obsolete, it will show a pop-up suggesting to download them. If Google Fit is not installed,
|
||||
* it will open the Play Store at the location of the Google Fit app.
|
||||
* The plugin does not wait until the missing packages are installed, it will return immediately.
|
||||
* If both Play Services and Google Fit are available, this function just returns without any visible effect.
|
||||
*
|
||||
* This function is only available on Android.
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static promptInstallFit(): Promise<any> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Requests read and write access to a set of data types. It is recommendable to always explain why the app
|
||||
* needs access to the data before asking the user to authorize it.
|
||||
* This function must be called before using the query and store functions, even if the authorization has already
|
||||
* been given at some point in the past.
|
||||
*
|
||||
* Quirks of requestAuthorization()
|
||||
|
||||
* In Android, it will try to get authorization from the Google Fit APIs.
|
||||
* It is necessary that the app's package name and the signing key are registered in the Google API console.
|
||||
* In Android, be aware that if the activity is destroyed (e.g. after a rotation) or is put in background,
|
||||
* the connection to Google Fit may be lost without any callback. Going through the authorization will ensure that
|
||||
* the app is connected again.
|
||||
* In Android 6 and over, this function will also ask for some dynamic permissions if needed
|
||||
* (e.g. in the case of "distance", it will need access to ACCESS_FINE_LOCATION).
|
||||
*
|
||||
* @param {Array<String>} datatypes a list of data types you want to be granted access to
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestAuthorization(datatypes: Array<string>): Promise<any> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if the app has authorization to read/write a set of datatypes.
|
||||
* This function is similar to requestAuthorization() and has similar quirks.
|
||||
*
|
||||
* @param {Array<String>} datatypes a list of data types you want to be granted access to
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAuthorized(datatypes: Array<string>): Promise<any> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets all the data points of a certain data type within a certain time window.
|
||||
* Warning: if the time span is big, it can generate long arrays!
|
||||
*
|
||||
* Quirks of query()
|
||||
*
|
||||
* In iOS, the amount of datapoints is limited to 1000 by default.
|
||||
* You can override this by adding a limit: xxx to your query object.
|
||||
* In iOS, datapoints are ordered in an descending fashion (from newer to older).
|
||||
* You can revert this behaviour by adding ascending: true to your query object.
|
||||
* In Android, it is possible to query for "raw" steps or to select those as filtered by the Google Fit app.
|
||||
* In the latter case the query object must contain the field filtered: true.
|
||||
* In Google Fit, calories.basal is returned as an average per day, and usually is not available in all days.
|
||||
* In Google Fit, calories.active is computed by subtracting the basal calories from the total.
|
||||
* As basal energy expenditure, an average is computed from the week before endDate.
|
||||
* While Google Fit calculates basal and active calories automatically,
|
||||
* HealthKit needs an explicit input from some app.
|
||||
* When querying for activities, Google Fit is able to determine some activities automatically
|
||||
* (still, walking, running, biking, in vehicle), while HealthKit only relies on the input of
|
||||
* the user or of some external app.
|
||||
* When querying for activities, calories and distance are also provided in HealthKit (units are kcal and meters) and
|
||||
* never in Google Fit.
|
||||
* When querying for nutrition, Google Fit always returns all the nutrition elements it has,
|
||||
* while HealthKit returns only those that are stored as correlation. To be sure to get all stored the quantities
|
||||
* (regardless of they are stored as correlation or not), it's better to query single nutrients.
|
||||
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
|
||||
* Automatic conversion is not trivial and depends on the actual substance.
|
||||
*
|
||||
* @param queryOptions {HealthQueryOptions}
|
||||
* @return {Promise<HealthData>}
|
||||
*/
|
||||
@Cordova()
|
||||
static query(queryOptions: HealthQueryOptions): Promise<HealthData> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity.
|
||||
*
|
||||
* Quirks of queryAggregated()
|
||||
* In Android, to query for steps as filtered by the Google Fit app, the flag filtered:
|
||||
* true must be added into the query object.
|
||||
* When querying for activities, calories and distance are provided
|
||||
* when available in HealthKit and never in Google Fit.
|
||||
* In Android, the start and end dates returned are the date of the first and the last available samples.
|
||||
* If no samples are found, start and end may not be set.
|
||||
* When bucketing, buckets will include the whole hour / day / month / week / year where start and end times
|
||||
* fall into. For example, if your start time is 2016-10-21 10:53:34,
|
||||
* the first daily bucket will start at 2016-10-21 00:00:00.
|
||||
* Weeks start on Monday.
|
||||
* When querying for nutrition, HealthKit returns only those that are stored as correlation.
|
||||
* To be sure to get all the stored quantities, it's better to query single nutrients.
|
||||
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
|
||||
*
|
||||
* @param queryOptionsAggregated {HealthQueryOptionsAggregated}
|
||||
* @return {Promise<HealthData[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
static queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise<HealthData[]> {
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stores a data point.
|
||||
*
|
||||
* Quirks of store()
|
||||
*
|
||||
* Google Fit doesn't allow you to overwrite data points that overlap with others already stored of the same type (see here). At the moment there is no support for update nor delete.
|
||||
* In iOS you cannot store the total calories, you need to specify either basal or active. If you use total calories, the active ones will be stored.
|
||||
* In Android you can only store active calories, as the basal are estimated automatically. If you store total calories, these will be treated as active.
|
||||
* In iOS distance is assumed to be of type WalkingRunning, if you want to explicitly set it to Cycling you need to add the field cycling: true.
|
||||
* In iOS storing the sleep activities is not supported at the moment.
|
||||
* Storing of nutrients is not supported at the moment.
|
||||
* @param storeOptions
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static store(storeOptions: HealthStoreOptions): 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,6 +116,11 @@ import { Cordova, Plugin } from './plugin';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HotspotConnectionInfo
|
||||
* HotspotNetwork
|
||||
* HotspotNetworkConfig
|
||||
* HotspotDevice
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Hotspot',
|
||||
@@ -210,10 +318,10 @@ export class Hotspot {
|
||||
static getNetConfig(): Promise<HotspotNetworkConfig> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<ConnectionInfo>}
|
||||
* @returns {Promise<HotspotConnectionInfo>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> { return; }
|
||||
static getConnectionInfo(): Promise<HotspotConnectionInfo> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<string>}
|
||||
@@ -260,94 +368,3 @@ export class Hotspot {
|
||||
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
|
||||
@@ -137,22 +157,3 @@ export class HTTP {
|
||||
@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,6 +38,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HttpdOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Httpd',
|
||||
@@ -40,7 +59,7 @@ export class Httpd {
|
||||
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,7 +135,7 @@ export interface PluginResult {
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface Delegate {
|
||||
export interface IBeaconDelegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
@@ -151,9 +150,9 @@ export interface Delegate {
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
* @returns {Observable<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.
|
||||
*
|
||||
*
|
||||
* @returns {Observable<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,6 +265,13 @@ export interface Delegate {
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* Beacon
|
||||
* BeaconRegion
|
||||
* CircularRegion
|
||||
* IBeaconPluginResult
|
||||
* IBeaconDelegate
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: '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;
|
||||
}
|
||||
);
|
||||
@@ -387,33 +393,33 @@ export class IBeacon {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Delegate} 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.
|
||||
*
|
||||
* @returns {Delegate} 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.
|
||||
*
|
||||
@@ -540,11 +546,11 @@ export class IBeacon {
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise which is resolved with the
|
||||
* @returns {Promise<IBeaconPluginResult>} Returns a promise which is resolved with the
|
||||
* requested authorization status.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static getAuthorizationStatus(): Promise<any> { return; }
|
||||
static getAuthorizationStatus(): Promise<IBeaconPluginResult> { return; }
|
||||
|
||||
/**
|
||||
* For iOS 8 and above only. The permission model has changed by Apple in iOS 8, making it necessary for apps to
|
||||
@@ -560,7 +566,7 @@ export class IBeacon {
|
||||
|
||||
|
||||
/**
|
||||
* See the docuemntation of {@code requestWhenInUseAuthorization} for further details.
|
||||
* See the documentation of {@code requestWhenInUseAuthorization} for further details.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when the native layer
|
||||
* shows the request dialog.
|
||||
@@ -611,7 +617,7 @@ 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.
|
||||
|
||||
@@ -20,6 +20,11 @@ export interface ImagePickerOptions {
|
||||
* Quality of images, defaults to 100
|
||||
*/
|
||||
quality?: number;
|
||||
|
||||
/**
|
||||
* Output type, defaults to 0 (FILE_URI).
|
||||
*/
|
||||
outputType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,6 +65,8 @@ export interface ImageResizerOptions {
|
||||
* () => { console.log('Error occured'); }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ImageResizerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ImageResizer',
|
||||
|
||||
@@ -3,6 +3,50 @@ import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface InAppBrowserOptions {
|
||||
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
|
||||
location?: 'yes' | 'no';
|
||||
/** Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
|
||||
* Omit or set to no (default) to have the browser open and load normally. */
|
||||
hidden?: 'yes' | 'no';
|
||||
/** Set to yes to have the browser's cookie cache cleared before the new window is opened. */
|
||||
clearcache?: 'yes';
|
||||
/** Set to yes to have the session cookie cache cleared before the new window is opened. */
|
||||
clearsessioncache?: 'yes';
|
||||
/** (Android Only) set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
|
||||
zoom?: 'yes' | 'no';
|
||||
/** Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
|
||||
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser. */
|
||||
hardwareback?: 'yes' | 'no';
|
||||
/** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */
|
||||
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
|
||||
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
|
||||
shouldPauseOnSuspend?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
|
||||
closebuttoncaption?: string;
|
||||
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
|
||||
disallowoverscroll?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */
|
||||
toolbar?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */
|
||||
enableViewportScale?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
|
||||
* The HTML's video element must also include the webkit-playsinline attribute (defaults to no) */
|
||||
allowInlineMediaPlayback?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
|
||||
keyboardDisplayRequiresUserAction?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no). */
|
||||
suppressesIncrementalRendering?: 'yes' | 'no';
|
||||
/** (iOS Only) Set to pagesheet, formsheet or fullscreen to set the presentation style (defaults to fullscreen). */
|
||||
presentationstyle?: 'pagesheet' | 'formsheet' | 'fullscreen';
|
||||
/** (iOS Only) Set to fliphorizontal, crossdissolve or coververtical to set the transition style (defaults to coververtical). */
|
||||
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
|
||||
/** (iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window. */
|
||||
toolbarposition?: 'top' | 'bottom';
|
||||
/** (Windows only) Set to yes to create the browser control without a border around it.
|
||||
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
|
||||
fullscreen?: 'yes';
|
||||
}
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
@@ -29,6 +73,9 @@ export interface InAppBrowserEvent extends Event {
|
||||
* browser.insertCSS(...);
|
||||
* browser.close();
|
||||
* ```
|
||||
* @interfaces
|
||||
* InAppBrowserEvent
|
||||
* InAppBrowserOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'InAppBrowser',
|
||||
@@ -38,13 +85,6 @@ export interface InAppBrowserEvent extends Event {
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static open(url: string, target?: string, options?: string): void {
|
||||
console.warn('Native: Your current usage of the InAppBrowser plugin is deprecated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.');
|
||||
}
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
/**
|
||||
@@ -55,8 +95,12 @@ export class InAppBrowser {
|
||||
* The options string must not contain any blank space, and each feature's
|
||||
* name/value pairs must be separated by a comma. Feature names are case insensitive.
|
||||
*/
|
||||
constructor(url: string, target?: string, options?: string) {
|
||||
constructor(url: string, target?: string, options?: InAppBrowserOptions);
|
||||
constructor(url: string, target?: string, options?: string);
|
||||
constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
|
||||
try {
|
||||
if (options && typeof options !== 'string')
|
||||
options = Object.keys(options).map(key => `${key}=${options[key]}`).join(',');
|
||||
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
|
||||
} catch (e) {
|
||||
window.open(url);
|
||||
@@ -68,33 +112,37 @@ export class InAppBrowser {
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
show(): void { }
|
||||
|
||||
/**
|
||||
* Closes the InAppBrowser window.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
close(): void { }
|
||||
|
||||
/**
|
||||
* Hides an InAppBrowser window that is currently shown. Calling this has no effect
|
||||
* if the InAppBrowser was already hidden.
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
hide(): void { }
|
||||
|
||||
/**
|
||||
* 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; }
|
||||
executeScript(script: { file?: string, code?: string }): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param {Object} 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.
|
||||
@@ -107,4 +155,5 @@ export class InAppBrowser {
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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,6 +79,8 @@ export interface LaunchNavigatorOptions {
|
||||
* error => console.log('Error launching navigator', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* LaunchNavigatorOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LaunchNavigator',
|
||||
|
||||
@@ -1,5 +1,94 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface ILocalNotification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
* Default: 0
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* First row of the notification
|
||||
* Default: Empty string (iOS) or the app name (Android)
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Second row of the notification
|
||||
* Default: Empty string
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||
* Default: 0 (which means that the system triggers the local notification once)
|
||||
*/
|
||||
every?: string;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: any;
|
||||
firstAt?: any;
|
||||
|
||||
/**
|
||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||
* Default: 0 (which means don't show a number)
|
||||
*/
|
||||
badge?: number;
|
||||
|
||||
/**
|
||||
* Uri of the file containing the sound to play when an alert is displayed
|
||||
* Default: res://platform_default
|
||||
*/
|
||||
sound?: string;
|
||||
|
||||
/**
|
||||
* Arbitrary data, objects will be encoded to JSON string
|
||||
* Default: null
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the icon that is shown in the ticker and notification
|
||||
* Default: res://icon
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
||||
* Default: res://ic_popup_reminder
|
||||
*/
|
||||
smallIcon?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* RGB value for the background color of the smallIcon.
|
||||
* Default: Androids COLOR_DEFAULT, which will vary based on Android version.
|
||||
*/
|
||||
color?: string;
|
||||
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Ongoing notifications differ from regular notifications in the following ways:
|
||||
* - They are sorted above the regular notifications in the notification panel
|
||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||
* Default: false
|
||||
*/
|
||||
ongoing?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* ARGB value that you would like the LED on the device to blink
|
||||
* Default: FFFFFF
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
@@ -14,7 +103,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: 'Single Notification',
|
||||
* text: 'Single ILocalNotification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret: key }
|
||||
* });
|
||||
@@ -23,26 +112,27 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: 'Multi Notification 1',
|
||||
* text: 'Multi ILocalNotification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: 'Local Notification Example',
|
||||
* text: 'Multi Notification 2',
|
||||
* title: 'Local ILocalNotification Example',
|
||||
* text: 'Multi ILocalNotification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: 'Delayed Notification',
|
||||
* text: 'Delayed ILocalNotification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ILocalNotification
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
@@ -54,21 +144,21 @@ export class LocalNotifications {
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options {Notification | Array<Notification>} optional
|
||||
* @param options {Notification | Array<ILocalNotification>} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: Notification | Array<Notification>): void { }
|
||||
static schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options {Notification} optional
|
||||
* @param options {ILocalNotification} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: Notification): void { }
|
||||
static update(options?: ILocalNotification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
@@ -154,47 +244,47 @@ export class LocalNotifications {
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(notificationId: any): Promise<Notification> { return; }
|
||||
static get(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled(notificationId: any): Promise<Notification> { return; }
|
||||
static getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered(notificationId: any): Promise<Notification> { return; }
|
||||
static getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<Notification>> { return; }
|
||||
static getAll(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<Notification>> { return; }
|
||||
static getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<Notification>> { return; }
|
||||
static getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
@@ -223,86 +313,3 @@ export class LocalNotifications {
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
* Default: 0
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* First row of the notification
|
||||
* Default: Empty string (iOS) or the app name (Android)
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Second row of the notification
|
||||
* Default: Empty string
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||
* Default: 0 (which means that the system triggers the local notification once)
|
||||
*/
|
||||
every?: string;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: any;
|
||||
firstAt?: any;
|
||||
|
||||
/**
|
||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||
* Default: 0 (which means don't show a number)
|
||||
*/
|
||||
badge?: number;
|
||||
|
||||
/**
|
||||
* Uri of the file containing the sound to play when an alert is displayed
|
||||
* Default: res://platform_default
|
||||
*/
|
||||
sound?: string;
|
||||
|
||||
/**
|
||||
* Arbitrary data, objects will be encoded to JSON string
|
||||
* Default: null
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the icon that is shown in the ticker and notification
|
||||
* Default: res://icon
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
||||
* Default: res://ic_popup_reminder
|
||||
*/
|
||||
smallIcon?: string;
|
||||
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Ongoing notifications differ from regular notifications in the following ways:
|
||||
* - They are sorted above the regular notifications in the notification panel
|
||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||
* Default: false
|
||||
*/
|
||||
ongoing?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* ARGB value that you would like the LED on the device to blink
|
||||
* Default: FFFFFF
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin';
|
||||
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 in the format {success?: Function, failure?: Function}
|
||||
* @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,15 +1,119 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The full path of the file, including the name.
|
||||
*/
|
||||
fullPath: string;
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
lastModifiedDate: Date;
|
||||
/**
|
||||
* The size of the file, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Retrieves the format information of the media file.
|
||||
* @param {Function} successCallback
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
||||
}
|
||||
|
||||
export interface MediaFileData {
|
||||
/**
|
||||
* The actual format of the audio and video content.
|
||||
*/
|
||||
codecs: string;
|
||||
/**
|
||||
* The average bitrate of the content. The value is zero for images.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The length of the video or sound clip in seconds. The value is zero for images.
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
|
||||
export interface CaptureError {
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface CaptureAudioOptions {
|
||||
/**
|
||||
* Maximum number of audio clips. Defaults to 1.
|
||||
* On iOS you can only record one file.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration per video clip. This will be ignored on BlackBerry.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Quality of the video. This parameter can only be used with Android.
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
export interface ConfigurationData {
|
||||
/**
|
||||
* The ASCII-encoded lowercase string representing the media type.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture } from 'ionic-native';
|
||||
* import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
@@ -20,6 +124,14 @@ declare var navigator: any;
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MediaFile
|
||||
* MediaFileData
|
||||
* CaptureError
|
||||
* CaptureAudioOptions
|
||||
* CaptureImageOptions
|
||||
* CaptureVideoOptions
|
||||
* ConfigurationData
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MediaCapture',
|
||||
@@ -52,7 +164,7 @@ export class MediaCapture {
|
||||
/**
|
||||
* Start the audio recorder application and return information about captured audio clip files.
|
||||
* @param options
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -100,122 +212,3 @@ export class MediaCapture {
|
||||
static onPendingCaptureError(): Observable<CaptureError> { return; }
|
||||
|
||||
}
|
||||
/**
|
||||
* Encapsulates properties of a media capture file.
|
||||
*/
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The full path of the file, including the name.
|
||||
*/
|
||||
fullPath: string;
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
lastModifiedDate: Date;
|
||||
/**
|
||||
* The size of the file, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Retrieves the format information of the media file.
|
||||
* @param {Function} successCallback
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
codecs: string;
|
||||
/**
|
||||
* The average bitrate of the content. The value is zero for images.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The length of the video or sound clip in seconds. The value is zero for images.
|
||||
*/
|
||||
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.
|
||||
* On iOS you can only record one file.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration per video clip. This will be ignored on BlackBerry.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Quality of the video. This parameter can only be used with Android.
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -41,9 +45,7 @@ export interface MediaError {
|
||||
* });
|
||||
*
|
||||
* // get file duration
|
||||
* file.getDuration().then((duration) => {
|
||||
* console.log(position);
|
||||
* });
|
||||
* file.getDuration();
|
||||
*
|
||||
* // skip to 10 seconds (expects int value in ms)
|
||||
* file.seekTo(10000);
|
||||
@@ -223,6 +225,21 @@ export class MediaPlugin {
|
||||
})
|
||||
stopRecord(): void { }
|
||||
|
||||
/**
|
||||
* Pauses recording
|
||||
*/
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
pauseRecord(): void { }
|
||||
|
||||
/**
|
||||
* Resumes recording
|
||||
*/
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
resumeRecord(): void { }
|
||||
|
||||
/**
|
||||
* Stops playing an audio file.
|
||||
|
||||
@@ -85,7 +85,10 @@ export class Mixpanel {
|
||||
* @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,21 @@
|
||||
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;
|
||||
album:string;
|
||||
duration: number;
|
||||
elapsed:number;
|
||||
ticker: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name MusicControls
|
||||
* @description
|
||||
@@ -25,6 +41,11 @@ import { Observable } from 'rxjs/Observable';
|
||||
* hasNext : false, // show next button, optional, default: true
|
||||
* hasClose : true, // show close button, optional, default: false
|
||||
*
|
||||
* // iOS only, optional
|
||||
* album : 'Absolution' // optional, default: ''
|
||||
* duration : 60, // optional, default: 0
|
||||
* elapsed : 10, // optional, default: 0
|
||||
*
|
||||
* // Android only, optional
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
@@ -71,6 +92,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MusicControlsOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MusicControls',
|
||||
@@ -79,6 +102,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
repo: 'https://github.com/homerours/cordova-music-controls-plugin'
|
||||
})
|
||||
export class MusicControls {
|
||||
|
||||
/**
|
||||
* Create the media controls
|
||||
* @param options {MusicControlsOptions}
|
||||
@@ -113,17 +137,13 @@ export class MusicControls {
|
||||
* Toggle play/pause:
|
||||
* @param isPlaying {boolean}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
@Cordova()
|
||||
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;
|
||||
|
||||
/**
|
||||
* Toggle dismissable:
|
||||
* @param dismissable {boolean}
|
||||
*/
|
||||
@Cordova()
|
||||
static updateDismissable(dismissable: boolean): void {}
|
||||
}
|
||||
|
||||
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.street + " 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,
|
||||
@@ -36,60 +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;
|
||||
}
|
||||
|
||||
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,7 +40,7 @@ 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({
|
||||
pluginName: 'Network',
|
||||
@@ -52,10 +52,32 @@ declare var navigator: any;
|
||||
export class Network {
|
||||
|
||||
/**
|
||||
* Return the network connection type
|
||||
* Connection type
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static connection: string;
|
||||
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
|
||||
|
||||
@@ -47,6 +47,21 @@ export class NFC {
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @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
|
||||
@@ -56,25 +71,10 @@ export class NFC {
|
||||
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
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
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.
|
||||
@@ -152,6 +152,27 @@ export class NFC {
|
||||
*/
|
||||
@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; };
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -1,238 +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({
|
||||
pluginName: '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.
|
||||
* @returns {any}
|
||||
* 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
|
||||
* @returns {any}
|
||||
* 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; }
|
||||
|
||||
displayType: OSDisplayType;
|
||||
/**
|
||||
* @returns {any}
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
@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<any>} 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<any>} 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;
|
||||
@@ -293,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 { }
|
||||
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export class PayPalPayment {
|
||||
/**
|
||||
* Optional array of PayPalItem objects.
|
||||
*/
|
||||
items: string;
|
||||
items: Array<PayPalItem>;
|
||||
|
||||
/**
|
||||
* Optional customer shipping address, if your app wishes to provide this to the SDK.
|
||||
@@ -220,7 +220,7 @@ export class PayPalItem {
|
||||
* @param {String} currency: ISO standard currency code.
|
||||
* @param {String} sku: The stock keeping unit for this item. 50 characters max (optional)
|
||||
*/
|
||||
constructor(name: string, quantity: number, price: string, currency: string, sku: string) {
|
||||
constructor(name: string, quantity: number, price: string, currency: string, sku?: string) {
|
||||
this.name = name;
|
||||
this.quantity = quantity;
|
||||
this.price = price;
|
||||
@@ -246,7 +246,7 @@ export class PayPalItem {
|
||||
/**
|
||||
* The stock keeping unit for this item. 50 characters max (optional)
|
||||
*/
|
||||
sku: string;
|
||||
sku?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
103
src/plugins/pedometer.ts
Normal file
103
src/plugins/pedometer.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Interface of a pedometer data object which is returned by watching for new data or by recieving historical data
|
||||
*/
|
||||
|
||||
export interface IPedometerData {
|
||||
startDate?: number;
|
||||
endDate?: number;
|
||||
numberOfSteps: number;
|
||||
distance: number;
|
||||
floorsAscended: number;
|
||||
floorsDescended: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Pedometer
|
||||
* @description
|
||||
* Fetch pedestrian-related pedometer data,
|
||||
* such as step counts and other information about the distance travelled.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Pedometer } from 'ionic-native';
|
||||
*
|
||||
* Pedometer.isDistanceAvailable()
|
||||
* .then((available: boolean) => console.log(available))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* Pedometer.startPedometerUpdates()
|
||||
* .subscribe((data: IPedometerData) => {
|
||||
* console.log(data);
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Pedometer',
|
||||
plugin: 'cordova-plugin-pedometer',
|
||||
pluginRef: 'pedometer',
|
||||
repo: 'https://github.com/leecrossley/cordova-plugin-pedometer',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Pedometer {
|
||||
|
||||
/**
|
||||
* Checks if step counting is available. Only works on iOS.
|
||||
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
|
||||
*/
|
||||
@Cordova()
|
||||
static isStepCountingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Distance estimation indicates the ability to use step information to supply the approximate distance travelled by the user.
|
||||
* This capability is not supported on all devices, even with iOS 8.
|
||||
* Only works on iOS.
|
||||
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
|
||||
*/
|
||||
@Cordova()
|
||||
static isDistanceAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Floor counting indicates the ability to count the number of floors the user walks up or down using stairs.
|
||||
* This capability is not supported on all devices, even with iOS 8.
|
||||
* Only works on iOS.
|
||||
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
|
||||
*/
|
||||
@Cordova()
|
||||
static isFloorCountingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Starts the delivery of recent pedestrian-related data to your Cordova app.
|
||||
*
|
||||
* When the app is suspended, the delivery of updates stops temporarily.
|
||||
* Upon returning to foreground or background execution, the pedometer object begins updates again.
|
||||
* @return {Observable<IPedometerData>} Returns a Observable that recieves repeatly data from pedometer in background.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopPedometerUpdates'
|
||||
})
|
||||
static startPedometerUpdates(): Observable<IPedometerData> { return; }
|
||||
|
||||
/**
|
||||
* Stops the delivery of recent pedestrian data updates to your Cordova app.
|
||||
* @return {Promise<boolean>} Returns a promise that resolves when pedometer watching was stopped
|
||||
*/
|
||||
@Cordova()
|
||||
static stopPedometerUpdates(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieves the data between the specified start and end dates.
|
||||
* The startDate and endDate options are required and can be constructed in any valid JavaScript way
|
||||
* (e.g. new Date(2015, 4, 1, 15, 20, 00) is also valid, as is milliseconds).
|
||||
* Only works on iOS.
|
||||
* @param {any} options start date and en date where you want to get pedometer data
|
||||
* @return {Promise<IPedometerData>} Returns a promise that resolves when pedometer data found
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static queryData(options: { startDate: Date, endDate: Date }): Promise<IPedometerData> { return; }
|
||||
}
|
||||
207
src/plugins/photo-library.ts
Normal file
207
src/plugins/photo-library.ts
Normal file
@@ -0,0 +1,207 @@
|
||||
import { Plugin, Cordova, CordovaFiniteObservable } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name PhotoLibrary
|
||||
* @description
|
||||
* The PhotoLibrary plugin allows access to photos from device by url. So you can use plain img tag to display photos and their thumbnails, and different 3rd party libraries as well.
|
||||
* Saving photos and videos to the library is also supported.
|
||||
* cdvphotolibrary urls should be trusted by Angular. See plugin homepage to learn how.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PhotoLibrary } from 'ionic-native';
|
||||
*
|
||||
* PhotoLibrary.requestAuthorization().then(() => {
|
||||
* PhotoLibrary.getLibrary().subscribe({
|
||||
* next: library => {
|
||||
* library.forEach(function(libraryItem) {
|
||||
* console.log(libraryItem.id); // ID of the photo
|
||||
* console.log(libraryItem.photoURL); // Cross-platform access to photo
|
||||
* console.log(libraryItem.thumbnailURL);// Cross-platform access to thumbnail
|
||||
* console.log(libraryItem.fileName);
|
||||
* console.log(libraryItem.width);
|
||||
* console.log(libraryItem.height);
|
||||
* console.log(libraryItem.creationDate);
|
||||
* console.log(libraryItem.latitude);
|
||||
* console.log(libraryItem.longitude);
|
||||
* console.log(libraryItem.albumIds); // array of ids of appropriate AlbumItem, only of includeAlbumsData was used
|
||||
* });
|
||||
* },
|
||||
* error: err => {},
|
||||
* complete: () => { console.log("could not get photos"); }
|
||||
* });
|
||||
* })
|
||||
* .catch(err => console.log("permissions weren't granted"));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PhotoLibrary',
|
||||
plugin: 'cordova-plugin-photo-library',
|
||||
pluginRef: 'cordova.plugins.photoLibrary',
|
||||
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
|
||||
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"'
|
||||
})
|
||||
export class PhotoLibrary {
|
||||
|
||||
/**
|
||||
* Retrieves library items. Library item contains photo metadata like width and height, as well as photoURL and thumbnailURL.
|
||||
* @param options {GetLibraryOptions} Optional, like thumbnail size and chunks settings.
|
||||
* @return {Observable<LibraryItem[]>} Returns library items. If appropriate option was set, will be returned by chunks.
|
||||
*/
|
||||
@CordovaFiniteObservable({
|
||||
callbackOrder: 'reverse',
|
||||
resultFinalPredicate: (result: {isLastChunk: boolean}) => { return result.isLastChunk; },
|
||||
resultTransform: (result: {library: LibraryItem[]}) => { return result.library; },
|
||||
})
|
||||
static getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
|
||||
|
||||
/**
|
||||
* Asks user permission to access photo library.
|
||||
* @param options {RequestAuthorizationOptions} Optional, like whether only read access needed or read/write.
|
||||
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
static requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Returns list of photo albums on device.
|
||||
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
static getAlbums(): Promise<AlbumItem[]> { return; }
|
||||
|
||||
/**
|
||||
* Provides means to request URL of thumbnail, with specified size or quality.
|
||||
* @param photo {string | LibraryItem} Id of photo, or LibraryItem.
|
||||
* @param options {GetThumbnailOptions} Options, like thumbnail size or quality.
|
||||
* @return {Promise<string>} Resolves to URL of cdvphotolibrary schema.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getThumbnailURL(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Provides means to request photo URL by id.
|
||||
* @param photo {string | LibraryItem} Id or LibraryItem.
|
||||
* @param options {GetPhotoOptions} Optional options.
|
||||
* @return {Promise<string>} Resolves to URL of cdvphotolibrary schema.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getPhotoURL(photo: string | LibraryItem, options?: GetPhotoOptions): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns thumbnail as Blob.
|
||||
* @param photo {string | LibraryItem} Id or LibraryItem.
|
||||
* @param options {GetThumbnailOptions} Options, like thumbnail size or quality.
|
||||
* @return {Promise<Blob>} Resolves requested thumbnail as blob.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getThumbnail(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<Blob> { return; }
|
||||
|
||||
/**
|
||||
* Returns photo as Blob.
|
||||
* @param photo {string | LibraryItem} Id or LibraryItem.
|
||||
* @param options {GetPhotoOptions} Optional options.
|
||||
* @return {Promise<Blob>} Resolves requested photo as blob.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getPhoto(photo: string | LibraryItem, options?: GetPhotoOptions): Promise<Blob> { return; }
|
||||
|
||||
/**
|
||||
* Saves image to specified album. Album will be created if not exists.
|
||||
* LibraryItem that represents saved image is returned.
|
||||
* @param url {string} URL of a file, or DataURL.
|
||||
* @param album {AlbumItem | string} Name of an album or AlbumItem object.
|
||||
* @param options {GetThumbnailOptions} Options, like thumbnail size for resulting LibraryItem.
|
||||
* @return {Promise<LibraryItem>} Resolves to LibraryItem that represents saved image.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static saveImage(url: string, album: AlbumItem | string, options?: GetThumbnailOptions): Promise<LibraryItem> { return; }
|
||||
|
||||
/**
|
||||
* Saves video to specified album. Album will be created if not exists.
|
||||
* @param url {string} URL of a file, or DataURL.
|
||||
* @param album {AlbumItem | string} Name of an album or AlbumItem object.
|
||||
* @return {Promise<void>} Resolves when save operation completes.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static saveVideo(url: string, album: AlbumItem | string): Promise<void> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface LibraryItem {
|
||||
/**
|
||||
* Local id of the photo
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* URL of cdvphotolibrary schema.
|
||||
*/
|
||||
photoURL: string;
|
||||
/**
|
||||
* URL of cdvphotolibrary schema.
|
||||
*/
|
||||
thumbnailURL: string;
|
||||
fileName: string;
|
||||
width: number;
|
||||
height: number;
|
||||
creationDate: Date;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
albumIds?: string[];
|
||||
}
|
||||
|
||||
export interface AlbumItem {
|
||||
/**
|
||||
* Local id of the album
|
||||
*/
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export interface GetLibraryOptions {
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
quality?: number;
|
||||
itemsInChunk?: number;
|
||||
chunkTimeSec?: number;
|
||||
useOriginalFileNames?: boolean;
|
||||
includeAlbumData?: boolean;
|
||||
}
|
||||
|
||||
export interface RequestAuthorizationOptions {
|
||||
read?: boolean;
|
||||
write?: boolean;
|
||||
}
|
||||
|
||||
export interface GetThumbnailOptions {
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
export interface GetPhotoOptions {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user