mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
848 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9bd5100a2 | ||
|
|
51bafccf38 | ||
|
|
c3127d35bb | ||
|
|
1322c1b089 | ||
|
|
9bf7895386 | ||
|
|
538dcb98eb | ||
|
|
3da0efe38e | ||
|
|
b983de2145 | ||
|
|
9f98f8ef46 | ||
|
|
3e2964b385 | ||
|
|
77ab2c21da | ||
|
|
94025a7fd2 | ||
|
|
8c021bcaa0 | ||
|
|
da7a3707fa | ||
|
|
cb293639bc | ||
|
|
16f0712462 | ||
|
|
e9b2b93486 | ||
|
|
a8258ec998 | ||
|
|
09747cd746 | ||
|
|
2f89ae0e84 | ||
|
|
ac748abf78 | ||
|
|
1279114b73 | ||
|
|
7c30718369 | ||
|
|
9c75a06131 | ||
|
|
1e38a6c005 | ||
|
|
23639ee859 | ||
|
|
be20c51996 | ||
|
|
1615b74065 | ||
|
|
5638f90783 | ||
|
|
47b6164e99 | ||
|
|
229f5509e9 | ||
|
|
70c15c31ca | ||
|
|
a98ccc726f | ||
|
|
538ebfe9fe | ||
|
|
8e98481609 | ||
|
|
0ec46b03b5 | ||
|
|
f10f152d2c | ||
|
|
d746a98ef4 | ||
|
|
dbf95ea4bd | ||
|
|
911537b61b | ||
|
|
db55342329 | ||
|
|
d54ce83c8f | ||
|
|
2e926f4a94 | ||
|
|
292a9f08e9 | ||
|
|
b2cd106aae | ||
|
|
ab681cccbe | ||
|
|
9008aa264b | ||
|
|
33ca56a151 | ||
|
|
d8892e195b | ||
|
|
0ab14a085e | ||
|
|
a88cf7034b | ||
|
|
c44071d117 | ||
|
|
fb275e0d9f | ||
|
|
5c7d7ac527 | ||
|
|
1134ac96b6 | ||
|
|
e902856089 | ||
|
|
67adb23a14 | ||
|
|
028a568515 | ||
|
|
7a8d30f4e1 | ||
|
|
9541009742 | ||
|
|
9dee2fbc0c | ||
|
|
60b9c69763 | ||
|
|
b98fa28b4b | ||
|
|
603aa9f6d2 | ||
|
|
f4fa8c31f0 | ||
|
|
8e787fdd5f | ||
|
|
c5ec7c33b5 | ||
|
|
c6dbf343fb | ||
|
|
fa311e6a7c | ||
|
|
04347c3df8 | ||
|
|
8adb36e2a0 | ||
|
|
c700c31127 | ||
|
|
5981622f3a | ||
|
|
77d6308bca | ||
|
|
92e0bb55c3 | ||
|
|
452aa5d8c9 | ||
|
|
2ddb8be775 | ||
|
|
ebf07161b6 | ||
|
|
6ddd2aa184 | ||
|
|
9974a1fbd8 | ||
|
|
67edb835f2 | ||
|
|
5b6cb6e19f | ||
|
|
9a5a62bc3a | ||
|
|
d192dee1ee | ||
|
|
0d6997cbdd | ||
|
|
49325e8b93 | ||
|
|
de07df6f20 | ||
|
|
ca60c5b912 | ||
|
|
54d1a9891b | ||
|
|
2c57bc965c | ||
|
|
d62779a2a6 | ||
|
|
009a20608e | ||
|
|
ca14bf6a75 | ||
|
|
49fe24dee2 | ||
|
|
d9d89341d2 | ||
|
|
bbf75bcbd7 | ||
|
|
9441928884 | ||
|
|
8eb656cce8 | ||
|
|
bf0486cb8b | ||
|
|
e681761f56 | ||
|
|
84ec3fa8d2 | ||
|
|
c618ceb693 | ||
|
|
46a9b6d50d | ||
|
|
44fe04bbbd | ||
|
|
3385c1b6dc | ||
|
|
a1b0f885a7 | ||
|
|
56e8eaeb5d | ||
|
|
ba77fd70c3 | ||
|
|
1841220359 | ||
|
|
c44fb75adc | ||
|
|
ad6badef1f | ||
|
|
7bcf1bfc74 | ||
|
|
0c36988544 | ||
|
|
71e49da8ad | ||
|
|
c28df732d5 | ||
|
|
d5dfdf83f3 | ||
|
|
e42f4d0079 | ||
|
|
cabe327e9b | ||
|
|
98d22a3079 | ||
|
|
3fffab6d6c | ||
|
|
60defd3e50 | ||
|
|
c79ffc4434 | ||
|
|
ec5e27be4b | ||
|
|
cf347cd369 | ||
|
|
28f316e408 | ||
|
|
9986e0d0b3 | ||
|
|
8b809de568 | ||
|
|
fa1f718412 | ||
|
|
3fabc4d72c | ||
|
|
3a11d290e5 | ||
|
|
700fb47b73 | ||
|
|
61dc8aa18e | ||
|
|
c3f92e92c2 | ||
|
|
54d2c46742 | ||
|
|
114a74d3ba | ||
|
|
b2d29dbde5 | ||
|
|
36bfe38a4c | ||
|
|
d4e2c10006 | ||
|
|
ae6a3cda7a | ||
|
|
d5ac89996f | ||
|
|
a4216fd8ca | ||
|
|
a38adf53c3 | ||
|
|
bd7ebaee3b | ||
|
|
d92fb1da8b | ||
|
|
acb7cd862d | ||
|
|
1976c38dc7 | ||
|
|
e522a25968 | ||
|
|
ad84e758be | ||
|
|
427527a129 | ||
|
|
3ba72e9f15 | ||
|
|
a693740f1a | ||
|
|
2a98be594a | ||
|
|
0787f69884 | ||
|
|
dadaf5831e | ||
|
|
2f9c5e6674 | ||
|
|
d02688971d | ||
|
|
95ca373e10 | ||
|
|
4abb6ec78e | ||
|
|
59a382d6df | ||
|
|
80d9fe2211 | ||
|
|
8b48d6c275 | ||
|
|
585d4ff37b | ||
|
|
6ba1d4908b | ||
|
|
3a8e958684 | ||
|
|
1358411b80 | ||
|
|
e26783b8c6 | ||
|
|
fff1dc45e2 | ||
|
|
4aec187e8c | ||
|
|
d9188446a0 | ||
|
|
7ae6e10375 | ||
|
|
ea53a1923a | ||
|
|
f45f34442a | ||
|
|
49de11e761 | ||
|
|
c29aaca857 | ||
|
|
9241339b2c | ||
|
|
9c8b0ceda6 | ||
|
|
78c226e83d | ||
|
|
ef148d2a68 | ||
|
|
7fa2f7f364 | ||
|
|
5ef96d4558 | ||
|
|
e39810b7d0 | ||
|
|
f211da7280 | ||
|
|
c1398eb54b | ||
|
|
1e1aaad7aa | ||
|
|
54ef50178b | ||
|
|
6f7171d26b | ||
|
|
cf75a53438 | ||
|
|
8ab1d13fb3 | ||
|
|
dd250a6d17 | ||
|
|
9082c5efbf | ||
|
|
b19f6d1ccd | ||
|
|
abc90f2e6a | ||
|
|
717c1438c4 | ||
|
|
67e0713f18 | ||
|
|
693d344dea | ||
|
|
914d1442b6 | ||
|
|
c4acbfe095 | ||
|
|
a26b8879f3 | ||
|
|
2e82320b4c | ||
|
|
e6700a360e | ||
|
|
3fdc4a8acd | ||
|
|
82e7bd65a6 | ||
|
|
9ab73602af | ||
|
|
9f557bee8a | ||
|
|
9c8259f659 | ||
|
|
db99482157 | ||
|
|
bb321057d2 | ||
|
|
853f425383 | ||
|
|
7cb3bc7542 | ||
|
|
3da2831779 | ||
|
|
1072ab115b | ||
|
|
efb2ee7880 | ||
|
|
5b98a80828 | ||
|
|
785646800b | ||
|
|
8d6c2dfb9a | ||
|
|
b7a562053a | ||
|
|
d76ad8803e | ||
|
|
13216d1f04 | ||
|
|
00e68ca990 | ||
|
|
c987a06f91 | ||
|
|
87049e9582 | ||
|
|
bab2971c58 | ||
|
|
fd0ac37ffc | ||
|
|
b64d61828a | ||
|
|
08d66ead9b | ||
|
|
9bd8997a31 | ||
|
|
156328c9de | ||
|
|
93696d53f7 | ||
|
|
78b3ec5b1f | ||
|
|
f07431a14c | ||
|
|
8439faf6b8 | ||
|
|
51ab03d097 | ||
|
|
abd910de67 | ||
|
|
24184a5a6a | ||
|
|
0b39ff8b7d | ||
|
|
6ad54ecf86 | ||
|
|
3dd863cb49 | ||
|
|
b719a0372b | ||
|
|
bdef1daba5 | ||
|
|
695099b2b0 | ||
|
|
28f4680575 | ||
|
|
40a7b138e2 | ||
|
|
fa624df1da | ||
|
|
5577c51dbc | ||
|
|
1ab76ae693 | ||
|
|
98bd5cee38 | ||
|
|
f6903cdcdf | ||
|
|
b5cc14c546 | ||
|
|
8988fad713 | ||
|
|
7b8b2d7136 | ||
|
|
dd2ccef0c7 | ||
|
|
e46f10878e | ||
|
|
2dacec0cb5 | ||
|
|
0c5fadee86 | ||
|
|
01b30c68e1 | ||
|
|
e5b0365d0c | ||
|
|
867400d1ac | ||
|
|
88f6ecf250 | ||
|
|
e6beaa49a4 | ||
|
|
fa03fa544f | ||
|
|
c22747fa2e | ||
|
|
fd8f80e92b | ||
|
|
17f2fcb829 | ||
|
|
6a412155a3 | ||
|
|
489d860264 | ||
|
|
ca43394185 | ||
|
|
b3eed47cbb | ||
|
|
71916a85dd | ||
|
|
0669ba5222 | ||
|
|
bec0eac122 | ||
|
|
00e63d9fc8 | ||
|
|
ac181c5439 | ||
|
|
8fbf1f2b34 | ||
|
|
685ac5c7a0 | ||
|
|
634843e1b2 | ||
|
|
d5310b0f73 | ||
|
|
a72cd59b99 | ||
|
|
6f4737190b | ||
|
|
c98b4f4c85 | ||
|
|
8f5532eb74 | ||
|
|
4340597fc9 | ||
|
|
7324246e6a | ||
|
|
55b6ab9c54 | ||
|
|
a5e591cfa6 | ||
|
|
48e5d46f1e | ||
|
|
62d8645468 | ||
|
|
0388ac3f6b | ||
|
|
24752652b7 | ||
|
|
eb03de96ba | ||
|
|
0317d4455f | ||
|
|
757d0961b9 | ||
|
|
693ba01137 | ||
|
|
fa0175d248 | ||
|
|
04d01ac1b3 | ||
|
|
77c7b9d00a | ||
|
|
ee4cfadff1 | ||
|
|
49d8348db3 | ||
|
|
6e445b1beb | ||
|
|
970eb755b6 | ||
|
|
1a803e70be | ||
|
|
6982a2d35f | ||
|
|
0660a3bc67 | ||
|
|
96776567eb | ||
|
|
d09018d2d4 | ||
|
|
0649d8ca8c | ||
|
|
41abaeb7c9 | ||
|
|
4dc82383a0 | ||
|
|
799e2f0b2e | ||
|
|
b95f88c165 | ||
|
|
bbda6e22a2 | ||
|
|
3edfafb6f9 | ||
|
|
99c1d499f7 | ||
|
|
37ed9a097a | ||
|
|
db3d5b63c6 | ||
|
|
6521e1833c | ||
|
|
debe6834ef | ||
|
|
292c8801ea | ||
|
|
b031ceed99 | ||
|
|
82d4ec2738 | ||
|
|
9c55358620 | ||
|
|
51bc5ef542 | ||
|
|
74a252b324 | ||
|
|
43c8592b40 | ||
|
|
babfb0dca3 | ||
|
|
ceb4217415 | ||
|
|
798625698d | ||
|
|
5cfb3b033b | ||
|
|
95d666c348 | ||
|
|
276d61bf3a | ||
|
|
397a209ad2 | ||
|
|
d2f42ef33a | ||
|
|
fe46907aaa | ||
|
|
5c92455ee9 | ||
|
|
046cbe7fca | ||
|
|
32f09275aa | ||
|
|
542ff4cf95 | ||
|
|
5710eb78a8 | ||
|
|
842a80d493 | ||
|
|
c2d4f1c0da | ||
|
|
e28e5b0f5f | ||
|
|
bff4862979 | ||
|
|
6bcef44d42 | ||
|
|
69c9b6f555 | ||
|
|
7f38cb5a16 | ||
|
|
cf7abe110d | ||
|
|
5b060345d2 | ||
|
|
1784036ef7 | ||
|
|
7a8577007c | ||
|
|
7c6e6d8b6b | ||
|
|
c5fd83ddb6 | ||
|
|
7b2fe69c7c | ||
|
|
f0961c7b23 | ||
|
|
35c8bbd49e | ||
|
|
1a343c1ea5 | ||
|
|
4fef8ff326 | ||
|
|
13681756ae | ||
|
|
4a798281e4 | ||
|
|
79670b7878 | ||
|
|
720084578d | ||
|
|
3dd6a92ccf | ||
|
|
7d1686ef93 | ||
|
|
b40b0fff98 | ||
|
|
4dba0580ac | ||
|
|
11653ce752 | ||
|
|
d3e6f3ba41 | ||
|
|
2c6cc37a5f | ||
|
|
4c7defb2ec | ||
|
|
2da02e6d46 | ||
|
|
7a91c87a72 | ||
|
|
598f8a9e7c | ||
|
|
6f0f02bb66 | ||
|
|
e4bde77bd4 | ||
|
|
c24b331866 | ||
|
|
4ac348bd0f | ||
|
|
f0026572e7 | ||
|
|
e30ccabf7b | ||
|
|
6b286db51a | ||
|
|
d79d62bfa0 | ||
|
|
2bdd3a3868 | ||
|
|
09d481e1d6 | ||
|
|
6f23bef5d1 | ||
|
|
84f54d64aa | ||
|
|
c9ddec3bb5 | ||
|
|
f62e1081e1 | ||
|
|
7dba41cbe1 | ||
|
|
77b0277290 | ||
|
|
40325cad9f | ||
|
|
ab5bbae2f6 | ||
|
|
5da746d2fc | ||
|
|
72a694a5e1 | ||
|
|
1ab0d2f915 | ||
|
|
083118aff4 | ||
|
|
ad373c93ae | ||
|
|
ac301c284f | ||
|
|
1e0509da98 | ||
|
|
ad3bef2e5a | ||
|
|
bbbbb3e8d0 | ||
|
|
0bc73e525d | ||
|
|
7ababc4d67 | ||
|
|
6ff8f03ef0 | ||
|
|
010a6ea304 | ||
|
|
973c80b264 | ||
|
|
b5f9ba588a | ||
|
|
c5724fdc4e | ||
|
|
ebda055444 | ||
|
|
7cf9bd8e5e | ||
|
|
ce710117f7 | ||
|
|
fcda04acf1 | ||
|
|
83ac4c7bbe | ||
|
|
2be7872cd6 | ||
|
|
97a7f1a4e7 | ||
|
|
e9e37f33f9 | ||
|
|
344ce11a3e | ||
|
|
7fcd1f85a3 | ||
|
|
5d13ba03d8 | ||
|
|
a99b753d2d | ||
|
|
8f26f4b3ef | ||
|
|
624bc1d9b5 | ||
|
|
0a07bef2d2 | ||
|
|
96bb4d38dc | ||
|
|
58a99a14d5 | ||
|
|
66e9e46458 | ||
|
|
d6060a95d7 | ||
|
|
80ff2f3bfa | ||
|
|
16f05c3b0d | ||
|
|
2ed84b1b71 | ||
|
|
8d21f5f225 | ||
|
|
be2c198259 | ||
|
|
dde011c8f6 | ||
|
|
47112c7c24 | ||
|
|
1b87af86bf | ||
|
|
d45a2b5407 | ||
|
|
49bf9b7cc5 | ||
|
|
79f0a3fc7b | ||
|
|
60b7c7469a | ||
|
|
c377489aba | ||
|
|
8bb22fb576 | ||
|
|
310e0942fd | ||
|
|
df06a24746 | ||
|
|
b9151bc062 | ||
|
|
972d63b2d2 | ||
|
|
440786a4f7 | ||
|
|
3a6ec05bef | ||
|
|
c5733326a9 | ||
|
|
f36b1c03cb | ||
|
|
3266d21ba4 | ||
|
|
62f1504514 | ||
|
|
f60d08b7a4 | ||
|
|
a092a31a1e | ||
|
|
6407518892 | ||
|
|
e7e45f608c | ||
|
|
c175badab6 | ||
|
|
05783be9ac | ||
|
|
6948eabc96 | ||
|
|
48196da281 | ||
|
|
a0b6b1084b | ||
|
|
4292959c87 | ||
|
|
e50b961bf9 | ||
|
|
0ba3957e8a | ||
|
|
c33842f8f0 | ||
|
|
f87237852f | ||
|
|
bfb63a77a2 | ||
|
|
b1ca6af2c3 | ||
|
|
2f20deacf2 | ||
|
|
de1086b894 | ||
|
|
6a19c8cf48 | ||
|
|
b6b0359fcf | ||
|
|
bb0d81a4e9 | ||
|
|
4014972feb | ||
|
|
3903fee2bf | ||
|
|
31706867c7 | ||
|
|
808a75e41c | ||
|
|
919e8dae30 | ||
|
|
763ad1bdb0 | ||
|
|
281575b961 | ||
|
|
42d1bbc7a8 | ||
|
|
a28667e751 | ||
|
|
505ff189d9 | ||
|
|
35c37c2d9e | ||
|
|
efbd11676f | ||
|
|
abf3335415 | ||
|
|
c83b0437fa | ||
|
|
23fc908eb6 | ||
|
|
9d35567cb5 | ||
|
|
7f77b8f069 | ||
|
|
410b3d261f | ||
|
|
d8baf3a814 | ||
|
|
c36b0a6b3f | ||
|
|
3385a46648 | ||
|
|
550b8289c9 | ||
|
|
2aa998f66f | ||
|
|
dff034a5b6 | ||
|
|
c407b6d4f0 | ||
|
|
58c9439a32 | ||
|
|
c75f89894a | ||
|
|
a566240266 | ||
|
|
d03d70ff0b | ||
|
|
7910493a6c | ||
|
|
c76de34b97 | ||
|
|
ddae67913d | ||
|
|
4f9716415b | ||
|
|
caf2d67443 | ||
|
|
393e9d0e00 | ||
|
|
bbbd0d52e9 | ||
|
|
26dead93ff | ||
|
|
1facde3966 | ||
|
|
d5513db9bb | ||
|
|
d135dc26e2 | ||
|
|
2dc68a4785 | ||
|
|
2f706deb26 | ||
|
|
54460e2362 | ||
|
|
1db1374226 | ||
|
|
3917a3f7b9 | ||
|
|
210346e1e3 | ||
|
|
f4efe1f6eb | ||
|
|
04b24d255e | ||
|
|
e34c25b490 | ||
|
|
ea36333497 | ||
|
|
f93f958d66 | ||
|
|
8f3d36f4bc | ||
|
|
51364f8edd | ||
|
|
cb176aae90 | ||
|
|
9d573a92ce | ||
|
|
877ac27868 | ||
|
|
9c8321d3b4 | ||
|
|
e8bfb77b3d | ||
|
|
87ab8980b2 | ||
|
|
13de69080a | ||
|
|
8d439ff0cf | ||
|
|
f6d5ac4621 | ||
|
|
f37a40e138 | ||
|
|
21d8122257 | ||
|
|
0cf7d6aca1 | ||
|
|
94a7dae863 | ||
|
|
4e9bc95fff | ||
|
|
ad57733daf | ||
|
|
f4acc35cba | ||
|
|
f2cf1d4e03 | ||
|
|
b91740a91a | ||
|
|
a006cdb77b | ||
|
|
c93d95132d | ||
|
|
dd0c9baffd | ||
|
|
661276467c | ||
|
|
cf8e3420c0 | ||
|
|
9fe5c196aa | ||
|
|
76aa8a6494 | ||
|
|
9bcc4ed80f | ||
|
|
cd82a5393e | ||
|
|
00d87dba98 | ||
|
|
759f8ef910 | ||
|
|
841b242fb9 | ||
|
|
ae03d7237e | ||
|
|
ff64c6e363 | ||
|
|
820e4d78bf | ||
|
|
c7a5f7d023 | ||
|
|
a4798b81a8 | ||
|
|
48334aa4cd | ||
|
|
8b2d47587a | ||
|
|
c04379af19 | ||
|
|
d26bc886cf | ||
|
|
905f988d43 | ||
|
|
eff7841ec2 | ||
|
|
8526e89e12 | ||
|
|
bde47eb37b | ||
|
|
61716467df | ||
|
|
efa222fb55 | ||
|
|
abfa8a5f0f | ||
|
|
a438967336 | ||
|
|
47a9b34ea2 | ||
|
|
c4110eedf4 | ||
|
|
27218cda86 | ||
|
|
8c059fc1d0 | ||
|
|
dd39ba8c48 | ||
|
|
aa76fac3af | ||
|
|
e4f198ae42 | ||
|
|
dfdaa157a4 | ||
|
|
ea58a78f62 | ||
|
|
34f34521d9 | ||
|
|
ffcbb6a355 | ||
|
|
2510c5fd4a | ||
|
|
ed8c67ce7e | ||
|
|
16628a49f7 | ||
|
|
38ff6f2a32 | ||
|
|
af39282191 | ||
|
|
eab0bf44b2 | ||
|
|
a94912912e | ||
|
|
55ba65ac68 | ||
|
|
f3e698f1be | ||
|
|
14e41a31ef | ||
|
|
62bcd313e3 | ||
|
|
7a53013819 | ||
|
|
4a0f082158 | ||
|
|
f2bf2b5626 | ||
|
|
4e87ac72ea | ||
|
|
95e256293f | ||
|
|
22ab575dd0 | ||
|
|
abd706f435 | ||
|
|
4c00e14cd4 | ||
|
|
e45d7c4ab1 | ||
|
|
c37fdf47a4 | ||
|
|
9a2ea25308 | ||
|
|
560e5ce7bb | ||
|
|
dc0039b820 | ||
|
|
8bc499f221 | ||
|
|
93ce443467 | ||
|
|
f3c5ebd28b | ||
|
|
bcd46eea9d | ||
|
|
689bfd9568 | ||
|
|
dcf3ab2787 | ||
|
|
b4158f4f85 | ||
|
|
0a54929169 | ||
|
|
e34f94e0c1 | ||
|
|
d4c6ea46e6 | ||
|
|
203d4c7669 | ||
|
|
8cd6686803 | ||
|
|
aaddd9eea2 | ||
|
|
1e300ae35f | ||
|
|
c9b76c4a9a | ||
|
|
0e5bdc2f1e | ||
|
|
4b08d854bd | ||
|
|
115c167cfa | ||
|
|
b8d7806843 | ||
|
|
4c2bb9e052 | ||
|
|
618d866bfe | ||
|
|
66d1da2b55 | ||
|
|
ecbe5faef8 | ||
|
|
2160a2d9e8 | ||
|
|
39385135de | ||
|
|
014038a678 | ||
|
|
c60c3b7671 | ||
|
|
154c029f79 | ||
|
|
4b8ab4a00f | ||
|
|
9b86ac637f | ||
|
|
6ed32efe27 | ||
|
|
43e8a6d3d2 | ||
|
|
cf3f0f63c3 | ||
|
|
7a84262fee | ||
|
|
3748bccad2 | ||
|
|
0c486b0965 | ||
|
|
306cb5d2a3 | ||
|
|
b413f21d4b | ||
|
|
36624aff9c | ||
|
|
225a44ca4d | ||
|
|
cabeeb8dab | ||
|
|
9d03a6009b | ||
|
|
93fb978a5c | ||
|
|
6a6c256e05 | ||
|
|
9ca38cd8a1 | ||
|
|
066821dbec | ||
|
|
8242c88cbb | ||
|
|
484f9a0076 | ||
|
|
049903222a | ||
|
|
7ae82f471d | ||
|
|
2503ef2ee5 | ||
|
|
899c695414 | ||
|
|
990c9c2a49 | ||
|
|
f23436fe6d | ||
|
|
29816f7ab5 | ||
|
|
09e6fc9738 | ||
|
|
4e206812f0 | ||
|
|
53b6d813d5 | ||
|
|
06c749ffab | ||
|
|
5162411b38 | ||
|
|
ea049ff82f | ||
|
|
838629db3a | ||
|
|
080c5a19e6 | ||
|
|
bd9366bdfe | ||
|
|
206fa625fd | ||
|
|
58c3fda956 | ||
|
|
ccf7fb56c8 | ||
|
|
eeb5393a3f | ||
|
|
8dfe0dbaf2 | ||
|
|
817a4340e7 | ||
|
|
5506e8a2e2 | ||
|
|
aa51c03c5c | ||
|
|
40bd9bb20d | ||
|
|
41c9adf55a | ||
|
|
2c9245c06c | ||
|
|
d3d14d0b86 | ||
|
|
1da35968de | ||
|
|
2c01d1998f | ||
|
|
08fe04e87e | ||
|
|
8b9e317519 | ||
|
|
e20c411dff | ||
|
|
c854c5a18c | ||
|
|
af97b7a362 | ||
|
|
cfcf9fbfd1 | ||
|
|
971ee4adda | ||
|
|
df326f773f | ||
|
|
b8f475f188 | ||
|
|
cb24876f23 | ||
|
|
075842d69d | ||
|
|
77d31cdf42 | ||
|
|
b95191af06 | ||
|
|
7952f9ef60 | ||
|
|
d4d30ab9c9 | ||
|
|
a279ee02e0 | ||
|
|
d4bee49678 | ||
|
|
8b27bed4df | ||
|
|
979838f4b7 | ||
|
|
5807dd7f09 | ||
|
|
a8fa61ddb9 | ||
|
|
5979e9a8b0 | ||
|
|
0aee6c88ce | ||
|
|
f59570e39d | ||
|
|
006bc70387 | ||
|
|
57725828a6 | ||
|
|
f982b40166 | ||
|
|
5afcbfc4bf | ||
|
|
fe74f9d277 | ||
|
|
41d335e4e9 | ||
|
|
f0bb4cfeff | ||
|
|
445570c241 | ||
|
|
1b161d8c9e | ||
|
|
074d16605d | ||
|
|
68db707f7b | ||
|
|
6c0aaa643e | ||
|
|
81a0696e70 | ||
|
|
70b30a390f | ||
|
|
f461a0f9bb | ||
|
|
9c25244bc6 | ||
|
|
499e89e254 | ||
|
|
13f10f7e19 | ||
|
|
c98f0fb125 | ||
|
|
45cf787625 | ||
|
|
fea162a468 | ||
|
|
313b6952ae | ||
|
|
d46f22d2a1 | ||
|
|
c771abc8c3 | ||
|
|
957fbd8193 | ||
|
|
8d82aff41f | ||
|
|
b329d9f36b | ||
|
|
88e05d663a | ||
|
|
494d80e9de | ||
|
|
1e69371648 | ||
|
|
df1d42fa99 | ||
|
|
6791754874 | ||
|
|
34e038d3ca | ||
|
|
0231220c6f | ||
|
|
24910aacee | ||
|
|
77447975b2 | ||
|
|
3f276580c6 | ||
|
|
c674940487 | ||
|
|
f21c49e293 | ||
|
|
1eed1a1cb3 | ||
|
|
28ee511437 | ||
|
|
712f201bf2 | ||
|
|
4841f31a92 | ||
|
|
0c0456ada6 | ||
|
|
dac013fe7b | ||
|
|
965d742bb6 | ||
|
|
4f85110f75 | ||
|
|
8bd906c1a7 | ||
|
|
46e3a0ecb3 | ||
|
|
6ee645a976 | ||
|
|
3a1a3ceabc | ||
|
|
29de6b394e | ||
|
|
6f625f9222 | ||
|
|
de14b0ea15 | ||
|
|
e55c0c3e15 | ||
|
|
1dbfd70724 | ||
|
|
4059035050 | ||
|
|
b4b3ec0d2a | ||
|
|
d03ff962e3 | ||
|
|
af5d4ad87f | ||
|
|
453374d4e7 | ||
|
|
daa6d4cbb9 | ||
|
|
2996da65c3 | ||
|
|
b5a2ffc6a5 | ||
|
|
f1988f67f5 | ||
|
|
2fe37c461c | ||
|
|
be1725d2eb | ||
|
|
a1ce39dfda | ||
|
|
0cb79d1cd1 | ||
|
|
e8f4b08f66 | ||
|
|
cdf9cdef54 | ||
|
|
72ec500ffd | ||
|
|
c23f5e90dc | ||
|
|
0315e63782 | ||
|
|
9a28b24a0b | ||
|
|
5c72340a37 | ||
|
|
360888563f | ||
|
|
b8a513301e | ||
|
|
4f0cd24476 | ||
|
|
00d35c636b | ||
|
|
e150224cda | ||
|
|
fa4721319e | ||
|
|
6229d4932e | ||
|
|
7c20bddd17 | ||
|
|
2b4e318072 | ||
|
|
dd97df19fe | ||
|
|
9eb63a0d74 | ||
|
|
08412feae0 | ||
|
|
7bc847a7f8 | ||
|
|
3e0b2c5b32 | ||
|
|
be3c579c49 | ||
|
|
31ec643126 | ||
|
|
c94ba61a66 | ||
|
|
6fcc109b6b | ||
|
|
27c02ecb82 | ||
|
|
63a1a34f97 | ||
|
|
dcd7ad430f | ||
|
|
bc3f10cbc1 | ||
|
|
17214ffba7 | ||
|
|
f8330daa8b | ||
|
|
b7fb2483bf | ||
|
|
6e8248a0b8 | ||
|
|
c40fec7ae3 | ||
|
|
7c39e91b68 | ||
|
|
6d87f6ecb0 | ||
|
|
8030f3d4be | ||
|
|
e52fb1cacc | ||
|
|
b995d7bc31 | ||
|
|
ff9b500938 | ||
|
|
8e91f2128f | ||
|
|
c122171dd5 | ||
|
|
35d083ed52 | ||
|
|
a0529ef0ed | ||
|
|
ca845d6b98 | ||
|
|
b811fad3a6 | ||
|
|
0412387d02 | ||
|
|
f362215dd3 | ||
|
|
85349696c2 | ||
|
|
a1fe6d7965 | ||
|
|
92a4608a5b | ||
|
|
b8afd70a42 | ||
|
|
c36c210e66 | ||
|
|
5b2a7b8618 | ||
|
|
71c3b19a71 | ||
|
|
de3f7c2335 | ||
|
|
ef977b7d9e | ||
|
|
347c8a0715 | ||
|
|
ba20dbe590 | ||
|
|
b8be1de068 | ||
|
|
592feb409e | ||
|
|
4a38c02c14 | ||
|
|
d84b83b42c | ||
|
|
38cea9da27 | ||
|
|
da28af024c | ||
|
|
c69f8203ff | ||
|
|
eee5fd0c17 | ||
|
|
ef960c8aec | ||
|
|
f2f3741819 | ||
|
|
e802571726 | ||
|
|
644e999d1e | ||
|
|
5a14ec01ef | ||
|
|
3a6210873e | ||
|
|
25fab64e3f |
19
.github/CONTRIBUTING.md
vendored
Normal file
19
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Contributing to Ionic Native
|
||||
|
||||
## Have an issue?
|
||||
#### There are no rules, but here are a few things to consider:
|
||||
###### Before you submit an issue:
|
||||
* Do a quick search to see if there are similar issues
|
||||
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/v2/api/platform/Platform/#ready).
|
||||
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save ionic-native@latest`
|
||||
|
||||
###### Still having problems? submit an issue with the following details:
|
||||
* Short description of the issue
|
||||
* Steps to reproduce
|
||||
* Stack trace (if available)
|
||||
|
||||
|
||||
## Feature request?
|
||||
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
|
||||
|
||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
.idea
|
||||
dist/
|
||||
scripts/ionic-native-bower
|
||||
|
||||
814
CHANGELOG.md
814
CHANGELOG.md
@@ -1,3 +1,791 @@
|
||||
<a name="2.3.2"></a>
|
||||
## [2.3.2](https://github.com/driftyco/ionic-native/compare/v2.3.1...v2.3.2) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** fix GoogleMapsLaLngBounds ([c3127d3](https://github.com/driftyco/ionic-native/commit/c3127d3)), closes [#972](https://github.com/driftyco/ionic-native/issues/972)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.1"></a>
|
||||
## [2.3.1](https://github.com/driftyco/ionic-native/compare/v2.3.0...v2.3.1) (2017-01-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add clearAllNotifications() ([8c021bc](https://github.com/driftyco/ionic-native/commit/8c021bc))
|
||||
* **battery-status:** add missing pluginRef ([3da0efe](https://github.com/driftyco/ionic-native/commit/3da0efe))
|
||||
* **core:** fix exception in CordovaProperty ([#998](https://github.com/driftyco/ionic-native/issues/998)) ([cb29363](https://github.com/driftyco/ionic-native/commit/cb29363)), closes [#992](https://github.com/driftyco/ionic-native/issues/992)
|
||||
* **core:** fix plugin check ([da7a370](https://github.com/driftyco/ionic-native/commit/da7a370))
|
||||
* **plugin:** adds subscribe() and unsubscribe() ([94025a7](https://github.com/driftyco/ionic-native/commit/94025a7))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** add PluginConfig interface ([b983de2](https://github.com/driftyco/ionic-native/commit/b983de2)), closes [#996](https://github.com/driftyco/ionic-native/issues/996)
|
||||
* **google-maps:** add base class functions ([#993](https://github.com/driftyco/ionic-native/issues/993)) ([9f98f8e](https://github.com/driftyco/ionic-native/commit/9f98f8e))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.0"></a>
|
||||
# [2.3.0](https://github.com/driftyco/ionic-native/compare/v2.2.17...v2.3.0) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **native-geocoder:** fix callback order ([dbf95ea](https://github.com/driftyco/ionic-native/commit/dbf95ea))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **backlight:** add Backlight plugin ([#973](https://github.com/driftyco/ionic-native/issues/973)) ([1279114](https://github.com/driftyco/ionic-native/commit/1279114))
|
||||
* **broadcaster:** add Broadcaster plugin ([#877](https://github.com/driftyco/ionic-native/issues/877)) ([1e38a6c](https://github.com/driftyco/ionic-native/commit/1e38a6c))
|
||||
* **fingerprint-aio:** add cordova-plugin-fingerprint-aio ([#845](https://github.com/driftyco/ionic-native/issues/845)) ([1615b74](https://github.com/driftyco/ionic-native/commit/1615b74))
|
||||
* **firebase:** add firebase plugin ([#914](https://github.com/driftyco/ionic-native/issues/914)) ([8e98481](https://github.com/driftyco/ionic-native/commit/8e98481)), closes [#608](https://github.com/driftyco/ionic-native/issues/608)
|
||||
* **launch-review:** add LaunchReview plugin ([#949](https://github.com/driftyco/ionic-native/issues/949)) ([9c75a06](https://github.com/driftyco/ionic-native/commit/9c75a06))
|
||||
* **nativegeocoder:** add NativeGeocoder plugin ([#800](https://github.com/driftyco/ionic-native/issues/800)) ([911537b](https://github.com/driftyco/ionic-native/commit/911537b))
|
||||
* **navigationbar:** add NavigationBar plugin ([#826](https://github.com/driftyco/ionic-native/issues/826)) ([70c15c3](https://github.com/driftyco/ionic-native/commit/70c15c3))
|
||||
* **rollbar:** add Rollbar plugin ([#832](https://github.com/driftyco/ionic-native/issues/832)) ([229f550](https://github.com/driftyco/ionic-native/commit/229f550))
|
||||
* **serial:** add Serial plugin ([#952](https://github.com/driftyco/ionic-native/issues/952)) ([ac748ab](https://github.com/driftyco/ionic-native/commit/ac748ab))
|
||||
* **speech-recognition:** add SpeechRecognition plugin ([#897](https://github.com/driftyco/ionic-native/issues/897)) ([7c30718](https://github.com/driftyco/ionic-native/commit/7c30718))
|
||||
* **stripe:** add stripe plugin ([#913](https://github.com/driftyco/ionic-native/issues/913)) ([0ec46b0](https://github.com/driftyco/ionic-native/commit/0ec46b0))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.17"></a>
|
||||
## [2.2.17](https://github.com/driftyco/ionic-native/compare/v2.2.16...v2.2.17) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **app-rate:** onRateDialogShow callback ([#985](https://github.com/driftyco/ionic-native/issues/985)) ([ab681cc](https://github.com/driftyco/ionic-native/commit/ab681cc))
|
||||
* **core:** increase deviceready timeout for sanity ([0ab14a0](https://github.com/driftyco/ionic-native/commit/0ab14a0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **barcodescanner:** add missing options ([#966](https://github.com/driftyco/ionic-native/issues/966)) ([e902856](https://github.com/driftyco/ionic-native/commit/e902856)), closes [#965](https://github.com/driftyco/ionic-native/issues/965)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.16"></a>
|
||||
## [2.2.16](https://github.com/driftyco/ionic-native/compare/v2.2.15...v2.2.16) (2017-01-11)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.15"></a>
|
||||
## [2.2.15](https://github.com/driftyco/ionic-native/compare/v2.2.14...v2.2.15) (2017-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **apprate:** captialize URL in storeAppURL property ([b98fa28](https://github.com/driftyco/ionic-native/commit/b98fa28))
|
||||
* **ble:** stopScan takes no args when used as clear function ([#944](https://github.com/driftyco/ionic-native/issues/944)) ([6ddd2aa](https://github.com/driftyco/ionic-native/commit/6ddd2aa))
|
||||
* **onesignal:** OSNotification.app_id is optional ([#946](https://github.com/driftyco/ionic-native/issues/946)) ([ebf0716](https://github.com/driftyco/ionic-native/commit/ebf0716))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.14"></a>
|
||||
## [2.2.14](https://github.com/driftyco/ionic-native/compare/v2.2.13...v2.2.14) (2017-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** fix startTrackerWithId when interval is not provided ([49fe24d](https://github.com/driftyco/ionic-native/commit/49fe24d))
|
||||
* **google-plus:** fixes login without options ([ca14bf6](https://github.com/driftyco/ionic-native/commit/ca14bf6)), closes [#932](https://github.com/driftyco/ionic-native/issues/932)
|
||||
* **inappbrowser:** fix insertCSS method name ([de07df6](https://github.com/driftyco/ionic-native/commit/de07df6)), closes [#921](https://github.com/driftyco/ionic-native/issues/921)
|
||||
* **mixpanel:** fix issue when not passing eventProperties ([#927](https://github.com/driftyco/ionic-native/issues/927)) ([bbf75bc](https://github.com/driftyco/ionic-native/commit/bbf75bc))
|
||||
* **nfc:** add missing param for addMimeTypeListener ([#937](https://github.com/driftyco/ionic-native/issues/937)) ([ca60c5b](https://github.com/driftyco/ionic-native/commit/ca60c5b))
|
||||
* **push:** fix typing for additionalData ([0d6997c](https://github.com/driftyco/ionic-native/commit/0d6997c)), closes [#868](https://github.com/driftyco/ionic-native/issues/868)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add altitudeAccuracy into response typings ([#922](https://github.com/driftyco/ionic-native/issues/922)) ([8eb656c](https://github.com/driftyco/ionic-native/commit/8eb656c))
|
||||
* **market:** add search method, return promises ([d62779a](https://github.com/driftyco/ionic-native/commit/d62779a))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.13"></a>
|
||||
## [2.2.13](https://github.com/driftyco/ionic-native/compare/v2.2.12...v2.2.13) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob:** add adId prop to AdMobOptions ([d5dfdf8](https://github.com/driftyco/ionic-native/commit/d5dfdf8))
|
||||
* **background-mode:** isEnabled and isActive return booleans ([ba77fd7](https://github.com/driftyco/ionic-native/commit/ba77fd7)), closes [#908](https://github.com/driftyco/ionic-native/issues/908)
|
||||
* **diagnostic:** add missing types ([1841220](https://github.com/driftyco/ionic-native/commit/1841220)), closes [#905](https://github.com/driftyco/ionic-native/issues/905)
|
||||
* **diagnostic:** add permissionStatus types ([#890](https://github.com/driftyco/ionic-native/issues/890)) ([3385c1b](https://github.com/driftyco/ionic-native/commit/3385c1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-fingerprint-auth:** update to v1.2.1 ([#910](https://github.com/driftyco/ionic-native/issues/910)) ([a1b0f88](https://github.com/driftyco/ionic-native/commit/a1b0f88))
|
||||
* **nfc:** add new functions ([#853](https://github.com/driftyco/ionic-native/issues/853)) ([c44fb75](https://github.com/driftyco/ionic-native/commit/c44fb75))
|
||||
* **onesignal:** improve typings ([#888](https://github.com/driftyco/ionic-native/issues/888)) ([56e8eae](https://github.com/driftyco/ionic-native/commit/56e8eae))
|
||||
* **sim:** add new methods ([#894](https://github.com/driftyco/ionic-native/issues/894)) ([0c36988](https://github.com/driftyco/ionic-native/commit/0c36988))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.12"></a>
|
||||
## [2.2.12](https://github.com/driftyco/ionic-native/compare/v2.2.11...v2.2.12) (2016-12-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **camera-preview:** parameter size is optional ([#871](https://github.com/driftyco/ionic-native/issues/871)) ([61dc8aa](https://github.com/driftyco/ionic-native/commit/61dc8aa))
|
||||
* **diagnostic:** permissionStatus gets values from plugin in runtime ([9986e0d](https://github.com/driftyco/ionic-native/commit/9986e0d)), closes [#872](https://github.com/driftyco/ionic-native/issues/872)
|
||||
* **network:** update API ([ec5e27b](https://github.com/driftyco/ionic-native/commit/ec5e27b))
|
||||
* **sms:** fix callback index when omitting options param ([114a74d](https://github.com/driftyco/ionic-native/commit/114a74d)), closes [#858](https://github.com/driftyco/ionic-native/issues/858)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **admob:** update api and docs ([6ba1d49](https://github.com/driftyco/ionic-native/commit/6ba1d49))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.11"></a>
|
||||
## [2.2.11](https://github.com/driftyco/ionic-native/compare/v2.2.10...v2.2.11) (2016-12-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cordova-property:** fixes static properties of classes ([7ae6e10](https://github.com/driftyco/ionic-native/commit/7ae6e10))
|
||||
* **device:** fixes device plugin ([d918844](https://github.com/driftyco/ionic-native/commit/d918844))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* device: device property no longer exists
|
||||
|
||||
|
||||
|
||||
<a name="2.2.10"></a>
|
||||
## [2.2.10](https://github.com/driftyco/ionic-native/compare/v2.2.9...v2.2.10) (2016-12-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **contacts:** fix few bugs in Contacts ([#846](https://github.com/driftyco/ionic-native/issues/846)) ([b19f6d1](https://github.com/driftyco/ionic-native/commit/b19f6d1))
|
||||
* **sqlite:** add static constructor, and fix resolve type ([#697](https://github.com/driftyco/ionic-native/issues/697)) ([9082c5e](https://github.com/driftyco/ionic-native/commit/9082c5e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **actionsheet:** add ActionSheetOptions interface ([f211da7](https://github.com/driftyco/ionic-native/commit/f211da7))
|
||||
* **googlemap:** add disableAutoPan to GoogleMapsMarkerOptions ([cf75a53](https://github.com/driftyco/ionic-native/commit/cf75a53)), closes [#844](https://github.com/driftyco/ionic-native/issues/844)
|
||||
* **googlemaps:** add markerClick and infoClick to MarkerOptions ([6f7171d](https://github.com/driftyco/ionic-native/commit/6f7171d))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.9"></a>
|
||||
## [2.2.9](https://github.com/driftyco/ionic-native/compare/v2.2.8...v2.2.9) (2016-12-01)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.8"></a>
|
||||
## [2.2.8](https://github.com/driftyco/ionic-native/compare/v2.2.7...v2.2.8) (2016-12-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add return ([3fdc4a8](https://github.com/driftyco/ionic-native/commit/3fdc4a8))
|
||||
* **card-io:** fix typo in options ([e6700a3](https://github.com/driftyco/ionic-native/commit/e6700a3))
|
||||
* **globalization:** add missing parameter to numberToString function ([1072ab1](https://github.com/driftyco/ionic-native/commit/1072ab1)), closes [#835](https://github.com/driftyco/ionic-native/issues/835)
|
||||
* **headercolor:** solve typo in usage and chore ([bab2971](https://github.com/driftyco/ionic-native/commit/bab2971))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **card-io:** add typing for response ([2e82320](https://github.com/driftyco/ionic-native/commit/2e82320))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.7"></a>
|
||||
## [2.2.7](https://github.com/driftyco/ionic-native/compare/v2.2.5...v2.2.7) (2016-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **3dTouch:** fixes onHomeIconPressed ([#813](https://github.com/driftyco/ionic-native/issues/813)) ([695099b](https://github.com/driftyco/ionic-native/commit/695099b))
|
||||
* **camera-preview:** formatting. Closes [#790](https://github.com/driftyco/ionic-native/issues/790) ([5577c51](https://github.com/driftyco/ionic-native/commit/5577c51))
|
||||
* **datepicker:** fix allowOldDates option ([#761](https://github.com/driftyco/ionic-native/issues/761)) ([fa03fa5](https://github.com/driftyco/ionic-native/commit/fa03fa5))
|
||||
* **diagnostics:** fix [#776](https://github.com/driftyco/ionic-native/issues/776) ([#777](https://github.com/driftyco/ionic-native/issues/777)) ([01b30c6](https://github.com/driftyco/ionic-native/commit/01b30c6))
|
||||
* **file:** correct writeFile flags ([9bd8997](https://github.com/driftyco/ionic-native/commit/9bd8997)), closes [#789](https://github.com/driftyco/ionic-native/issues/789)
|
||||
* **googlemap:** fix typoe googledesic to geodesic ([78b3ec5](https://github.com/driftyco/ionic-native/commit/78b3ec5)), closes [#765](https://github.com/driftyco/ionic-native/issues/765)
|
||||
* **native-audio:** completeCallback is optional on play method ([b719a03](https://github.com/driftyco/ionic-native/commit/b719a03)), closes [#792](https://github.com/driftyco/ionic-native/issues/792)
|
||||
* **nfc:** don't bind to name field, fix [#740](https://github.com/driftyco/ionic-native/issues/740) ([#749](https://github.com/driftyco/ionic-native/issues/749)) ([ca43394](https://github.com/driftyco/ionic-native/commit/ca43394))
|
||||
* **plugin:** don't bind to name field. Fixes [#740](https://github.com/driftyco/ionic-native/issues/740) ([71916a8](https://github.com/driftyco/ionic-native/commit/71916a8))
|
||||
* **video-player:** scalingMode is number ([f07431a](https://github.com/driftyco/ionic-native/commit/f07431a)), closes [#774](https://github.com/driftyco/ionic-native/issues/774)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **camera-preview:** add disable method ([6ad54ec](https://github.com/driftyco/ionic-native/commit/6ad54ec))
|
||||
* **google-analytics:** new interval period parameter ([abd910d](https://github.com/driftyco/ionic-native/commit/abd910d)), closes [#816](https://github.com/driftyco/ionic-native/issues/816)
|
||||
* **google-map:** add get and set methods to Marker class ([51ab03d](https://github.com/driftyco/ionic-native/commit/51ab03d)), closes [#798](https://github.com/driftyco/ionic-native/issues/798)
|
||||
* **headercolor:** add HeaderColor plugin ([93696d5](https://github.com/driftyco/ionic-native/commit/93696d5)), closes [#760](https://github.com/driftyco/ionic-native/issues/760)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.5"></a>
|
||||
## [2.2.5](https://github.com/driftyco/ionic-native/compare/v2.2.4...v2.2.5) (2016-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **3dtouch:** add missing property ([#739](https://github.com/driftyco/ionic-native/issues/739)) ([757d096](https://github.com/driftyco/ionic-native/commit/757d096))
|
||||
* **geolocation:** fix watchPosition return type ([d5310b0](https://github.com/driftyco/ionic-native/commit/d5310b0)), closes [#741](https://github.com/driftyco/ionic-native/issues/741)
|
||||
* **nfc:** fix Ndef class ([ac181c5](https://github.com/driftyco/ionic-native/commit/ac181c5)), closes [#713](https://github.com/driftyco/ionic-native/issues/713)
|
||||
* **sqlite:** check if plugin exists before opening database ([6f47371](https://github.com/driftyco/ionic-native/commit/6f47371))
|
||||
* **sqlite:** check if plugin exists before opening database ([c98b4f4](https://github.com/driftyco/ionic-native/commit/c98b4f4))
|
||||
* **sqlite:** fix callback issue with transaction method ([a72cd59](https://github.com/driftyco/ionic-native/commit/a72cd59)), closes [#732](https://github.com/driftyco/ionic-native/issues/732)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **diagnostic:** add missing functions ([eb03de9](https://github.com/driftyco/ionic-native/commit/eb03de9)), closes [#743](https://github.com/driftyco/ionic-native/issues/743)
|
||||
* **filepath:** add cordova-plugin-filepath ([#714](https://github.com/driftyco/ionic-native/issues/714)) ([0660a3b](https://github.com/driftyco/ionic-native/commit/0660a3b))
|
||||
* **plugins:** add name field ([9677656](https://github.com/driftyco/ionic-native/commit/9677656))
|
||||
* **sms:** add hasPermission method ([8fbf1f2](https://github.com/driftyco/ionic-native/commit/8fbf1f2)), closes [#721](https://github.com/driftyco/ionic-native/issues/721)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.4"></a>
|
||||
## [2.2.4](https://github.com/driftyco/ionic-native/compare/v2.2.3...v2.2.4) (2016-10-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sqlite:** fix callback order for transaction ([#700](https://github.com/driftyco/ionic-native/issues/700)) ([799e2f0](https://github.com/driftyco/ionic-native/commit/799e2f0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **device-feedback:** add DeviceFeedback plugin ([#696](https://github.com/driftyco/ionic-native/issues/696)) ([bbda6e2](https://github.com/driftyco/ionic-native/commit/bbda6e2))
|
||||
* **image-picker:** add new android methods ([3edfafb](https://github.com/driftyco/ionic-native/commit/3edfafb))
|
||||
* **mixpanel:** MixpanelPeople returns promises ([#681](https://github.com/driftyco/ionic-native/issues/681)) ([b95f88c](https://github.com/driftyco/ionic-native/commit/b95f88c)), closes [#667](https://github.com/driftyco/ionic-native/issues/667)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.3"></a>
|
||||
## [2.2.3](https://github.com/driftyco/ionic-native/compare/v2.2.2...v2.2.3) (2016-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** Expose 'type' property in GoogleMapsLatLngBounds [#693](https://github.com/driftyco/ionic-native/issues/693) ([#694](https://github.com/driftyco/ionic-native/issues/694)) ([74a252b](https://github.com/driftyco/ionic-native/commit/74a252b))
|
||||
* **onesignal:** update to match latest API version ([#691](https://github.com/driftyco/ionic-native/issues/691)) ([babfb0d](https://github.com/driftyco/ionic-native/commit/babfb0d))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.2"></a>
|
||||
## [2.2.2](https://github.com/driftyco/ionic-native/compare/v2.2.1...v2.2.2) (2016-10-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **file:** getFreeDiskSpace now works ([d2f42ef](https://github.com/driftyco/ionic-native/commit/d2f42ef))
|
||||
* **file:** read methods can accept Blobs too ([276d61b](https://github.com/driftyco/ionic-native/commit/276d61b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **file:** getFile and getDirectory are now public ([5c92455](https://github.com/driftyco/ionic-native/commit/5c92455)), closes [#657](https://github.com/driftyco/ionic-native/issues/657)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.1"></a>
|
||||
## [2.2.1](https://github.com/driftyco/ionic-native/compare/v2.2.0...v2.2.1) (2016-10-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **diagnostic:** misspelled getContactsAuthorizationStatus method ([#678](https://github.com/driftyco/ionic-native/issues/678)) ([bff4862](https://github.com/driftyco/ionic-native/commit/bff4862))
|
||||
* **file:** fix writeFile method ([842a80d](https://github.com/driftyco/ionic-native/commit/842a80d))
|
||||
* **file:** last parameter for writeFile now only accepts options ([5710eb7](https://github.com/driftyco/ionic-native/commit/5710eb7))
|
||||
* **http:** export via window.IonicNative ([#675](https://github.com/driftyco/ionic-native/issues/675)) ([cf7abe1](https://github.com/driftyco/ionic-native/commit/cf7abe1))
|
||||
* **location-accuracy:** accuracy param is number ([c2d4f1c](https://github.com/driftyco/ionic-native/commit/c2d4f1c)), closes [#676](https://github.com/driftyco/ionic-native/issues/676)
|
||||
* **themeablebrowser:** add missed options ([#680](https://github.com/driftyco/ionic-native/issues/680)) ([e28e5b0](https://github.com/driftyco/ionic-native/commit/e28e5b0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **file:** resolveLocalFilesystemUrl and resolveDirectoryUrl are now public methods ([542ff4c](https://github.com/driftyco/ionic-native/commit/542ff4c)), closes [#657](https://github.com/driftyco/ionic-native/issues/657)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.0"></a>
|
||||
# [2.2.0](https://github.com/driftyco/ionic-native/compare/v2.1.9...v2.2.0) (2016-10-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **native-transitions:** add missing interface properties ([35c8bbd](https://github.com/driftyco/ionic-native/commit/35c8bbd))
|
||||
* **onesignal:** update to match latest api ([#671](https://github.com/driftyco/ionic-native/issues/671)) ([7c6e6d8](https://github.com/driftyco/ionic-native/commit/7c6e6d8)), closes [#667](https://github.com/driftyco/ionic-native/issues/667)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **http:** add cordovaHTTP wrapper ([#674](https://github.com/driftyco/ionic-native/issues/674)) ([f0961c7](https://github.com/driftyco/ionic-native/commit/f0961c7))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.9"></a>
|
||||
## [2.1.9](https://github.com/driftyco/ionic-native/compare/v2.1.7...v2.1.9) (2016-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** fixes GoogleMapsLatLng class ([11653ce](https://github.com/driftyco/ionic-native/commit/11653ce))
|
||||
* **paypal:** add optional details param to paypalpayment ([7200845](https://github.com/driftyco/ionic-native/commit/7200845))
|
||||
* **paypal:** problems with selection of PayPal environment ([#662](https://github.com/driftyco/ionic-native/issues/662)) ([3dd6a92](https://github.com/driftyco/ionic-native/commit/3dd6a92))
|
||||
* **thmeable-browser:** fix the name of the plugin ([#663](https://github.com/driftyco/ionic-native/issues/663)) ([1368175](https://github.com/driftyco/ionic-native/commit/1368175))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.7"></a>
|
||||
## [2.1.7](https://github.com/driftyco/ionic-native/compare/v2.1.6...v2.1.7) (2016-10-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **paypal:** fixed currency code not found issue ([#653](https://github.com/driftyco/ionic-native/issues/653)) ([598f8a9](https://github.com/driftyco/ionic-native/commit/598f8a9))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.6"></a>
|
||||
## [2.1.6](https://github.com/driftyco/ionic-native/compare/v2.1.3...v2.1.6) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** specify successIndex and errorIndex for methods with optional params ([6f23bef](https://github.com/driftyco/ionic-native/commit/6f23bef))
|
||||
* **paypal:** fix helper classes ([f002657](https://github.com/driftyco/ionic-native/commit/f002657))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.3"></a>
|
||||
## [2.1.3](https://github.com/driftyco/ionic-native/compare/v2.1.2...v2.1.3) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** add missing methods, fix return types ([77b0277](https://github.com/driftyco/ionic-native/commit/77b0277))
|
||||
* **google-analytics:** add newSession param ([f62e108](https://github.com/driftyco/ionic-native/commit/f62e108))
|
||||
* **google-analytics:** fix depreciated plugin reference ([40325ca](https://github.com/driftyco/ionic-native/commit/40325ca))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.2"></a>
|
||||
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.2) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** add missing properties ([72a694a](https://github.com/driftyco/ionic-native/commit/72a694a)), closes [#642](https://github.com/driftyco/ionic-native/issues/642)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **zBar:** add zBar barcode scanner plugin ([#634](https://github.com/driftyco/ionic-native/issues/634)) ([bbbbb3e](https://github.com/driftyco/ionic-native/commit/bbbbb3e))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/driftyco/ionic-native/compare/v2.0.3...v2.1.0) (2016-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **calendar:** fixed modifyEventWithOptions and related interface ([80ff2f3](https://github.com/driftyco/ionic-native/commit/80ff2f3))
|
||||
* **googlemaps:** CameraPosition target can now be GoogleMapsLatLng[] ([#587](https://github.com/driftyco/ionic-native/issues/587)) ([8d21f5f](https://github.com/driftyco/ionic-native/commit/8d21f5f))
|
||||
* **googlemaps:** typo in GoogleMapsTileOverlayOptions ([#589](https://github.com/driftyco/ionic-native/issues/589)) ([be2c198](https://github.com/driftyco/ionic-native/commit/be2c198))
|
||||
* **isdebug:** export IsDebug class ([#578](https://github.com/driftyco/ionic-native/issues/578)) ([c573332](https://github.com/driftyco/ionic-native/commit/c573332))
|
||||
* **media:** add status as a parmeter instead of property of instance ([58a99a1](https://github.com/driftyco/ionic-native/commit/58a99a1))
|
||||
* **paypal:** fix typings, add PayPalItem and PayPalPaymentDetails ([5d13ba0](https://github.com/driftyco/ionic-native/commit/5d13ba0))
|
||||
* **power-management:** fix repo and pluginref ([#603](https://github.com/driftyco/ionic-native/issues/603)) ([d6060a9](https://github.com/driftyco/ionic-native/commit/d6060a9))
|
||||
* **push:** Add support for passing notification id into finish ([#600](https://github.com/driftyco/ionic-native/issues/600)) ([16f05c3](https://github.com/driftyco/ionic-native/commit/16f05c3))
|
||||
* **social-sharing:** shareWithOptions method signature ([#598](https://github.com/driftyco/ionic-native/issues/598)) ([2ed84b1](https://github.com/driftyco/ionic-native/commit/2ed84b1)), closes [/github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/src/android/nl/xservices/plugins/SocialSharing.java#L209](https://github.com//github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/src/android/nl/xservices/plugins/SocialSharing.java/issues/L209)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ble:** add startScanWithOptions ([79f0a3f](https://github.com/driftyco/ionic-native/commit/79f0a3f)), closes [#539](https://github.com/driftyco/ionic-native/issues/539)
|
||||
* **googlemaps:** support bounds in Geocoder ([#599](https://github.com/driftyco/ionic-native/issues/599)) ([66e9e46](https://github.com/driftyco/ionic-native/commit/66e9e46))
|
||||
* **location-accuracy:** add location accuracy plugin ([#583](https://github.com/driftyco/ionic-native/issues/583)) ([60b7c74](https://github.com/driftyco/ionic-native/commit/60b7c74)), closes [#484](https://github.com/driftyco/ionic-native/issues/484)
|
||||
* **plugin:** add getPlugin to plugin interface. Fixes [#582](https://github.com/driftyco/ionic-native/issues/582) ([d45a2b5](https://github.com/driftyco/ionic-native/commit/d45a2b5))
|
||||
* **plugin:** checkInstall w/ warning msg ([47112c7](https://github.com/driftyco/ionic-native/commit/47112c7))
|
||||
* **stepcounter:** add stepcounter plugin ([#607](https://github.com/driftyco/ionic-native/issues/607)) ([a99b753](https://github.com/driftyco/ionic-native/commit/a99b753))
|
||||
* **themable-browser:** add ThemableBrowser plugin ([b9151bc](https://github.com/driftyco/ionic-native/commit/b9151bc)), closes [#549](https://github.com/driftyco/ionic-native/issues/549)
|
||||
* **themable-browser:** add ThemableBrowser plugin ([972d63b](https://github.com/driftyco/ionic-native/commit/972d63b)), closes [#549](https://github.com/driftyco/ionic-native/issues/549)
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/driftyco/ionic-native/compare/v1.3.21...v2.0.3) (2016-09-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **call-number:** number should be a string ([763ad1b](https://github.com/driftyco/ionic-native/commit/763ad1b)), closes [#545](https://github.com/driftyco/ionic-native/issues/545)
|
||||
* **googlemaps:** CameraPosition target can now be LatLngBounds ([23fc908](https://github.com/driftyco/ionic-native/commit/23fc908)), closes [#547](https://github.com/driftyco/ionic-native/issues/547)
|
||||
* **npm:** duplicate typings ([e50b961](https://github.com/driftyco/ionic-native/commit/e50b961))
|
||||
* **plugins:** export VideoPlayer. Fixes [#563](https://github.com/driftyco/ionic-native/issues/563) ([4292959](https://github.com/driftyco/ionic-native/commit/4292959))
|
||||
* **ts:** use old ts version for 1.3.x [#567](https://github.com/driftyco/ionic-native/issues/567) ([6a19c8c](https://github.com/driftyco/ionic-native/commit/6a19c8c))
|
||||
* **webintent:** add type param. Fixes [#564](https://github.com/driftyco/ionic-native/issues/564) ([a0b6b10](https://github.com/driftyco/ionic-native/commit/a0b6b10))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add showAppSettings function ([281575b](https://github.com/driftyco/ionic-native/commit/281575b)), closes [#548](https://github.com/driftyco/ionic-native/issues/548)
|
||||
* **BackgroundGeolocation:** code cleanup ([3170686](https://github.com/driftyco/ionic-native/commit/3170686))
|
||||
* **BackgroundGeolocation:** Update to the latest version ([808a75e](https://github.com/driftyco/ionic-native/commit/808a75e))
|
||||
* **BackgroundGeolocation:** Update to the latest version ([919e8da](https://github.com/driftyco/ionic-native/commit/919e8da))
|
||||
* **build:** Support ES2015 modules ([4014972](https://github.com/driftyco/ionic-native/commit/4014972))
|
||||
* **emailcomposer:** use new supported plugin. [#568](https://github.com/driftyco/ionic-native/issues/568) ([a092a31](https://github.com/driftyco/ionic-native/commit/a092a31))
|
||||
* **localNotifications:** added register and has permission functions ([#536](https://github.com/driftyco/ionic-native/issues/536)) ([c83b043](https://github.com/driftyco/ionic-native/commit/c83b043))
|
||||
* **npm:** typescript 2.0.2 ([e7e45f6](https://github.com/driftyco/ionic-native/commit/e7e45f6))
|
||||
* **plugin:** cordova function override. fixes [#437](https://github.com/driftyco/ionic-native/issues/437) ([f60d08b](https://github.com/driftyco/ionic-native/commit/f60d08b))
|
||||
* **push:** add coldstart property. Fixes [#559](https://github.com/driftyco/ionic-native/issues/559) ([48196da](https://github.com/driftyco/ionic-native/commit/48196da))
|
||||
* **scripts:** publish script with npm and bower. Fixes [#448](https://github.com/driftyco/ionic-native/issues/448) ([3903fee](https://github.com/driftyco/ionic-native/commit/3903fee))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.21"></a>
|
||||
## [1.3.21](https://github.com/driftyco/ionic-native/compare/v1.3.20...v1.3.21) (2016-09-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **base64togallery:** fixes callbacks ([#513](https://github.com/driftyco/ionic-native/issues/513)) ([1db1374](https://github.com/driftyco/ionic-native/commit/1db1374))
|
||||
* **diagnostic:** Add DENIED_ALWAYS to permissionStatus, also some code formatting ([9d573a9](https://github.com/driftyco/ionic-native/commit/9d573a9))
|
||||
* **diagnostic:** Fix diagnostic objects ([cb176aa](https://github.com/driftyco/ionic-native/commit/cb176aa))
|
||||
* **diagnostic:** Fix permissionStatus object ([8f3d36f](https://github.com/driftyco/ionic-native/commit/8f3d36f))
|
||||
* **diagnostic:** Fix typo ([f93f958](https://github.com/driftyco/ionic-native/commit/f93f958))
|
||||
* **file:** set exclusive to true when replace is false ([7910493](https://github.com/driftyco/ionic-native/commit/7910493)), closes [#516](https://github.com/driftyco/ionic-native/issues/516)
|
||||
* **geolocation:** retain Observable even during an error condition ([#532](https://github.com/driftyco/ionic-native/issues/532)) ([26dead9](https://github.com/driftyco/ionic-native/commit/26dead9))
|
||||
* **googlemaps:** moveCamera and animateCamera now return a Promise ([d03d70f](https://github.com/driftyco/ionic-native/commit/d03d70f)), closes [#511](https://github.com/driftyco/ionic-native/issues/511)
|
||||
* **install-instructions:** This fixes install instructions for deeplinks, facebook and googlemaps ([#499](https://github.com/driftyco/ionic-native/issues/499)) ([877ac27](https://github.com/driftyco/ionic-native/commit/877ac27))
|
||||
* **media:** nest the constructor logic ([a566240](https://github.com/driftyco/ionic-native/commit/a566240))
|
||||
* **mixpanel:** Make eventProperties optional ([#501](https://github.com/driftyco/ionic-native/issues/501)) ([51364f8](https://github.com/driftyco/ionic-native/commit/51364f8))
|
||||
* **ng1:** fail gracefully when angular 1 promises can't be retrieved ([d135dc2](https://github.com/driftyco/ionic-native/commit/d135dc2))
|
||||
* **ng1:** grab injector from app. [#451](https://github.com/driftyco/ionic-native/issues/451) ([2dc68a4](https://github.com/driftyco/ionic-native/commit/2dc68a4))
|
||||
* remove CanvasCamera plugin ([c75f898](https://github.com/driftyco/ionic-native/commit/c75f898))
|
||||
* **social-sharing:** shareViaEmail now resolves/rejects when not providing optional args ([c76de34](https://github.com/driftyco/ionic-native/commit/c76de34))
|
||||
* **social-sharing:** various fixes ([#520](https://github.com/driftyco/ionic-native/issues/520)) ([4f97164](https://github.com/driftyco/ionic-native/commit/4f97164))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **file:** adds chunked blob writing ([#529](https://github.com/driftyco/ionic-native/issues/529)) ([bbbd0d5](https://github.com/driftyco/ionic-native/commit/bbbd0d5))
|
||||
* **file:** allows writeFile and writeExistingFile to accept Blob ([#527](https://github.com/driftyco/ionic-native/issues/527)) ([393e9d0](https://github.com/driftyco/ionic-native/commit/393e9d0))
|
||||
* **googlemaps:** can pass HTMLElement to constructor ([dff034a](https://github.com/driftyco/ionic-native/commit/dff034a))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.20"></a>
|
||||
## [1.3.20](https://github.com/driftyco/ionic-native/compare/v1.3.19...v1.3.20) (2016-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **GoogleMaps:** Fixes [#452](https://github.com/driftyco/ionic-native/issues/452) ([#498](https://github.com/driftyco/ionic-native/issues/498)) ([f6d5ac4](https://github.com/driftyco/ionic-native/commit/f6d5ac4))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **canvas-camera:** add CanvasCamera support ([ad57733](https://github.com/driftyco/ionic-native/commit/ad57733))
|
||||
* **file-chooser:** add file chooser plugin support ([#495](https://github.com/driftyco/ionic-native/issues/495)) ([94a7dae](https://github.com/driftyco/ionic-native/commit/94a7dae))
|
||||
* **file-opener:** add file opener support ([#497](https://github.com/driftyco/ionic-native/issues/497)) ([21d8122](https://github.com/driftyco/ionic-native/commit/21d8122)), closes [#295](https://github.com/driftyco/ionic-native/issues/295)
|
||||
* **music-controls:** add music controls plugin support ([#494](https://github.com/driftyco/ionic-native/issues/494)) ([4e9bc95](https://github.com/driftyco/ionic-native/commit/4e9bc95))
|
||||
* **youtube:** add Youtube video player plugin support ([#496](https://github.com/driftyco/ionic-native/issues/496)) ([0cf7d6a](https://github.com/driftyco/ionic-native/commit/0cf7d6a))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.19"></a>
|
||||
## [1.3.19](https://github.com/driftyco/ionic-native/compare/v1.3.18...v1.3.19) (2016-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mixpanel:** implement CordovaProperty correctly ([dd0c9ba](https://github.com/driftyco/ionic-native/commit/dd0c9ba))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **call-number:** add support for CallNumber plugin ([#487](https://github.com/driftyco/ionic-native/issues/487)) ([759f8ef](https://github.com/driftyco/ionic-native/commit/759f8ef))
|
||||
* **market:** add Market plugin support ([#490](https://github.com/driftyco/ionic-native/issues/490)) ([9bcc4ed](https://github.com/driftyco/ionic-native/commit/9bcc4ed))
|
||||
* **mixpanel:** add mixpanel support ([#492](https://github.com/driftyco/ionic-native/issues/492)) ([cf8e342](https://github.com/driftyco/ionic-native/commit/cf8e342))
|
||||
* **native-page-transitions:** add support for Native Page Transitions plugin ([#488](https://github.com/driftyco/ionic-native/issues/488)) ([00d87db](https://github.com/driftyco/ionic-native/commit/00d87db))
|
||||
* **nfc:** add nfc support ([#493](https://github.com/driftyco/ionic-native/issues/493)) ([76aa8a6](https://github.com/driftyco/ionic-native/commit/76aa8a6))
|
||||
* **paypal:** add PayPal support ([#491](https://github.com/driftyco/ionic-native/issues/491)) ([9fe5c19](https://github.com/driftyco/ionic-native/commit/9fe5c19))
|
||||
* **power-management:** add power management support ([#489](https://github.com/driftyco/ionic-native/issues/489)) ([cd82a53](https://github.com/driftyco/ionic-native/commit/cd82a53))
|
||||
* **streaming-media:** add streaming media support ([#486](https://github.com/driftyco/ionic-native/issues/486)) ([841b242](https://github.com/driftyco/ionic-native/commit/841b242))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.18"></a>
|
||||
## [1.3.18](https://github.com/driftyco/ionic-native/compare/v1.3.17...v1.3.18) (2016-08-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **facebook:** export interfaces ([c4110ee](https://github.com/driftyco/ionic-native/commit/c4110ee))
|
||||
* **File:** fixed readFileAs ([#479](https://github.com/driftyco/ionic-native/issues/479)) ([eff7841](https://github.com/driftyco/ionic-native/commit/eff7841))
|
||||
* **geofence:** fix event listeners ([efa222f](https://github.com/driftyco/ionic-native/commit/efa222f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **code-push:** add wrapper for cordova-plugin-code-push ([#420](https://github.com/driftyco/ionic-native/issues/420)) ([905f988](https://github.com/driftyco/ionic-native/commit/905f988))
|
||||
* **diagnostic:** add full plugin functionality ([#424](https://github.com/driftyco/ionic-native/issues/424)) ([47a9b34](https://github.com/driftyco/ionic-native/commit/47a9b34)), closes [#224](https://github.com/driftyco/ionic-native/issues/224)
|
||||
* **geofence:** Adds geofence plugin ([#442](https://github.com/driftyco/ionic-native/issues/442)) ([a438967](https://github.com/driftyco/ionic-native/commit/a438967))
|
||||
* **inAppPurchase:** add inAppPurhcase plugin ([#423](https://github.com/driftyco/ionic-native/issues/423)) ([8526e89](https://github.com/driftyco/ionic-native/commit/8526e89))
|
||||
* **IsDebug:** add the IsDebug plugin ([#475](https://github.com/driftyco/ionic-native/issues/475)) ([dd39ba8](https://github.com/driftyco/ionic-native/commit/dd39ba8))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.17"></a>
|
||||
## [1.3.17](https://github.com/driftyco/ionic-native/compare/v1.3.16...v1.3.17) (2016-08-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add the reject function at the expected errorIndex position in the args array ([#436](https://github.com/driftyco/ionic-native/issues/436)) ([4e87ac7](https://github.com/driftyco/ionic-native/commit/4e87ac7))
|
||||
* **camera-preview:** changes implementation to match Cordova plugin ([#441](https://github.com/driftyco/ionic-native/issues/441)) ([55ba65a](https://github.com/driftyco/ionic-native/commit/55ba65a))
|
||||
* **file:** fixes exclusive option ([#459](https://github.com/driftyco/ionic-native/issues/459)) ([14e41a3](https://github.com/driftyco/ionic-native/commit/14e41a3))
|
||||
* **file:** initialize writeFile options ([#468](https://github.com/driftyco/ionic-native/issues/468)) ([16628a4](https://github.com/driftyco/ionic-native/commit/16628a4))
|
||||
* **nativeaudio:** fix plugin reference ([2510c5f](https://github.com/driftyco/ionic-native/commit/2510c5f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **instagram:** add instagram sharing plugin ([#453](https://github.com/driftyco/ionic-native/issues/453)) ([f3e698f](https://github.com/driftyco/ionic-native/commit/f3e698f)), closes [#307](https://github.com/driftyco/ionic-native/issues/307)
|
||||
* **VideoEditor:** add video editor plugin. ([#457](https://github.com/driftyco/ionic-native/issues/457)) ([7a53013](https://github.com/driftyco/ionic-native/commit/7a53013)), closes [#316](https://github.com/driftyco/ionic-native/issues/316)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.16"></a>
|
||||
## [1.3.16](https://github.com/driftyco/ionic-native/compare/v1.3.15...v1.3.16) (2016-08-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **photo-viewer:** method is static ([8bc499f](https://github.com/driftyco/ionic-native/commit/8bc499f))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.15"></a>
|
||||
## [1.3.15](https://github.com/driftyco/ionic-native/compare/v1.3.14...v1.3.15) (2016-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-analytics:** add missing functions ([689bfd9](https://github.com/driftyco/ionic-native/commit/689bfd9))
|
||||
* **TTS:** add tts plugin ([#431](https://github.com/driftyco/ionic-native/issues/431)) ([dcf3ab2](https://github.com/driftyco/ionic-native/commit/dcf3ab2)), closes [#311](https://github.com/driftyco/ionic-native/issues/311)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.14"></a>
|
||||
## [1.3.14](https://github.com/driftyco/ionic-native/compare/v1.3.12...v1.3.14) (2016-08-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **datepicker:** date now accepts Date, string, or number ([#428](https://github.com/driftyco/ionic-native/issues/428)) ([aaddd9e](https://github.com/driftyco/ionic-native/commit/aaddd9e)), closes [#354](https://github.com/driftyco/ionic-native/issues/354)
|
||||
* **inappbrowser:** fix event listener ([4b08d85](https://github.com/driftyco/ionic-native/commit/4b08d85))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **native-audio:** Add native audio plugin ([#427](https://github.com/driftyco/ionic-native/issues/427)) ([8cd6686](https://github.com/driftyco/ionic-native/commit/8cd6686)), closes [#315](https://github.com/driftyco/ionic-native/issues/315)
|
||||
* **shake:** add Shake plugin ([#426](https://github.com/driftyco/ionic-native/issues/426)) ([203d4c7](https://github.com/driftyco/ionic-native/commit/203d4c7)), closes [#313](https://github.com/driftyco/ionic-native/issues/313)
|
||||
* **zip:** add zip plugin ([#430](https://github.com/driftyco/ionic-native/issues/430)) ([e34f94e](https://github.com/driftyco/ionic-native/commit/e34f94e)), closes [#421](https://github.com/driftyco/ionic-native/issues/421)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.12"></a>
|
||||
## [1.3.12](https://github.com/driftyco/ionic-native/compare/v1.3.11...v1.3.12) (2016-08-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **inappbrowser:** fix event listener ([618d866](https://github.com/driftyco/ionic-native/commit/618d866))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.11"></a>
|
||||
## [1.3.11](https://github.com/driftyco/ionic-native/compare/v1.3.10...v1.3.11) (2016-08-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **backgroundGeolocation:** update config and move to sync. Fixes [#331](https://github.com/driftyco/ionic-native/issues/331) ([4e20681](https://github.com/driftyco/ionic-native/commit/4e20681))
|
||||
* **camera:** camera options should be optional. Fixes [#413](https://github.com/driftyco/ionic-native/issues/413) ([#417](https://github.com/driftyco/ionic-native/issues/417)) ([c60c3b7](https://github.com/driftyco/ionic-native/commit/c60c3b7))
|
||||
* **index:** export Geolocation interfaces. ([#404](https://github.com/driftyco/ionic-native/issues/404)) ([0c486b0](https://github.com/driftyco/ionic-native/commit/0c486b0))
|
||||
* **ng1:** Copy object properly. Fixes [#357](https://github.com/driftyco/ionic-native/issues/357) ([9ca38cd](https://github.com/driftyco/ionic-native/commit/9ca38cd))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **file:** alternate file implementation ([#283](https://github.com/driftyco/ionic-native/issues/283)) ([6ed32ef](https://github.com/driftyco/ionic-native/commit/6ed32ef))
|
||||
* **GoogleAnalytics:** Add campaign measurement tracking ([#405](https://github.com/driftyco/ionic-native/issues/405)) ([cf3f0f6](https://github.com/driftyco/ionic-native/commit/cf3f0f6))
|
||||
* **GoogleMaps:** Allow specify enableHighAccuracy option that attempt to get your location with highest accuracy ([#410](https://github.com/driftyco/ionic-native/issues/410)) ([43e8a6d](https://github.com/driftyco/ionic-native/commit/43e8a6d))
|
||||
* **ibeacon:** using option otherPromise instead of sync ([#388](https://github.com/driftyco/ionic-native/issues/388)) ([306cb5d](https://github.com/driftyco/ionic-native/commit/306cb5d))
|
||||
* **inappbrowser:** implement instance based wrapper ([#305](https://github.com/driftyco/ionic-native/issues/305)) ([4b8ab4a](https://github.com/driftyco/ionic-native/commit/4b8ab4a))
|
||||
* **keyboard:** enable hideKeyboardAccessoryBar function ([#398](https://github.com/driftyco/ionic-native/issues/398)) ([7a84262](https://github.com/driftyco/ionic-native/commit/7a84262)), closes [#394](https://github.com/driftyco/ionic-native/issues/394)
|
||||
* **photo-viewer:** add wrapper for plugin ([#359](https://github.com/driftyco/ionic-native/issues/359)) ([154c029](https://github.com/driftyco/ionic-native/commit/154c029))
|
||||
* **video-player:** Added video player plugin ([#391](https://github.com/driftyco/ionic-native/issues/391)) ([cabeeb8](https://github.com/driftyco/ionic-native/commit/cabeeb8)), closes [#342](https://github.com/driftyco/ionic-native/issues/342)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.10"></a>
|
||||
## [1.3.10](https://github.com/driftyco/ionic-native/compare/v1.3.9...v1.3.10) (2016-08-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **brightness:** use correct pluginRef ([e20c411](https://github.com/driftyco/ionic-native/commit/e20c411))
|
||||
* **diagnostics:** Corrects isEnabled functions to isAvailable ([#373](https://github.com/driftyco/ionic-native/issues/373)) ([ccf7fb5](https://github.com/driftyco/ionic-native/commit/ccf7fb5))
|
||||
* **ng1:** use $q promises instead of the native Promise ([#378](https://github.com/driftyco/ionic-native/issues/378)) ([817a434](https://github.com/driftyco/ionic-native/commit/817a434))
|
||||
* **one-signal:** return Observable instead of promise ([#352](https://github.com/driftyco/ionic-native/issues/352)) ([08fe04e](https://github.com/driftyco/ionic-native/commit/08fe04e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **crop:** add crop plugin ([#284](https://github.com/driftyco/ionic-native/issues/284)) ([41c9adf](https://github.com/driftyco/ionic-native/commit/41c9adf))
|
||||
* **screen-orientation:** Added Screen Orientation Plugin [#342](https://github.com/driftyco/ionic-native/issues/342) ([#366](https://github.com/driftyco/ionic-native/issues/366)) ([bd9366b](https://github.com/driftyco/ionic-native/commit/bd9366b))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.9"></a>
|
||||
## [1.3.9](https://github.com/driftyco/ionic-native/compare/v1.3.8...v1.3.9) (2016-07-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **file:** readAsText() and adds readAsDataURL() in File plugin ([#346](https://github.com/driftyco/ionic-native/issues/346)) ([77d31cd](https://github.com/driftyco/ionic-native/commit/77d31cd))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-fingerprint-auth:** add wrapper for plugin ([df326f7](https://github.com/driftyco/ionic-native/commit/df326f7)), closes [#334](https://github.com/driftyco/ionic-native/issues/334)
|
||||
* **secure-storage:** Add Secure Storage Wrapper ([#347](https://github.com/driftyco/ionic-native/issues/347)) ([075842d](https://github.com/driftyco/ionic-native/commit/075842d))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.8"></a>
|
||||
## [1.3.8](https://github.com/driftyco/ionic-native/compare/v1.3.7...v1.3.8) (2016-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **base64togallery:** update plugin wrapper to match latest version ([d4bee49](https://github.com/driftyco/ionic-native/commit/d4bee49)), closes [#335](https://github.com/driftyco/ionic-native/issues/335)
|
||||
* **sqlite:** fix method attribute typo ([#324](https://github.com/driftyco/ionic-native/issues/324)) ([006bc70](https://github.com/driftyco/ionic-native/commit/006bc70))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **facebook:** add FacebookLoginResponse interface ([8b27bed](https://github.com/driftyco/ionic-native/commit/8b27bed))
|
||||
* **otherPromise:** can work better with plugins that return promises ([#304](https://github.com/driftyco/ionic-native/issues/304)) ([0aee6c8](https://github.com/driftyco/ionic-native/commit/0aee6c8))
|
||||
* **social-sharing:** add canShareViaEmail ([#333](https://github.com/driftyco/ionic-native/issues/333)) ([5807dd7](https://github.com/driftyco/ionic-native/commit/5807dd7))
|
||||
* **twitter-connect:** add twitter connect plugin ([979838f](https://github.com/driftyco/ionic-native/commit/979838f)), closes [#308](https://github.com/driftyco/ionic-native/issues/308)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.7"></a>
|
||||
## [1.3.7](https://github.com/driftyco/ionic-native/compare/v1.3.6...v1.3.7) (2016-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **contacts:** missing name property, types ([#320](https://github.com/driftyco/ionic-native/issues/320)) ([074d166](https://github.com/driftyco/ionic-native/commit/074d166))
|
||||
* **geolocation:** handle errors on watchPosition ([1b161d8](https://github.com/driftyco/ionic-native/commit/1b161d8)), closes [#322](https://github.com/driftyco/ionic-native/issues/322)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **sim:** Add sim plugin ([#317](https://github.com/driftyco/ionic-native/issues/317)) ([4f85110](https://github.com/driftyco/ionic-native/commit/4f85110))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.6"></a>
|
||||
## [1.3.6](https://github.com/driftyco/ionic-native/compare/v1.3.5...v1.3.6) (2016-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** able to pass array of LatLng to GoogleMapsLatLngBounds constructor ([de14b0e](https://github.com/driftyco/ionic-native/commit/de14b0e)), closes [#298](https://github.com/driftyco/ionic-native/issues/298)
|
||||
* **launch-navigator:** fix the navigate function wrapper to match latest plugin API ([6f625f9](https://github.com/driftyco/ionic-native/commit/6f625f9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **camera-preview:** add wrapper for camera-preview ([#301](https://github.com/driftyco/ionic-native/issues/301)) ([3a1a3ce](https://github.com/driftyco/ionic-native/commit/3a1a3ce))
|
||||
* **launch-navigator:** add new methods and constants to match latest plugin API ([29de6b3](https://github.com/driftyco/ionic-native/commit/29de6b3))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.5"></a>
|
||||
## [1.3.5](https://github.com/driftyco/ionic-native/compare/v1.3.4...v1.3.5) (2016-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ibeacon:** minor fixes ([b5a2ffc](https://github.com/driftyco/ionic-native/commit/b5a2ffc))
|
||||
* **safari-view-controller:** fix wrappers ([b4b3ec0](https://github.com/driftyco/ionic-native/commit/b4b3ec0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **googlemaps:** add Geocoder class ([#292](https://github.com/driftyco/ionic-native/issues/292)) ([2996da6](https://github.com/driftyco/ionic-native/commit/2996da6)), closes [#280](https://github.com/driftyco/ionic-native/issues/280)
|
||||
* **inAppPurchase:** add inAppPurchase ([f1988f6](https://github.com/driftyco/ionic-native/commit/f1988f6))
|
||||
* **media-capture:** add media capture plugin ([#293](https://github.com/driftyco/ionic-native/issues/293)) ([daa6d4c](https://github.com/driftyco/ionic-native/commit/daa6d4c)), closes [#272](https://github.com/driftyco/ionic-native/issues/272)
|
||||
* **nativestorage:** add NativeStorage plugin wrapper ([af5d4ad](https://github.com/driftyco/ionic-native/commit/af5d4ad))
|
||||
* **pin-dialog:** add pin dialog plugin ([#291](https://github.com/driftyco/ionic-native/issues/291)) ([2fe37c4](https://github.com/driftyco/ionic-native/commit/2fe37c4))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.4"></a>
|
||||
## [1.3.4](https://github.com/driftyco/ionic-native/compare/v1.3.3...v1.3.4) (2016-07-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **touchid:** make isAvailable static ([c23f5e9](https://github.com/driftyco/ionic-native/commit/c23f5e9))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* **changelog:** old changelog ([0cb79d1](https://github.com/driftyco/ionic-native/commit/0cb79d1))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.3"></a>
|
||||
## [1.3.3](https://github.com/driftyco/ionic-native/compare/v1.3.2...v1.3.3) (2016-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove unnecessary decorator ([#257](https://github.com/driftyco/ionic-native/issues/257)) ([25fab64](https://github.com/driftyco/ionic-native/commit/25fab64))
|
||||
* **actionsheet:** add missing optional parameter for hide function ([#262](https://github.com/driftyco/ionic-native/issues/262)) ([644e999](https://github.com/driftyco/ionic-native/commit/644e999))
|
||||
* **background-geolocation:** fix pluginref again ([b8a5133](https://github.com/driftyco/ionic-native/commit/b8a5133))
|
||||
* **geolocation:** fix plugin reference ([4f0cd24](https://github.com/driftyco/ionic-native/commit/4f0cd24)), closes [#258](https://github.com/driftyco/ionic-native/issues/258)
|
||||
* **googlemaps:** use correct methods for addGroundOverlay and addKmlOverlay ([#268](https://github.com/driftyco/ionic-native/issues/268)) ([b8be1de](https://github.com/driftyco/ionic-native/commit/b8be1de))
|
||||
* **socialsharing:** all methods return Promises now ([e150224](https://github.com/driftyco/ionic-native/commit/e150224)), closes [#275](https://github.com/driftyco/ionic-native/issues/275)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ibeacon:** add iBeacon plugin support ([#270](https://github.com/driftyco/ionic-native/issues/270)) ([dd97df1](https://github.com/driftyco/ionic-native/commit/dd97df1))
|
||||
* **onesignal:** added wrapper for the Cordova OneSignal Plugin ([#252](https://github.com/driftyco/ionic-native/issues/252)) ([ba20dbe](https://github.com/driftyco/ionic-native/commit/ba20dbe))
|
||||
* **push:** added support for Action Buttons on iOS with categories ([#273](https://github.com/driftyco/ionic-native/issues/273)) ([592feb4](https://github.com/driftyco/ionic-native/commit/592feb4))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.2"></a>
|
||||
## [1.3.2](https://github.com/driftyco/ionic-native/compare/v1.3.1...v1.3.2) (2016-06-27)
|
||||
|
||||
@@ -9,12 +797,28 @@
|
||||
|
||||
|
||||
<a name="1.3.1"></a>
|
||||
## [1.3.1](https://github.com/driftyco/ionic-native/compare/v1.2.4...v1.3.1) (2016-06-26)
|
||||
## [1.3.1](https://github.com/driftyco/ionic-native/compare/v1.3.0...v1.3.1) (2016-06-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **3dtouch:** fix implementation for onHomeIconPressed function ([d2b2be6](https://github.com/driftyco/ionic-native/commit/d2b2be6)), closes [#232](https://github.com/driftyco/ionic-native/issues/232)
|
||||
* **sqlite:** resolve race condition, add comments ([#235](https://github.com/driftyco/ionic-native/issues/235)) ([f1c8ce3](https://github.com/driftyco/ionic-native/commit/f1c8ce3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **googlemaps:** add GoogleMapsLatLngBounds class ([17da427](https://github.com/driftyco/ionic-native/commit/17da427))
|
||||
* **printer:** add printer plugin ([#225](https://github.com/driftyco/ionic-native/issues/225)) ([48ffcae](https://github.com/driftyco/ionic-native/commit/48ffcae))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.0"></a>
|
||||
# [1.3.0](https://github.com/driftyco/ionic-native/compare/v1.2.3...v1.3.0) (2016-06-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **barcodescanner:** add missing options param ([4fdcbb5](https://github.com/driftyco/ionic-native/commit/4fdcbb5)), closes [#180](https://github.com/driftyco/ionic-native/issues/180)
|
||||
* **base64togallery:** method is now static ([be7b9e2](https://github.com/driftyco/ionic-native/commit/be7b9e2)), closes [#212](https://github.com/driftyco/ionic-native/issues/212)
|
||||
* **batterystatus:** correct plugin name on npm ([66b7fa6](https://github.com/driftyco/ionic-native/commit/66b7fa6))
|
||||
@@ -23,7 +827,6 @@
|
||||
* **deviceorientation:** cancelFunction renamed to clearFunction ([8dee02e](https://github.com/driftyco/ionic-native/commit/8dee02e))
|
||||
* **geolocation:** fix watchPosition() ([4a8650e](https://github.com/driftyco/ionic-native/commit/4a8650e)), closes [#164](https://github.com/driftyco/ionic-native/issues/164)
|
||||
* **googlemaps:** isAvailable() returns boolean, not an instance of GoogleMap ([a53ae8f](https://github.com/driftyco/ionic-native/commit/a53ae8f))
|
||||
* **sqlite:** resolve race condition, add comments ([#235](https://github.com/driftyco/ionic-native/issues/235)) ([f1c8ce3](https://github.com/driftyco/ionic-native/commit/f1c8ce3)), closes [#235](https://github.com/driftyco/ionic-native/issues/235)
|
||||
|
||||
|
||||
### Features
|
||||
@@ -31,13 +834,6 @@
|
||||
* **angular1:** Support Angular 1 ([af8fbde](https://github.com/driftyco/ionic-native/commit/af8fbde))
|
||||
* **barcodescanner:** add encode function ([e73f57f](https://github.com/driftyco/ionic-native/commit/e73f57f)), closes [#115](https://github.com/driftyco/ionic-native/issues/115)
|
||||
* **deeplinks:** Add Ionic Deeplinks Plugin ([c93cbed](https://github.com/driftyco/ionic-native/commit/c93cbed))
|
||||
* **googlemaps:** add GoogleMapsLatLngBounds class ([17da427](https://github.com/driftyco/ionic-native/commit/17da427))
|
||||
* **printer:** add printer plugin ([#225](https://github.com/driftyco/ionic-native/issues/225)) ([48ffcae](https://github.com/driftyco/ionic-native/commit/48ffcae))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.4"></a>
|
||||
## [1.2.4](https://github.com/driftyco/ionic-native/compare/v1.2.3...v1.2.4) (2016-06-01)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Contributing to Ionic Native
|
||||
|
||||
|
||||
## Feature request?
|
||||
Have a plugin you'd like to see supported? Because Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whichever plugin you'd like to add.
|
||||
|
||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||
|
||||
## Having an issue?
|
||||
#### There are no rules, but here are a few things to consider:
|
||||
###### Before you submit an issue:
|
||||
* Do a quick search to see if there are similar issues
|
||||
* Check that you are using the latest version of `ionic-native`
|
||||
|
||||
###### Still having problems? submit an issue with the following details:
|
||||
* Short description of the issue
|
||||
* Steps to reproduce
|
||||
* Stack trace (if available)
|
||||
93
DEVELOPER.md
93
DEVELOPER.md
@@ -5,6 +5,16 @@ This is a short guide on creating new plugin wrappers for Ionic Native.
|
||||
|
||||
## Creating Plugin Wrappers
|
||||
|
||||
First, let's start by creating a new plugin wrapper from template.
|
||||
|
||||
```
|
||||
// Call this command, and replace PluginName with the name of the plugin you wish to add
|
||||
// Make sure to capitalize the first letter, or use CamelCase if necessary.
|
||||
|
||||
gulp plugin:create -n PluginName
|
||||
```
|
||||
|
||||
|
||||
Let's take a look at the existing plugin wrapper for Geolocation to see what goes into an Ionic Native plugin (comments have been removed for clarity):
|
||||
|
||||
```
|
||||
@@ -92,14 +102,95 @@ The `@Cordova` decorator has a few more options now.
|
||||
|
||||
`clearFunction` is used in conjunction with the `observable` option and indicates the function to be called when the Observable is disposed.
|
||||
|
||||
### Updating index.ts
|
||||
|
||||
For new plugins, you will need to update `/src/index.ts` to properly export your plugin and make it available for use.
|
||||
|
||||
1. Import the plugin class into `index.ts`:
|
||||
|
||||
`import {PluginClassName} from ./plugins/filenameForPlugin`
|
||||
|
||||
No need to put the `.ts` extension on the filename.
|
||||
|
||||
2. Add the plugin class name to the list in the `export` object:
|
||||
|
||||
```
|
||||
export {
|
||||
ActionSheet,
|
||||
AdMob,
|
||||
AndroidFingerprintAuth,
|
||||
YourPluginClassName,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
3. Add the plugin class name to the `window['IonicNative']` object:
|
||||
|
||||
```
|
||||
window['IonicNative'] = {
|
||||
ActionSheet: ActionSheet,
|
||||
AdMob: AdMob,
|
||||
AndroidFingerprintAuth: AndroidFingerprintAuth,
|
||||
YourPluginClassName: YourPluginClassName,
|
||||
...
|
||||
```
|
||||
|
||||
4. If your plugin exports any other objects outside of the plugin class, add an export statement for the file:
|
||||
|
||||
`export * from './plugins/filenameForPlugin';`
|
||||
|
||||
No need to put the `.ts` extension on the filename.
|
||||
|
||||
For example, `googlemaps.ts` exports a const outside of the plugin's main `GoogleMap` class:
|
||||
|
||||
```
|
||||
export const GoogleMapsAnimation = {
|
||||
BOUNCE: 'BOUNCE',
|
||||
DROP: 'DROP'
|
||||
};
|
||||
```
|
||||
|
||||
To properly export `GoogleMapsAnimation`, `index.ts` is updated with:
|
||||
|
||||
`export * from './plugins/googlemaps';`
|
||||
|
||||
### Testing your changes
|
||||
|
||||
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. Then, you must go to your ionic application folder and replace your current `node_modules/ionic-native/dist/` with the newly generated one.
|
||||
|
||||
### Cleaning the code
|
||||
|
||||
You need to run `npm run tslint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
|
||||
You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
|
||||
|
||||
### 'Wrapping' Up
|
||||
|
||||
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
|
||||
|
||||
## Commit Message Format
|
||||
|
||||
We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the our change log. (Ok you got us, it's basically Angular's commit message format).
|
||||
|
||||
`type(scope): subject`
|
||||
|
||||
#### Type
|
||||
Must be one of the following:
|
||||
|
||||
* **fix**: A bug fix
|
||||
* **feat**: A new feature
|
||||
* **docs**: Documentation only changes
|
||||
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||
* **perf**: A code change that improves performance
|
||||
* **test**: Adding missing tests
|
||||
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||
|
||||
#### Scope
|
||||
The scope could be anything specifying place of the commit change. For example, the name of the plugin being changed
|
||||
|
||||
#### Subject
|
||||
The subject contains succinct description of the change:
|
||||
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* do not capitalize first letter
|
||||
* do not place a period (.) at the end
|
||||
* entire length of the commit message must not go over 50 characters
|
||||
23
LICENSE
Normal file
23
LICENSE
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright 2015-present Drifty Co.
|
||||
http://drifty.com/
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
47
README.md
47
README.md
@@ -1,8 +1,8 @@
|
||||
[](https://circleci.com/gh/driftyco/ionic-native) [](http://commitizen.github.io/cz-cli/)
|
||||
[](https://www.npmjs.com/package/ionic-native-playground)
|
||||
[](https://www.npmjs.com/package/ionic-native)
|
||||
|
||||
[](https://nodei.co/npm/ionic-native/)
|
||||
|
||||
[](https://nodei.co/npm/ionic-native/)
|
||||
|
||||
# Ionic Native
|
||||
|
||||
@@ -17,9 +17,9 @@ For the full Ionic Native documentation, please visit [http://ionicframework.com
|
||||
Ionic Native wraps plugin callbacks in a Promise or [Observable](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754), providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.
|
||||
|
||||
```
|
||||
import {Geolocation} from 'ionic-native';
|
||||
import { Geolocation } from 'ionic-native';
|
||||
|
||||
Geolocation.getCurrentPosition().then(pos => {
|
||||
Geolocation.getCurrentPosition().then(pos => {
|
||||
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
|
||||
});
|
||||
|
||||
@@ -31,13 +31,50 @@ let watch = Geolocation.watchPosition().subscribe(pos => {
|
||||
watch.unsubscribe();
|
||||
```
|
||||
|
||||
### Angular 1
|
||||
|
||||
Ionic Native works as a stand-in for [ngCordova](http://ngcordova.com/). In many cases, the usage is identical, but we import `ionic.native` instead of `ngCordova` as our module.
|
||||
|
||||
As a rule of thumb: take the ES6 class name of the plugin and add `$cordova` to get the service name. For example, `Geolocation` would be `$cordovaGeolocation`, and `Camera` will be `$cordovaCamera`:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ionic', 'ionic.native'])
|
||||
|
||||
.controller('MyCtrl', function($scope, $cordovaCamera) {
|
||||
$scope.takePicture = function() {
|
||||
$cordovaCamera.getPicture(opts).then(function(p) {
|
||||
}, function(err) {
|
||||
});
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
For services that return observables, the Angular 1 digest cycle must be done manually (currently):
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ionic', 'ionic.native'])
|
||||
|
||||
.controller('MyCtrl', function($scope, $cordovaGeolocation) {
|
||||
$scope.takePicture = function() {
|
||||
$cordovaGeolocation.watchPosition(opts).subscribe(function(p) {
|
||||
$scope.$apply(function() {
|
||||
$scope.position = p.coords;
|
||||
});
|
||||
}, function(err) {
|
||||
});
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
### Runtime Diagnostics
|
||||
|
||||
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Run following commmand to install ionic-native in your project.
|
||||
Run following commmand to install ionic-native in your project.
|
||||
```
|
||||
npm install ionic-native --save
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ dependencies:
|
||||
|
||||
test:
|
||||
override:
|
||||
- echo "No tests are written at the moment. But we will attempt to build the library with the latest changes."
|
||||
- npm test
|
||||
- npm run build
|
||||
|
||||
deployment:
|
||||
|
||||
25
gulpfile.js
25
gulpfile.js
@@ -3,6 +3,8 @@ var minimist = require('minimist');
|
||||
var uglify = require('gulp-uglify');
|
||||
var rename = require("gulp-rename");
|
||||
var tslint = require('gulp-tslint');
|
||||
var decamelize = require('decamelize');
|
||||
var replace = require('gulp-replace');
|
||||
|
||||
var flagConfig = {
|
||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||
@@ -25,8 +27,23 @@ gulp.task("minify:dist", function(){
|
||||
.pipe(gulp.dest('./dist'));
|
||||
});
|
||||
|
||||
gulp.task("tslint", function(){
|
||||
gulp.src("src/**/*.ts")
|
||||
.pipe(tslint())
|
||||
.pipe(tslint.report('verbose'));
|
||||
gulp.task('lint', function() {
|
||||
gulp.src('src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: "verbose",
|
||||
configuration: 'tslint.json'
|
||||
}))
|
||||
.pipe(tslint.report())
|
||||
});
|
||||
|
||||
gulp.task('plugin:create', function(){
|
||||
if(flags.n && flags.n !== ''){
|
||||
var src = flags.m?'./scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl';
|
||||
return gulp.src(src)
|
||||
.pipe(replace('PluginName', flags.n))
|
||||
.pipe(rename(decamelize(flags.n, '-') + '.ts'))
|
||||
.pipe(gulp.dest('./src/plugins/'));
|
||||
} else {
|
||||
console.log("Usage is: gulp plugin:create -n PluginName");
|
||||
}
|
||||
});
|
||||
|
||||
61
karma.conf.ts
Normal file
61
karma.conf.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
const WATCH = process.argv.indexOf('--watch') > -1;
|
||||
|
||||
module.exports = config => {
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: './',
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['jasmine', 'browserify'],
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'test/**/*.spec.ts'
|
||||
],
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'test/**/*.spec.ts': ['browserify']
|
||||
},
|
||||
|
||||
browserify: {
|
||||
debug: true,
|
||||
plugin: [ 'tsify' ],
|
||||
extensions: ['.js', '.ts']
|
||||
},
|
||||
|
||||
phantomjsLauncher: {
|
||||
// Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
|
||||
exitOnResourceError: true
|
||||
},
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['dots'],
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: WATCH,
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: !WATCH
|
||||
});
|
||||
};
|
||||
61
package.json
61
package.json
@@ -1,47 +1,63 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "1.3.2",
|
||||
"version": "2.3.2",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/index.js",
|
||||
"main": "dist/es5/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"typings": "dist/es5/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"rxjs": "^5.0.0-beta.6"
|
||||
"rxjs": "5.0.0-beta.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.0.1",
|
||||
"browserify": "^13.3.0",
|
||||
"canonical-path": "0.0.2",
|
||||
"conventional-changelog-cli": "^1.2.0",
|
||||
"conventional-github-releaser": "^1.1.3",
|
||||
"cpr": "^1.0.0",
|
||||
"cz-conventional-changelog": "^1.1.6",
|
||||
"cpr": "^2.0.2",
|
||||
"cz-conventional-changelog": "^1.2.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"dgeni": "^0.4.2",
|
||||
"dgeni-packages": "^0.10.18",
|
||||
"glob": "^6.0.4",
|
||||
"es6-shim": "~0.35.2",
|
||||
"glob": "^7.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-tslint": "^5.0.0",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"lodash": "3.10.1",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-tslint": "^6.1.2",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"jasmine-core": "~2.5.2",
|
||||
"karma": "~1.3.0",
|
||||
"karma-browserify": "~5.1.0",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-phantomjs-launcher": "~1.0.2",
|
||||
"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",
|
||||
"tslint": "^3.8.1",
|
||||
"tslint-eslint-rules": "^1.3.0",
|
||||
"typescript": "^1.8.10"
|
||||
"semver": "^5.3.0",
|
||||
"tsify": "~3.0.0",
|
||||
"tslint": "^3.15.1",
|
||||
"tslint-ionic-rules": "0.0.7",
|
||||
"typescript": "~2.0.10",
|
||||
"watchify": "~3.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"tslint": "./node_modules/.bin/gulp tslint",
|
||||
"watch": "./node_modules/.bin/tsc -w",
|
||||
"build": "npm run tslint && npm run build:js && npm run build:bundle && npm run build:minify",
|
||||
"build:js": "./node_modules/.bin/tsc",
|
||||
"build:bundle": "./node_modules/.bin/browserify dist/index.js > dist/ionic.native.js",
|
||||
"build:minify": "./node_modules/.bin/gulp minify:dist",
|
||||
"changelog": "./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
||||
"test": "karma start",
|
||||
"test:watch": "npm test -- --watch",
|
||||
"start": "npm run test:watch",
|
||||
"lint": "gulp lint",
|
||||
"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",
|
||||
"build:bundle": "browserify dist/es5/index.js > dist/ionic.native.js",
|
||||
"build:minify": "gulp minify:dist",
|
||||
"shipit": "npm run build && npm publish && bash ./scripts/bower.sh",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||
"plugin:create": "gulp plugin:create"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -52,7 +68,6 @@
|
||||
"url": "https://github.com/driftyco/ionic-native/issues"
|
||||
},
|
||||
"homepage": "https://github.com/driftyco/ionic-native",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
|
||||
26
scripts/bower.json
Normal file
26
scripts/bower.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": [
|
||||
"ionic.native.js"
|
||||
],
|
||||
"authors": [
|
||||
"Max Lynch <max@ionic.io>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
"native",
|
||||
"html5",
|
||||
"hybrid",
|
||||
"mobile"
|
||||
],
|
||||
"homepage": "https://github.com/driftyco/ionic-native-bower",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
28
scripts/bower.sh
Normal file
28
scripts/bower.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
|
||||
# readJsonProp(jsonFile, property)
|
||||
# - restriction: property needs to be on an own line!
|
||||
function readJsonProp {
|
||||
echo $(sed -En 's/.*"'$2'"[ ]*:[ ]*"(.*)".*/\1/p' $1)
|
||||
}
|
||||
|
||||
VERSION=$(readJsonProp "package.json" "version")
|
||||
|
||||
echo "BOWERING IONIC-NATIVE VERSION $VERSION. FOR GREAT JUSTICE..."
|
||||
|
||||
DIR="scripts/ionic-native-bower"
|
||||
rm -rf $DIR
|
||||
mkdir $DIR
|
||||
cp dist/ionic.native.js dist/ionic.native.min.js $DIR
|
||||
cd $DIR
|
||||
git init
|
||||
git remote add origin git@github.com:driftyco/ionic-native-bower.git
|
||||
cp ../bower.json .
|
||||
git add .
|
||||
git commit -m "Bower release"
|
||||
git tag -f -m v$VERSION v$VERSION
|
||||
git push -f --tags origin master
|
||||
|
||||
echo "BOWERING COMPLETED SOMEWHAT SUCCESSFULLY"
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sitePath": "../ionic-site",
|
||||
"v2DocsDir": "docs/v2/native",
|
||||
"docsDest": "../ionic-site/docs/v2/native"
|
||||
"docsDest": "../ionic-site/content/docs/v2/native"
|
||||
}
|
||||
|
||||
@@ -31,12 +31,37 @@ module.exports = function(currentVersion) {
|
||||
// $runBefore: ['rendering-docs'],
|
||||
// $process: function(docs){
|
||||
// docs.forEach(function(doc){
|
||||
// if (doc.members && doc.name == "IonicApp"){
|
||||
// doc.members.forEach(function(method){
|
||||
// if (method.name === "load") {
|
||||
// console.log(method);
|
||||
// }
|
||||
// })
|
||||
// if (doc.name == "Camera"){
|
||||
//
|
||||
// // console.log(doc.tags);
|
||||
// // doc.tags.forEach(function(tag){
|
||||
// // if(tag.tagName == 'classes'){
|
||||
// //
|
||||
// // }
|
||||
// // });
|
||||
//
|
||||
// // doc.moduleDoc.exports.forEach(function(d,i){
|
||||
// // if(d.name === 'CameraOptions') {
|
||||
// // console.log('Name: ' + d.name);
|
||||
// // console.log('Type: ' + d.docType);
|
||||
// // console.log('First member: ', d.members[0]);
|
||||
// // }
|
||||
// // });
|
||||
//
|
||||
//
|
||||
// // var exports = doc.exportSymbol.parent.exports;
|
||||
// // for(var p in exports) {
|
||||
// // if(p == 'CameraOptions')
|
||||
// // {
|
||||
// // var x = exports[p];
|
||||
// // console.log(x.members.quality);
|
||||
// // }
|
||||
// // }
|
||||
// // doc.members.forEach(function(method){
|
||||
// // if (method.name === "getPicture") {
|
||||
// // console.log(method);
|
||||
// // }
|
||||
// // })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
@@ -51,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
|
||||
@@ -60,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
|
||||
};
|
||||
@@ -74,12 +99,11 @@ module.exports = function(currentVersion) {
|
||||
|
||||
renderDocsProcessor.extraData.version = versionData;
|
||||
renderDocsProcessor.extraData.versionInfo = versionInfo;
|
||||
|
||||
computePathsProcessor.pathTemplates = [{
|
||||
docTypes: ['class', 'var', 'function', 'let'],
|
||||
getOutputPath: function(doc) {
|
||||
var docPath = doc.name + '/index.md';
|
||||
var path = config.v2DocsDir + '/' + docPath;
|
||||
var path = 'content/' + config.v2DocsDir + '/' + docPath;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,17 @@ function run {
|
||||
./git/clone.sh --repository="ionic-site" \
|
||||
--directory="$SITE_DIR" \
|
||||
--branch="master"
|
||||
ls -al $SITE_DIR
|
||||
cd $SITE_DIR
|
||||
ls -al
|
||||
else
|
||||
echo "using existing"
|
||||
cd $SITE_DIR
|
||||
git reset --hard
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf content/docs/v2/native/*/ || true
|
||||
|
||||
}
|
||||
|
||||
source $(dirname $0)/../utils.inc.sh
|
||||
|
||||
@@ -5,6 +5,15 @@ module.exports = function collectInputsOutputs() {
|
||||
$process: function(docs) {
|
||||
docs.forEach(function(doc) {
|
||||
|
||||
if (doc.statics && doc.statics.length) {
|
||||
for (var i in doc.statics) {
|
||||
// identify properties to differentiate from methods
|
||||
if (typeof doc.statics[i].parameters == 'undefined') {
|
||||
doc.statics[i].isProperty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doc.members && doc.members.length) {
|
||||
var members = [];
|
||||
var inputs = [];
|
||||
|
||||
@@ -19,14 +19,17 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
docs.forEach(function(doc, i) {
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
|
||||
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
|
||||
.replace('/index.md', '');
|
||||
.replace('/index.md', '')
|
||||
.replace('content/', '');
|
||||
|
||||
docs[i].demo = !!docs[i].demo;
|
||||
});
|
||||
|
||||
docs.push({
|
||||
docType: 'native_menu-menu',
|
||||
id: 'native_menu-menu',
|
||||
template: 'native_menu.template.html',
|
||||
outputPath: '_includes/v2_fluid/native_menu.html'
|
||||
outputPath: 'content/_includes/v2_fluid/native_menu.html'
|
||||
});
|
||||
|
||||
// returning docs will replace docs object in the next process
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = function latestVersion(renderDocsProcessor) {
|
||||
$process: function(docs) {
|
||||
var versionData = renderDocsProcessor.extraData.version;
|
||||
|
||||
var docsBase = 'dist/ionic-site/docs/v2/';
|
||||
var docsBase = 'dist/ionic-site/content/docs/v2/';
|
||||
var versionDir = path.resolve(docsBase, versionData.latest.name);
|
||||
var latestDir = path.resolve(docsBase, 'api');
|
||||
|
||||
|
||||
@@ -5,15 +5,20 @@ module.exports = function removePrivateMembers() {
|
||||
$runAfter: ['tags-parsed'],
|
||||
$runBefore: ['rendering-docs'],
|
||||
$process: function(docs) {
|
||||
docs.forEach(function(doc){
|
||||
docs.forEach(function(doc) {
|
||||
if (doc.members) {
|
||||
doc.members = doc.members.filter(function(member){
|
||||
return !member.tags.tagsByName.get("private");
|
||||
})
|
||||
doc.members = doc.members.filter(function(member) {
|
||||
return !member.tags.tagsByName.get('private');
|
||||
});
|
||||
}
|
||||
})
|
||||
if (doc.statics) {
|
||||
doc.statics = doc.statics.filter(function(staticMethod) {
|
||||
return !staticMethod.tags.tagsByName.get('private');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return docs;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'usage'}
|
||||
{'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
|
||||
];
|
||||
|
||||
252
scripts/docs/templates/common.template.html
vendored
252
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(' ','-') $>"
|
||||
@@ -11,6 +11,39 @@ doc: "<$ doc.name $>"
|
||||
docType: "<$ doc.docType $>"
|
||||
---
|
||||
|
||||
<@ macro interfaceTable(interface) @>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == interface @>
|
||||
<table class="table param-table" style="margin:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<@ for param in export.members @>
|
||||
<tr>
|
||||
<td>
|
||||
<$ param.name $>
|
||||
<@ if param.optional @><div><em>(optional)</em></div><@ endif @>
|
||||
</td>
|
||||
<td>
|
||||
<code><$ param.returnType | escape $></code>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.description | marked $>
|
||||
</td>
|
||||
</tr>
|
||||
<@ endfor @>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endmacro @>
|
||||
|
||||
<@ macro paramList(paramData) -@>
|
||||
<@- if paramData -@><span class="params">(
|
||||
<@- for param in paramData -@>
|
||||
@@ -73,15 +106,81 @@ docType: "<$ doc.docType $>"
|
||||
<$ typeList(fn.typeList) $> <$ fn.description $>
|
||||
<@- endmacro -@>
|
||||
|
||||
|
||||
|
||||
<@ macro documentClass(doc) @>
|
||||
<@- if doc.statics.length -@>
|
||||
<h2>Static Members</h2>
|
||||
<@ for method in doc.statics -@>
|
||||
<@ if not method.internal @>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3><$ functionSyntax(method) $></h3>
|
||||
<@- if method.decorators @>
|
||||
<@ for prop in method.decorators[0].argumentInfo @>
|
||||
<@ if prop.platforms @>
|
||||
<p>
|
||||
<b>Platforms:</b>
|
||||
<@- for platform in prop.platforms @>
|
||||
<code><$ platform $></code>
|
||||
<@ endfor -@>
|
||||
</p>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@- endif @>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this -@>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@- endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
<@ endif @>
|
||||
<@ endfor -@>
|
||||
<@ endif @>
|
||||
|
||||
<!-- methods on the class -->
|
||||
<@- if doc.members and doc.members.length @>
|
||||
|
||||
<h2>Instance Members</h2>
|
||||
<@ for method in doc.members -@>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3>
|
||||
<$ functionSyntax(method) $>
|
||||
</h3>
|
||||
<$ method.description $>
|
||||
<@ if method.params -@>
|
||||
<$ paramTable(method.params) $>
|
||||
<@- endif @>
|
||||
<@ if method.this -@>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@- endif @>
|
||||
<@ if method.returns -@>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@- endif @>
|
||||
<@- endfor @>
|
||||
<@- endif -@>
|
||||
<@ endmacro @>
|
||||
<@ block body @>
|
||||
|
||||
|
||||
<@ block content @>
|
||||
|
||||
<@ block header @>
|
||||
|
||||
<h1 class="api-title">
|
||||
|
||||
<@ if doc.docType == "directive" @>
|
||||
<$ doc.name | dashCase $>
|
||||
<@ else @>
|
||||
@@ -101,23 +200,30 @@ 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', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
<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 $>">
|
||||
Improve this doc
|
||||
</a>
|
||||
|
||||
<@ if doc.codepen @>
|
||||
{% include codepen.html id="<$ doc.codepen $>" %}
|
||||
<@ endif @>
|
||||
|
||||
<@ endblock @>
|
||||
|
||||
<!-- decorators -->
|
||||
<@- 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 $>">
|
||||
@@ -141,15 +247,15 @@ docType: "<$ doc.docType $>"
|
||||
<h2>Supported platforms</h2>
|
||||
<@ block platforms @>
|
||||
<ul>
|
||||
<@- for platform in prop.platforms @>
|
||||
<@ for platform in prop.platforms -@>
|
||||
<li><$ platform $></li>
|
||||
<@ endfor -@>
|
||||
<@- endfor @>
|
||||
</ul>
|
||||
<@ endblock @>
|
||||
<!-- @platforms tag end -->
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
<@ endif -@><!-- if doc.decorators -->
|
||||
|
||||
<!-- @usage tag -->
|
||||
<@ if doc.usage @>
|
||||
@@ -181,12 +287,11 @@ docType: "<$ doc.docType $>"
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<@ for prop in doc.properties @>
|
||||
<@ for prop in doc.properties -@>
|
||||
<tr>
|
||||
<td>
|
||||
<$ prop.name $>
|
||||
</td>
|
||||
|
||||
<@ if hasTypes @>
|
||||
<td>
|
||||
<$ prop.type.name $>
|
||||
@@ -197,84 +302,53 @@ docType: "<$ doc.docType $>"
|
||||
<$ prop.description $>
|
||||
</td>
|
||||
</tr>
|
||||
<@ endfor @>
|
||||
<@- endfor @>
|
||||
</tbody>
|
||||
</table>
|
||||
<@ endif @>
|
||||
|
||||
<@- if doc.statics.length -@>
|
||||
<h2>Static Members</h2>
|
||||
<@- for method in doc.statics @><@ if not method.internal @>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3><$ functionSyntax(method) $></h3>
|
||||
|
||||
<@- if method.decorators @>
|
||||
<@ for prop in method.decorators[0].argumentInfo @>
|
||||
<@ if prop.platforms @>
|
||||
<b>Platforms:</b>
|
||||
<@- for platform in prop.platforms @>
|
||||
<code><$ platform $></code>
|
||||
<@ endfor -@>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this @>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
<@ endif @>
|
||||
<@ endfor -@>
|
||||
<@ endif @>
|
||||
|
||||
<!-- methods on the class -->
|
||||
<@- if doc.members and doc.members.length @>
|
||||
|
||||
<h2>Instance Members</h2>
|
||||
<@- for method in doc.members @>
|
||||
|
||||
<div id="<$ method.name $>"></div>
|
||||
|
||||
<h3>
|
||||
<$ functionSyntax(method) $>
|
||||
</h3>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this @>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
|
||||
<@ endfor -@>
|
||||
<$ documentClass(doc) $>
|
||||
|
||||
<@ block advanced @>
|
||||
<@- if doc.advanced -@>
|
||||
<h2><a class="anchor" name="advanced" href="#advanced"></a>Advanced</h2>
|
||||
<$ doc.advanced | marked $>
|
||||
<@- endif -@>
|
||||
<@ endblock @>
|
||||
|
||||
<!-- other classes -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'classes' -@>
|
||||
<!--<h2><a class="anchor" name="related-classes" href="#related-classes"></a>Related Classes</h2>-->
|
||||
<@ set classes = tag.description.split('\n') @>
|
||||
<@ for item in classes -@>
|
||||
<@ if item.length > 1 @>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == item @>
|
||||
<h2><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h2>
|
||||
<$ documentClass(export) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@- endif @>
|
||||
<@- endfor @>
|
||||
<!-- end other classes -->
|
||||
|
||||
<!-- interfaces -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'interfaces' @>
|
||||
<!--<h2><a class="anchor" name="interfaces" href="#interfaces"></a>Interfaces</h2>-->
|
||||
<@ set interfaces = tag.description.split('\n') @>
|
||||
<@ for item in interfaces -@>
|
||||
<@ if item.length > 1 @>
|
||||
<h2><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h2>
|
||||
<$ interfaceTable(item) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<!-- end interfaces -->
|
||||
|
||||
<!-- related link -->
|
||||
<@- if doc.see @>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">β</span></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
@@ -23,10 +23,10 @@ function run {
|
||||
# CD in to the site dir to commit updated docs
|
||||
cd $SITE_DIR
|
||||
|
||||
CHANGES=$(git status --porcelain)
|
||||
|
||||
# if no changes, don't commit
|
||||
if [[ "$CHANGES" == "" ]]; then
|
||||
CHANGED=$(git diff-index --name-only HEAD --)
|
||||
if [ -z "$CHANGED" ];
|
||||
then
|
||||
echo "-- No changes detected for the following commit, docs not updated."
|
||||
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
||||
else
|
||||
@@ -39,7 +39,7 @@ function run {
|
||||
git fetch
|
||||
git rebase
|
||||
|
||||
git push origin master
|
||||
git push origin master || :
|
||||
|
||||
echo "-- Updated docs for $VERSION_NAME succesfully!"
|
||||
fi
|
||||
|
||||
20
scripts/templates/wrap-min.tmpl
Normal file
20
scripts/templates/wrap-min.tmpl
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Plugin } from './plugin';
|
||||
/**
|
||||
* @name PluginName
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PluginName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PluginName',
|
||||
plugin: '',
|
||||
pluginRef: '',
|
||||
repo: ''
|
||||
})
|
||||
export class PluginName {
|
||||
}
|
||||
51
scripts/templates/wrap.tmpl
Normal file
51
scripts/templates/wrap.tmpl
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* This is a template for new plugin wrappers
|
||||
*
|
||||
* TODO:
|
||||
* - Add/Change information below
|
||||
* - Document usage (importing, executing main functionality)
|
||||
* - Remove any imports that you are not using
|
||||
* - Add this file to /src/index.ts (follow style of other plugins)
|
||||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs.
|
||||
* - Remove this note
|
||||
*
|
||||
*/
|
||||
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name PluginName
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PluginName } from 'ionic-native';
|
||||
*
|
||||
* PluginName.functionName('Hello', 123)
|
||||
* .then((something: any) => doSomething(something))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PluginName',
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
install: '' // OPTIONAL install command, in case the plugin requires variables
|
||||
})
|
||||
export class PluginName {
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
* @param arg1 {string} Some param to configure something
|
||||
* @param arg2 {number} Another param to configure something
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
static functionName(arg1: string, arg2: number): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
||||
451
src/index.ts
451
src/index.ts
@@ -1,206 +1,373 @@
|
||||
import {initAngular1} from './ng1';
|
||||
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 {AppAvailability} from './plugins/appavailability';
|
||||
import {AppRate} from './plugins/apprate';
|
||||
import {AppVersion} from './plugins/appversion';
|
||||
import {Badge} from './plugins/badge';
|
||||
import {BackgroundGeolocation} from './plugins/background-geolocation';
|
||||
import {BackgroundMode} from './plugins/backgroundmode';
|
||||
import {BarcodeScanner} from './plugins/barcodescanner';
|
||||
import {Base64ToGallery} from './plugins/base64togallery';
|
||||
import {BatteryStatus} from './plugins/batterystatus';
|
||||
import {Brightness} from './plugins/brightness';
|
||||
import {BLE} from './plugins/ble';
|
||||
import {BluetoothSerial} from './plugins/bluetoothserial';
|
||||
import {Calendar} from './plugins/calendar';
|
||||
import {Camera} from './plugins/camera';
|
||||
import {CardIO} from './plugins/card-io';
|
||||
import {Clipboard} from './plugins/clipboard';
|
||||
import {Contacts} from './plugins/contacts';
|
||||
import {DatePicker} from './plugins/datepicker';
|
||||
import {DBMeter} from './plugins/dbmeter';
|
||||
import {Deeplinks} from './plugins/deeplinks';
|
||||
import {Device} from './plugins/device';
|
||||
import {DeviceAccounts} from './plugins/deviceaccounts';
|
||||
import {DeviceMotion} from './plugins/devicemotion';
|
||||
import {DeviceOrientation} from './plugins/deviceorientation';
|
||||
import {Diagnostic} from './plugins/diagnostic';
|
||||
import {Dialogs} from './plugins/dialogs';
|
||||
import {EmailComposer} from './plugins/emailcomposer';
|
||||
import {Facebook} from './plugins/facebook';
|
||||
import {File} from './plugins/file';
|
||||
import {Transfer} from './plugins/filetransfer';
|
||||
import {Flashlight} from './plugins/flashlight';
|
||||
import {Geolocation} from './plugins/geolocation';
|
||||
import {Globalization} from './plugins/globalization';
|
||||
import {GooglePlus} from './plugins/google-plus';
|
||||
import {GoogleMap} from './plugins/googlemaps';
|
||||
import {GoogleAnalytics} from './plugins/googleanalytics';
|
||||
import {Hotspot} from './plugins/hotspot';
|
||||
import {Httpd} from './plugins/httpd';
|
||||
import {ImagePicker} from './plugins/imagepicker';
|
||||
import {InAppBrowser} from './plugins/inappbrowser';
|
||||
import {Insomnia} from './plugins/insomnia';
|
||||
import {Keyboard} from './plugins/keyboard';
|
||||
import {LaunchNavigator} from './plugins/launchnavigator';
|
||||
import {LocalNotifications} from './plugins/localnotifications';
|
||||
import {MediaPlugin} from './plugins/media';
|
||||
import {Network, Connection} from './plugins/network';
|
||||
import {Printer} from './plugins/printer';
|
||||
import {Push} from './plugins/push';
|
||||
import {SafariViewController} from './plugins/safari-view-controller';
|
||||
import {Screenshot} from './plugins/screenshot';
|
||||
import {SMS} from './plugins/sms';
|
||||
import {SocialSharing} from './plugins/socialsharing';
|
||||
import {SpinnerDialog} from './plugins/spinnerdialog';
|
||||
import {Splashscreen} from './plugins/splashscreen';
|
||||
import {SQLite} from './plugins/sqlite';
|
||||
import {StatusBar} from './plugins/statusbar';
|
||||
import {ThreeDeeTouch} from './plugins/3dtouch';
|
||||
import {Toast} from './plugins/toast';
|
||||
import {TouchID} from './plugins/touchid';
|
||||
import {Vibration} from './plugins/vibration';
|
||||
import {WebIntent} from './plugins/webintent';
|
||||
import { ActionSheet } from './plugins/actionsheet';
|
||||
import { AdMob } from './plugins/admob';
|
||||
import { AndroidFingerprintAuth } from './plugins/android-fingerprint-auth';
|
||||
import { AppAvailability } from './plugins/appavailability';
|
||||
import { AppRate } from './plugins/apprate';
|
||||
import { AppVersion } from './plugins/appversion';
|
||||
import { Badge } from './plugins/badge';
|
||||
import { BackgroundGeolocation } from './plugins/background-geolocation';
|
||||
import { BackgroundMode } from './plugins/backgroundmode';
|
||||
import { Backlight } from './plugins/backlight';
|
||||
import { BarcodeScanner } from './plugins/barcodescanner';
|
||||
import { Base64ToGallery } from './plugins/base64togallery';
|
||||
import { BatteryStatus } from './plugins/batterystatus';
|
||||
import { Brightness } from './plugins/brightness';
|
||||
import { BLE } from './plugins/ble';
|
||||
import { BluetoothSerial } from './plugins/bluetoothserial';
|
||||
import { Broadcaster } from './plugins/broadcaster';
|
||||
import { Calendar } from './plugins/calendar';
|
||||
import { CallNumber } from './plugins/call-number';
|
||||
import { Camera } from './plugins/camera';
|
||||
import { CameraPreview } from './plugins/camera-preview';
|
||||
import { CardIO } from './plugins/card-io';
|
||||
import { Clipboard } from './plugins/clipboard';
|
||||
import { CodePush } from './plugins/code-push';
|
||||
import { Contacts } from './plugins/contacts';
|
||||
import { Crop } from './plugins/crop';
|
||||
import { DatePicker } from './plugins/datepicker';
|
||||
import { DBMeter } from './plugins/dbmeter';
|
||||
import { Deeplinks } from './plugins/deeplinks';
|
||||
import { Device } from './plugins/device';
|
||||
import { DeviceFeedback } from './plugins/device-feedback';
|
||||
import { DeviceAccounts } from './plugins/deviceaccounts';
|
||||
import { DeviceMotion } from './plugins/devicemotion';
|
||||
import { DeviceOrientation } from './plugins/deviceorientation';
|
||||
import { Diagnostic } from './plugins/diagnostic';
|
||||
import { Dialogs } from './plugins/dialogs';
|
||||
import { EmailComposer } from './plugins/emailcomposer';
|
||||
import { EstimoteBeacons } from './plugins/estimote-beacons';
|
||||
import { Facebook } from './plugins/facebook';
|
||||
import { File } from './plugins/file';
|
||||
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';
|
||||
import { Globalization } from './plugins/globalization';
|
||||
import { GooglePlus } from './plugins/google-plus';
|
||||
import { GoogleMap } from './plugins/googlemap';
|
||||
import { GoogleAnalytics } from './plugins/googleanalytics';
|
||||
import { HeaderColor } from './plugins/headercolor';
|
||||
import { Hotspot } from './plugins/hotspot';
|
||||
import { HTTP } from './plugins/http';
|
||||
import { Httpd } from './plugins/httpd';
|
||||
import { IBeacon } from './plugins/ibeacon';
|
||||
import { ImagePicker } from './plugins/imagepicker';
|
||||
import { ImageResizer } from './plugins/imageresizer';
|
||||
import { InAppBrowser } from './plugins/inappbrowser';
|
||||
import { InAppPurchase } from './plugins/inapppurchase';
|
||||
import { Insomnia } from './plugins/insomnia';
|
||||
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';
|
||||
import { MusicControls } from './plugins/music-controls';
|
||||
import { Network } from './plugins/network';
|
||||
import { NFC } from './plugins/nfc';
|
||||
import { OneSignal } from './plugins/onesignal';
|
||||
import { PhotoViewer } from './plugins/photo-viewer';
|
||||
import { ScreenOrientation } from './plugins/screen-orientation';
|
||||
import { PayPal } from './plugins/pay-pal';
|
||||
import { PinDialog } from './plugins/pin-dialog';
|
||||
import { 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 { Vibration } from './plugins/vibration';
|
||||
import { VideoEditor } from './plugins/video-editor';
|
||||
import { VideoPlayer } from './plugins/video-player';
|
||||
import { WebIntent } from './plugins/webintent';
|
||||
import { YoutubeVideoPlayer } from './plugins/youtube-video-player';
|
||||
import { ZBar } from './plugins/z-bar';
|
||||
import { Zip } from './plugins/zip';
|
||||
export * from './plugins/3dtouch';
|
||||
export * from './plugins/actionsheet';
|
||||
export * from './plugins/admob';
|
||||
export * from './plugins/android-fingerprint-auth';
|
||||
export * from './plugins/appavailability';
|
||||
export * from './plugins/apprate';
|
||||
export * from './plugins/appversion';
|
||||
export * from './plugins/background-geolocation';
|
||||
export * from './plugins/backgroundmode';
|
||||
export * from './plugins/backlight';
|
||||
export * from './plugins/badge';
|
||||
export * from './plugins/barcodescanner';
|
||||
export * from './plugins/base64togallery';
|
||||
export * from './plugins/batterystatus';
|
||||
export * from './plugins/ble';
|
||||
export * from './plugins/bluetoothserial';
|
||||
export * from './plugins/brightness';
|
||||
export * from './plugins/broadcaster';
|
||||
export * from './plugins/calendar';
|
||||
export * from './plugins/call-number';
|
||||
export * from './plugins/camera';
|
||||
export * from './plugins/camera-preview';
|
||||
export * from './plugins/card-io';
|
||||
export * from './plugins/clipboard';
|
||||
export * from './plugins/code-push';
|
||||
export * from './plugins/contacts';
|
||||
export * from './plugins/crop';
|
||||
export * from './plugins/datepicker';
|
||||
export * from './plugins/dbmeter';
|
||||
export * from './plugins/deeplinks';
|
||||
export * from './plugins/device';
|
||||
export * from './plugins/device-feedback';
|
||||
export * from './plugins/deviceaccounts';
|
||||
export * from './plugins/devicemotion';
|
||||
export * from './plugins/deviceorientation';
|
||||
export * from './plugins/googlemaps';
|
||||
export * from './plugins/diagnostic';
|
||||
export * from './plugins/dialogs';
|
||||
export * from './plugins/emailcomposer';
|
||||
export * from './plugins/estimote-beacons';
|
||||
export * from './plugins/facebook';
|
||||
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';
|
||||
export * from './plugins/globalization';
|
||||
export * from './plugins/google-plus';
|
||||
export * from './plugins/googleanalytics';
|
||||
export * from './plugins/googlemap';
|
||||
export * from './plugins/headercolor';
|
||||
export * from './plugins/hotspot';
|
||||
export * from './plugins/http';
|
||||
export * from './plugins/httpd';
|
||||
export * from './plugins/ibeacon';
|
||||
export * from './plugins/imagepicker';
|
||||
export * from './plugins/imageresizer';
|
||||
export * from './plugins/inappbrowser';
|
||||
export * from './plugins/inapppurchase';
|
||||
export * from './plugins/insomnia';
|
||||
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';
|
||||
export * from './plugins/media';
|
||||
export * from './plugins/media-capture';
|
||||
export * from './plugins/mixpanel';
|
||||
export * from './plugins/music-controls';
|
||||
export * from './plugins/native-audio';
|
||||
export * from './plugins/native-geocoder';
|
||||
export * from './plugins/native-page-transitions';
|
||||
export * from './plugins/nativestorage';
|
||||
export * from './plugins/navigationbar';
|
||||
export * from './plugins/network';
|
||||
export * from './plugins/nfc';
|
||||
export * from './plugins/onesignal';
|
||||
export * from './plugins/pay-pal';
|
||||
export * from './plugins/photo-viewer';
|
||||
export * from './plugins/pin-dialog';
|
||||
export * from './plugins/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 {
|
||||
export * from './plugins/touchid';
|
||||
export * from './plugins/twitter-connect';
|
||||
export * from './plugins/vibration';
|
||||
export * from './plugins/video-editor';
|
||||
export * from './plugins/video-player';
|
||||
export * from './plugins/webintent';
|
||||
export * from './plugins/youtube-video-player';
|
||||
export * from './plugins/z-bar';
|
||||
export * from './plugins/zip';
|
||||
|
||||
// Window export to use outside of a module loading system
|
||||
window['IonicNative'] = {
|
||||
ActionSheet,
|
||||
AdMob,
|
||||
AndroidFingerprintAuth,
|
||||
AppAvailability,
|
||||
AppRate,
|
||||
AppVersion,
|
||||
Badge,
|
||||
BackgroundGeolocation,
|
||||
BackgroundMode,
|
||||
Backlight,
|
||||
BarcodeScanner,
|
||||
Base64ToGallery,
|
||||
BatteryStatus,
|
||||
Brightness,
|
||||
BLE,
|
||||
BluetoothSerial,
|
||||
Broadcaster,
|
||||
Calendar,
|
||||
CallNumber,
|
||||
Camera,
|
||||
CameraPreview,
|
||||
CardIO,
|
||||
Clipboard,
|
||||
Connection,
|
||||
CodePush,
|
||||
Contacts,
|
||||
Crop,
|
||||
DatePicker,
|
||||
DBMeter,
|
||||
Deeplinks,
|
||||
Device,
|
||||
DeviceFeedback,
|
||||
DeviceAccounts,
|
||||
DeviceMotion,
|
||||
DeviceOrientation,
|
||||
Dialogs,
|
||||
Diagnostic,
|
||||
EmailComposer,
|
||||
EstimoteBeacons,
|
||||
Facebook,
|
||||
File,
|
||||
FileChooser,
|
||||
FileOpener,
|
||||
FilePath,
|
||||
FingerprintAIO,
|
||||
Flashlight,
|
||||
Firebase,
|
||||
Geofence,
|
||||
Geolocation,
|
||||
Globalization,
|
||||
GooglePlus,
|
||||
GoogleMap,
|
||||
GoogleAnalytics,
|
||||
HeaderColor,
|
||||
Hotspot,
|
||||
HTTP,
|
||||
Httpd,
|
||||
IBeacon,
|
||||
ImagePicker,
|
||||
ImageResizer,
|
||||
InAppBrowser,
|
||||
InAppPurchase,
|
||||
Insomnia,
|
||||
Instagram,
|
||||
IsDebug,
|
||||
Keyboard,
|
||||
LaunchNavigator,
|
||||
LaunchReview,
|
||||
LocalNotifications,
|
||||
LocationAccuracy,
|
||||
Market,
|
||||
MediaCapture,
|
||||
MediaPlugin,
|
||||
Mixpanel,
|
||||
MusicControls,
|
||||
NativeAudio,
|
||||
NativeGeocoder,
|
||||
NativePageTransitions,
|
||||
NativeStorage,
|
||||
NavigationBar,
|
||||
Network,
|
||||
PayPal,
|
||||
NFC,
|
||||
Printer,
|
||||
Push,
|
||||
OneSignal,
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
PowerManagement,
|
||||
Rollbar,
|
||||
SafariViewController,
|
||||
Screenshot,
|
||||
SecureStorage,
|
||||
Serial,
|
||||
Shake,
|
||||
Sim,
|
||||
SMS,
|
||||
SocialSharing,
|
||||
SpinnerDialog,
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
SpeechRecognition,
|
||||
Stepcounter,
|
||||
StreamingMedia,
|
||||
Stripe,
|
||||
ThreeDeeTouch,
|
||||
Toast,
|
||||
TouchID,
|
||||
Transfer,
|
||||
TextToSpeech,
|
||||
ThemeableBrowser,
|
||||
TwitterConnect,
|
||||
VideoEditor,
|
||||
VideoPlayer,
|
||||
Vibration,
|
||||
WebIntent
|
||||
}
|
||||
|
||||
export * from './plugins/plugin';
|
||||
|
||||
// Window export to use outside of a module loading system
|
||||
window['IonicNative'] = {
|
||||
ActionSheet: ActionSheet,
|
||||
AdMob: AdMob,
|
||||
AppAvailability: AppAvailability,
|
||||
AppRate: AppRate,
|
||||
AppVersion: AppVersion,
|
||||
Badge: Badge,
|
||||
BackgroundGeolocation: BackgroundGeolocation,
|
||||
BarcodeScanner: BarcodeScanner,
|
||||
Base64ToGallery: Base64ToGallery,
|
||||
BatteryStatus: BatteryStatus,
|
||||
Brightness: Brightness,
|
||||
BLE: BLE,
|
||||
BluetoothSerial: BluetoothSerial,
|
||||
Calendar: Calendar,
|
||||
Camera: Camera,
|
||||
CardIO: CardIO,
|
||||
Clipboard: Clipboard,
|
||||
Connection: Connection,
|
||||
Contacts: Contacts,
|
||||
DatePicker: DatePicker,
|
||||
DBMeter: DBMeter,
|
||||
Deeplinks: Deeplinks,
|
||||
Device: Device,
|
||||
DeviceAccounts: DeviceAccounts,
|
||||
DeviceMotion: DeviceMotion,
|
||||
DeviceOrientation: DeviceOrientation,
|
||||
Dialogs: Dialogs,
|
||||
Diagnostic: Diagnostic,
|
||||
EmailComposer: EmailComposer,
|
||||
Facebook: Facebook,
|
||||
File: File,
|
||||
Flashlight: Flashlight,
|
||||
Geolocation: Geolocation,
|
||||
Globalization: Globalization,
|
||||
GooglePlus: GooglePlus,
|
||||
GoogleMap : GoogleMap,
|
||||
GoogleAnalytics: GoogleAnalytics,
|
||||
Hotspot: Hotspot,
|
||||
Httpd: Httpd,
|
||||
ImagePicker: ImagePicker,
|
||||
InAppBrowser: InAppBrowser,
|
||||
Keyboard: Keyboard,
|
||||
LaunchNavigator: LaunchNavigator,
|
||||
LocalNotifications: LocalNotifications,
|
||||
MediaPlugin: MediaPlugin,
|
||||
Network: Network,
|
||||
Printer: Printer,
|
||||
Push: Push,
|
||||
SafariViewController: SafariViewController,
|
||||
Screenshot: Screenshot,
|
||||
SMS: SMS,
|
||||
SocialSharing: SocialSharing,
|
||||
SpinnerDialog: SpinnerDialog,
|
||||
Splashscreen: Splashscreen,
|
||||
SQLite: SQLite,
|
||||
StatusBar: StatusBar,
|
||||
ThreeDeeTouch: ThreeDeeTouch,
|
||||
Toast: Toast,
|
||||
TouchID: TouchID,
|
||||
Transfer: Transfer,
|
||||
Vibration: Vibration,
|
||||
WebIntent: WebIntent
|
||||
WebIntent,
|
||||
YoutubeVideoPlayer,
|
||||
ZBar,
|
||||
Zip
|
||||
};
|
||||
|
||||
initAngular1(window['IonicNative']);
|
||||
@@ -209,16 +376,16 @@ initAngular1(window['IonicNative']);
|
||||
// log an error if it didn't fire in a reasonable amount of time. Generally,
|
||||
// when this happens, developers should remove and reinstall plugins, since
|
||||
// an inconsistent plugin is often the culprit.
|
||||
let before = +new Date;
|
||||
const before = Date.now();
|
||||
|
||||
let didFireReady = false;
|
||||
document.addEventListener('deviceready', function() {
|
||||
console.log('DEVICE READY FIRED AFTER', (+new Date - before), 'ms');
|
||||
document.addEventListener('deviceready', () => {
|
||||
console.log('DEVICE READY FIRED AFTER', (Date.now() - before), 'ms');
|
||||
didFireReady = true;
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
setTimeout(() => {
|
||||
if (!didFireReady && window.cordova) {
|
||||
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
|
||||
console.warn(`Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`);
|
||||
}
|
||||
}, DEVICE_READY_TIMEOUT);
|
||||
|
||||
16
src/ng1.ts
16
src/ng1.ts
@@ -3,26 +3,24 @@ declare var window;
|
||||
/**
|
||||
* Initialize the ionic.native Angular module if we're running in ng1.
|
||||
* This iterates through the list of registered plugins and dynamically
|
||||
* creates Angular 1 services of the form $cordovaSERVICE, ex: $cordovStatusBar.
|
||||
* creates Angular 1 services of the form $cordovaSERVICE, ex: $cordovaStatusBar.
|
||||
*/
|
||||
export function initAngular1(plugins) {
|
||||
if (window.angular) {
|
||||
window.angular.module('ionic.native', []);
|
||||
|
||||
const ngModule = window.angular.module('ionic.native', []);
|
||||
|
||||
for (var name in plugins) {
|
||||
let serviceName = '$cordova' + name;
|
||||
let cls = plugins[name];
|
||||
|
||||
(function(serviceName, cls, name) {
|
||||
window.angular.module('ionic.native').service(serviceName, [function() {
|
||||
let funcs = {};
|
||||
for (var k in cls) {
|
||||
funcs[k] = cls[k];
|
||||
}
|
||||
funcs['name'] = name;
|
||||
ngModule.service(serviceName, [function() {
|
||||
var funcs = window.angular.copy(cls);
|
||||
funcs.prototype['name'] = name;
|
||||
return funcs;
|
||||
}]);
|
||||
})(serviceName, cls, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,74 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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
|
||||
* @usage
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
* ```
|
||||
* import {ThreeDeeTouch, ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch} from 'ionic-native';
|
||||
* import { ThreeDeeTouch } from 'ionic-native';
|
||||
*
|
||||
* // import for type completion on variables
|
||||
* import { ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch } from 'ionic-native';
|
||||
* ...
|
||||
*
|
||||
* ThreeDeeTouch.isAvailable().then(isAvailable => console.log("3D Touch available? " + isAvailable)):
|
||||
* ThreeDeeTouch.isAvailable().then(isAvailable => console.log("3D Touch available? " + isAvailable));
|
||||
*
|
||||
* ThreeDeeTouch.watchForceTouches()
|
||||
* .subscribe(
|
||||
@@ -48,79 +105,88 @@ declare var window: any;
|
||||
* }
|
||||
* ];
|
||||
* ThreeDeeTouch.configureQuickActions(actions);
|
||||
*
|
||||
* ThreeDeeTouch.onHomeIconPressed().subscribe(
|
||||
* (payload) => {
|
||||
* // returns an object that is the button you presed
|
||||
* console.log('Pressed the ${payload.title} button')
|
||||
* console.log(payload.type)
|
||||
*
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ThreeDeeTouchQuickAction
|
||||
* ThreeDeeTouchForceTouch
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
platforms: ['iOS']
|
||||
pluginName: 'ThreeDeeTouch',
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
export class ThreeDeeTouch {
|
||||
|
||||
/**
|
||||
* You need an iPhone 6S or some future tech to use the features of this plugin, so you can check at runtime if the user's device is supported.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {return; }
|
||||
/**
|
||||
* You need an iPhone 6S or some future tech to use the features of this plugin, so you can check at runtime if the user's device is supported.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether the plugin is available or not
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* You can get a notification when the user force touches the webview. The plugin defines a Force Touch when at least 75% of the maximum force is applied to the screen. Your app will receive the x and y coordinates, so you have to figure out which UI element was touched.
|
||||
* @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> {return; }
|
||||
/**
|
||||
* You can get a notification when the user force touches the webview. The plugin defines a Force Touch when at least 75% of the maximum force is applied to the screen. Your app will receive the x and y coordinates, so you have to figure out which UI element was touched.
|
||||
* @returns {Observable<ThreeDeeTouchForceTouch>} Returns an observable that sends a `ThreeDeeTouchForceTouch` object
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> { return; }
|
||||
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void {}
|
||||
/**
|
||||
* setup the 3D-touch actions, takes an array of objects with the following
|
||||
* @param {string} type (optional) A type that can be used `onHomeIconPressed` callback
|
||||
* @param {string} title Title for your action
|
||||
* @param {string} subtitle (optional) A short description for your action
|
||||
* @param {string} iconType (optional) Choose between Prohibit, Contact, Home, MarkLocation, Favorite, Love, Cloud, Invitation, Confirmation, Mail, Message, Date, Time, CapturePhoto, CaptureVideo, Task, TaskCompleted, Alarm, Bookmark, Shuffle, Audio, Update
|
||||
* @param {string} iconTemplate (optional) Can be used to provide your own icon
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void { }
|
||||
|
||||
/**
|
||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch) {
|
||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
} else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enableLinkPreview(): void {}
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enableLinkPreview(): void { }
|
||||
|
||||
/**
|
||||
* Disabled the link preview feature, if enabled.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disableLinkPreview(): void { }
|
||||
|
||||
/**
|
||||
* Disabled the link preview feature, if enabled.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disableLinkPreview(): void {}
|
||||
}
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
}
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
force: number;
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
@@ -1,4 +1,48 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
@@ -8,8 +52,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {ActionSheet} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { ActionSheet } from 'ionic-native';
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
@@ -17,13 +61,15 @@ import {Plugin, Cordova} from './plugin';
|
||||
* 'buttonLabels': buttonLabels,
|
||||
* 'addCancelButtonWithLabel': 'Cancel',
|
||||
* 'addDestructiveButtonWithLabel' : 'Delete'
|
||||
* }).then(buttonIndex => {
|
||||
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
|
||||
* }).then((buttonIndex: number) => {
|
||||
* console.log('Button pressed: ' + buttonIndex);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ActionSheetOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ActionSheet',
|
||||
plugin: 'cordova-plugin-actionsheet',
|
||||
pluginRef: 'plugins.actionsheet',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
|
||||
@@ -32,39 +78,20 @@ import {Plugin, Cordova} from './plugin';
|
||||
export class ActionSheet {
|
||||
|
||||
/**
|
||||
* Show the ActionSheet. The ActionSheet's options is an object with the following propterties.
|
||||
*
|
||||
* | Option | Type | Description |
|
||||
* |-------------------------------|-----------|----------------------------------------------|
|
||||
* | title |`string` | The title for the actionsheet |
|
||||
* | buttonLabels |`string[]` | the labels for the buttons. Uses the index x |
|
||||
* | androidTheme |`number` | Theme to be used on Android |
|
||||
* | androidEnableCancelButton |`boolean` | Enable a cancel on Android |
|
||||
* | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone |
|
||||
* | addCancelButtonWithLabel |`string` | Add a cancel button with text |
|
||||
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
|
||||
* | position |`number[]` | On an iPad, set the X,Y position |
|
||||
*
|
||||
* @param {options} Options See table above
|
||||
* @returns {Promise} Returns a Promise that resolves with the index of the
|
||||
* Show a native ActionSheet component. See below for options.
|
||||
* @param options {ActionSheetOptions} Options See table below
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the index of the
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options?: {
|
||||
buttonLabels: string[],
|
||||
title?: string,
|
||||
androidTheme?: number,
|
||||
androidEnableCancelButton?: boolean,
|
||||
winphoneEnableCancelButton?: boolean,
|
||||
addCancelButtonWithLabel?: string,
|
||||
addDestructiveButtonWithLabel?: string,
|
||||
position?: number[]
|
||||
}): Promise<any> { return; }
|
||||
static show(options?: ActionSheetOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Hide the ActionSheet.
|
||||
* Progamtically hide the native ActionSheet
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the actionsheet is closed
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(): Promise<any> { return; }
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,114 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
|
||||
|
||||
export interface AdMobOptions {
|
||||
|
||||
/**
|
||||
* Banner ad ID
|
||||
*/
|
||||
adId?: string;
|
||||
|
||||
/**
|
||||
* Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM`
|
||||
*/
|
||||
adSize?: AdMobAdSize;
|
||||
|
||||
/**
|
||||
* Banner width, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Banner height, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
/**
|
||||
* Allow banner to overlap webview, or else it will push webview up or down to avoid overlap. Defaults to false.
|
||||
*/
|
||||
overlap?: boolean;
|
||||
|
||||
/**
|
||||
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
/**
|
||||
* X in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Y in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Set to true to receive test ad for testing purposes
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
|
||||
/**
|
||||
* Auto show interstitial ad when loaded. Set to false if hope to control the show timing with prepareInterstitial/showInterstitial
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
|
||||
/**
|
||||
* Re-create the banner on web view orientation change (not screen orientation), or else just move the banner. Default:true.
|
||||
*/
|
||||
orientationRenew?: boolean;
|
||||
|
||||
/**
|
||||
* Set extra color style for Ad
|
||||
*/
|
||||
adExtras?: AdMobAdExtras;
|
||||
|
||||
}
|
||||
|
||||
export interface AdMobAdExtras {
|
||||
|
||||
color_bg: string;
|
||||
|
||||
color_bg_top: string;
|
||||
|
||||
color_border: string;
|
||||
|
||||
color_link: string;
|
||||
|
||||
color_text: string;
|
||||
|
||||
color_url: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdMob
|
||||
* @description Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @description
|
||||
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @usage
|
||||
* Please refer the the plugin's original repository for detailed usage.
|
||||
* ```typescript
|
||||
* import { AdMob } from 'ionic-native';
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* AdMob.onAdDismiss()
|
||||
* .subscribe(() => { console.log('User dismissed ad'); });
|
||||
* }
|
||||
*
|
||||
* onClick() {
|
||||
* AdMob.prepareInterstitial('YOUR_ADID')
|
||||
* .then(() => { AdMob.showInterstitial(); });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AdMobOptions
|
||||
* AdMobAdExtras
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMob',
|
||||
plugin: 'cordova-plugin-admobpro',
|
||||
pluginRef: 'AdMob',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',
|
||||
@@ -15,77 +116,89 @@ 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
|
||||
})
|
||||
static removeBanner(): void {}
|
||||
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
|
||||
})
|
||||
static showBannerAtXY(x: number, y: number): void {}
|
||||
static showBannerAtXY(x: number, y: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Hide the banner, remove it from screen, but can show it later
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hideBanner(): void {}
|
||||
static hideBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
* Prepare interstitial banner
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when interstitial is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareInterstitial(adIdOrOptions: any): Promise<any> {return; }
|
||||
static prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show interstitial
|
||||
* Show interstitial ad when it's ready
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showInterstitial(): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static isInterstitialReady (): Promise<boolean> {return; }
|
||||
static showInterstitial(): void { }
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -97,83 +210,67 @@ 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
|
||||
* @returns {Promise<any>} Returns a promise that resolves with the ad settings
|
||||
*/
|
||||
@Cordova()
|
||||
static getAdSettings(): Promise<any> {return; }
|
||||
|
||||
// Events
|
||||
static getAdSettings(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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; }
|
||||
|
||||
}
|
||||
|
||||
167
src/plugins/android-fingerprint-auth.ts
Normal file
167
src/plugins/android-fingerprint-auth.ts
Normal file
@@ -0,0 +1,167 @@
|
||||
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
|
||||
* This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AndroidFingerprintAuth } from 'ionic-native';
|
||||
*
|
||||
* AndroidFingerprintAuth.isAvailable()
|
||||
* .then((result)=> {
|
||||
* if(result.isAvailable){
|
||||
* // it is available
|
||||
*
|
||||
* AndroidFingerprintAuth.encrypt({ clientId: "myAppName", username: "myUsername", password: "myPassword" })
|
||||
* .then(result => {
|
||||
* 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 => {
|
||||
* if (error === "Cancelled") {
|
||||
* console.log("Fingerprint authentication cancelled");
|
||||
* } else console.error(error)
|
||||
* });
|
||||
*
|
||||
* } else {
|
||||
* // fingerprint auth isn't available
|
||||
* }
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* AndroidFingerprintAuthOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidFingerprintAuth',
|
||||
plugin: 'cordova-plugin-android-fingerprint-auth',
|
||||
pluginRef: 'FingerprintAuth',
|
||||
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'
|
||||
})
|
||||
export class AndroidFingerprintAuth {
|
||||
|
||||
/**
|
||||
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
|
||||
* @param options {AndroidFingerprintAuthOptions} Options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static encrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Biometric authentication
|
||||
*/
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withBackup: boolean;
|
||||
/**
|
||||
* base64encoded string representation of user credentials
|
||||
*/
|
||||
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<{
|
||||
/**
|
||||
* Biometric authentication
|
||||
*/
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withBackup: boolean;
|
||||
/**
|
||||
* FingerprintAuth.CipherMode.DECRYPT
|
||||
* Decrypted password
|
||||
*/
|
||||
password: string;
|
||||
}> {return; }
|
||||
|
||||
/**
|
||||
* Check if service is available
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> { return; }
|
||||
|
||||
/**
|
||||
* 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; }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name App Availability
|
||||
@@ -8,26 +8,27 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppAvailability} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { AppAvailability, Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* var app;
|
||||
* 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';
|
||||
* }
|
||||
*
|
||||
* AppAvailability.check(app)
|
||||
* .then(
|
||||
* yes => console.log(app + " is available"),
|
||||
* no => console.log(app + " is NOT available")
|
||||
* (yes: string) => console.log(app + ' is available'),
|
||||
* (no: string) => console.log(app + ' is NOT available')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppAvailability',
|
||||
plugin: 'cordova-plugin-appavailability',
|
||||
pluginRef: 'appAvailability',
|
||||
repo: 'https://github.com/ohh2ahh/AppAvailability',
|
||||
@@ -37,7 +38,7 @@ export class AppAvailability {
|
||||
|
||||
/**
|
||||
* Checks if an app is available on device
|
||||
* @param app Package name on android, or URI scheme on iOS
|
||||
* @param {string} app Package name on android, or URI scheme on iOS
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -1,7 +1,94 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface AppRatePreferences {
|
||||
|
||||
/**
|
||||
* Custom BCP 47 language tag
|
||||
*/
|
||||
useLanguage?: string;
|
||||
|
||||
/**
|
||||
* Custom application title
|
||||
*/
|
||||
displayAppName?: string;
|
||||
|
||||
/**
|
||||
* Show dialog again when application version will be updated. Defaults to `true`
|
||||
*/
|
||||
promptAgainForEachNewVersion?: boolean;
|
||||
|
||||
/**
|
||||
* count of runs of application before dialog will be displayed. Defaults to `3`
|
||||
*/
|
||||
usesUntilPrompt?: number;
|
||||
|
||||
/**
|
||||
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
|
||||
*/
|
||||
openStoreInApp?: boolean;
|
||||
|
||||
/**
|
||||
* use custom view for rate dialog. Defaults to `false`
|
||||
*/
|
||||
useCustomRateDialog?: boolean;
|
||||
|
||||
/**
|
||||
* Custom locale object
|
||||
*/
|
||||
customLocale?: any;
|
||||
|
||||
/**
|
||||
* Callbacks for events
|
||||
*/
|
||||
callbacks?: AppRateCallbacks;
|
||||
|
||||
/**
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppURL?: AppRateStoreAppUrls;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateCallbacks {
|
||||
|
||||
/**
|
||||
* call back function. called when user clicked on rate-dialog buttons
|
||||
*/
|
||||
onButtonClicked?: Function;
|
||||
|
||||
/**
|
||||
* call back function. called when rate-dialog showing
|
||||
*/
|
||||
onRateDialogShow?: Function;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateStoreAppUrls {
|
||||
|
||||
/**
|
||||
* application id in AppStore
|
||||
*/
|
||||
ios?: string;
|
||||
|
||||
/**
|
||||
* application URL in GooglePlay
|
||||
*/
|
||||
android?: string;
|
||||
|
||||
/**
|
||||
* application URL in AppWorld
|
||||
*/
|
||||
blackberry?: string;
|
||||
|
||||
/**
|
||||
* application URL in WindowsStore
|
||||
*/
|
||||
windows8?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name App Rate
|
||||
* @description
|
||||
@@ -10,18 +97,25 @@ declare var window;
|
||||
* Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the [AppRate plugin docs](https://github.com/pushandplay/cordova-plugin-apprate).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppRate} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { AppRate } from 'ionic-native';
|
||||
*
|
||||
* AppRate.preferences.storeAppURL = {
|
||||
* ios: '<my_app_id>',
|
||||
* android: 'market://details?id=<package_name>',
|
||||
* };
|
||||
*
|
||||
* AppRate.preferences.storeAppURL.ios = '<my_app_id>';
|
||||
* AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
|
||||
* AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/';
|
||||
* AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name=<the Package Family Name of the application>';
|
||||
* AppRate.promptForRating();
|
||||
* AppRate.promptForRating(false);
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AppRatePreferences
|
||||
* AppRateStoreAppUrls
|
||||
* AppRateCallbacks
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppRate',
|
||||
plugin: 'cordova-plugin-apprate',
|
||||
pluginRef: 'AppRate',
|
||||
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
|
||||
@@ -30,34 +124,17 @@ declare var window;
|
||||
export class AppRate {
|
||||
|
||||
/**
|
||||
* 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 |
|
||||
* @type {{}}
|
||||
* Configure various settings for the Rating View.
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get preferences() { return window.AppRate.preferences; }
|
||||
static preferences: AppRatePreferences;
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
*
|
||||
* @param {boolean} immediately Show the rating prompt immediately.
|
||||
*/
|
||||
@Cordova()
|
||||
static promptForRating(immediately: boolean): void {};
|
||||
static promptForRating(immediately: boolean): void { };
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name App Version
|
||||
@@ -8,8 +8,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](https://github.com/whiteoctober/cordova-plugin-app-version).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppVersion} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { AppVersion } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* AppVersion.getAppName();
|
||||
@@ -19,36 +19,38 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppVersion',
|
||||
plugin: 'cordova-plugin-app-version',
|
||||
pluginRef: 'cordova.getAppVersion',
|
||||
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class AppVersion {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAppName(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the package name of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPackageName(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the build identifier of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getVersionCode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the version of the app
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getVersionNumber(): Promise<any> { return; }
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
|
||||
export interface Location {
|
||||
export interface BackgroundGeolocationResponse {
|
||||
|
||||
/**
|
||||
* ID of location as stored in DB (or null)
|
||||
@@ -51,6 +49,11 @@ export interface Location {
|
||||
*/
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
* bearing, in degrees.
|
||||
*/
|
||||
@@ -67,7 +70,7 @@ export interface Location {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
|
||||
@@ -88,7 +91,7 @@ export interface Config {
|
||||
* When enabled, the plugin will emit sounds for life-cycle events of
|
||||
* background-geolocation! See debugging sounds table.
|
||||
*/
|
||||
debug: boolean;
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* The minimum distance (measured in meters) a device must move horizontally
|
||||
@@ -99,10 +102,28 @@ export interface Config {
|
||||
/**
|
||||
* IOS, ANDROID ONLY
|
||||
* Enable this in order to force a stop() when the application terminated
|
||||
* (e.g. on iOS, double-tap home button, swipe away the app).
|
||||
* (e.g. on iOS, double-tap home button, swipe away the app).o
|
||||
*
|
||||
* Defaults to true
|
||||
*/
|
||||
stopOnTerminate?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Start background service on device boot.
|
||||
*
|
||||
* Defaults to false
|
||||
*/
|
||||
startOnBoot?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If false location service will not be started in foreground and no notification will be shown.
|
||||
*
|
||||
* Defaults to true
|
||||
*/
|
||||
startForeground?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID, WP8 ONLY
|
||||
* The minimum time interval between location updates in seconds.
|
||||
@@ -110,7 +131,7 @@ export interface Config {
|
||||
* and the MS doc (http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geolocator.reportinterval)
|
||||
* for more information
|
||||
*/
|
||||
locationTimeout?: number;
|
||||
interval?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
@@ -130,18 +151,25 @@ export interface Config {
|
||||
*/
|
||||
notificationIconColor?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
*/
|
||||
notificationIcon?: string;
|
||||
notificationIconLarge?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The filename of a custom notification icon. See android quirks.
|
||||
* NOTE: Only available for API Level >=21.
|
||||
*/
|
||||
notificationIconSmall?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Set location service provider @see wiki (https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers)
|
||||
*/
|
||||
locationService?: number;
|
||||
locationProvider?: number;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
@@ -151,6 +179,52 @@ export interface Config {
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Pauses location updates when app is paused
|
||||
*
|
||||
* Defaults to true
|
||||
*/
|
||||
pauseLocationUpdates?: boolean;
|
||||
|
||||
/**
|
||||
* Server url where to send HTTP POST with recorded locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
*/
|
||||
url?: string;
|
||||
|
||||
/**
|
||||
* Server url where to send fail to post locations
|
||||
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
|
||||
*/
|
||||
syncUrl?: string;
|
||||
|
||||
/**
|
||||
* Specifies how many previously failed locations will be sent to server at once
|
||||
*
|
||||
* Defaults to 100
|
||||
*/
|
||||
syncThreshold?: number;
|
||||
|
||||
/**
|
||||
* Optional HTTP headers sent along in HTTP request
|
||||
*/
|
||||
httpHeaders?: any;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Switch to less accurate significant changes and region monitory when in background (default)
|
||||
*
|
||||
* Defaults to 100
|
||||
*/
|
||||
saveBatteryOnBackground?: boolean;
|
||||
|
||||
/**
|
||||
* Limit maximum number of locations stored into db
|
||||
*
|
||||
* Defaults to 10000
|
||||
*/
|
||||
maxLocations?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,13 +235,13 @@ export interface Config {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import {BackgroundGeolocation} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { BackgroundGeolocation } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // When device is ready :
|
||||
* platform.ready().then(() => {
|
||||
* // IMPORTANT: BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
|
||||
*
|
||||
* // BackgroundGeolocation is highly configurable. See platform specific configuration options
|
||||
* let config = {
|
||||
@@ -177,68 +251,118 @@ export interface Config {
|
||||
* debug: true, // enable this hear sounds for background-geolocation life-cycle.
|
||||
* stopOnTerminate: false, // enable this to clear background location settings when the app terminates
|
||||
* };
|
||||
*
|
||||
* BackgroundGeolocation.configure(config)
|
||||
* .then((location) => {
|
||||
* console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
|
||||
*
|
||||
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
|
||||
* // and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
|
||||
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
|
||||
* BackgroundGeolocation.finish(); // FOR IOS ONLY
|
||||
* })
|
||||
* .catch((error) => {
|
||||
* console.log('BackgroundGeolocation error');
|
||||
* });
|
||||
* BackgroundGeolocation.configure((location) => {
|
||||
console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
|
||||
|
||||
// IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
|
||||
// and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
|
||||
// IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
|
||||
BackgroundGeolocation.finish(); // FOR IOS ONLY
|
||||
|
||||
* }, (error) => {
|
||||
* console.log('BackgroundGeolocation error');
|
||||
* }, config);
|
||||
*
|
||||
* // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
|
||||
* BackgroundGeolocation.start();
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* // If you wish to turn OFF background-tracking, call the #stop method.
|
||||
* BackgroundGeolocation.stop();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* BackgroundGeolocationResponse
|
||||
* BackgroundGeolocationConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundGeolocation',
|
||||
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
||||
pluginRef: 'plugins.backgroundGeoLocation',
|
||||
pluginRef: 'backgroundGeolocation',
|
||||
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
|
||||
platforms: ['iOS', 'Android', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundGeolocation {
|
||||
|
||||
/**
|
||||
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers
|
||||
*
|
||||
* Possible values:
|
||||
* ANDROID_DISTANCE_FILTER_PROVIDER: 0,
|
||||
* ANDROID_ACTIVITY_PROVIDER: 1
|
||||
*
|
||||
* @enum {number}
|
||||
*/
|
||||
static LocationProvider: any = {
|
||||
ANDROID_DISTANCE_FILTER_PROVIDER: 0,
|
||||
ANDROID_ACTIVITY_PROVIDER: 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000].
|
||||
* The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings.
|
||||
* 1000 results in lowest power drain and least accurate readings.
|
||||
*
|
||||
* Possible values:
|
||||
* HIGH: 0
|
||||
* MEDIUM: 10
|
||||
* LOW: 100
|
||||
* PASSIVE: 1000
|
||||
*
|
||||
* enum {number}
|
||||
*/
|
||||
static Accuracy: any = {
|
||||
HIGH: 0,
|
||||
MEDIUM: 10,
|
||||
LOW: 100,
|
||||
PASSIVE: 1000
|
||||
};
|
||||
|
||||
/**
|
||||
* Used in the switchMode function
|
||||
*
|
||||
* Possible values:
|
||||
* BACKGROUND: 0
|
||||
* FOREGROUND: 1
|
||||
*
|
||||
* @enum {number}
|
||||
*/
|
||||
static Mode: any = {
|
||||
BACKGROUND: 0,
|
||||
FOREGROUND: 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Configure the plugin.
|
||||
* Success callback will be called with one argument - Location object, which tries to mimic w3c Coordinates interface.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* Fail callback to be executed every time a geolocation error occurs.
|
||||
*
|
||||
* Options a json object of type Config
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
sync: true
|
||||
})
|
||||
static configure(options: Config): Promise<Location> { return; }
|
||||
|
||||
static configure(callback: Function, errorCallback: Function, options: BackgroundGeolocationConfig): any { return; }
|
||||
|
||||
/**
|
||||
* Turn ON the background-geolocation system.
|
||||
* The user will be tracked whenever they suspend the app.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static start(): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Turn OFF background-tracking
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stop(): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Inform the native plugin that you're finished, the background-task may be completed
|
||||
* NOTE: IOS, WP only
|
||||
@@ -246,7 +370,6 @@ export class BackgroundGeolocation {
|
||||
@Cordova()
|
||||
static finish() { }
|
||||
|
||||
|
||||
/**
|
||||
* Force the plugin to enter "moving" or "stationary" state
|
||||
* NOTE: IOS, WP only
|
||||
@@ -254,26 +377,28 @@ export class BackgroundGeolocation {
|
||||
@Cordova()
|
||||
static changePace(isMoving: boolean) { }
|
||||
|
||||
|
||||
/**
|
||||
* Setup configuration
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static setConfig(options: Config): Promise<any> { return; }
|
||||
static setConfig(options: BackgroundGeolocationConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns current stationaryLocation if available. null if not
|
||||
* NOTE: IOS, WP only
|
||||
* @returns {Promise<Location>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getStationaryLocation(): Promise<Location> { return; }
|
||||
static getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
||||
|
||||
/**
|
||||
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
|
||||
* your #success callback will be executed with #location param containing #radius of region
|
||||
* NOTE: IOS, WP only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static onStationary(): Promise<any> { return; }
|
||||
@@ -286,17 +411,24 @@ export class BackgroundGeolocation {
|
||||
@Cordova()
|
||||
static isLocationEnabled(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* Display app settings to change permissions
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static showAppSettings(): void { }
|
||||
|
||||
/**
|
||||
* Display device location settings
|
||||
*/
|
||||
@Cordova()
|
||||
static showLocationSettings() { }
|
||||
@Cordova({sync: true})
|
||||
static showLocationSettings(): void { }
|
||||
|
||||
/**
|
||||
* 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()
|
||||
static watchLocationMode(): Promise<boolean> { return; }
|
||||
@@ -316,13 +448,22 @@ export class BackgroundGeolocation {
|
||||
* or
|
||||
* - option.debug is true
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getValidLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete stored location by given locationId.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteLocation(locationId: number): Promise<any> { return; }
|
||||
@@ -330,8 +471,37 @@ export class BackgroundGeolocation {
|
||||
/**
|
||||
* Delete all stored locations.
|
||||
* NOTE: ANDROID only
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteAllLocations(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Normally plugin will handle switching between BACKGROUND and FOREGROUND mode itself.
|
||||
* Calling switchMode you can override plugin behavior and force plugin to switch into other mode.
|
||||
*
|
||||
* In FOREGROUND mode plugin uses iOS local manager to receive locations and behavior is affected by option.desiredAccuracy and option.distanceFilter.
|
||||
* In BACKGROUND mode plugin uses significant changes and region monitoring to receive locations and uses option.stationaryRadius only.
|
||||
*
|
||||
* BackgroundGeolocation.Mode.FOREGROUND
|
||||
* BackgroundGeolocation.Mode.BACKGROUND
|
||||
*
|
||||
* NOTE: iOS only
|
||||
*
|
||||
* @param {number} See above.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
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
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLogEntries(limit: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +1,63 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface BackgroundModeConfiguration {
|
||||
|
||||
/**
|
||||
* Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
* Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Background Mode
|
||||
* @description
|
||||
* Cordova plugin to prevent the app from going to sleep while in background.
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
|
||||
*@usage
|
||||
* ```js
|
||||
* import {BackgroundMode} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { BackgroundMode } from 'ionic-native';
|
||||
*
|
||||
* BackgroundMode.enable();
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* BackgroundModeConfiguration
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'de.appplant.cordova.plugin.background-mode',
|
||||
pluginName: 'BackgroundMode',
|
||||
plugin: 'cordova-plugin-background-mode',
|
||||
pluginRef: 'cordova.plugins.backgroundMode',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Enable the background mode.
|
||||
* Once called, prevents the app from being paused while in background.
|
||||
@@ -26,81 +65,72 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static enable(): void {}
|
||||
static enable(): void { }
|
||||
|
||||
/**
|
||||
* Disable the background mode.
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
/**
|
||||
* Disable the background mode.
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
@Cordova()
|
||||
static disable(): void {}
|
||||
static disable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
* Available only for Android platform.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: Configure): void {}
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
* Available only for Android platform.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static update(options?: Configure): void {}
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* Can be used to get notified or run function when the background mode has been activated, deactivated or failed.
|
||||
* @param eventName The name of the event. Available events: activate, deactivate, failure
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is enabled.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface Configure {
|
||||
/**
|
||||
*Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
static isEnabled(): boolean { return; }
|
||||
|
||||
/**
|
||||
*The text that scrolls itself on statusbar
|
||||
* Can be used to get the information if the background mode is active.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is active.
|
||||
*/
|
||||
ticker?: String;
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isActive(): boolean { return; }
|
||||
|
||||
/**
|
||||
*Description of background task
|
||||
* Override the default title, ticker and text.
|
||||
* Available only for Android platform.
|
||||
* @param {Configure} options List of option to configure. See table below
|
||||
*/
|
||||
text?: String;
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*Boolean, if true plugin will not display a notification. Default is false.
|
||||
* Modify the displayed information.
|
||||
* Available only for Android platform.
|
||||
* @param {Configure} options Any options you want to update. See table below.
|
||||
*/
|
||||
silent?: boolean;
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*Boolean. By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
* Called when background mode is activated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is activated
|
||||
*/
|
||||
resume?: boolean;
|
||||
@CordovaFunctionOverride()
|
||||
static onactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode is deactivated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is deactivated
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static ondeactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode fails
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode fails
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onfailure(): Observable<any> { return; };
|
||||
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Badge
|
||||
@@ -8,8 +8,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Badge} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Badge } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Badge.set(10);
|
||||
@@ -18,6 +18,7 @@ import {Plugin, Cordova} from './plugin';
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Badge',
|
||||
plugin: 'cordova-plugin-badge',
|
||||
pluginRef: 'cordova.plugins.notification.badge',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-badge',
|
||||
@@ -27,6 +28,7 @@ export class Badge {
|
||||
|
||||
/**
|
||||
* Clear the badge of the app icon.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(): Promise<boolean> { return; }
|
||||
@@ -34,14 +36,14 @@ export class Badge {
|
||||
/**
|
||||
* Set the badge of the app icon.
|
||||
* @param {number} badgeNumber The new badge number.
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static set(badgeNumber: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the badge of the app icon.
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> { return; }
|
||||
@@ -49,7 +51,7 @@ export class Badge {
|
||||
/**
|
||||
* Increase the badge number.
|
||||
* @param {number} increaseBy Count to add to the current badge number
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static increase(increaseBy: number): Promise<any> { return; }
|
||||
@@ -57,21 +59,23 @@ export class Badge {
|
||||
/**
|
||||
* Decrease the badge number.
|
||||
* @param {number} decreaseBy Count to subtract from the current badge number
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static decrease(decreaseBy: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determine if the app has permission to show badges.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to set badge notifications
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,53 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface BarcodeScannerOptions {
|
||||
|
||||
/**
|
||||
* Prefer front camera. Supported on iOS and Android.
|
||||
*/
|
||||
preferFrontCamera?: boolean;
|
||||
|
||||
/**
|
||||
* Show flip camera button. Supported on iOS and Android.
|
||||
*/
|
||||
showFlipCameraButton?: boolean;
|
||||
|
||||
/**
|
||||
* Show torch button. Supported on iOS and Android.
|
||||
*/
|
||||
showTorchButton?: boolean;
|
||||
|
||||
/**
|
||||
* Disable animations. Supported on iOS only.
|
||||
*/
|
||||
disableAnimations?: boolean;
|
||||
|
||||
/**
|
||||
* Prompt text. Supported on Android only.
|
||||
*/
|
||||
prompt?: string;
|
||||
|
||||
/**
|
||||
* Formats separated by commas. Defaults to all formats except `PDF_417` and `RSS_EXPANDED`.
|
||||
*/
|
||||
formats?: string;
|
||||
|
||||
/**
|
||||
* Orientation. Supported on Android only. Can be set to `portrait` or `landscape`. Defaults to none so the user can rotate the phone and pick an orientation.
|
||||
*/
|
||||
orientation?: string;
|
||||
|
||||
/**
|
||||
* Launch with the torch switched on (if available). Supported on Android only.
|
||||
*/
|
||||
torchOn?: boolean;
|
||||
|
||||
/**
|
||||
* Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only.
|
||||
*/
|
||||
resultDisplayDuration?: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Barcode Scanner
|
||||
@@ -8,8 +57,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {BarcodeScanner} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { BarcodeScanner } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* BarcodeScanner.scan().then((barcodeData) => {
|
||||
@@ -18,8 +67,11 @@ import {Plugin, Cordova} from './plugin';
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* BarcodeScannerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BarcodeScanner',
|
||||
plugin: 'phonegap-plugin-barcodescanner',
|
||||
pluginRef: 'cordova.plugins.barcodeScanner',
|
||||
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',
|
||||
@@ -27,28 +79,34 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class BarcodeScanner {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static Encode: any = {
|
||||
TEXT_TYPE: 'TEXT_TYPE',
|
||||
EMAIL_TYPE: 'EMAIL_TYPE',
|
||||
PHONE_TYPE: 'PHONE_TYPE',
|
||||
SMS_TYPE: 'SMS_TYPE'
|
||||
};
|
||||
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
* @return Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
* @param options {BarcodeScannerOptions} Optional options to pass to the scanner
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static scan(options?: any): Promise<any> { return; }
|
||||
static scan(options?: BarcodeScannerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Encodes data into a barcode.
|
||||
* NOTE: not well supported on Android
|
||||
* @param type
|
||||
* @param data
|
||||
* @param type {string} Type of encoding
|
||||
* @param data {any} Data to encode
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static encode(type: string, data: any): Promise<any> {return; }
|
||||
static encode(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Base64ToGallery} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Base64ToGallery } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Base64ToGallery.base64ToGallery(base64Data, 'img_').then(
|
||||
* res => console.log("Saved image to gallery ", res),
|
||||
* err => console.log("Error saving image to gallery ", err)
|
||||
* res => console.log('Saved image to gallery ', res),
|
||||
* err => console.log('Error saving image to gallery ', err)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Base64ToGallery',
|
||||
plugin: 'cordova-base64-to-gallery',
|
||||
pluginRef: 'cordova',
|
||||
repo: 'https://github.com/Nexxa/cordova-base64-to-gallery',
|
||||
@@ -23,12 +25,16 @@ export class Base64ToGallery {
|
||||
|
||||
/**
|
||||
* Converts a base64 string to an image file in the device gallery
|
||||
* @param data
|
||||
* @param prefix
|
||||
* @param {string} data The actual base64 string that you want to save
|
||||
* @param {any} options (optional) An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
|
||||
* @returns {Promise<any>} returns a promise that resolves when the image is saved.
|
||||
*/
|
||||
@Cordova()
|
||||
static base64ToGallery(data: string , prefix?: string ): Promise<any> {
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static base64ToGallery(data: string, options?: {prefix?: string; mediaScanner?: boolean}): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,8 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Battery Status
|
||||
* @description
|
||||
* Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {BatteryStatus} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = BatteryStatus.onChange().subscribe(
|
||||
* status => {
|
||||
* console.log(status.level, status.isPlugged);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // stop watch
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-battery-status',
|
||||
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']
|
||||
})
|
||||
export class BatteryStatus {
|
||||
export interface BatteryStatusResponse {
|
||||
|
||||
/**
|
||||
* Watch the change in battery level
|
||||
* @returns {Observable} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange (): Observable<StatusObject> {return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
static onLow (): Observable<StatusObject> {return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
static onCritical (): Observable<StatusObject> {return; }
|
||||
|
||||
}
|
||||
|
||||
export interface StatusObject {
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
@@ -73,4 +12,70 @@ export interface StatusObject {
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Battery Status
|
||||
* @description
|
||||
* Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { BatteryStatus } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = BatteryStatus.onChange().subscribe(
|
||||
* (status: StatusObject) => {
|
||||
* console.log(status.level, status.isPlugged);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // stop watch
|
||||
* 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']
|
||||
})
|
||||
export class BatteryStatus {
|
||||
|
||||
/**
|
||||
* Watch the change in battery level
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
static onLow(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
static onCritical(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name BLE
|
||||
@@ -24,7 +24,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
@@ -34,7 +34,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
* ```
|
||||
* After connecting, the peripheral object also includes service, characteristic and descriptor information.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
@@ -93,7 +93,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* ### Android
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "00:1A:7D:DA:71:13",
|
||||
@@ -108,7 +108,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802",
|
||||
@@ -137,7 +137,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* // ASCII only
|
||||
* function stringToBytes(string) {
|
||||
* var array = new Uint8Array(string.length);
|
||||
@@ -160,12 +160,14 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BLE',
|
||||
plugin: 'cordova-plugin-ble-central',
|
||||
pluginRef: 'ble',
|
||||
repo: 'https://github.com/don/cordova-plugin-ble-central',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class BLE {
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
@@ -177,7 +179,7 @@ export class BLE {
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param {number} seconds Number of seconds to run discovery
|
||||
* @return Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
@@ -198,15 +200,28 @@ export class BLE {
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Scans for BLE devices. This function operates similarly to the `startScan` function, but allows you to specify extra options (like allowing duplicate device reports).
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param options {any}
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
*
|
||||
@@ -272,7 +287,7 @@ export class BLE {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; };
|
||||
): Promise<any> { return; };
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
@@ -308,7 +323,7 @@ export class BLE {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
@@ -325,7 +340,7 @@ export class BLE {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
@@ -351,7 +366,7 @@ export class BLE {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Observable<any> { return; }
|
||||
): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
@@ -359,14 +374,14 @@ export class BLE {
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {string} serviceUUID UUID of the BLE service
|
||||
* @param {string} characteristicUUID UUID of the BLE characteristic
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopNotification(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Report the connection status.
|
||||
@@ -379,7 +394,7 @@ export class BLE {
|
||||
* );
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnected(deviceId: string): Promise<any> { return; }
|
||||
@@ -387,22 +402,15 @@ export class BLE {
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.isEnabled().then(
|
||||
* () => { console.log('enabled'); },
|
||||
* () => { console.log('not enabled'); }
|
||||
* );
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<void>} Returns a Promise that resolves if Bluetooth is enabled, and rejects if disabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<any> { return; }
|
||||
static isEnabled(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static showBluetoothSettings(): Promise<any> { return; }
|
||||
@@ -410,8 +418,9 @@ export class BLE {
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Bluetooth Serial
|
||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { BluetoothSerial } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Write a string
|
||||
* BluetoothSerial.write("hello world").then(success, failure);
|
||||
*
|
||||
* // Array of int or bytes
|
||||
* BluetoothSerial.write([186, 220, 222]).then(success, failure);
|
||||
*
|
||||
* // Typed Array
|
||||
* var data = new Uint8Array(4);
|
||||
* data[0] = 0x41;
|
||||
* data[1] = 0x42;
|
||||
* data[2] = 0x43;
|
||||
* data[3] = 0x44;
|
||||
* BluetoothSerial.write(data).then(success, failure);
|
||||
*
|
||||
* // Array Buffer
|
||||
* BluetoothSerial.write(data.buffer).then(success, failure);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BluetoothSerial',
|
||||
repo: 'https://github.com/don/BluetoothSerial',
|
||||
plugin: 'cordova-plugin-bluetooth-serial',
|
||||
pluginRef: 'bluetoothSerial',
|
||||
@@ -16,209 +38,189 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Connect to a Bluetooth device
|
||||
* Returns an Observable. Subscribe to connect, unsubscribe to disconnect.
|
||||
* @param macAddress_or_uuid Identifier of the remote device
|
||||
* @param {string} macAddress_or_uuid Identifier of the remote device
|
||||
* @returns {Observable<any>} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
static connect (macAddress_or_uuid: string): Observable<any> {return; }
|
||||
static connect(macAddress_or_uuid: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Connect insecurely to a Bluetooth device
|
||||
* Returns an Observable. Subscribe to connect, unsubscribe to disconnect.
|
||||
* @param macAddress Identifier of the remote device
|
||||
* @param {string} macAddress Identifier of the remote device
|
||||
* @returns {Observable<any>} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
static connectInsecure (macAddress: string): Observable<any> {return; }
|
||||
static connectInsecure(macAddress: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
* @param data ArrayBuffer of data
|
||||
* @usage
|
||||
* ```ts
|
||||
* // Write a string
|
||||
* Bluetooth.write("hello world").then(success, failure);
|
||||
*
|
||||
* // Array of int or bytes
|
||||
* Bluetooth.write([186, 220, 222]).then(success, failure);
|
||||
*
|
||||
* // Typed Array
|
||||
* var data = new Uint8Array(4);
|
||||
* data[0] = 0x41;
|
||||
* data[1] = 0x42;
|
||||
* data[2] = 0x43;
|
||||
* data[3] = 0x44;
|
||||
* Bluetooth.write(data).then(success, failure);
|
||||
*
|
||||
* // Array Buffer
|
||||
* Bluetooth.write(data.buffer).then(success, failure);
|
||||
* ```
|
||||
* @param {any} data ArrayBuffer of data
|
||||
* @returns {Promise<any>} returns a promise when data has been written
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static write (data: any): Promise<any> {return; }
|
||||
static write(data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Gets the number of bytes of data available
|
||||
* @returns {Promise<any>} returns a promise that contains the available bytes
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
}) static available (): Promise<any> {return; }
|
||||
}) static available(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
* @returns {Promise<any>} returns a promise with data from the buffer
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static read (): Promise<any> {return; }
|
||||
static read(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads data from the buffer until it reaches a delimiter
|
||||
* @param delimiter
|
||||
* @param {string} delimiter string that you want to search until
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static readUntil (delimiter: string): Promise<any> {return; }
|
||||
static readUntil(delimiter: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @param delimiter
|
||||
* @param {string} delimiter the string you want to watch for
|
||||
* @returns {Observable<any>} returns an observable.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribe'
|
||||
})
|
||||
static subscribe (delimiter: string): Observable<any> {return; }
|
||||
static subscribe(delimiter: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @returns {Observable<any>} returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribeRawData'
|
||||
})
|
||||
static subscribeRawData (): Observable<any> {return; }
|
||||
static subscribeRawData(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
* @returns {Promise<any>} returns a promise when completed
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static clear (): Promise<any> {return; }
|
||||
static clear(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static list (): Promise<any> {return; }
|
||||
static list(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isEnabled (): Promise<any> {return; }
|
||||
static isEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isConnected (): Promise<any> {return; }
|
||||
static isConnected(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static readRSSI (): Promise<any> {return; }
|
||||
static readRSSI(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static showBluetoothSettings (): Promise<any> {return; }
|
||||
static showBluetoothSettings(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static enable (): Promise<any> {return; }
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
* @usage
|
||||
* ```ts
|
||||
* [{
|
||||
* "class": 276,
|
||||
* "id": "10:BF:48:CB:00:00",
|
||||
* "address": "10:BF:48:CB:00:00",
|
||||
* "name": "Nexus 7"
|
||||
* }, {
|
||||
* "class": 7936,
|
||||
* "id": "00:06:66:4D:00:00",
|
||||
* "address": "00:06:66:4D:00:00",
|
||||
* "name": "RN42"
|
||||
* }]
|
||||
* ```
|
||||
* @returns {Promise<any>} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static discoverUnpaired (): Promise<any> {return; }
|
||||
static discoverUnpaired(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
|
||||
* @returns {Observable<any>} Returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
observable: true,
|
||||
clearFunction: 'clearDeviceDiscoveredListener'
|
||||
})
|
||||
static setDeviceDiscoveredListener (): Observable<any> {return; }
|
||||
static setDeviceDiscoveredListener(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets the human readable device name that is broadcasted to other devices
|
||||
* @param newName Desired name of device
|
||||
* @param {string} newName Desired name of device
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setName (newName: string): void {}
|
||||
static setName(newName: string): void { }
|
||||
|
||||
/**
|
||||
* Makes the device discoverable by other devices
|
||||
* @param discoverableDuration Desired number of seconds device should be discoverable for
|
||||
* @param {number} discoverableDuration Desired number of seconds device should be discoverable for
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setDiscoverable (discoverableDuration: number): void {}
|
||||
|
||||
|
||||
static setDiscoverable(discoverableDuration: number): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Brightness
|
||||
@@ -8,8 +8,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: `cordova-plugin-brightness`. For more info, please see the [Brightness plugin docs](https://github.com/mgcrea/cordova-plugin-brightness).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Brightness} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Brightness } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let brightnessValue: number = 0.8;
|
||||
* Brightness.setBrightness(brightnessValue);
|
||||
@@ -17,34 +18,36 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-brightness',
|
||||
pluginRef: 'plugins.brightness',
|
||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||
platforms: ['Android', 'iOS']
|
||||
pluginName: 'Brightness',
|
||||
plugin: 'cordova-plugin-brightness',
|
||||
pluginRef: 'cordova.plugins.brightness',
|
||||
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Brightness {
|
||||
|
||||
/**
|
||||
* Sets the brightness of the display.
|
||||
*
|
||||
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||
* @returns {Promise} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
static setBrightness(value: number): Promise<any> { return; }
|
||||
/**
|
||||
* Sets the brightness of the display.
|
||||
*
|
||||
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
static setBrightness(value: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves with the
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
static getBrightness(): Promise<any> { return; }
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
static getBrightness(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||
*/
|
||||
@Cordova()
|
||||
static setKeepScreenOn(value: boolean): void { }
|
||||
|
||||
/**
|
||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||
*/
|
||||
@Cordova()
|
||||
static setKeepScreenOn(value: boolean): void { }
|
||||
}
|
||||
|
||||
51
src/plugins/broadcaster.ts
Normal file
51
src/plugins/broadcaster.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Broadcaster
|
||||
* @description
|
||||
* This plugin adds exchanging events between native code and your app.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Broadcaster } from 'ionic-native';
|
||||
*
|
||||
* // Listen to events from Native
|
||||
* Broadcaster.addEventListener('eventName').then((event) => console.log(event));
|
||||
*
|
||||
* // Send event to Native
|
||||
* Broadcaster.fireNativeEvent('eventName', {}).then(() => console.log('success'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Broadcaster',
|
||||
plugin: 'cordova-plugin-broadcaster',
|
||||
pluginRef: 'broadcaster',
|
||||
repo: 'https://github.com/bsorrentino/cordova-broadcaster',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Broadcaster {
|
||||
|
||||
/**
|
||||
* This function listen to an event sent from the native code
|
||||
* @param eventName {string}
|
||||
* @return {Observable<any>} Returns an observable to watch when an event is received
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'removeEventListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addEventListener(eventName: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* This function sends data to the native code
|
||||
* @param eventName {string}
|
||||
* @param eventData {any}
|
||||
* @return {Promise<any>} Returns a promise that resolves when an event is successfully fired
|
||||
*/
|
||||
@Cordova()
|
||||
static fireNativeEvent(eventName: string, eventData: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,19 +1,55 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface CalendarOptions {
|
||||
firstReminderMinutes?: number;
|
||||
secondReminderMinutes?: number;
|
||||
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
recurrenceInterval?: number; // only used when recurrence is set
|
||||
recurrenceEndDate?: Date;
|
||||
calendarName?: string;
|
||||
calendarId?: number;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface Calendar {
|
||||
id: number;
|
||||
name: string;
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
firstReminderMinutes?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
secondReminderMinutes?: number;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,10 +59,23 @@ export interface Calendar {
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin).
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```
|
||||
* import {Calendar} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Calendar.createCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CalendarOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Calendar',
|
||||
plugin: 'cordova-plugin-calendar',
|
||||
pluginRef: 'plugins.calendar',
|
||||
repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin',
|
||||
@@ -42,86 +91,60 @@ export class Calendar {
|
||||
* - You're using Android < 6, or
|
||||
* - You've already granted permission
|
||||
*
|
||||
* If this returns false, you should call `requestReadWritePermissions` function
|
||||
* If this returns false, you should call the `requestReadWritePermission` function
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasReadWritePermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Check if we have read permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasReadPermission(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Check if we have read permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasReadPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Check if we have write permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasWritePermission(): Promise<boolean> {return; }
|
||||
/**
|
||||
* Check if we have write permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasWritePermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Request write permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWritePermission(): Promise<any> {return; }
|
||||
/**
|
||||
* Request write permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWritePermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request read permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadPermission(): Promise<any> {return; }
|
||||
/**
|
||||
* Request read permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests read/write permissions
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestReadWritePermission(): Promise<any> {return; }
|
||||
static requestReadWritePermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {Calendar} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Calendar.createCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object.
|
||||
* options:
|
||||
* calendarName: string the name of the calendar
|
||||
* calendarColor: string the hex color of the calendar
|
||||
* @return Returns a Promise
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @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)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* Calendar.deleteCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string} name Name of the calendar to delete.
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteCalendar(name: string): Promise<any> { return; }
|
||||
@@ -129,41 +152,21 @@ 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.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEvent(
|
||||
@@ -172,7 +175,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Silently create an event with additional options.
|
||||
@@ -183,7 +186,7 @@ export class Calendar {
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventWithOptions(
|
||||
@@ -193,7 +196,7 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Interactively create an event.
|
||||
@@ -203,7 +206,7 @@ export class Calendar {
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventInteractively(
|
||||
@@ -212,7 +215,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Interactively create an event with additional options.
|
||||
@@ -223,7 +226,7 @@ export class Calendar {
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static createEventInteractivelyWithOptions(
|
||||
@@ -233,7 +236,7 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
// deprecated
|
||||
// @Cordova()
|
||||
@@ -254,7 +257,7 @@ export class Calendar {
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static findEvent(
|
||||
@@ -263,18 +266,17 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Find an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise that resolves with the event, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the event, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static findEventWithOptions(
|
||||
@@ -284,30 +286,34 @@ export class Calendar {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Find a list of events within the specified date range. (Android only)
|
||||
*
|
||||
* @param {Date} [startDate] The start date
|
||||
* @param {Date} [endDate] The end date
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get a list of all calendars.
|
||||
* @return A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
* @returns {Promise<any>} A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static listCalendars(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -325,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,
|
||||
@@ -337,7 +345,7 @@ export class Calendar {
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Modify an event with additional options. (iOS only)
|
||||
@@ -352,34 +360,38 @@ export class Calendar {
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @param {CalendarOptions} [filterOptions] Event Options, see `getCalendarOptions`
|
||||
* @param {CalendarOptions} [newOptions] New event options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
newTitle?: string,
|
||||
newLocation?: string,
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date,
|
||||
options?: CalendarOptions
|
||||
) { return; }
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
newTitle?: string,
|
||||
newLocation?: string,
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date,
|
||||
filterOptions?: CalendarOptions,
|
||||
newOptions?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteEvent(
|
||||
title?: string,
|
||||
@@ -387,7 +399,7 @@ export class Calendar {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete an event from the specified Calendar. (iOS only)
|
||||
@@ -400,20 +412,24 @@ export class Calendar {
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
calendarName?: string
|
||||
): Promise<any> { return; }
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
calendarName?: string
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Open the calendar at the specified date.
|
||||
* @return {Date} date
|
||||
* @param {Date} date The date you want to open the calendar on
|
||||
* @return {Promise<any>} Promise returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static openCalendar(date: Date): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
40
src/plugins/call-number.ts
Normal file
40
src/plugins/call-number.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name CallNumber
|
||||
* @description
|
||||
* Call a number directly from your Cordova/Ionic application.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {CallNumber} from 'ionic-native';
|
||||
*
|
||||
* CallNumber.callNumber(18001010101, true)
|
||||
* .then(() => console.log('Launched dialer!'))
|
||||
* .catch(() => console.log('Error launching dialer'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CallNumber',
|
||||
plugin: 'call-number',
|
||||
pluginRef: 'plugins.CallNumber',
|
||||
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CallNumber {
|
||||
|
||||
/**
|
||||
* Calls a phone number
|
||||
* @param numberToCall {string} The phone number to call as a string
|
||||
* @param bypassAppChooser {boolean} Set to true to bypass the app chooser and go directly to dialer
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
172
src/plugins/camera-preview.ts
Normal file
172
src/plugins/camera-preview.ts
Normal file
@@ -0,0 +1,172 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface CameraPreviewRect {
|
||||
|
||||
x: number;
|
||||
|
||||
y: number;
|
||||
|
||||
width: number;
|
||||
|
||||
height: number;
|
||||
|
||||
}
|
||||
|
||||
export interface CameraPreviewSize {
|
||||
|
||||
maxWidth: number;
|
||||
|
||||
maxHeight: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
*
|
||||
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { CameraPreview, CameraPreviewRect } from 'ionic-native';
|
||||
*
|
||||
* // camera options (Size and location)
|
||||
* let cameraRect: CameraPreviewRect = {
|
||||
* x: 100,
|
||||
* y: 100,
|
||||
* width: 200,
|
||||
* height: 200
|
||||
* };
|
||||
*
|
||||
*
|
||||
* // 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
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // take a picture
|
||||
* CameraPreview.takePicture({
|
||||
* maxWidth: 640,
|
||||
* maxHeight: 640
|
||||
* });
|
||||
*
|
||||
* // Switch camera
|
||||
* CameraPreview.switchCamera();
|
||||
*
|
||||
* // set color effect to negative
|
||||
* CameraPreview.setColorEffect('negative');
|
||||
*
|
||||
* // Stop the camera preview
|
||||
* CameraPreview.stopCamera();
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CameraPreviewRect
|
||||
* CameraPreviewSize
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CameraPreview',
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
pluginRef: 'cordova.plugins.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
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { }
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static stopCamera(): void { }
|
||||
|
||||
/**
|
||||
* Take the picture, the parameter size is optional
|
||||
* @param {CameraPreviewSize} optional - size of the picture to take
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static takePicture(size?: CameraPreviewSize): void { }
|
||||
|
||||
/**
|
||||
* Register a callback function that receives the original picture and the image captured from the preview box.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static setOnPictureTakenHandler(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static switchCamera(): void { }
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static show(): void { }
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide(): void { }
|
||||
|
||||
/**
|
||||
* Disables the camera preview
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static disable(): void { }
|
||||
|
||||
/**
|
||||
* Set camera color effect.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static setColorEffect(effect: string): void { }
|
||||
|
||||
}
|
||||
@@ -1,67 +1,67 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface CameraOptions {
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
quality?: number;
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string
|
||||
* FILE_URI : 1, Return image file URI
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
destinationType?: number;
|
||||
/**
|
||||
* Set the source of the picture.
|
||||
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
|
||||
* PHOTOLIBRARY : 0,
|
||||
* CAMERA : 1,
|
||||
* SAVEDPHOTOALBUM : 2
|
||||
*/
|
||||
sourceType?: number;
|
||||
/** Allow simple editing of image before selection. */
|
||||
allowEdit?: boolean;
|
||||
/**
|
||||
* Choose the returned image file's encoding.
|
||||
* Defined in navigator.camera.EncodingType. Default is JPEG
|
||||
* JPEG : 0 Return JPEG encoded image
|
||||
* PNG : 1 Return PNG encoded image
|
||||
*/
|
||||
encodingType?: number;
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetHeight?: number;
|
||||
/**
|
||||
* Set the type of media to select from. Only works when PictureSourceType
|
||||
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
|
||||
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
|
||||
* Will return format specified via DestinationType
|
||||
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
|
||||
* ALLMEDIA : 2 allow selection from all media types
|
||||
*/
|
||||
mediaType?: number;
|
||||
/** Rotate the image to correct for the orientation of the device during capture. */
|
||||
correctOrientation?: boolean;
|
||||
/** Save the image to the photo album on the device after capture. */
|
||||
saveToPhotoAlbum?: boolean;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in navigator.camera.Direction. Default is BACK.
|
||||
* FRONT: 0
|
||||
* BACK: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
popoverOptions?: CameraPopoverOptions;
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
quality?: number;
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in Camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string,
|
||||
* FILE_URI : 1, Return image file URI,
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
destinationType?: number;
|
||||
/**
|
||||
* Set the source of the picture.
|
||||
* Defined in Camera.PictureSourceType. Default is CAMERA.
|
||||
* PHOTOLIBRARY : 0,
|
||||
* CAMERA : 1,
|
||||
* SAVEDPHOTOALBUM : 2
|
||||
*/
|
||||
sourceType?: number;
|
||||
/** Allow simple editing of image before selection. */
|
||||
allowEdit?: boolean;
|
||||
/**
|
||||
* Choose the returned image file's encoding.
|
||||
* Defined in Camera.EncodingType. Default is JPEG
|
||||
* JPEG : 0 Return JPEG encoded image
|
||||
* PNG : 1 Return PNG encoded image
|
||||
*/
|
||||
encodingType?: number;
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetHeight?: number;
|
||||
/**
|
||||
* Set the type of media to select from. Only works when PictureSourceType
|
||||
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in Camera.MediaType
|
||||
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
|
||||
* Will return format specified via DestinationType
|
||||
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
|
||||
* ALLMEDIA : 2 allow selection from all media types
|
||||
*/
|
||||
mediaType?: number;
|
||||
/** Rotate the image to correct for the orientation of the device during capture. */
|
||||
correctOrientation?: boolean;
|
||||
/** Save the image to the photo album on the device after capture. */
|
||||
saveToPhotoAlbum?: boolean;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in Camera.Direction. Default is BACK.
|
||||
* BACK: 0
|
||||
* FRONT: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
popoverOptions?: CameraPopoverOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,20 +69,20 @@ export interface CameraOptions {
|
||||
* of the popover when selecting images from an iPad's library or album.
|
||||
*/
|
||||
export interface CameraPopoverOptions {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
|
||||
* Matches iOS UIPopoverArrowDirection constants.
|
||||
* ARROW_UP : 1,
|
||||
* ARROW_DOWN : 2,
|
||||
* ARROW_LEFT : 4,
|
||||
* ARROW_RIGHT : 8,
|
||||
* ARROW_ANY : 15
|
||||
*/
|
||||
arrowDir: number;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
|
||||
* Matches iOS UIPopoverArrowDirection constants.
|
||||
* ARROW_UP : 1,
|
||||
* ARROW_DOWN : 2,
|
||||
* ARROW_LEFT : 4,
|
||||
* ARROW_RIGHT : 8,
|
||||
* ARROW_ANY : 15
|
||||
*/
|
||||
arrowDir: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,45 +93,33 @@ export interface CameraPopoverOptions {
|
||||
* Requires {@link module:driftyco/ionic-native} and the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Camera} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { Camera } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Camera.getPicture(options).then((imageData) => {
|
||||
* // imageData is either a base64 encoded string or a file URI
|
||||
* // If it's base64:
|
||||
* let base64Image = "data:image/jpeg;base64," + imageData;
|
||||
* let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
* }, (err) => {
|
||||
* // Handle error
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* CameraOptions
|
||||
* CameraPopoverOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Camera',
|
||||
plugin: 'cordova-plugin-camera',
|
||||
pluginRef: 'navigator.camera',
|
||||
repo: 'https://github.com/apache/cordova-plugin-camera',
|
||||
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
|
||||
})
|
||||
export class Camera {
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions} options
|
||||
* @return Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getPicture(options: CameraOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static cleanup() { };
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static DestinationType = {
|
||||
@@ -144,6 +132,7 @@ export class Camera {
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static EncodingType = {
|
||||
@@ -153,6 +142,7 @@ export class Camera {
|
||||
PNG: 1
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static MediaType = {
|
||||
@@ -161,34 +151,37 @@ export class Camera {
|
||||
/** Allow selection of video only, ONLY RETURNS URL */
|
||||
VIDEO: 1,
|
||||
/** Allow selection from all media types */
|
||||
ALLMEDIA : 2
|
||||
ALLMEDIA: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static PictureSourceType = {
|
||||
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
|
||||
PHOTOLIBRARY : 0,
|
||||
PHOTOLIBRARY: 0,
|
||||
/** Take picture from camera */
|
||||
CAMERA : 1,
|
||||
CAMERA: 1,
|
||||
/** Choose image from picture library (same as PHOTOLIBRARY for Android) */
|
||||
SAVEDPHOTOALBUM : 2
|
||||
SAVEDPHOTOALBUM: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
|
||||
* @enum {number}
|
||||
*/
|
||||
static PopoverArrowDirection = {
|
||||
ARROW_UP : 1,
|
||||
ARROW_DOWN : 2,
|
||||
ARROW_LEFT : 4,
|
||||
ARROW_RIGHT : 8,
|
||||
ARROW_ANY : 15
|
||||
ARROW_UP: 1,
|
||||
ARROW_DOWN: 2,
|
||||
ARROW_LEFT: 4,
|
||||
ARROW_RIGHT: 8,
|
||||
ARROW_ANY: 15
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static Direction = {
|
||||
@@ -198,6 +191,24 @@ export class Camera {
|
||||
FRONT: 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions?} options optional. Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-).
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getPicture(options?: CameraOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static cleanup(): Promise<any> { return; };
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,141 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
* @usage
|
||||
* ```
|
||||
* import {CardIO} from 'ionic-native';
|
||||
* import { CardIO } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* CardIO.canScan()
|
||||
* .then(
|
||||
@@ -23,51 +151,41 @@ import {Plugin, Cordova} from './plugin';
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CardIOOptions
|
||||
* CardIOResponse
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
pluginName: 'CardIO',
|
||||
plugin: 'card.io.cordova.mobilesdk',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CardIO {
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
static canScan(): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<any> {return; }
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static canScan(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param {CardIOOptions} options Options for configuring the plugin
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<CardIOResponse> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve the version of the card.io library. Useful when contacting support.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve the version of the card.io library. Useful when contacting support.
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> {return; }
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
requireExpiry?: boolean;
|
||||
requireCCV?: boolean;
|
||||
requirePostalCode?: boolean;
|
||||
supressManual?: boolean;
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
keepApplicationTheme?: boolean;
|
||||
requireCardholderName?: boolean;
|
||||
scanInstructions?: string;
|
||||
noCamera?: boolean;
|
||||
scanExpiry?: boolean;
|
||||
languageOrLocale?: string;
|
||||
guideColor?: string;
|
||||
supressConfirmation?: boolean;
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Clipboard
|
||||
@@ -9,25 +9,25 @@ import {Plugin, Cordova} from './plugin';
|
||||
* For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Clipboard} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Clipboard } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Clipboard.copy("Hello world");
|
||||
* Clipboard.copy('Hello world');
|
||||
*
|
||||
* Clipboard.paste().then(
|
||||
* (resolve : string) => {
|
||||
* alert(resolve);
|
||||
* },
|
||||
* (reject : string) => {
|
||||
* alert("Error: " + reject);
|
||||
* (resolve: string) => {
|
||||
* alert(resolve);
|
||||
* },
|
||||
* (reject: string) => {
|
||||
* alert('Error: ' + reject);
|
||||
* }
|
||||
* );
|
||||
* );
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Clipboard',
|
||||
plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git',
|
||||
pluginRef: 'cordova.plugins.clipboard',
|
||||
repo: 'https://github.com/VersoSolutions/CordovaClipboard',
|
||||
@@ -37,15 +37,15 @@ export class Clipboard {
|
||||
|
||||
/**
|
||||
* Copies the given text
|
||||
* @param text
|
||||
* @returns {Promise<T>}
|
||||
* @param {string} text Text that gets copied on the system clipboard
|
||||
* @returns {Promise<any>} Returns a promise after the text has been copied
|
||||
*/
|
||||
@Cordova()
|
||||
static copy(text: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Pastes the text stored in clipboard
|
||||
* @returns {Promise<T>}
|
||||
* @returns {Promise<any>} Returns a promise after the text has been pasted
|
||||
*/
|
||||
@Cordova()
|
||||
static paste(): Promise<any> { return; }
|
||||
|
||||
520
src/plugins/code-push.ts
Normal file
520
src/plugins/code-push.ts
Normal file
@@ -0,0 +1,520 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
namespace Http {
|
||||
export const enum Verb {
|
||||
GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
statusCode: number;
|
||||
body?: string;
|
||||
}
|
||||
|
||||
export interface Requester {
|
||||
request(verb: Verb, url: string, callback: Callback<Response>): void;
|
||||
request(verb: Verb, url: string, requestBody: string, callback: Callback<Response>): void;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a package. All fields are non-nullable, except when retrieving the currently running package on the first run of the app,
|
||||
* in which case only the appVersion is compulsory.
|
||||
*
|
||||
* !! THIS TYPE IS READ FROM NATIVE CODE AS WELL. ANY CHANGES TO THIS INTERFACE NEEDS TO BE UPDATED IN NATIVE CODE !!
|
||||
*/
|
||||
export interface IPackage {
|
||||
deploymentKey: string;
|
||||
description: string;
|
||||
label: string;
|
||||
appVersion: string;
|
||||
isMandatory: boolean;
|
||||
packageHash: string;
|
||||
packageSize: number;
|
||||
failedInstall: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a remote package, which represents an update package available for download.
|
||||
*/
|
||||
export interface IRemotePackage extends IPackage {
|
||||
/**
|
||||
* The URL at which the package is available for download.
|
||||
*/
|
||||
downloadUrl: string;
|
||||
|
||||
/**
|
||||
* Downloads the package update from the CodePush service.
|
||||
*
|
||||
* @param downloadSuccess Called with one parameter, the downloaded package information, once the download completed successfully.
|
||||
* @param downloadError Optional callback invoked in case of an error.
|
||||
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
|
||||
*/
|
||||
download(downloadSuccess: SuccessCallback<ILocalPackage>, downloadError?: ErrorCallback, downloadProgress?: SuccessCallback<DownloadProgress>): void;
|
||||
|
||||
/**
|
||||
* Aborts the current download session, previously started with download().
|
||||
*
|
||||
* @param abortSuccess Optional callback invoked if the abort operation succeeded.
|
||||
* @param abortError Optional callback invoked in case of an error.
|
||||
*/
|
||||
abortDownload(abortSuccess?: SuccessCallback<void>, abortError?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a local package.
|
||||
*
|
||||
* !! THIS TYPE IS READ FROM NATIVE CODE AS WELL. ANY CHANGES TO THIS INTERFACE NEEDS TO BE UPDATED IN NATIVE CODE !!
|
||||
*/
|
||||
export interface ILocalPackage extends IPackage {
|
||||
/**
|
||||
* The local storage path where this package is located.
|
||||
*/
|
||||
localPath: string;
|
||||
|
||||
/**
|
||||
* Indicates if the current application run is the first one after the package was applied.
|
||||
*/
|
||||
isFirstRun: boolean;
|
||||
|
||||
/**
|
||||
* Applies this package to the application. The application will be reloaded with this package and on every application launch this package will be loaded.
|
||||
* On the first run after the update, the application will wait for a codePush.notifyApplicationReady() call. Once this call is made, the install operation is considered a success.
|
||||
* Otherwise, the install operation will be marked as failed, and the application is reverted to its previous version on the next run.
|
||||
*
|
||||
* @param installSuccess Callback invoked if the install operation succeeded.
|
||||
* @param installError Optional callback inovoked in case of an error.
|
||||
* @param installOptions Optional parameter used for customizing the installation behavior.
|
||||
*/
|
||||
install(installSuccess: SuccessCallback<InstallMode>, errorCallback?: ErrorCallback, installOptions?: InstallOptions): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decomposed static side of RemotePackage.
|
||||
* For Class Decomposition guidelines see http://www.typescriptlang.org/Handbook#writing-dts-files-guidelines-and-specifics
|
||||
*/
|
||||
/* tslint:disable */
|
||||
interface RemotePackage_Static {
|
||||
new (): IRemotePackage;
|
||||
}
|
||||
/* tslint:enable */
|
||||
|
||||
/**
|
||||
* Decomposed static side of LocalPackage.
|
||||
* For Class Decomposition guidelines see http://www.typescriptlang.org/Handbook#writing-dts-files-guidelines-and-specifics
|
||||
*/
|
||||
/* tslint:disable */
|
||||
interface LocalPackage_Static {
|
||||
new (): ILocalPackage;
|
||||
}
|
||||
/* tslint:enable */
|
||||
|
||||
declare var RemotePackage: RemotePackage_Static;
|
||||
declare var LocalPackage: LocalPackage_Static;
|
||||
|
||||
/**
|
||||
* Defines the JSON format of the current package information file.
|
||||
* This file is stored in the local storage of the device and persists between store updates and code-push updates.
|
||||
*
|
||||
* !! THIS FILE IS READ FROM NATIVE CODE AS WELL. ANY CHANGES TO THIS INTERFACE NEEDS TO BE UPDATED IN NATIVE CODE !!
|
||||
*/
|
||||
interface IPackageInfoMetadata extends ILocalPackage {
|
||||
nativeBuildTime: string;
|
||||
}
|
||||
|
||||
interface NativeUpdateNotification {
|
||||
updateAppVersion: boolean; // Always true
|
||||
appVersion: string;
|
||||
}
|
||||
|
||||
export interface Callback<T> { (error: Error, parameter: T): void; }
|
||||
export interface SuccessCallback<T> { (result?: T): void; }
|
||||
export interface ErrorCallback { (error?: Error): void; }
|
||||
|
||||
interface Configuration {
|
||||
appVersion: string;
|
||||
clientUniqueId: string;
|
||||
deploymentKey: string;
|
||||
serverUrl: string;
|
||||
ignoreAppVersion?: boolean;
|
||||
}
|
||||
|
||||
declare class AcquisitionStatus {
|
||||
static DeploymentSucceeded: string;
|
||||
static DeploymentFailed: string;
|
||||
}
|
||||
|
||||
declare class AcquisitionManager {
|
||||
constructor(httpRequester: Http.Requester, configuration: Configuration);
|
||||
public queryUpdateWithCurrentPackage(currentPackage: IPackage, callback?: Callback<IRemotePackage | NativeUpdateNotification>): void;
|
||||
public reportStatusDeploy(pkg?: IPackage, status?: string, previousLabelOrAppVersion?: string, previousDeploymentKey?: string, callback?: Callback<void>): void;
|
||||
public reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
|
||||
}
|
||||
|
||||
interface CodePushCordovaPlugin {
|
||||
|
||||
/**
|
||||
* Get the current package information.
|
||||
*
|
||||
* @param packageSuccess Callback invoked with the currently deployed package information.
|
||||
* @param packageError Optional callback invoked in case of an error.
|
||||
*/
|
||||
getCurrentPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
|
||||
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
|
||||
*/
|
||||
getPendingPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Checks with the CodePush server if an update package is available for download.
|
||||
*
|
||||
* @param querySuccess Callback invoked in case of a successful response from the server.
|
||||
* The callback takes one RemotePackage parameter. A non-null package is a valid update.
|
||||
* A null package means the application is up to date for the current native application version.
|
||||
* @param queryError Optional callback invoked in case of an error.
|
||||
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
|
||||
*/
|
||||
checkForUpdate(querySuccess: SuccessCallback<IRemotePackage>, queryError?: ErrorCallback, deploymentKey?: string): void;
|
||||
|
||||
/**
|
||||
* Notifies the plugin that the update operation succeeded and that the application is ready.
|
||||
* Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop.
|
||||
* If using sync API, calling this function is not required since sync calls it internally.
|
||||
*
|
||||
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
|
||||
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
|
||||
*/
|
||||
notifyApplicationReady(notifySucceeded?: SuccessCallback<void>, notifyFailed?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
|
||||
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
|
||||
*/
|
||||
restartApplication(installSuccess: SuccessCallback<void>, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Convenience method for installing updates in one method call.
|
||||
* This method is provided for simplicity, and its behavior can be replicated by using window.codePush.checkForUpdate(), RemotePackage's download() and LocalPackage's install() methods.
|
||||
*
|
||||
* The algorithm of this method is the following:
|
||||
* - Checks for an update on the CodePush server.
|
||||
* - If an update is available
|
||||
* - If the update is mandatory and the alertMessage is set in options, the user will be informed that the application will be updated to the latest version.
|
||||
* The update package will then be downloaded and applied.
|
||||
* - If the update is not mandatory and the confirmMessage is set in options, the user will be asked if they want to update to the latest version.
|
||||
* If they decline, the syncCallback will be invoked with SyncStatus.UPDATE_IGNORED.
|
||||
* - Otherwise, the update package will be downloaded and applied with no user interaction.
|
||||
* - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE.
|
||||
* - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR.
|
||||
*
|
||||
* @param syncCallback Optional callback to be called with the status of the sync operation.
|
||||
* The callback will be called only once, and the possible statuses are defined by the SyncStatus enum.
|
||||
* @param syncOptions Optional SyncOptions parameter configuring the behavior of the sync operation.
|
||||
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
|
||||
*
|
||||
*/
|
||||
sync(syncCallback?: SuccessCallback<SyncStatus>, syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the possible result statuses of the window.codePush.sync operation.
|
||||
*/
|
||||
export enum SyncStatus {
|
||||
/**
|
||||
* The application is up to date.
|
||||
*/
|
||||
UP_TO_DATE,
|
||||
|
||||
/**
|
||||
* An update is available, it has been downloaded, unzipped and copied to the deployment folder.
|
||||
* After the completion of the callback invoked with SyncStatus.UPDATE_INSTALLED, the application will be reloaded with the updated code and resources.
|
||||
*/
|
||||
UPDATE_INSTALLED,
|
||||
|
||||
/**
|
||||
* An optional update is available, but the user declined to install it. The update was not downloaded.
|
||||
*/
|
||||
UPDATE_IGNORED,
|
||||
|
||||
/**
|
||||
* An error happened during the sync operation. This might be an error while communicating with the server, downloading or unziping the update.
|
||||
* The console logs should contain more information about what happened. No update has been applied in this case.
|
||||
*/
|
||||
ERROR,
|
||||
|
||||
/**
|
||||
* There is an ongoing sync in progress, so this attempt to sync has been aborted.
|
||||
*/
|
||||
IN_PROGRESS,
|
||||
|
||||
/**
|
||||
* Intermediate status - the plugin is about to check for updates.
|
||||
*/
|
||||
CHECKING_FOR_UPDATE,
|
||||
|
||||
/**
|
||||
* Intermediate status - a user dialog is about to be displayed. This status will be reported only if user interaction is enabled.
|
||||
*/
|
||||
AWAITING_USER_ACTION,
|
||||
|
||||
/**
|
||||
* Intermediate status - the update package is about to be downloaded.
|
||||
*/
|
||||
DOWNLOADING_PACKAGE,
|
||||
|
||||
/**
|
||||
* Intermediate status - the update package is about to be installed.
|
||||
*/
|
||||
INSTALLING_UPDATE
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the available install modes for updates.
|
||||
*/
|
||||
export enum InstallMode {
|
||||
/**
|
||||
* The update will be applied to the running application immediately. The application will be reloaded with the new content immediately.
|
||||
*/
|
||||
IMMEDIATE,
|
||||
|
||||
/**
|
||||
* The update is downloaded but not installed immediately. The new content will be available the next time the application is started.
|
||||
*/
|
||||
ON_NEXT_RESTART,
|
||||
|
||||
/**
|
||||
* The udpate is downloaded but not installed immediately. The new content will be available the next time the application is resumed or restarted, whichever event happends first.
|
||||
*/
|
||||
ON_NEXT_RESUME
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the install operation options.
|
||||
*/
|
||||
export interface InstallOptions {
|
||||
/**
|
||||
* Used to specify the InstallMode used for the install operation. This is optional and defaults to InstallMode.ON_NEXT_RESTART.
|
||||
*/
|
||||
installMode?: InstallMode;
|
||||
|
||||
/**
|
||||
* If installMode === ON_NEXT_RESUME, the minimum amount of time (in seconds) which needs to pass with the app in the background before an update install occurs when the app is resumed.
|
||||
*/
|
||||
minimumBackgroundDuration?: number;
|
||||
|
||||
/**
|
||||
* Used to specify the InstallMode used for the install operation if the update is mandatory. This is optional and defaults to InstallMode.IMMEDIATE.
|
||||
*/
|
||||
mandatoryInstallMode?: InstallMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the sync operation options.
|
||||
*/
|
||||
export interface SyncOptions extends InstallOptions {
|
||||
/**
|
||||
* Optional boolean flag. If set, previous updates which were rolled back will be ignored. Defaults to true.
|
||||
*/
|
||||
ignoreFailedUpdates?: boolean;
|
||||
|
||||
/**
|
||||
* Used to enable, disable or customize the user interaction during sync.
|
||||
* If set to false, user interaction will be disabled. If set to true, the user will be alerted or asked to confirm new updates, based on whether the update is mandatory.
|
||||
* To customize the user dialog, this option can be set to a custom UpdateDialogOptions instance.
|
||||
*/
|
||||
updateDialog?: boolean | UpdateDialogOptions;
|
||||
|
||||
/**
|
||||
* Overrides the config.xml deployment key when checking for updates.
|
||||
*/
|
||||
deploymentKey?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the configuration options for the alert or confirmation dialog
|
||||
*/
|
||||
export interface UpdateDialogOptions {
|
||||
/**
|
||||
* If a mandatory update is available and this option is set, the message will be displayed to the user in an alert dialog before downloading and installing the update.
|
||||
* The user will not be able to cancel the operation, since the update is mandatory.
|
||||
*/
|
||||
mandatoryUpdateMessage?: string;
|
||||
|
||||
/**
|
||||
* If an optional update is available and this option is set, the message will be displayed to the user in a confirmation dialog.
|
||||
* If the user confirms the update, it will be downloaded and installed. Otherwise, the update update is not downloaded.
|
||||
*/
|
||||
optionalUpdateMessage?: string;
|
||||
|
||||
/**
|
||||
* The title of the dialog box used for interacting with the user in case of a mandatory or optional update.
|
||||
* This title will only be used if at least one of mandatoryUpdateMessage or optionalUpdateMessage options are set.
|
||||
*/
|
||||
updateTitle?: string;
|
||||
|
||||
/**
|
||||
* The label of the confirmation button in case of an optional update.
|
||||
*/
|
||||
optionalInstallButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* The label of the cancel button in case of an optional update.
|
||||
*/
|
||||
optionalIgnoreButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* The label of the continue button in case of a mandatory update.
|
||||
*/
|
||||
mandatoryContinueButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* Flag indicating if the update description provided by the CodePush server should be displayed in the dialog box appended to the update message.
|
||||
*/
|
||||
appendReleaseDescription?: boolean;
|
||||
|
||||
/**
|
||||
* Optional prefix to add to the release description.
|
||||
*/
|
||||
descriptionPrefix?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the JSON format of the package diff manifest file.
|
||||
*/
|
||||
interface IDiffManifest {
|
||||
deletedFiles: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the format of the DownloadProgress object, used to send periodical update notifications on the progress of the update download.
|
||||
*/
|
||||
export interface DownloadProgress {
|
||||
totalBytes: number;
|
||||
receivedBytes: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name CodePush
|
||||
* @description
|
||||
* CodePush plugin for Cordova by Microsoft that supports iOS and Android.
|
||||
*
|
||||
* For more info, please see https://github.com/ksachdeva/ionic2-code-push-example
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CodePush } from 'ionic-native';
|
||||
*
|
||||
* // note - mostly error & completed methods of observable will not fire
|
||||
* // as syncStatus will contain the current state of the update
|
||||
* CodePush.sync().subscribe((syncStatus) => console.log(syncStatus));
|
||||
*
|
||||
* const downloadProgress = (progress) => { console.log(`Downloaded ${progress.receivedBytes} of ${progress.totalBytes}`); }
|
||||
* CodePush.sync({}, downloadProgress).subscribe((syncStatus) => console.log(syncStatus));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CodePush',
|
||||
plugin: 'cordova-plugin-code-push',
|
||||
pluginRef: 'codePush',
|
||||
repo: 'https://github.com/Microsoft/cordova-plugin-code-push',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class CodePush {
|
||||
|
||||
/**
|
||||
* Get the current package information.
|
||||
*
|
||||
* @param packageSuccess Callback invoked with the currently deployed package information.
|
||||
* @param packageError Optional callback invoked in case of an error.
|
||||
* @returns {Promise<ILocalPackage>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentPackage(): Promise<ILocalPackage> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
|
||||
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
|
||||
* @returns {Promise<ILocalPackage>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPendingPackage(): Promise<ILocalPackage> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks with the CodePush server if an update package is available for download.
|
||||
*
|
||||
* @param querySuccess Callback invoked in case of a successful response from the server.
|
||||
* The callback takes one RemotePackage parameter. A non-null package is a valid update.
|
||||
* A null package means the application is up to date for the current native application version.
|
||||
* @param queryError Optional callback invoked in case of an error.
|
||||
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
|
||||
* @returns {Promise<IRemotePackage>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static checkForUpdate(deploymentKey?: string): Promise<IRemotePackage> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the plugin that the update operation succeeded and that the application is ready.
|
||||
* Calling this function is required on the first run after an update. On every subsequent application run, calling this function is a noop.
|
||||
* If using sync API, calling this function is not required since sync calls it internally.
|
||||
*
|
||||
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
|
||||
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static notifyApplicationReady(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
|
||||
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static restartApplication(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method for installing updates in one method call.
|
||||
* This method is provided for simplicity, and its behavior can be replicated by using window.codePush.checkForUpdate(), RemotePackage's download() and LocalPackage's install() methods.
|
||||
*
|
||||
* The algorithm of this method is the following:
|
||||
* - Checks for an update on the CodePush server.
|
||||
* - If an update is available
|
||||
* - If the update is mandatory and the alertMessage is set in options, the user will be informed that the application will be updated to the latest version.
|
||||
* The update package will then be downloaded and applied.
|
||||
* - If the update is not mandatory and the confirmMessage is set in options, the user will be asked if they want to update to the latest version.
|
||||
* If they decline, the syncCallback will be invoked with SyncStatus.UPDATE_IGNORED.
|
||||
* - Otherwise, the update package will be downloaded and applied with no user interaction.
|
||||
* - If no update is available on the server, or if a previously rolled back update is available and the ignoreFailedUpdates is set to true, the syncCallback will be invoked with the SyncStatus.UP_TO_DATE.
|
||||
* - If an error occurs during checking for update, downloading or installing it, the syncCallback will be invoked with the SyncStatus.ERROR.
|
||||
*
|
||||
* @param syncCallback Optional callback to be called with the status of the sync operation.
|
||||
* @param syncOptions Optional SyncOptions parameter configuring the behavior of the sync operation.
|
||||
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
|
||||
* @returns {Observable<SyncStatus>}
|
||||
*
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3 // we don't need this, so we set it to a value higher than # of args
|
||||
})
|
||||
static sync(syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): Observable<SyncStatus> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,215 +1,256 @@
|
||||
import {Plugin, Cordova, InstanceProperty, CordovaInstance} from './plugin';
|
||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise } from './plugin';
|
||||
|
||||
declare var window: any,
|
||||
navigator: any;
|
||||
navigator: any;
|
||||
|
||||
export type ContactFieldType = 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'familyName' | 'formatted' | 'givenName' | 'honorificPrefix' | 'honorificSuffix' | 'id' | 'ims' | 'locality' | 'middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface IContactProperties {
|
||||
/** A globally unique identifier. */
|
||||
id?: string;
|
||||
/** The name of this Contact, suitable for display to end users. */
|
||||
displayName?: string;
|
||||
/** An object containing all components of a persons name. */
|
||||
name?: ContactName;
|
||||
/** 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?: ContactAddress[];
|
||||
/** An array of all the contact's IM addresses. */
|
||||
ims?: IContactField[];
|
||||
/** An array of all the contact's organizations. */
|
||||
organizations?: ContactOrganization[];
|
||||
/** 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[];
|
||||
|
||||
/** 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[];
|
||||
}
|
||||
export class Contact {
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty get id(): string {return; }
|
||||
@InstanceProperty get displayName(): string {return; }
|
||||
@InstanceProperty get nickname(): ContactName {return; }
|
||||
@InstanceProperty get phoneNumbers(): string {return; }
|
||||
@InstanceProperty get emails(): IContactField[] {return; }
|
||||
@InstanceProperty get addresses(): ContactAddress[] {return; }
|
||||
@InstanceProperty get ims(): IContactField[] {return; }
|
||||
@InstanceProperty get organizations(): ContactOrganization[] {return; }
|
||||
@InstanceProperty get birthday(): Date {return; }
|
||||
@InstanceProperty get note(): string {return; }
|
||||
@InstanceProperty get photos(): IContactField[] {return; }
|
||||
@InstanceProperty get categories(): IContactField[] {return; }
|
||||
@InstanceProperty get urls(): IContactField[] {return; }
|
||||
constructor () {
|
||||
this._objectInstance = navigator.contacts.create();
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class Contact implements IContactProperties {
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty id: string;
|
||||
@InstanceProperty displayName: string;
|
||||
@InstanceProperty name: IContactName;
|
||||
@InstanceProperty nickname: string;
|
||||
@InstanceProperty phoneNumbers: IContactField[];
|
||||
@InstanceProperty emails: IContactField[];
|
||||
@InstanceProperty addresses: IContactAddress[];
|
||||
@InstanceProperty ims: IContactField[];
|
||||
@InstanceProperty organizations: IContactOrganization[];
|
||||
@InstanceProperty birthday: Date;
|
||||
@InstanceProperty note: string;
|
||||
@InstanceProperty photos: IContactField[];
|
||||
@InstanceProperty categories: IContactField[];
|
||||
@InstanceProperty urls: IContactField[];
|
||||
|
||||
constructor() {
|
||||
this._objectInstance = navigator.contacts.create();
|
||||
}
|
||||
|
||||
clone(): Contact {
|
||||
let newContact = new Contact();
|
||||
for (let prop in this) {
|
||||
if (prop === 'id') return;
|
||||
newContact[prop] = this[prop];
|
||||
}
|
||||
clone(): Contact {
|
||||
let newContact = new Contact();
|
||||
for (let prop in this) {
|
||||
if (prop === 'id') return;
|
||||
newContact[prop] = this[prop];
|
||||
}
|
||||
return newContact;
|
||||
}
|
||||
@CordovaInstance()
|
||||
remove(): Promise<any> {return; }
|
||||
@CordovaInstance()
|
||||
save(): Promise<any> {return; }
|
||||
return newContact;
|
||||
}
|
||||
|
||||
@CordovaInstance()
|
||||
remove(): Promise<any> { return; }
|
||||
|
||||
save(): Promise<any> {
|
||||
return getPromise((resolve, reject) => {
|
||||
this._objectInstance.save((contact) => {
|
||||
this._objectInstance = contact;
|
||||
resolve(this);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
interface IContactError {
|
||||
/** Error code */
|
||||
code: number;
|
||||
/** Error message */
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface IContactError {
|
||||
/** Error code */
|
||||
code: number;
|
||||
/** Error message */
|
||||
message: string;
|
||||
}
|
||||
declare var ContactError: {
|
||||
new(code: number): IContactError;
|
||||
UNKNOWN_ERROR: number;
|
||||
INVALID_ARGUMENT_ERROR: number;
|
||||
TIMEOUT_ERROR: number;
|
||||
PENDING_OPERATION_ERROR: number;
|
||||
IO_ERROR: number;
|
||||
NOT_SUPPORTED_ERROR: number;
|
||||
PERMISSION_DENIED_ERROR: number
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare var ContactError: {
|
||||
new (code: number): IContactError;
|
||||
UNKNOWN_ERROR: number;
|
||||
INVALID_ARGUMENT_ERROR: number;
|
||||
TIMEOUT_ERROR: number;
|
||||
PENDING_OPERATION_ERROR: number;
|
||||
IO_ERROR: number;
|
||||
NOT_SUPPORTED_ERROR: number;
|
||||
PERMISSION_DENIED_ERROR: number
|
||||
};
|
||||
|
||||
export interface IContactName {
|
||||
/** The complete name of the contact. */
|
||||
formatted?: string;
|
||||
/** The contact's family name. */
|
||||
familyName?: string;
|
||||
/** The contact's given name. */
|
||||
givenName?: string;
|
||||
/** The contact's middle name. */
|
||||
middleName?: string;
|
||||
/** The contact's prefix (example Mr. or Dr.) */
|
||||
honorificPrefix?: string;
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
/** The complete name of the contact. */
|
||||
formatted?: string;
|
||||
/** The contact's family name. */
|
||||
familyName?: string;
|
||||
/** The contact's given name. */
|
||||
givenName?: string;
|
||||
/** The contact's middle name. */
|
||||
middleName?: string;
|
||||
/** The contact's prefix (example Mr. or Dr.) */
|
||||
honorificPrefix?: string;
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactName implements IContactName {
|
||||
private _objectInstance: any;
|
||||
constructor(formatted?: string, familyName?: string, givenName?: string, middleName?: string, honorificPrefix?: string, honorificSuffix?: string) {
|
||||
this._objectInstance = new window.ContactName(formatted, familyName, givenName, middleName, honorificPrefix, honorificSuffix);
|
||||
}
|
||||
@InstanceProperty get formatted(): string {return; }
|
||||
@InstanceProperty get familyName(): string {return; }
|
||||
@InstanceProperty get givenName(): string {return; }
|
||||
@InstanceProperty get middleName(): string {return; }
|
||||
@InstanceProperty get honorificPrefix(): string {return; }
|
||||
@InstanceProperty get honorificSuffix(): string {return; }
|
||||
constructor(public formatted?: string,
|
||||
public familyName?: string,
|
||||
public givenName?: string,
|
||||
public middleName?: string,
|
||||
public honorificPrefix?: string,
|
||||
public honorificSuffix?: string) {}
|
||||
}
|
||||
|
||||
export interface IContactField {
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value?: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactField implements IContactField {
|
||||
private _objectInstance: any;
|
||||
constructor(type?: string, value?: string, pref?: boolean) {
|
||||
this._objectInstance = new window.ContactField(type, value, pref);
|
||||
}
|
||||
@InstanceProperty get type(): string {return; }
|
||||
@InstanceProperty get value(): string {return; }
|
||||
@InstanceProperty get pref(): boolean {return; }
|
||||
constructor(public type?: string,
|
||||
public value?: string,
|
||||
public pref?: boolean) {}
|
||||
}
|
||||
|
||||
export interface IContactAddress {
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
streetAddress?: string;
|
||||
/** The city or locality. */
|
||||
locality?: string;
|
||||
/** The state or region. */
|
||||
region?: string;
|
||||
/** The zip code or postal code. */
|
||||
postalCode?: string;
|
||||
/** The country name. */
|
||||
country?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
streetAddress?: string;
|
||||
/** The city or locality. */
|
||||
locality?: string;
|
||||
/** The state or region. */
|
||||
region?: string;
|
||||
/** The zip code or postal code. */
|
||||
postalCode?: string;
|
||||
/** The country name. */
|
||||
country?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactAddress implements IContactAddress {
|
||||
private _objectInstance: any;
|
||||
constructor (pref?: boolean,
|
||||
type?: string,
|
||||
formatted?: string,
|
||||
streetAddress?: string,
|
||||
locality?: string,
|
||||
region?: string,
|
||||
postalCode?: string,
|
||||
country?: string) {
|
||||
this._objectInstance = new window.ContactAddress(pref, type, formatted, streetAddress, locality, region, postalCode, country);
|
||||
}
|
||||
@InstanceProperty get pref(): boolean {return; }
|
||||
@InstanceProperty get type(): string {return; }
|
||||
@InstanceProperty get formatted(): string {return; }
|
||||
@InstanceProperty get streetAddress(): string {return; }
|
||||
@InstanceProperty get locality(): string {return; }
|
||||
@InstanceProperty get region(): string {return; }
|
||||
@InstanceProperty get postalCode(): string {return; }
|
||||
@InstanceProperty get country(): string {return; }
|
||||
constructor(public pref?: boolean,
|
||||
public type?: string,
|
||||
public formatted?: string,
|
||||
public streetAddress?: string,
|
||||
public locality?: string,
|
||||
public region?: string,
|
||||
public postalCode?: string,
|
||||
public country?: string) {}
|
||||
}
|
||||
|
||||
export interface IContactOrganization {
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
department?: string;
|
||||
/** The contact's title at the organization. */
|
||||
title?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
department?: string;
|
||||
/** The contact's title at the organization. */
|
||||
title?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactOrganization implements IContactOrganization {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
this._objectInstance = new window.ContactOrganization();
|
||||
}
|
||||
@InstanceProperty get pref(): boolean {return; }
|
||||
@InstanceProperty get type(): string {return; }
|
||||
@InstanceProperty get name(): string {return; }
|
||||
@InstanceProperty get department(): string {return; }
|
||||
@InstanceProperty get title(): string {return; }
|
||||
constructor(
|
||||
public type?: string,
|
||||
public name?: string,
|
||||
public department?: string,
|
||||
public title?: string,
|
||||
public pref?: boolean
|
||||
) {}
|
||||
}
|
||||
|
||||
/** Search options to filter navigator.contacts. */
|
||||
export interface IContactFindOptions {
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** Determines if the find operation returns multiple navigator.contacts. */
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** 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. */
|
||||
desiredFields?: string[];
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
*/
|
||||
hasPhoneNumber?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactFindOptions implements IContactFindOptions {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
this._objectInstance = new window.ContactFindOptions();
|
||||
}
|
||||
@InstanceProperty get filter(): string {return; }
|
||||
@InstanceProperty get multiple(): boolean {return; }
|
||||
@InstanceProperty get desiredFields(): any {return; }
|
||||
@InstanceProperty get hasPhoneNumber(): boolean {return; }
|
||||
constructor(public filter?: string,
|
||||
public multiple?: boolean,
|
||||
public desiredFields?: string[],
|
||||
public hasPhoneNumber?: boolean) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Contacts
|
||||
* @description
|
||||
@@ -217,56 +258,79 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```js
|
||||
* import {Contact} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Contacts, Contact, ContactField, ContactName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let contact: Contact = Contacts.create();
|
||||
*
|
||||
* let contact = new Contact();
|
||||
* contact.displayName = "Mr. Ionitron";
|
||||
* contact.name = new ContactName(null, 'Smith', 'John');
|
||||
* contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
|
||||
* contact.save().then(
|
||||
* () => console.log("Contact saved!", contact),
|
||||
* (error: any) => console.error("Error saving contact.", error)
|
||||
* () => console.log('Contact saved!', contact),
|
||||
* (error: any) => console.error('Error saving contact.', error)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @interfaces
|
||||
* IContactProperties
|
||||
* IContactError
|
||||
* IContactName
|
||||
* IContactField
|
||||
* IContactAddress
|
||||
* IContactOrganization
|
||||
* IContactFindOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Contacts',
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
pluginRef: 'navigator.contacts',
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts'
|
||||
})
|
||||
export class Contacts {
|
||||
static create(): Contact {
|
||||
return new Contact();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a single contact.
|
||||
* @returns {Contact} Returns a Contact object
|
||||
*/
|
||||
static create(): Contact {
|
||||
return new Contact();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
*
|
||||
* Example: Contacts.find(['*'], { filter: 'Max' }) // will search for a displayName of 'Max'
|
||||
*
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
* A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
|
||||
* A contactFields value of "*" searches all contact fields.
|
||||
*
|
||||
* @param options {Object} the options to query with:
|
||||
* filter: The search string used to find navigator.contacts. (string) (Default: "")
|
||||
* multiple: Determines if the find operation returns multiple navigator.contacts. (Boolean) (Default: false)
|
||||
* desiredFields: Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. (DOMString[]) [Optional]
|
||||
* hasPhoneNumber(Android only): Filters the search to only return contacts with a phone number informed. (Boolean) (Default: false)
|
||||
*
|
||||
* @return Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
* @param fields {ContactFieldType[]} Contact fields to be used as a search qualifier
|
||||
* @param options {IContactFindOptions} Optional options for the query
|
||||
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static find(fields: string[], options?: any): Promise<any> { return; }
|
||||
static find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.find(fields, (contacts) => {
|
||||
resolve(contacts.map(processContact));
|
||||
}, reject, options);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a single Contact.
|
||||
* @return Returns a Promise that resolves with the selected Contact
|
||||
* @returns {Promise<Contact>} Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
@Cordova()
|
||||
static pickContact(): Promise<any> {return; }
|
||||
}
|
||||
static pickContact(): Promise<Contact> {
|
||||
return getPromise((resolve, reject) => {
|
||||
navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function processContact(contact) {
|
||||
let newContact = new Contact();
|
||||
for (let prop in contact) {
|
||||
if (typeof contact[prop] === 'function') continue;
|
||||
newContact[prop] = contact[prop];
|
||||
}
|
||||
return newContact;
|
||||
}
|
||||
|
||||
38
src/plugins/crop.ts
Normal file
38
src/plugins/crop.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Crop
|
||||
* @description Crops images
|
||||
* @usage
|
||||
* ```
|
||||
* import {Crop} from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* Crop.crop('path/to/image.jpg', {quality: 75})
|
||||
* .then(
|
||||
* newImage => console.log("new image path is: " + newImage),
|
||||
* error => console.error("Error cropping image", error)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Crop',
|
||||
plugin: 'cordova-plugin-crop',
|
||||
pluginRef: 'plugins',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop'
|
||||
})
|
||||
export class Crop {
|
||||
|
||||
/**
|
||||
* Crops an image
|
||||
* @param pathToImage
|
||||
* @param options
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the new image path, or rejects if failed to crop.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static crop(pathToImage: string, options?: {quality: number}): Promise<string> { return; }
|
||||
|
||||
}
|
||||
@@ -1,66 +1,121 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
* Platforms: iOS, Android, Windows
|
||||
* The mode of the date picker
|
||||
* Values: date | time | datetime
|
||||
*/
|
||||
mode: string;
|
||||
|
||||
/**
|
||||
* Platforms: iOS, Android, Windows
|
||||
* Selected date
|
||||
*/
|
||||
date: Date;
|
||||
date: Date | string | number;
|
||||
|
||||
/**
|
||||
* Platforms: iOS, Android, Windows
|
||||
* Minimum date
|
||||
* Type: Date | empty String
|
||||
* Default: empty String
|
||||
*/
|
||||
minDate?: Date;
|
||||
minDate?: Date | string | number;
|
||||
|
||||
/**
|
||||
* Platforms?: iOS, Android, Windows
|
||||
* Maximum date
|
||||
* Type?: Date | empty String
|
||||
* Default?: empty String
|
||||
*/
|
||||
maxDate?: Date;
|
||||
maxDate?: Date | string | number;
|
||||
|
||||
/**
|
||||
* Platforms?: Android
|
||||
* Label for the dialog title. If empty, uses android default (Set date/Set time).
|
||||
* Type?: String
|
||||
* Default?: empty String
|
||||
*/
|
||||
titleText?: string;
|
||||
|
||||
/**
|
||||
* Platforms?: Android
|
||||
* Label of BUTTON_POSITIVE (done button) on Android
|
||||
*/
|
||||
okText?: string;
|
||||
|
||||
// TODO complete documentation here, and copy params & docs to main plugin docs
|
||||
/**
|
||||
* 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;
|
||||
allowOldDate?: boolean;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,39 +123,50 @@ export interface DatePickerOptions {
|
||||
* @description
|
||||
* The DatePicker plugin allows the user to fetch date or time using native dialogs.
|
||||
*
|
||||
* Platforms supported: iOS, Android, Windows
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-datepicker`. For more info, please see the [DatePicker plugin docs](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {DatePicker} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { DatePicker } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* DatePicker.show({
|
||||
* date: new Date(),
|
||||
* mode: 'date'
|
||||
* }).then(
|
||||
* date => console.log("Got date: ", date),
|
||||
* err => console.log("Error occurred while getting date:", err)
|
||||
* date => console.log('Got date: ', date),
|
||||
* err => console.log('Error occurred while getting date: ', err)
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* DatePickerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DatePicker',
|
||||
plugin: 'cordova-plugin-datepicker',
|
||||
pluginRef: 'datePicker',
|
||||
repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker'
|
||||
repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
export class DatePicker {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static ANDROID_THEMES = {
|
||||
THEME_TRADITIONAL: 1,
|
||||
THEME_HOLO_DARK: 2,
|
||||
THEME_HOLO_LIGHT: 3,
|
||||
THEME_DEVICE_DEFAULT_DARK: 4,
|
||||
THEME_DEVICE_DEFAULT_LIGHT: 5
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the date and/or time picker dialog(s)
|
||||
* @param options
|
||||
* @param {DatePickerOptions} options Options for the date picker.
|
||||
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: DatePickerOptions): Promise<Date> { return; }
|
||||
static show(options: DatePickerOptions): Promise<Date> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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.
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DBMeter} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { DBMeter } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Start listening
|
||||
@@ -16,7 +16,7 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* // Check if we are listening
|
||||
* DBMeter.isListening().then(
|
||||
* (isListening : boolean) => console.log(isListening)
|
||||
* (isListening: boolean) => console.log(isListening)
|
||||
* );
|
||||
*
|
||||
* // Stop listening
|
||||
@@ -24,12 +24,13 @@ import {Observable} from 'rxjs/Observable';
|
||||
*
|
||||
* // Delete DBMeter instance from memory
|
||||
* DBMeter.delete().then(
|
||||
* () => console.log("Deleted DB Meter instance"),
|
||||
* error => console.log("Error occurred while deleting DB Meter instance")
|
||||
* () => console.log('Deleted DB Meter instance'),
|
||||
* error => console.log('Error occurred while deleting DB Meter instance')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DBMeter',
|
||||
plugin: 'cordova-plugin-dbmeter',
|
||||
pluginRef: 'DBMeter',
|
||||
repo: 'https://github.com/akofman/cordova-plugin-dbmeter',
|
||||
@@ -39,33 +40,33 @@ export class DBMeter {
|
||||
|
||||
/**
|
||||
* Starts listening
|
||||
* @return {Observable<string>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stop'
|
||||
})
|
||||
static start (): Observable<any> {return; }
|
||||
static start(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stops listening
|
||||
* @private
|
||||
*/
|
||||
@Cordova()
|
||||
static stop (): Promise<any> {return; }
|
||||
static stop(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if the DB Meter is listening
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||
*/
|
||||
@Cordova()
|
||||
static isListening(): Promise<boolean> {return; }
|
||||
static isListening(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Delete the DB Meter instance
|
||||
* @return {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||
* @returns {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(): Promise<any> {return; }
|
||||
static delete(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface DeeplinkMatch {
|
||||
|
||||
/**
|
||||
* The route info for the matched route
|
||||
*/
|
||||
@@ -17,7 +18,8 @@ export interface DeeplinkMatch {
|
||||
* any internal native data available as "extras" at the time
|
||||
* the route was matched (for example, Facebook sometimes adds extra data)
|
||||
*/
|
||||
$link: any;
|
||||
$link: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,16 +28,55 @@ export interface DeeplinkMatch {
|
||||
* and Universal App Links.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {IonicDeeplinks} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Deeplinks } from 'ionic-native';
|
||||
*
|
||||
* Deeplinks.route({
|
||||
'/about-us': AboutPage,
|
||||
'/universal-links-test': 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);
|
||||
});
|
||||
* ```
|
||||
*
|
||||
* Alternatively, if you're using Ionic 2, there's a convenience method that takes a reference to a `NavController` and handles
|
||||
* the actual navigation for you:
|
||||
*
|
||||
* ```typescript
|
||||
* 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',
|
||||
plugin: 'ionic-plugin-deeplinks',
|
||||
pluginRef: 'IonicDeeplink',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
|
||||
platforms: ['iOS', 'Android']
|
||||
platforms: ['iOS', 'Android'],
|
||||
install: 'ionic plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/'
|
||||
})
|
||||
export class Deeplinks {
|
||||
|
||||
@@ -46,13 +87,13 @@ export class Deeplinks {
|
||||
* paths takes an object of the form { 'path': data }. If a deeplink
|
||||
* matches the path, the resulting path-data pair will be returned in the
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
* @returns {Promise} Returns a Promise that resolves when a deeplink comes through, and
|
||||
* is rejected if a deeplink comes through that does not match a given path.
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that is called each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static route(paths): Observable<DeeplinkMatch> {return; }
|
||||
static route(paths): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -69,11 +110,12 @@ export class Deeplinks {
|
||||
* matches the path, the resulting path-data pair will be returned in the
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves when a deeplink comes through, and
|
||||
* is rejected if a deeplink comes through that does not match a given path.
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> {return; }
|
||||
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
}
|
||||
|
||||
56
src/plugins/device-feedback.ts
Normal file
56
src/plugins/device-feedback.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
/**
|
||||
* @name DeviceFeedback
|
||||
* @description
|
||||
*
|
||||
* Plugin that lets you provide haptic or acoustic feedback on Android devices.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { DeviceFeedback } from 'ionic-native';
|
||||
*
|
||||
* DeviceFeedback.acoustic();
|
||||
*
|
||||
* DeviceFeedback.haptic(0);
|
||||
*
|
||||
* DeviceFeedback.isFeedbackEnabled()
|
||||
* .then((feedback) => {
|
||||
* console.log(feedback);
|
||||
* // {
|
||||
* // acoustic: true,
|
||||
* // haptic: true
|
||||
* // }
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceFeedback',
|
||||
plugin: 'cordova-plugin-velda-devicefeedback',
|
||||
pluginRef: 'plugins.deviceFeedback',
|
||||
repo: 'https://github.com/VVelda/device-feedback',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class DeviceFeedback {
|
||||
|
||||
/**
|
||||
* Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static acoustic(): void { }
|
||||
|
||||
/**
|
||||
* Provide vibrate feedback to user, nevertheless respect user's tactile feedback setting as native feedback do.
|
||||
* @param type {Number} Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static haptic(type: number): void { }
|
||||
|
||||
/**
|
||||
* Check if haptic and acoustic feedback is enabled by user settings.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isFeedbackEnabled(): Promise<{ haptic: boolean; acoustic: boolean; }> { return; }
|
||||
|
||||
}
|
||||
@@ -1,30 +1,6 @@
|
||||
import {Plugin, CordovaProperty} from './plugin';
|
||||
import { CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
declare var window: {
|
||||
device: Device
|
||||
};
|
||||
|
||||
export interface Device {
|
||||
/** Get the version of Cordova running on the device. */
|
||||
cordova: string;
|
||||
/**
|
||||
* The device.model returns the name of the device's model or product. The value is set
|
||||
* by the device manufacturer and may be different across versions of the same product.
|
||||
*/
|
||||
model: string;
|
||||
/** Get the device's operating system name. */
|
||||
platform: string;
|
||||
/** Get the device's Universally Unique Identifier (UUID). */
|
||||
uuid: string;
|
||||
/** Get the operating system version. */
|
||||
version: string;
|
||||
/** Get the device's manufacturer. */
|
||||
manufacturer: string;
|
||||
/** Whether the device is running on a simulator. */
|
||||
isVirtual: boolean;
|
||||
/** Get the device hardware serial number. */
|
||||
serial: string;
|
||||
}
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name Device
|
||||
@@ -32,26 +8,54 @@ export interface Device {
|
||||
* Access information about the underlying device and platform.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Device} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* console.log('Device UUID is: ' + Device.device.uuid);
|
||||
* console.log('Device UUID is: ' + Device.uuid);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device'
|
||||
})
|
||||
export class Device {
|
||||
|
||||
/** Get the version of Cordova running on the device. */
|
||||
@CordovaProperty
|
||||
static cordova: string;
|
||||
|
||||
/**
|
||||
* Returns the whole device object.
|
||||
*
|
||||
* @returns {Object} The device object.
|
||||
* The device.model returns the name of the device's model or product. The value is set
|
||||
* by the device manufacturer and may be different across versions of the same product.
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get device() { return window.device; }
|
||||
static model: string;
|
||||
|
||||
/** Get the device's operating system name. */
|
||||
@CordovaProperty
|
||||
static platform: string;
|
||||
|
||||
/** Get the device's Universally Unique Identifier (UUID). */
|
||||
@CordovaProperty
|
||||
static uuid: string;
|
||||
|
||||
/** Get the operating system version. */
|
||||
@CordovaProperty
|
||||
static version: string;
|
||||
|
||||
/** Get the device's manufacturer. */
|
||||
@CordovaProperty
|
||||
static manufacturer: string;
|
||||
|
||||
/** Whether the device is running on a simulator. */
|
||||
@CordovaProperty
|
||||
static isVirtual: boolean;
|
||||
|
||||
/** Get the device hardware serial number. */
|
||||
@CordovaProperty
|
||||
static serial: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,33 +1,40 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
pluginRef: 'plugins.DeviceAccounts',
|
||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class DeviceAccounts {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
*/
|
||||
@Cordova()
|
||||
static getByType(type: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmails(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> {return; }
|
||||
}
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'DeviceAccounts',
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
pluginRef: 'plugins.DeviceAccounts',
|
||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class DeviceAccounts {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getByType(type: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmails(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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)
|
||||
@@ -25,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
|
||||
@@ -40,19 +40,18 @@ export interface AccelerometerOptions {
|
||||
* Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DeviceMotion} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { DeviceMotion } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Get the device current acceleration
|
||||
* DeviceMotion.getCurrentAcceleration().then(
|
||||
* acceleration => console.log(acceleration),
|
||||
* error => console.log(error)
|
||||
* (acceleration: AccelerationData) => console.log(acceleration),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch device acceleration
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => {
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: AccelerationData) => {
|
||||
* console.log(acceleration);
|
||||
* });
|
||||
*
|
||||
@@ -60,8 +59,12 @@ export interface AccelerometerOptions {
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceMotionAccelerationData
|
||||
* DeviceMotionAccelerometerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceMotion',
|
||||
plugin: 'cordova-plugin-device-motion',
|
||||
pluginRef: 'navigator.accelerometer',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-motion'
|
||||
@@ -70,35 +73,21 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Get the current acceleration along the x, y, and z axes.
|
||||
*
|
||||
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
|
||||
* @returns {Promise<DeviceMotionAccelerationData>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> {
|
||||
return;
|
||||
}
|
||||
static getCurrentAcceleration(): Promise<DeviceMotionAccelerationData> { return; }
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
*
|
||||
* ```ts
|
||||
* // Watch device acceleration
|
||||
* var subscription = DeviceMotion.watchPosition().subscribe(acceleration => {
|
||||
* console.log(acceleration);
|
||||
* });
|
||||
*
|
||||
* // Stop watch
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @param options
|
||||
* @returns {Observable<AccelerationData>}
|
||||
* @param {AccelerometerOptions} options list of options for the accelerometer.
|
||||
* @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,7 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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)
|
||||
@@ -25,7 +25,7 @@ export interface CompassHeading {
|
||||
|
||||
}
|
||||
|
||||
export interface CompassOptions {
|
||||
export interface DeviceOrientationCompassOptions {
|
||||
|
||||
/**
|
||||
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
|
||||
@@ -45,27 +45,31 @@ export interface CompassOptions {
|
||||
* Requires Cordova plugin: `cordova-plugin-device-orientation`. For more info, please see the [Device Orientation docs](https://github.com/apache/cordova-plugin-device-orientation).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DeviceOrientation} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* // CompassHeading is an interface for compass
|
||||
* import { DeviceOrientation, CompassHeading } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Get the device current compass heading
|
||||
* DeviceOrientation.getCurrentHeading().then(
|
||||
* data => console.log(data),
|
||||
* error => console.log(error)
|
||||
* (data: CompassHeading) => console.log(data),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch the device compass heading change
|
||||
* var subscription = DeviceOrientation.watchHeading().subscribe(
|
||||
* data => console.log(data)
|
||||
* (data: CompassHeading) => console.log(data)
|
||||
* );
|
||||
*
|
||||
* // Stop watching heading change
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceOrientationCompassOptions
|
||||
* DeviceOrientationCompassHeading
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceOrientation',
|
||||
plugin: 'cordova-plugin-device-orientation',
|
||||
pluginRef: 'navigator.compass',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation'
|
||||
@@ -74,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 options
|
||||
* @returns {Observable<CompassHeading>}
|
||||
* @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,97 +1,576 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Cordova, Plugin, CordovaProperty} from './plugin';
|
||||
|
||||
/**
|
||||
* @name Diagnostic
|
||||
* @description
|
||||
* Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Diagnostic } from 'ionic-native';
|
||||
*
|
||||
* let successCallback = (isAvailable) => { console.log('Is available? ' + isAvailable); };
|
||||
* let errorCallback = (e) => console.error(e);
|
||||
*
|
||||
* Diagnostic.isCameraAvailable().then(successCallback).catch(errorCallback);
|
||||
*
|
||||
* Diagnostic.isBluetoothAvailable().then(successCallback, errorCallback);
|
||||
*
|
||||
*
|
||||
* Diagnostic.getBluetoothState()
|
||||
* .then((state) => {
|
||||
* if (state == Diagnostic.bluetoothStates.POWERED_ON){
|
||||
* // do something
|
||||
* } else {
|
||||
* // do something else
|
||||
* }
|
||||
* }).catch(e => console.error(e));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Diagnostic',
|
||||
plugin: 'cordova.plugins.diagnostic',
|
||||
pluginRef: 'cordova.plugins.diagnostic',
|
||||
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
|
||||
})
|
||||
export class Diagnostic {
|
||||
|
||||
static permission = {
|
||||
READ_CALENDAR: 'READ_CALENDAR',
|
||||
WRITE_CALENDAR: 'WRITE_CALENDAR',
|
||||
CAMERA: 'CAMERA',
|
||||
READ_CONTACTS: 'READ_CONTACTS',
|
||||
WRITE_CONTACTS: 'WRITE_CONTACTS',
|
||||
GET_ACCOUNTS: 'GET_ACCOUNTS',
|
||||
ACCESS_FINE_LOCATION: 'ACCESS_FINE_LOCATION',
|
||||
ACCESS_COARSE_LOCATION: 'ACCESS_COARSE_LOCATION',
|
||||
RECORD_AUDIO: 'RECORD_AUDIO',
|
||||
READ_PHONE_STATE: 'READ_PHONE_STATE',
|
||||
CALL_PHONE: 'CALL_PHONE',
|
||||
ADD_VOICEMAIL: 'ADD_VOICEMAIL',
|
||||
USE_SIP: 'USE_SIP',
|
||||
PROCESS_OUTGOING_CALLS: 'PROCESS_OUTGOING_CALLS',
|
||||
READ_CALL_LOG: 'READ_CALL_LOG',
|
||||
WRITE_CALL_LOG: 'WRITE_CALL_LOG',
|
||||
SEND_SMS: 'SEND_SMS',
|
||||
RECEIVE_SMS: 'RECEIVE_SMS',
|
||||
READ_SMS: 'READ_SMS',
|
||||
RECEIVE_WAP_PUSH: 'RECEIVE_WAP_PUSH',
|
||||
RECEIVE_MMS: 'RECEIVE_MMS',
|
||||
WRITE_EXTERNAL_STORAGE: 'WRITE_EXTERNAL_STORAGE',
|
||||
READ_EXTERNAL_STORAGE: 'READ_EXTERNAL_STORAGE',
|
||||
BODY_SENSORS: 'BODY_SENSORS'
|
||||
};
|
||||
|
||||
@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'
|
||||
};
|
||||
|
||||
static permissionGroups = {
|
||||
CALENDAR: ['READ_CALENDAR', 'WRITE_CALENDAR'],
|
||||
CAMERA: ['CAMERA'],
|
||||
CONTACTS: ['READ_CONTACTS', 'WRITE_CONTACTS', 'GET_ACCOUNTS'],
|
||||
LOCATION: ['ACCESS_FINE_LOCATION', 'ACCESS_COARSE_LOCATION'],
|
||||
MICROPHONE: ['RECORD_AUDIO'],
|
||||
PHONE: ['READ_PHONE_STATE', 'CALL_PHONE', 'ADD_VOICEMAIL', 'USE_SIP', 'PROCESS_OUTGOING_CALLS', 'READ_CALL_LOG', 'WRITE_CALL_LOG'],
|
||||
SENSORS: ['BODY_SENSORS'],
|
||||
SMS: ['SEND_SMS', 'RECEIVE_SMS', 'READ_SMS', 'RECEIVE_WAP_PUSH', 'RECEIVE_MMS'],
|
||||
STORAGE: ['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE']
|
||||
};
|
||||
|
||||
static locationMode = {
|
||||
HIGH_ACCURACY: 'high_accuracy',
|
||||
DEVICE_ONLY: 'device_only',
|
||||
BATTERY_SAVING: 'battery_saving',
|
||||
LOCATION_OFF: 'location_off'
|
||||
};
|
||||
|
||||
static bluetoothState = {
|
||||
UNKNOWN: 'unknown',
|
||||
RESETTING: 'resetting', // iOS
|
||||
UNSUPPORTED: 'unsupported', // iOS
|
||||
UNAUTHORIZED: 'unauthorized', // iOS
|
||||
POWERED_OFF: 'powered_off',
|
||||
POWERED_ON: 'powered_on',
|
||||
POWERING_OFF: 'powering_off',
|
||||
POWERING_ON: 'powering_on'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Checks if app is able to access device location.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isLocationEnabled(): Promise<any> {return; }
|
||||
static isLocationAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
|
||||
* On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiEnabled(): Promise<any> {return; }
|
||||
static isWifiAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
|
||||
* application is authorized to use it.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isCameraEnabled(): Promise<any> {return; }
|
||||
static isCameraAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
|
||||
* On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isBluetoothEnabled(): Promise<any> {return; }
|
||||
static isBluetoothAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Displays the device location settings to allow user to enable location services/change location mode.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
static switchToLocationSettings(): void { }
|
||||
|
||||
/**
|
||||
* Displays mobile settings to allow user to enable mobile data.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
static switchToMobileDataSettings(): void { }
|
||||
|
||||
/**
|
||||
* Displays Bluetooth settings to allow user to enable Bluetooth.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
static switchToBluetoothSettings(): void { }
|
||||
|
||||
/**
|
||||
* Displays WiFi settings to allow user to enable WiFi.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
static switchToWifiSettings(): void { }
|
||||
|
||||
/**
|
||||
* Returns true if the WiFi setting is set to enabled, and is the same as `isWifiAvailable()`
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'Windows 10'] })
|
||||
static isWifiEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Enables/disables WiFi on the device.
|
||||
* Requires `ACCESS_WIFI_STATE` and `CHANGE_WIFI_STATE` permissions on Android
|
||||
* @param state {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
|
||||
static setWifiState(state: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enables/disables Bluetooth on the device.
|
||||
* Requires `BLUETOOTH` and `BLUETOOTH_ADMIN` permissions on Android
|
||||
* @param state {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
|
||||
static setBluetoothState(state: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* 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>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isLocationEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use location.
|
||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isLocationAuthorized(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the location authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getLocationAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the location authorization status for the application.
|
||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
*
|
||||
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestLocationAuthorization(mode?: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use location.
|
||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
*/
|
||||
@Cordova()
|
||||
static isLocationAuthorized(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
|
||||
static requestLocationAuthorization(mode?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if camera hardware is present on device.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isCameraPresent(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isCameraPresent(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use the camera.
|
||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isCameraAuthorized(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isCameraAuthorized(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the camera authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getCameraAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests camera authorization for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static requestCameraAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use the microphone.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isMicrophoneAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the microphone authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getMicrophoneAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests microphone authorization for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static requestMicrophoneAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use contacts (address book).
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isContactsAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the contacts authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getContactsAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests contacts authorization for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static requestContactsAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use the calendar.
|
||||
*
|
||||
* Notes for Android:
|
||||
* - This is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time.
|
||||
*
|
||||
* Notes for iOS:
|
||||
* - This relates to Calendar Events (not Calendar Reminders)
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static isCalendarAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the calendar authorization status for the application.
|
||||
*
|
||||
* Notes for Android:
|
||||
* - This is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return `GRANTED` status as permissions are already granted at installation time.
|
||||
*
|
||||
* Notes for iOS:
|
||||
* - This relates to Calendar Events (not Calendar Reminders)
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getCalendarAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests calendar authorization for the application.
|
||||
*
|
||||
* Notes for iOS:
|
||||
* - Should only be called if authorization status is NOT_DETERMINED. Calling it when in any other state will have no effect and just return the current authorization status.
|
||||
* - This relates to Calendar Events (not Calendar Reminders)
|
||||
*
|
||||
* Notes for Android:
|
||||
* - This is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will have no effect as the permissions are already granted at installation time.
|
||||
* - This requests permission for `READ_CALENDAR` run-time permission
|
||||
* - Required permissions must be added to `AndroidManifest.xml` as appropriate - see Android permissions: `READ_CALENDAR`, `WRITE_CALENDAR`
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static requestCalendarAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Opens settings page for this app.
|
||||
* On Android, this opens the "App Info" page in the Settings app.
|
||||
* On iOS, this opens the app settings page in the Settings app. This works only on iOS 8+ - iOS 7 and below will invoke the errorCallback.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static switchToSettings(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the state of Bluetooth on the device.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'] })
|
||||
static getBluetoothState(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Registers a function to be called when a change in Bluetooth state occurs.
|
||||
* @param handler
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
|
||||
static registerBluetoothStateChangeHandler(handler: Function): void { }
|
||||
|
||||
/**
|
||||
* Registers a function to be called when a change in Location state occurs.
|
||||
* @param handler
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
|
||||
static registerLocationStateChangeHandler(handler: Function): void { }
|
||||
|
||||
/**
|
||||
* Checks if high-accuracy locations are available to the app from GPS hardware.
|
||||
* Returns true if Location mode is enabled and is set to "Device only" or "High accuracy" AND if the app is authorised to use location.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isGpsLocationAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if location mode is set to return high-accuracy locations from GPS hardware.
|
||||
* Returns true if Location mode is enabled and is set to either:
|
||||
* - Device only = GPS hardware only (high accuracy)
|
||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isGpsLocationEnabled(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isGpsLocationEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if low-accuracy locations are available to the app from network triangulation/WiFi access points.
|
||||
* Returns true if Location mode is enabled and is set to "Battery saving" or "High accuracy" AND if the app is authorised to use location.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isNetworkLocationAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points.
|
||||
* Returns true if Location mode is enabled and is set to either:
|
||||
* - Battery saving = network triangulation and Wifi network IDs (low accuracy)
|
||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isNetworkLocationEnabled(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isNetworkLocationEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the current location mode setting for the device.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static getLocationMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the current authorisation status for a given permission.
|
||||
* Note: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
* @param permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
|
||||
static getPermissionAuthorizationStatus(permission: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns the current authorisation status for multiple permissions.
|
||||
* Note: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
* @param permissions
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
|
||||
static getPermissionsAuthorizationStatus(permissions: any[]): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests app to be granted authorisation for a runtime permission.
|
||||
* Note: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will have no effect as the permissions are already granted at installation time.
|
||||
* @param permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
|
||||
static requestRuntimePermission(permission: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests app to be granted authorisation for multiple runtime permissions.
|
||||
* Note: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||
* @param permissions
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
|
||||
static requestRuntimePermissions(permissions: any[]): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if the plugin is currently requesting a runtime permission via the native API.
|
||||
* Note that only one request can be made concurrently because the native API cannot handle concurrent requests,
|
||||
* so the plugin will invoke the error callback if attempting to make more than one simultaneous request.
|
||||
* Multiple permission requests should be grouped into a single call since the native API is setup to handle batch requests of multiple permission groups.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static isRequestingPermission(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Registers a function to be called when a runtime permission request has completed.
|
||||
* Pass in a falsey value to de-register the currently registered function.
|
||||
* @param handler {Function}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerPermissionRequestCompleteHandler(handler: Function): void { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device setting for Bluetooth is switched on.
|
||||
* This requires `BLUETOOTH` permission on Android
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static isBluetoothEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device has Bluetooth capabilities.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static hasBluetoothSupport(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device has Bluetooth Low Energy (LE) capabilities.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static hasBluetoothLESupport(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device supports Bluetooth Low Energy (LE) Peripheral mode.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
static hasBluetoothLEPeripheralSupport(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use the Camera Roll in Photos app.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isCameraRollAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the authorization status for the application to use the Camera Roll in Photos app.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static getCameraRollAuthorizationStatus(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests camera roll authorization for the application.
|
||||
* Should only be called if authorization status is NOT_REQUESTED.
|
||||
* Calling it when in any other state will have no effect.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static requestCameraRollAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if remote (push) notifications are enabled.
|
||||
* On iOS 8+, returns true if app is registered for remote notifications AND "Allow Notifications" switch is ON AND alert style is not set to "None" (i.e. "Banners" or "Alerts").
|
||||
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications().
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isRemoteNotificationsEnabled(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isRemoteNotificationsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if the app is registered for remote (push) notifications on the device.
|
||||
* On iOS 8+, returns true if the app is registered for remote notifications and received its device token, or false if registration has not occurred, has failed, or has been denied by the user. Note that user preferences for notifications in the Settings app will not affect this.
|
||||
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled().
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isRegisteredForRemoteNotifications(): Promise<any> {return; }
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isRegisteredForRemoteNotifications(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Indicates the current setting of notification types for the app in the Settings app.
|
||||
* Note: on iOS 8+, if "Allow Notifications" switch is OFF, all types will be returned as disabled.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static getRemoteNotificationTypes(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized to use reminders.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isRemindersAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the reminders authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static getRemindersAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests reminders authorization for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static requestRemindersAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the application is authorized for background refresh.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static isBackgroundRefreshAuthorized(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the background refresh authorization status for the application.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
static getBackgroundRefreshStatus(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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.
|
||||
@@ -23,15 +24,18 @@ export interface PromptCallback {
|
||||
* Requires Cordova plugin: `cordova-plugin-dialogs`. For more info, please see the [Dialogs plugin docs](https://github.com/apache/cordova-plugin-dialogs).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Dialogs} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Dialogs } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DialogsPromptCallback
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Dialogs',
|
||||
plugin: 'cordova-plugin-dialogs',
|
||||
pluginRef: 'navigator.notification',
|
||||
repo: 'https://github.com/apache/cordova-plugin-dialogs.git'
|
||||
@@ -40,9 +44,9 @@ export class Dialogs {
|
||||
|
||||
/**
|
||||
* Shows a custom alert or dialog box.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title. (String) (Optional, defaults to Alert)
|
||||
* @param buttonName Button name. (String) (Optional, defaults to OK)
|
||||
* @param {string} message Dialog message.
|
||||
* @param {string} title Dialog title. (Optional, defaults to Alert)
|
||||
* @param {string} buttonName Button name. (Optional, defaults to OK)
|
||||
* @returns {Promise<any>} Returns a blank promise once the user has dismissed the alert.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -53,13 +57,13 @@ export class Dialogs {
|
||||
message,
|
||||
title: string = 'Alert',
|
||||
buttonName: string = 'OK'
|
||||
): Promise<any> {return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Displays a customizable confirmation dialog box.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title. (String) (Optional, defaults to Confirm)
|
||||
* @param buttonLabels Array of strings specifying button labels. (Array) (Optional, defaults to [OK,Cancel])
|
||||
* @param {string} message Dialog message.
|
||||
* @param {string} title Dialog title. (Optional, defaults to Confirm)
|
||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
|
||||
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -70,15 +74,15 @@ export class Dialogs {
|
||||
message,
|
||||
title: string = 'Confirm',
|
||||
buttonLabels: Array<string> = ['OK', 'Cancel']
|
||||
): Promise<number> { return; }
|
||||
): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* Displays a native dialog box that is more customizable than the browser's prompt function.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title (String) (Optional, defaults to Prompt)
|
||||
* @param buttonLabels Array of strings specifying button labels (Array) (Optional, defaults to ["OK","Cancel"])
|
||||
* @param defaultText Default textbox input value (String) (Optional, Default: empty string)
|
||||
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
* @param {string} message Dialog message.
|
||||
* @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<DialogsPromptCallback>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -89,16 +93,16 @@ export class Dialogs {
|
||||
title: string = 'Prompt',
|
||||
buttonLabels: Array<string> = ['OK', 'Cancel'],
|
||||
defaultText: string = ''
|
||||
): Promise<any> { return; }
|
||||
): Promise<DialogsPromptCallback> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* The device plays a beep sound.
|
||||
* @param times The number of times to repeat the beep. (Number)
|
||||
* @param {numbers} times The number of times to repeat the beep.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static beep(times: number): void {}
|
||||
static beep(times: number): void { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,44 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
*
|
||||
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/katzer/cordova-plugin-email-composer).
|
||||
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/hypery2k/cordova-email-plugin).
|
||||
*
|
||||
* DISCLAIMER: This plugin is experiencing issues with the latest versions of Cordova. Use at your own risk. Functionality is not guaranteed. Please stay tuned for a more stable version.
|
||||
* A good alternative to this plugin is the social sharing plugin.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {EmailComposer} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { EmailComposer } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* EmailComposer.isAvailable().then((available) =>{
|
||||
* EmailComposer.isAvailable().then((available: boolean) =>{
|
||||
* if(available) {
|
||||
* //Now we know we can send
|
||||
* }
|
||||
@@ -38,12 +63,15 @@ declare var cordova: any;
|
||||
* EmailComposer.open(email);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* EmailComposerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-email-composer',
|
||||
pluginName: 'EmailComposer',
|
||||
plugin: 'cordova-plugin-email',
|
||||
pluginRef: 'cordova.plugins.email',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-email-composer.git',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
repo: 'https://github.com/hypery2k/cordova-email-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class EmailComposer {
|
||||
|
||||
@@ -51,12 +79,27 @@ export class EmailComposer {
|
||||
* Verifies if sending emails is supported on the device.
|
||||
*
|
||||
* @param app {string?} An optional app id or uri scheme.
|
||||
* @returns {Promise<boolean>} Resolves if available, rejects if not available
|
||||
* @returns {Promise<any>} Resolves if available, rejects if not available
|
||||
*/
|
||||
static isAvailable (app?: string): Promise<any> {
|
||||
static isAvailable(app?: string): Promise<any> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
||||
else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); });
|
||||
if (app) {
|
||||
cordova.plugins.email.isAvailable(app, (isAvailable) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cordova.plugins.email.isAvailable((isAvailable) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,12 +110,12 @@ export class EmailComposer {
|
||||
* @param packageName {string} The package name
|
||||
*/
|
||||
@Cordova()
|
||||
static addAlias(alias: string, packageName: string): void {}
|
||||
static addAlias(alias: string, packageName: string): void { }
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -80,16 +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;
|
||||
}
|
||||
499
src/plugins/estimote-beacons.ts
Normal file
499
src/plugins/estimote-beacons.ts
Normal file
@@ -0,0 +1,499 @@
|
||||
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',
|
||||
plugin: 'cordova-plugin-estimote',
|
||||
pluginRef: 'estimote.beacons',
|
||||
repo: 'https://github.com/evothings/phonegap-estimotebeacons',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class EstimoteBeacons {
|
||||
|
||||
/** Proximity value */
|
||||
static ProximityUnknown = 0;
|
||||
|
||||
/** Proximity value */
|
||||
static ProximityImmediate = 1;
|
||||
|
||||
/** Proximity value */
|
||||
static ProximityNear = 2;
|
||||
|
||||
/** Proximity value */
|
||||
static ProximityFar = 3;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorUnknown = 0;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorMintCocktail = 1;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorIcyMarshmallow = 2;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorBlueberryPie = 3;
|
||||
|
||||
/**
|
||||
* Beacon colour.
|
||||
*/
|
||||
static BeaconColorSweetBeetroot = 4;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorCandyFloss = 5;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorLemonTart = 6;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorVanillaJello = 7;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorLiquoriceSwirl = 8;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorWhite = 9;
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorTransparent = 10;
|
||||
|
||||
/** Region state */
|
||||
static RegionStateUnknown = 'unknown';
|
||||
|
||||
/** Region state */
|
||||
static RegionStateOutside = 'outside';
|
||||
|
||||
/** Region state */
|
||||
static RegionStateInside = 'inside';
|
||||
|
||||
/**
|
||||
* Ask the user for permission to use location services
|
||||
* while the app is in the foreground.
|
||||
* You need to call this function or requestAlwaysAuthorization
|
||||
* on iOS 8+.
|
||||
* Does nothing on other platforms.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.requestWhenInUseAuthorization().then(
|
||||
* () => { console.log('on success'); },
|
||||
* () => { console.log('on error'); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestWhenInUseAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Ask the user for permission to use location services
|
||||
* whenever the app is running.
|
||||
* You need to call this function or requestWhenInUseAuthorization
|
||||
* on iOS 8+.
|
||||
* Does nothing on other platforms.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.requestAlwaysAuthorization().then(
|
||||
* () => { console.log('on success'); },
|
||||
* () => { console.log('on error'); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestAlwaysAuthorization(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the current location authorization status.
|
||||
* Implemented on iOS 8+.
|
||||
* Does nothing on other platforms.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.authorizationStatus().then(
|
||||
* (result) => { console.log('Location authorization status: ' + result); },
|
||||
* (errorMessage) => { console.log('Error: ' + errorMessage); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static authorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start advertising as a beacon.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion')
|
||||
* .then(() => { console.log('Beacon started'); });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param uuid {string} UUID string the beacon should advertise (mandatory).
|
||||
* @param major {number} Major value to advertise (mandatory).
|
||||
* @param minor {number} Minor value to advertise (mandatory).
|
||||
* @param regionId {string} Identifier of the region used to advertise (mandatory).
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
clearFunction: 'stopAdvertisingAsBeacon'
|
||||
})
|
||||
static startAdvertisingAsBeacon(uuid: string, major: number, minor: number, regionId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop advertising as a beacon.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion')
|
||||
* .then(() => { console.log('Beacon started'); });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopAdvertisingAsBeacon(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable analytics.
|
||||
*
|
||||
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.enableAnalytics(true).then(() => { console.log('Analytics enabled'); });
|
||||
* ```
|
||||
* @param enable {number} Boolean value to turn analytics on or off (mandatory).
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enableAnalytics(enable: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Test if analytics is enabled.
|
||||
*
|
||||
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.isAnalyticsEnabled().then((enabled) => { console.log('Analytics enabled: ' + enabled); });
|
||||
* ```
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAnalyticsEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Test if App ID and App Token is set.
|
||||
*
|
||||
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.isAuthorized().then((isAuthorized) => { console.log('App ID and App Token is set: ' + isAuthorized); });
|
||||
* ```
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAuthorized(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set App ID and App Token.
|
||||
*
|
||||
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.setupAppIDAndAppToken('MyAppID', 'MyAppToken').then(() => { console.log('AppID and AppToken configured!'); });
|
||||
* ```
|
||||
* @param appID {string} The App ID (mandatory).
|
||||
* @param appToken {string} The App Token (mandatory).
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setupAppIDAndAppToken(appID: string, appToken: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start scanning for all nearby beacons using CoreBluetooth (no region object is used).
|
||||
* Available on iOS.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => {
|
||||
* console.log(JSON.stringify(beacons));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each beacon discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopEstimoteBeaconDiscovery'
|
||||
})
|
||||
static startEstimoteBeaconDiscovery(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop CoreBluetooth scan. Available on iOS.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => {
|
||||
* console.log(JSON.stringify(beacons));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopEstimoteBeaconDiscovery(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start ranging beacons. Available on iOS and Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* let region: EstimoteBeaconRegion = {} // Empty region matches all beacons.
|
||||
* EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => {
|
||||
* console.log(JSON.stringify(info));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each beacon discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopRangingBeaconsInRegion',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging beacons. Available on iOS and Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* let region: EstimoteBeaconRegion = {} // Empty region matches all beacons.
|
||||
* EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => {
|
||||
* console.log(JSON.stringify(info));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start ranging secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* {@link EstimoteBeacons.startRangingBeaconsInRegion}.
|
||||
* To use secure beacons set the App ID and App Token using
|
||||
* {@link EstimoteBeacons.setupAppIDAndAppToken}.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopRangingSecureBeaconsInRegion',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* {@link EstimoteBeacons.stopRangingBeaconsInRegion}.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start monitoring beacons. Available on iOS and Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* let region: EstimoteBeaconRegion = {} // Empty region matches all beacons.
|
||||
* EstimoteBeacons.startMonitoringForRegion(region).subscribe(state => {
|
||||
* console.log('Region state: ' + JSON.stringify(state));
|
||||
* });
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @param [notifyEntryStateOnDisplay=false] {boolean} Set to true to detect if you
|
||||
* are inside a region when the user turns display on, see
|
||||
* {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation}
|
||||
* for further details (optional, defaults to false, iOS only).
|
||||
* @returns {Observable<any>} Returns an Observable that notifies of each region state discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopMonitoringForRegion',
|
||||
clearWithArgs: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring beacons. Available on iOS and Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* let region: EstimoteBeaconRegion = {} // Empty region matches all beacons.
|
||||
* EstimoteBeacons.stopMonitoringForRegion(region).then(() => { console.log('monitoring is stopped'); });
|
||||
* ```
|
||||
* @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory).
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start monitoring secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* EstimoteBeacons.startMonitoringForRegion.
|
||||
* To use secure beacons set the App ID and App Token using
|
||||
* {@link EstimoteBeacons.setupAppIDAndAppToken}.
|
||||
* @see {@link EstimoteBeacons.startMonitoringForRegion}
|
||||
* @param region {EstimoteBeaconRegion} Region
|
||||
* @param notifyEntryStateOnDisplay {boolean}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopSecureMonitoringForRegion',
|
||||
clearWithArgs: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
* {@link EstimoteBeacons.stopMonitoringForRegion}.
|
||||
* @param region {EstimoteBeaconRegion} Region
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Connect to Estimote Beacon. Available on Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.connectToBeacon(FF:0F:F0:00:F0:00);
|
||||
* ```
|
||||
* ```
|
||||
* EstimoteBeacons.connectToBeacon({
|
||||
* proximityUUID: '000000FF-F00F-0FF0-F000-000FF0F00000',
|
||||
* major: 1,
|
||||
* minor: 1
|
||||
* });
|
||||
* ```
|
||||
* @param beacon {Beacon} Beacon to connect to.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToBeacon(beacon: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Disconnect from connected Estimote Beacon. Available on Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* EstimoteBeacons.disconnectConnectedBeacon();
|
||||
* ```
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnectConnectedBeacon(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write proximity UUID to connected Estimote Beacon. Available on Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* // Example that writes constant ESTIMOTE_PROXIMITY_UUID
|
||||
* EstimoteBeacons.writeConnectedProximityUUID(ESTIMOTE_PROXIMITY_UUID);
|
||||
*
|
||||
* @param uuid {string} String to write as new UUID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedProximityUUID(uuid: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write major to connected Estimote Beacon. Available on Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* // Example that writes 1
|
||||
* EstimoteBeacons.writeConnectedMajor(1);
|
||||
*
|
||||
* @param major {number} number to write as new major
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedMajor(major: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write minor to connected Estimote Beacon. Available on Android.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* // Example that writes 1
|
||||
* EstimoteBeacons.writeConnectedMinor(1);
|
||||
*
|
||||
* @param minor {number} number to write as new minor
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static writeConnectedMinor(minor: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
@@ -69,8 +91,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
* For tracking events, see `logEvent` and `logPurchase`.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Facebook} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Facebook } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -78,27 +100,29 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Facebook',
|
||||
plugin: 'cordova-plugin-facebook4',
|
||||
pluginRef: 'facebookConnectPlugin',
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
|
||||
install: 'cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"'
|
||||
install: 'ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"'
|
||||
})
|
||||
export class Facebook {
|
||||
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param appId
|
||||
* @param version
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* status: "connected",
|
||||
* authResponse: {
|
||||
@@ -113,16 +137,16 @@ export class Facebook {
|
||||
* ```
|
||||
*
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in.
|
||||
* @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
*/
|
||||
@Cordova()
|
||||
static login(permissions: string[]): Promise<any> { return; }
|
||||
static login(permissions: string[]): Promise<FacebookLoginResponse> { return; }
|
||||
|
||||
/**
|
||||
* Logout of Facebook.
|
||||
*
|
||||
* For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout)
|
||||
* @return Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
@@ -151,7 +175,7 @@ export class Facebook {
|
||||
*
|
||||
* For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus)
|
||||
*
|
||||
* @return Returns a Promise that resolves with a status, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a status, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static getLoginStatus(): Promise<any> { return; }
|
||||
@@ -159,7 +183,7 @@ export class Facebook {
|
||||
/**
|
||||
* Get a Facebook access token for using Facebook services.
|
||||
*
|
||||
* @return Returns a Promise that resolves with an access token, or rejects with an error
|
||||
* @returns {Promise<string>} Returns a Promise that resolves with an access token, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static getAccessToken(): Promise<string> { return; }
|
||||
@@ -178,8 +202,8 @@ export class Facebook {
|
||||
* ```
|
||||
*
|
||||
* For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui)
|
||||
* @options {Object} options The dialog options
|
||||
* @return Returns a Promise that resolves with success data, or rejects with an error
|
||||
* @param {Object} options The dialog options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with success data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static showDialog(options: any): Promise<any> { return; }
|
||||
@@ -195,7 +219,7 @@ export class Facebook {
|
||||
*
|
||||
* @param {string} requestPath Graph API endpoint you want to call
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request.
|
||||
* @return Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static api(requestPath: string, permissions: string[]): Promise<any> { return; }
|
||||
@@ -206,21 +230,21 @@ export class Facebook {
|
||||
* @param {string} name Name of the event
|
||||
* @param {Object} [params] An object containing extra data to log with the event
|
||||
* @param {number} [valueToSum] any value to be added to added to a sum on each event
|
||||
* @return
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logEvent(
|
||||
name: string,
|
||||
params?: Object,
|
||||
valueToSum?: number
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Log a purchase. For more information see the Events section above.
|
||||
*
|
||||
* @param {number} value Value of the purchase.
|
||||
* @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217)
|
||||
* @return Returns a Promise
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logPurchase(value: number, currency: string): Promise<any> { return; }
|
||||
@@ -238,11 +262,12 @@ export class Facebook {
|
||||
* url: [App Link](https://developers.facebook.com/docs/applinks) to your app
|
||||
* picture: image to be displayed in the App Invite dialog
|
||||
*
|
||||
* @return Returns a Promise that resolves with the result data, or rejects with an error
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static appInvite(options: {
|
||||
url: string,
|
||||
picture: string
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
35
src/plugins/file-chooser.ts
Normal file
35
src/plugins/file-chooser.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileChooser
|
||||
* @description
|
||||
*
|
||||
* Opens the file picker on Android for the user to select a file, returns a file URI.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {FileChooser} from 'ionic-native';
|
||||
*
|
||||
* FileChooser.open()
|
||||
* .then(uri => console.log(uri));
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileChooser',
|
||||
plugin: 'http://github.com/don/cordova-filechooser.git',
|
||||
pluginRef: 'fileChooser',
|
||||
repo: 'https://github.com/don/cordova-filechooser',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FileChooser {
|
||||
|
||||
/**
|
||||
* Open a file
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static open(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
61
src/plugins/file-opener.ts
Normal file
61
src/plugins/file-opener.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileOpener
|
||||
* @description
|
||||
* This plugin will open a file on your device file system with its default application.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {FileOpener} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileOpener',
|
||||
plugin: 'cordova-plugin-file-opener2',
|
||||
pluginRef: 'cordova.plugins.fileOpener2',
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
|
||||
})
|
||||
export class FileOpener {
|
||||
|
||||
/**
|
||||
* Open an file
|
||||
* @param filePath {string} File Path
|
||||
* @param fileMIMEType {string} File MIME Type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'error'
|
||||
})
|
||||
static open(filePath: string, fileMIMEType: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Uninstalls a package
|
||||
* @param packageId {string} Package ID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'error'
|
||||
})
|
||||
static uninstall(packageId: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Check if an app is already installed
|
||||
* @param packageId {string} Package ID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'error'
|
||||
})
|
||||
static appIsInstalled(packageId: string): Promise<any> {return; }
|
||||
|
||||
}
|
||||
1356
src/plugins/file.ts
1356
src/plugins/file.ts
File diff suppressed because it is too large
Load Diff
38
src/plugins/filepath.ts
Normal file
38
src/plugins/filepath.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name FilePath
|
||||
* @description
|
||||
*
|
||||
* This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {FilePath} from 'ionic-native';
|
||||
*
|
||||
* FilePath.resolveNativePath(path)
|
||||
* .then(filePath => console.log(filePath);
|
||||
* .catch(err => console.log(err);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FilePath',
|
||||
plugin: 'cordova-plugin-filepath',
|
||||
pluginRef: 'window.FilePath',
|
||||
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FilePath {
|
||||
|
||||
/**
|
||||
* Resolve native path for given content URL/path.
|
||||
* @param {String} path Content URL/path.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static resolveNativePath(path: string): Promise<string> {return; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, CordovaInstance} from './plugin';
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
|
||||
declare var FileTransfer;
|
||||
|
||||
@@ -45,6 +45,7 @@ export interface FileUploadOptions {
|
||||
* Content-Type is present, multipart form data will NOT be used.
|
||||
*/
|
||||
headers?: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileUploadResult {
|
||||
@@ -68,6 +69,7 @@ export interface FileUploadResult {
|
||||
* The HTTP response headers by the server.
|
||||
*/
|
||||
headers: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileTransferError {
|
||||
@@ -102,36 +104,105 @@ export interface FileTransferError {
|
||||
* Either e.getMessage or e.toString.
|
||||
*/
|
||||
exception: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Transfer
|
||||
* @description This plugin allows you to upload and download files.
|
||||
* Example:
|
||||
* Create instance:
|
||||
*
|
||||
* @description
|
||||
* This plugin allows you to upload and download files.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Transfer } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Create instance:
|
||||
* const fileTransfer = new Transfer();
|
||||
*
|
||||
* Upload a file:
|
||||
* // Upload a file:
|
||||
* fileTransfer.upload(..).then(..).catch(..);
|
||||
*
|
||||
* Download a file:
|
||||
* // Download a file:
|
||||
* fileTransfer.download(..).then(..).catch(..);
|
||||
*
|
||||
* Abort active transfer:
|
||||
* // Abort active transfer:
|
||||
* fileTransfer.abort();
|
||||
*
|
||||
* E.g
|
||||
*
|
||||
* upload(){
|
||||
* const fileTransfer = new Transfer();
|
||||
* var options: any;
|
||||
*
|
||||
* options = {
|
||||
* fileKey: 'file',
|
||||
* fileName: 'name.jpg',
|
||||
* headers: {}
|
||||
* .....
|
||||
* }
|
||||
* fileTransfer.upload("<file path>", "<api endpoint>", options)
|
||||
* .then((data) => {
|
||||
* // success
|
||||
* }, (err) => {
|
||||
* // error
|
||||
* })
|
||||
* }
|
||||
*
|
||||
* // Cordova
|
||||
* declare var cordova: any;
|
||||
*
|
||||
* download() {
|
||||
* const fileTransfer = new Transfer();
|
||||
* let url = 'http://www.example.com/file.pdf';
|
||||
* fileTransfer.download(url, cordova.file.dataDirectory + 'file.pdf').then((entry) => {
|
||||
* console.log('download complete: ' + entry.toURL());
|
||||
* }, (error) => {
|
||||
* // handle error
|
||||
* });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* Note: You will not see your documents using a file explorer on your device. Use adb:
|
||||
*
|
||||
* ```
|
||||
* adb shell
|
||||
* run-as com.your.app
|
||||
* cd files
|
||||
* ls
|
||||
* ```
|
||||
* @interfaces
|
||||
* FileUploadOptions
|
||||
* FileUploadResult
|
||||
* FileTransferError
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileTransfer',
|
||||
plugin: 'cordova-plugin-file-transfer',
|
||||
pluginRef: 'FileTransfer',
|
||||
repo: 'https://github.com/apache/cordova-plugin-file-transfer'
|
||||
})
|
||||
export class Transfer {
|
||||
|
||||
public static FILE_NOT_FOUND_ERR: number = 1;
|
||||
public static INVALID_URL_ERR: number = 2;
|
||||
public static CONNECTION_ERR: number = 3;
|
||||
public static ABORT_ERR: number = 4;
|
||||
public static NOT_MODIFIED_ERR: number = 4;
|
||||
/**
|
||||
* Error code rejected from upload with FileTransferError
|
||||
* Defined in FileTransferError.
|
||||
* FILE_NOT_FOUND_ERR: 1 Return when file was not found
|
||||
* INVALID_URL_ERR: 2, Return when url was invalid
|
||||
* CONNECTION_ERR: 3, Return on connection error
|
||||
* ABORT_ERR: 4, Return on aborting
|
||||
* NOT_MODIFIED_ERR: 5 Return on "304 Not Modified" HTTP response
|
||||
* @enum {number}
|
||||
*/
|
||||
public static FileTransferErrorCode = {
|
||||
FILE_NOT_FOUND_ERR: 1,
|
||||
INVALID_URL_ERR: 2,
|
||||
CONNECTION_ERR: 3,
|
||||
ABORT_ERR: 4,
|
||||
NOT_MODIFIED_ERR: 5
|
||||
};
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
@@ -145,14 +216,14 @@ export class Transfer {
|
||||
* @param {string} fileUrl Filesystem URL representing the file on the device or a data URI. For backwards compatibility, this can also be the full path of the file on the device.
|
||||
* @param {string} url URL of the server to receive the file, as encoded by encodeURI().
|
||||
* @param {FileUploadOptions} options Optional parameters.
|
||||
* @param {boolean} trustAllHosts: Optional parameter, defaults to false. If set to true, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS.
|
||||
* @return Returns a Promise that resolves to a FileUploadResult and rejects with FileTransferError.
|
||||
* @param {boolean} trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS.
|
||||
* @returns {Promise<FileUploadResult>} Returns a Promise that resolves to a FileUploadResult and rejects with FileTransferError.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult | FileTransferError> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +234,7 @@ export class Transfer {
|
||||
* @param {stirng} target Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device.
|
||||
* @param {boolean} trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS.
|
||||
* @param {object} Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).
|
||||
* @return Returns a Promise that resolves to a FileEntry object.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to a FileEntry object.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
@@ -189,6 +260,6 @@ export class Transfer {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abort(): void {}
|
||||
abort(): void { }
|
||||
|
||||
}
|
||||
|
||||
62
src/plugins/fingerprint-aio.ts
Normal file
62
src/plugins/fingerprint-aio.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
|
||||
export interface FingerprintOptions {
|
||||
/**
|
||||
* Key for platform keychain
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Secret password. Only for android
|
||||
*/
|
||||
clientSecret?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name FingerprintAIO
|
||||
* @description
|
||||
* Use simple fingerprint authentication on Android and iOS.
|
||||
* Requires Cordova plugin: cordova-plugin-fingerprint-aio. For more info about plugin, vist: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FingerprintAIO } from 'ionic-native';
|
||||
*
|
||||
* FingerprintAIO.show({
|
||||
* clientId: "Fingerprint-Demo",
|
||||
* clientSecret: "password" //Only necessary for Android
|
||||
* })
|
||||
* .then((result: any) => console.log(any))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* FingerprintOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FingerprintAIO',
|
||||
plugin: 'cordova-plugin-fingerprint-aio',
|
||||
pluginRef: 'Fingerprint',
|
||||
repo: 'https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class FingerprintAIO {
|
||||
|
||||
/**
|
||||
* Check if fingerprint authentication is available
|
||||
* @return {Promise<any>} Returns a promise with result
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show authentication dialogue
|
||||
* @param options {FingerprintOptions} options for platform specific fingerprint API
|
||||
* @return {Promise<any>} Returns a promise that resolves when authentication was successfull
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: FingerprintOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
201
src/plugins/firebase.ts
Normal file
201
src/plugins/firebase.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Firebase
|
||||
* @description
|
||||
* This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported (including iOS 10).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Firebase } from 'ionic-native';
|
||||
*
|
||||
* Firebase.getToken()
|
||||
* .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
|
||||
* .catch(error => console.error('Error getting token', error));
|
||||
*
|
||||
* Firebase.onTokenRefresh()
|
||||
* .subscribe((token: string) => console.log(`Got a new token ${token}`));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Firebase',
|
||||
plugin: 'cordova-plugin-firebase',
|
||||
pluginRef: 'FirebasePlugin',
|
||||
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Firebase {
|
||||
|
||||
/**
|
||||
* Get the device token
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getToken(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when a token is refreshed
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onTokenRefresh(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when the user opens a notification
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onNotificationOpen(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Grant permission to recieve push notifications
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static grantPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
* @param badgeNumber {number}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setBadgeNumber(badgeNumber: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get icon badge number
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getBadgeNumber(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to a topic
|
||||
* @param topic {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static subscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Unsubscribe from a topic
|
||||
* @param topic {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static unsubscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
* @param type {string}
|
||||
* @param data {Object}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logEvent(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a user id for use in Analytics
|
||||
* @param userId {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(userId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a user property for use in Analytics
|
||||
* @param name {string}
|
||||
* @param value {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app
|
||||
* @param cacheExpirationSeconds
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static fetch(cacheExpirationSeconds?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Activate the Remote Config fetched config
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static activateFetched(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config value
|
||||
* @param key {string}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static getValue(key: string, namespace?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config byte array
|
||||
* @param key {string}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static getByteArray(key: string, namespace?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the current state of the FirebaseRemoteConfig singleton object
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static getInfo(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Change the settings for the FirebaseRemoteConfig object's operations
|
||||
* @param settings {Object}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setConfigSettings(settings: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set defaults in the Remote Config
|
||||
* @param defaults {Object}
|
||||
* @param namespace {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static setDefaults(defaults: any, namespace: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Flashlight
|
||||
@@ -7,21 +7,21 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Flashlight} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Flashlight } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Flashlight',
|
||||
plugin: 'cordova-plugin-flashlight',
|
||||
pluginRef: 'window.plugins.flashlight',
|
||||
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git'
|
||||
})
|
||||
export class Flashlight {
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the flashlight is available
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available.
|
||||
@@ -53,7 +53,7 @@ export class Flashlight {
|
||||
|
||||
/**
|
||||
* Checks if the flashlight is turned on.
|
||||
* Returns a boolean
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
|
||||
164
src/plugins/geofence.ts
Normal file
164
src/plugins/geofence.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
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.
|
||||
* Geofences persist after device reboot. Geofences will be monitored even when the app is not running.
|
||||
* @usage
|
||||
* ```
|
||||
* import { Geofence } from 'ionic-native';
|
||||
* import { Platform } from 'ionic-angular'
|
||||
* ...
|
||||
*
|
||||
* constructor(private platform: Platform) {
|
||||
* this.platform.ready().then(() => {
|
||||
// initialize the plugin
|
||||
* Geofence.initialize().then(
|
||||
* // resolved promise does not return a value
|
||||
* () => console.log('Geofence Plugin Ready'),
|
||||
* (err) => console.log(err)
|
||||
* )
|
||||
* })
|
||||
* }
|
||||
*
|
||||
* private addGeofence() {
|
||||
* //options describing geofence
|
||||
* let fence = {
|
||||
* id: "69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb", //any unique ID
|
||||
* latitude: 37.285951, //center of geofence radius
|
||||
* longitude: -121.936650,
|
||||
* radius: 100, //radius to edge of geofence
|
||||
* transitionType: 3, //see 'Transition Types' below
|
||||
* notification: { //notification settings
|
||||
* id: 1, //any unique ID
|
||||
* title: "You crossed a fence", //notification title
|
||||
* text: "You just arrived to Gliwice city center.", //notification body
|
||||
* openAppOnClick: true //open app when notification is tapped
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* Geofence.addOrUpdate(fence).then(
|
||||
* () => console.log('Geofence added'),
|
||||
* (err) => console.log('Geofence failed to add')
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
* ### Transition Types ###
|
||||
* Transition type specifies whether the geofence should trigger when the user enters and/or leaves the geofence.
|
||||
*
|
||||
* #### Supported values ####
|
||||
* - 1: Enter
|
||||
* - 2: Leave
|
||||
* - 3: Both
|
||||
*
|
||||
* ### Defining a Geofence ###
|
||||
* Geofences are defined by an object that is passed to `addOrUpdate()`. Object properties are:
|
||||
* - id: Any unique ID for the geofence. This ID is used to remove and update a geofence
|
||||
* - latitude: Latitude coordinate of the center of the geofence radius
|
||||
* - longitude: Latitude coordinate of the center of the geofence radius
|
||||
* - radius: Radius from the center to the edge of the geofence
|
||||
* - transitionType: Type of geofence transition to monitor for. See 'Transition Types' above
|
||||
* - notification: Object. Options for defining the notification sent when a geofence is crossed
|
||||
* - id: Any unique ID
|
||||
* - title: Notification title
|
||||
* - text: Notification body
|
||||
* - openAppOnClick: Boolean. Whether to open the app when the notification is tapped by the user
|
||||
*
|
||||
* ### Troubleshooting ###
|
||||
* #### I get compile errors when I run `ionic build ios` or `ionic run ios`. ####
|
||||
* This could be caused by the Cordova project directory in `/platforms/ios` not being named correctly.
|
||||
* Try running `ionic platform rm <platform>` then run `ionic platform add <platform>` to recreate the
|
||||
* platform directories.
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Geofence',
|
||||
plugin: 'cordova-plugin-geofence',
|
||||
pluginRef: 'geofence',
|
||||
repo: 'https://github.com/cowbell/cordova-plugin-geofence/',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows Phone']
|
||||
})
|
||||
|
||||
export class Geofence {
|
||||
|
||||
public static TransitionType = {
|
||||
ENTER: 1,
|
||||
EXIT: 2,
|
||||
BOTH: 3
|
||||
};
|
||||
|
||||
public static onTrasitionReceived: Function;
|
||||
|
||||
/**
|
||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static initialize(): Promise<void> { return; };
|
||||
|
||||
/**
|
||||
* Adds a new geofence or array of geofences. For geofence object, see above.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
|
||||
|
||||
/**
|
||||
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
|
||||
* geofence was created.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static remove(geofenceId: string | Array<string>): Promise<void> { return; };
|
||||
|
||||
/**
|
||||
* Removes all geofences.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static removeAll(): Promise<void> { return; };
|
||||
|
||||
/**
|
||||
* Returns an array of geofences currently being monitored.
|
||||
*
|
||||
* @returns {Promise<Array<string>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getWatched(): Promise<string> { return; };
|
||||
|
||||
/**
|
||||
* Called when a geofence is crossed in the direction specified by `TransitType`.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
static onTransitionReceived(): Observable<any> {
|
||||
|
||||
return new Observable<any>((observer) => {
|
||||
window && window.geofence && (window.geofence.onTransitionReceived = observer.next.bind(observer));
|
||||
return () => window.geofence.onTransitionReceived = () => {};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
static onNotificationClicked(): Observable<any> {
|
||||
|
||||
return new Observable<any>((observer) => {
|
||||
window && window.geofence && (window.geofence.onNotificationClicked = observer.next.bind(observer));
|
||||
return () => window.geofence.onNotificationClicked = () => {};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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.
|
||||
*/
|
||||
@@ -47,6 +48,7 @@ export interface Coordinates {
|
||||
* This value can be null.
|
||||
*/
|
||||
speed: number;
|
||||
|
||||
}
|
||||
|
||||
export interface Geoposition {
|
||||
@@ -61,7 +63,22 @@ export interface Geoposition {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface PositionError {
|
||||
|
||||
/**
|
||||
* A code that indicates the error that occurred
|
||||
*/
|
||||
code: number;
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -89,8 +106,8 @@ export interface GeolocationOptions {
|
||||
* @type {boolean}
|
||||
*/
|
||||
enableHighAccuracy?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Geolocation
|
||||
@@ -101,34 +118,43 @@ export interface GeolocationOptions {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import {Geolocation} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { Geolocation } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* //resp.coords.latitude
|
||||
* //resp.coords.longitude
|
||||
* })
|
||||
* // resp.coords.latitude
|
||||
* // resp.coords.longitude
|
||||
* }).catch((error) => {
|
||||
* console.log('Error getting location', error);
|
||||
* });
|
||||
*
|
||||
* let watch = Geolocation.watchPosition();
|
||||
* watch.subscribe((data) => {
|
||||
* //data.coords.latitude
|
||||
* //data.coords.longitude
|
||||
* })
|
||||
* // data can be a set of coordinates, or an error (if an error occurred).
|
||||
* // data.coords.latitude
|
||||
* // data.coords.longitude
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* Coordinates
|
||||
* Geoposition
|
||||
* PositionError
|
||||
* GeolocationOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Geolocation',
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation'
|
||||
})
|
||||
export class Geolocation {
|
||||
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
* @returns {Promise<Geoposition>} Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -139,8 +165,10 @@ export class Geolocation {
|
||||
* Watch the current device's position. Clear the watch by unsubscribing from
|
||||
* Observable changes.
|
||||
*
|
||||
* ```ts
|
||||
* var subscription = Geolocation.watchPosition().subscribe(position => {
|
||||
* ```typescript
|
||||
* var subscription = Geolocation.watchPosition()
|
||||
* .filter((p) => p.code === undefined) //Filter Out Errors
|
||||
* .subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
*
|
||||
@@ -149,15 +177,15 @@ export class Geolocation {
|
||||
* ```
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||
return new Observable<Geoposition>(
|
||||
(observer: any) => {
|
||||
let cb = (data: Geoposition) => observer.next(data);
|
||||
let watchId = navigator.geolocation.watchPosition(cb, options);
|
||||
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
|
||||
return () => navigator.geolocation.clearWatch(watchId);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,128 +1,136 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Globalization
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Globalization} from 'ionic-native';
|
||||
*
|
||||
* ```typescript
|
||||
* import { Globalization } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
||||
pluginName: 'Globalization',
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
|
||||
})
|
||||
export class Globalization {
|
||||
|
||||
/**
|
||||
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
|
||||
* @return {Promise<{value: string}>}
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getPreferredLanguage(): Promise<{value: string}> {return; }
|
||||
static getPreferredLanguage(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
|
||||
* @return {Promise<{value: string}>}
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocaleName(): Promise<{value: string}> {return; }
|
||||
static getLocaleName(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
* Converts date to string
|
||||
* @param date
|
||||
* @param options
|
||||
* @return {Promise<{value: string}>}
|
||||
* @param {Date} date Date you wish to convert
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @returns {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; }
|
||||
static dateToString(date: Date, options: { formatLength: string, selector: string }): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dateString
|
||||
* @param options
|
||||
* Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object.
|
||||
* @param {string} dateString Date as a string to be converted
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @returns {Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static stringToDate(dateString: string, options: {formatLength: string, selector: string}): Promise<{year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number}> {return; }
|
||||
|
||||
static stringToDate(dateString: string, options: { formatLength: string, selector: string }): Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns a pattern string to format and parse dates according to the client's user preferences.
|
||||
* @param options Object with the format length and selector
|
||||
* @returns {Promise<{pattern: string}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getDatePattern(options: {formatLength: string, selector: string}): Promise<{pattern: string}> {return; }
|
||||
|
||||
static getDatePattern(options: { formatLength: string, selector: string }): Promise<{ pattern: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
|
||||
* @param options Object with type (narrow or wide) and item (month or days).
|
||||
* @returns {Promise<{value: Array<string>}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; }
|
||||
static getDateNames(options: { type: string, item: string }): Promise<{ value: Array<string> }> { return; }
|
||||
|
||||
/**
|
||||
* Check if day light saving is active
|
||||
* @param date
|
||||
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
|
||||
* @param {data} date Date to process
|
||||
* @returns {Promise<{dst: string}>} reutrns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; }
|
||||
static isDayLightSavingsTime(date: Date): Promise<{ dst: string }> { return; }
|
||||
|
||||
/**
|
||||
* Get first day of week
|
||||
* Returns the first day of the week according to the client's user preferences and calendar.
|
||||
* @returns {Promise<{value: string}>} returns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static getFirstDayOfWeek(): Promise<{value: string}> {return; }
|
||||
static getFirstDayOfWeek(): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns a number formatted as a string according to the client's user preferences.
|
||||
* @param numberToConvert {Number} The number to convert
|
||||
* @param options {Object} Object with property `type` that can be set to: decimal, percent, or currency.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static numberToString(options: {type: string}): Promise<{value: string}> {return; }
|
||||
static numberToString(numberToConvert: number, options: { type: string }): Promise<{ value: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stringToConvert
|
||||
* @param options
|
||||
* @param {string} stringToConvert String you want to conver to a number
|
||||
* @param options The type of number you want to return. Can be decimal, percent, or currency.
|
||||
* @returns {Promise<{ value: number | string }>} Returns a promise with the value.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; }
|
||||
static stringToNumber(stringToConvert: string, options: { type: string }): Promise<{ value: number | string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns a pattern string to format and parse numbers according to the client's user preferences.
|
||||
* @param options Can be decimal, percent, or currency.
|
||||
* @returns {Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; }
|
||||
static getNumberPattern(options: { type: string }): Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param currencyCode
|
||||
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
|
||||
* @param {string} currencyCode Currency Code.A
|
||||
* @returns {Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; }
|
||||
static getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,46 +1,59 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
* @description
|
||||
* @usage
|
||||
* ```
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
* GooglePlus.login()
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-googleplus',
|
||||
pluginRef: 'window.plugins.googleplus',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
|
||||
platforms: ['Web', 'Android', 'iOS'],
|
||||
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid'
|
||||
pluginName: 'GooglePlus',
|
||||
plugin: 'cordova-plugin-googleplus',
|
||||
pluginRef: 'window.plugins.googleplus',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
|
||||
platforms: ['Web', 'Android', 'iOS'],
|
||||
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid'
|
||||
})
|
||||
export class GooglePlus {
|
||||
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static login(options?: any): Promise<any> {return; }
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> {return; }
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> {return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> {return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
@@ -10,114 +10,199 @@ 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({
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'analytics',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
pluginName: 'GoogleAnalytics',
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'ga',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
export class GoogleAnalytics {
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
*/
|
||||
@Cordova()
|
||||
static startTrackerWithId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param {string} title Screen title
|
||||
*/
|
||||
@Cordova()
|
||||
static trackView(title: string): Promise<any> { return; }
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an event
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
||||
* @param {string} category
|
||||
* @param {string} action
|
||||
* @param {string} label
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
|
||||
/**
|
||||
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more
|
||||
* @param allow {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAllowIDFACollection(allow: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
* @param {string} description
|
||||
* @param {boolean} fatal
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id User ID
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track User Timing (App Speed)
|
||||
* @param {string} category
|
||||
* @param {number} intervalInMilliseconds
|
||||
* @param {string} variable
|
||||
* @param {string} label
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
/**
|
||||
* Set a anonymize Ip address
|
||||
* @param anonymize {boolean} Set to true to anonymize the IP Address
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAnonymizeIp(anonymize: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
|
||||
* @param {string} id
|
||||
* @param {string} affiliation
|
||||
* @param {number} revenue
|
||||
* @param {number} tax
|
||||
* @param {number} shipping
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
/**
|
||||
* Sets the app version
|
||||
* @param appVersion {string} App version
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAppVersion(appVersion: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction Item (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem
|
||||
* @param {string} id
|
||||
* @param {string} name
|
||||
* @param {string} sku
|
||||
* @param {string} category
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
/**
|
||||
* Set OptOut
|
||||
* @param optout {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptOut(optout: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
/**
|
||||
* Enable verbose logging
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
/**
|
||||
* Track custom metric
|
||||
* @param key {string}
|
||||
* @param value {any}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static trackMetric(key: string, value?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param title {string} Screen title
|
||||
* @param campaignUrl {string} Campaign url for measuring referrals
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 3,
|
||||
errorIndex: 4
|
||||
})
|
||||
static trackView(title: string, campaignUrl?: string, newSession?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param key {string}
|
||||
* @param value {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an event
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
||||
* @param category {string}
|
||||
* @param action {string}
|
||||
* @param label {string}
|
||||
* @param value {number}
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 5,
|
||||
errorIndex: 6
|
||||
})
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number, newSession?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
* @param description {string}
|
||||
* @param fatal {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track User Timing (App Speed)
|
||||
* @param category {string}
|
||||
* @param intervalInMilliseconds {number}
|
||||
* @param variable {string}
|
||||
* @param label {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
|
||||
* @param id {string}
|
||||
* @param affiliation {string}
|
||||
* @param revenue {number}
|
||||
* @param tax {number}
|
||||
* @param shipping {number}
|
||||
* @param currencyCode {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Transaction Item (Ecommerce)
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem
|
||||
* @param {string} id
|
||||
* @param {string} name
|
||||
* @param {string} sku
|
||||
* @param {string} category
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param shouldEnable {boolean}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param {boolean} shouldEnable
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
}
|
||||
|
||||
1804
src/plugins/googlemap.ts
Normal file
1804
src/plugins/googlemap.ts
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
36
src/plugins/headercolor.ts
Normal file
36
src/plugins/headercolor.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Headerolor
|
||||
* @description
|
||||
* Cordova plugin to change color of header in multitask view
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { HeaderColor } from 'ionic-native';
|
||||
*
|
||||
* HeaderColor.tint("#becb29");
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HeaderColor',
|
||||
plugin: 'cordova-plugin-headercolor',
|
||||
pluginRef: 'plugins.headerColor',
|
||||
repo: 'https://github.com/tomloprod/cordova-plugin-headercolor',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class HeaderColor {
|
||||
|
||||
/**
|
||||
* Set a color to the task header
|
||||
* @param color {string} The hex value of the color
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static tint(color: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -1,21 +1,129 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
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
|
||||
* ```js
|
||||
* import {Hotspot, Network} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Hotspot, Network } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
* Hotspot.scanWifi().then((networks: Array<Network>) => {
|
||||
* console.log(networks);
|
||||
* });
|
||||
* ...
|
||||
*
|
||||
* Hotspot.scanWifi().then((networks: Array<Network>) => {
|
||||
* console.log(networks);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HotspotConnectionInfo
|
||||
* HotspotNetwork
|
||||
* HotspotNetworkConfig
|
||||
* HotspotDevice
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Hotspot',
|
||||
plugin: 'cordova-plugin-hotspot',
|
||||
pluginRef: 'cordova.plugins.hotspot',
|
||||
repo: 'https://github.com/hypery2k/cordova-hotspot-plugin',
|
||||
@@ -23,11 +131,17 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class Hotspot {
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {return; }
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static toggleWifi(): Promise<boolean> {return; }
|
||||
static toggleWifi(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Configures and starts hotspot with SSID and Password
|
||||
@@ -36,18 +150,18 @@ export class Hotspot {
|
||||
* @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
|
||||
* @param {string} password - password for your new Access Point
|
||||
*
|
||||
* @return {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
|
||||
* @returns {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
|
||||
*/
|
||||
@Cordova()
|
||||
static createHotspot(ssid: string, mode: string, password: string): Promise<void> {return; }
|
||||
static createHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Turns on Access Point
|
||||
*
|
||||
* @return {Promise<boolean>} - true if AP is started
|
||||
* @returns {Promise<boolean>} - true if AP is started
|
||||
*/
|
||||
@Cordova()
|
||||
static startHotspot(): Promise<boolean> {return; }
|
||||
static startHotspot(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Configures hotspot with SSID and Password
|
||||
@@ -56,29 +170,32 @@ export class Hotspot {
|
||||
* @param {string} mode - encryption mode (Open, WEP, WPA, WPA_PSK)
|
||||
* @param {string} password - password for your new Access Point
|
||||
*
|
||||
* @return {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
|
||||
* @returns {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
|
||||
*/
|
||||
@Cordova()
|
||||
static configureHotspot(ssid: string, mode: string, password: string): Promise<void> {return; }
|
||||
static configureHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Turns off Access Point
|
||||
*
|
||||
* @return {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
|
||||
* @returns {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static stopHotspot(): Promise<boolean> {return; }
|
||||
static stopHotspot(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if hotspot is enabled
|
||||
*
|
||||
* @return {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
|
||||
* @returns {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
|
||||
*/
|
||||
@Cordova()
|
||||
static isHotspotEnabled(): Promise<void> {return; }
|
||||
static isHotspotEnabled(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotDevice>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> {return; }
|
||||
static getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
|
||||
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
@@ -88,29 +205,29 @@ export class Hotspot {
|
||||
* @param {string} password
|
||||
* password to use
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToWifi(ssid: string, password: string): Promise<void> {return; }
|
||||
static connectToWifi(ssid: string, password: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
*
|
||||
* @param {string} ssid
|
||||
* SSID to connect
|
||||
* @param {string} password
|
||||
* Password to use
|
||||
* @param {string} authentication
|
||||
* Authentication modes to use (LEAP, SHARED, OPEN)
|
||||
* @param {string[]} encryption
|
||||
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
/**
|
||||
* Connect to a WiFi network
|
||||
*
|
||||
* @param {string} ssid
|
||||
* SSID to connect
|
||||
* @param {string} password
|
||||
* Password to use
|
||||
* @param {string} authentication
|
||||
* Authentication modes to use (LEAP, SHARED, OPEN)
|
||||
* @param {string[]} encryption
|
||||
* Encryption modes to use (CCMP, TKIP, WEP104, WEP40)
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> {return; }
|
||||
static connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Add a WiFi network
|
||||
@@ -122,11 +239,11 @@ export class Hotspot {
|
||||
* @param {string} password
|
||||
* Password for network
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that adding the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> {return; }
|
||||
static addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Remove a WiFi network
|
||||
@@ -134,175 +251,120 @@ export class Hotspot {
|
||||
* @param {string} ssid
|
||||
* SSID of network
|
||||
*
|
||||
* @return {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
* Promise that removing the WiFi network was successfull, rejected if unsuccessful
|
||||
*/
|
||||
@Cordova()
|
||||
static removeWifiNetwork(ssid: string): Promise<void> {return; }
|
||||
static removeWifiNetwork(ssid: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnectedToInternet(): Promise<boolean> {return; }
|
||||
static isConnectedToInternet(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnectedToInternetViaWifi(): Promise<boolean> {return; }
|
||||
static isConnectedToInternetViaWifi(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiOn(): Promise<boolean> {return; }
|
||||
static isWifiOn(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiSupported(): Promise<boolean> {return; }
|
||||
static isWifiSupported(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isWifiDirectSupported(): Promise<boolean> {return; }
|
||||
static isWifiDirectSupported(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scanWifi(): Promise<Array<Network>> {return; }
|
||||
static scanWifi(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<HotspotNetwork>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static scanWifiByLevel(): Promise<Array<Network>> {return; }
|
||||
static scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> {return; }
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static stopWifiPeriodicallyScan(): Promise<any> {return; }
|
||||
static stopWifiPeriodicallyScan(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<HotspotNetworkConfig>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getNetConfig(): Promise<NetworkConfig> {return; }
|
||||
static getNetConfig(): Promise<HotspotNetworkConfig> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<HotspotConnectionInfo>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> {return; }
|
||||
static getConnectionInfo(): Promise<HotspotConnectionInfo> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static pingHost(ip: string): Promise<string> {return; }
|
||||
static pingHost(ip: string): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Gets MAC Address associated with IP Address from ARP File
|
||||
*
|
||||
* @param {string} ip - IP Address that you want the MAC Address of
|
||||
*
|
||||
* @return {Promise<string>} - A Promise for the MAC Address
|
||||
* @returns {Promise<string>} - A Promise for the MAC Address
|
||||
*/
|
||||
@Cordova()
|
||||
static getMacAddressOfHost(ip: string): Promise<string> {return; }
|
||||
static getMacAddressOfHost(ip: string): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Checks if IP is live using DNS
|
||||
*
|
||||
* @param {string} ip - IP Address you want to test
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
*/
|
||||
@Cordova()
|
||||
static isDnsLive(ip: string): Promise<boolean> {return; }
|
||||
static isDnsLive(ip: string): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if IP is live using socket And PORT
|
||||
*
|
||||
* @param {string} ip - IP Address you want to test
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
|
||||
*/
|
||||
@Cordova()
|
||||
static isPortLive(ip: string): Promise<boolean> {return; }
|
||||
static isPortLive(ip: string): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if device is rooted
|
||||
*
|
||||
* @return {Promise<boolean>} - A Promise for whether the device is rooted
|
||||
* @returns {Promise<boolean>} - A Promise for whether the device is rooted
|
||||
*/
|
||||
@Cordova()
|
||||
static isRooted(): Promise<boolean> {return; }
|
||||
static isRooted(): Promise<boolean> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ConnectionInfo {
|
||||
/**
|
||||
* @property {string} SSID
|
||||
* The service set identifier (SSID) of the current 802.11 network.
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* @property {string} BSSID
|
||||
* The basic service set identifier (BSSID) of the current access point.
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* @property {string} linkSpeed
|
||||
* The current link speed in Mbps
|
||||
*/
|
||||
linkSpeed: string;
|
||||
/**
|
||||
* @property {string} IPAddress
|
||||
* The IP Address
|
||||
*/
|
||||
IPAddress: string;
|
||||
/**
|
||||
* @property {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 Network {
|
||||
/**
|
||||
* @property {string} SSID
|
||||
* Human readable network name
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* @property {string} BSSID
|
||||
* MAC Address of the access point
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* @property {number (int)} frequency
|
||||
* The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.
|
||||
*/
|
||||
frequency: number;
|
||||
/**
|
||||
* @property {number} level
|
||||
* The detected signal level in dBm, also known as the RSSI.
|
||||
*/
|
||||
level: number;
|
||||
/**
|
||||
* @property {number} timestamp
|
||||
* Timestamp in microseconds (since boot) when this result was last seen.
|
||||
*/
|
||||
timestamp: number;
|
||||
/**
|
||||
* @property {string} capabilities
|
||||
* Describes the authentication, key management, and encryption schemes supported by the access point.
|
||||
*/
|
||||
capabilities: string;
|
||||
}
|
||||
export interface NetworkConfig {
|
||||
/**
|
||||
* @property {string} deviceIPAddress - Device IP Address
|
||||
*/
|
||||
deviceIPAddress: string;
|
||||
/**
|
||||
* @property {string} deviceMacAddress - Device MAC Address
|
||||
*/
|
||||
deviceMacAddress: string;
|
||||
/**
|
||||
* @property {string} gatewayIPAddress - Gateway IP Address
|
||||
*/
|
||||
gatewayIPAddress: string;
|
||||
/**
|
||||
* @property {string} gatewayMacAddress - Gateway MAC Address
|
||||
*/
|
||||
gatewayMacAddress: string;
|
||||
}
|
||||
export interface HotspotDevice {
|
||||
/**
|
||||
* @property {string} ip
|
||||
* Hotspot IP Address
|
||||
*/
|
||||
ip: string;
|
||||
/**
|
||||
* @property {string} mac
|
||||
* Hotspot MAC Address
|
||||
*/
|
||||
mac: string;
|
||||
}
|
||||
|
||||
159
src/plugins/http.ts
Normal file
159
src/plugins/http.ts
Normal file
@@ -0,0 +1,159 @@
|
||||
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
|
||||
* Cordova / Phonegap plugin for communicating with HTTP servers. Supports iOS and Android.
|
||||
*
|
||||
* Advantages over Javascript requests:
|
||||
* - Background threading - all requests are done in a background thread
|
||||
* - SSL Pinning
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { HTTP } from 'ionic-native';
|
||||
*
|
||||
* HTTP.get('http://ionic.io', {}, {})
|
||||
* .then(data => {
|
||||
*
|
||||
* console.log(data.status);
|
||||
* console.log(data.data); // data received by server
|
||||
* console.log(data.headers);
|
||||
*
|
||||
* })
|
||||
* .catch(error => {
|
||||
*
|
||||
* console.log(error.status);
|
||||
* console.log(error.error); // error message as string
|
||||
* console.log(error.headers);
|
||||
*
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HTTPResponse
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HTTP',
|
||||
plugin: 'cordova-plugin-http',
|
||||
pluginRef: 'cordovaHTTP',
|
||||
repo: 'https://github.com/wymsee/cordova-HTTP',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class HTTP {
|
||||
|
||||
/**
|
||||
* This returns an object representing a basic HTTP Authorization header of the form.
|
||||
* @param username {string} Username
|
||||
* @param password {string} Password
|
||||
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getBasicAuthHeader(username: string, password: string): { Authorization: string; } { return; }
|
||||
|
||||
/**
|
||||
* This sets up all future requests to use Basic HTTP authentication with the given username and password.
|
||||
* @param username {string} Username
|
||||
* @param password {string} Password
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static useBasicAuth(username: string, password: string): void { }
|
||||
|
||||
/**
|
||||
* Set a header for all future requests. Takes a header and a value.
|
||||
* @param header {string} The name of the header
|
||||
* @param value {string} The value of the header
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setHeader(header: string, value: string): void { }
|
||||
|
||||
/**
|
||||
* Enable or disable SSL Pinning. This defaults to false.
|
||||
*
|
||||
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this stackoverflow answer. You want to convert it to a DER encoded certificate with a .cer extension.
|
||||
*
|
||||
* As an alternative, you can store your .cer files in the www/certificates folder.
|
||||
* @param enable {boolean} Set to true to enable
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static enableSSLPinning(enable: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Accept all SSL certificates. Or disabled accepting all certificates. Defaults to false.
|
||||
* @param accept {boolean} Set to true to accept
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static acceptAllCerts(accept: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Whether or not to validate the domain name in the certificate. This defaults to true.
|
||||
* @param validate {boolean} Set to true to validate
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static validateDomainName(validate: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Make a POST request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The local path of the file to upload
|
||||
* @param name {string} The name of the parameter to pass the file along as
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The path to donwload the file to, including the file name.
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> { return; }
|
||||
}
|
||||
@@ -1,61 +1,79 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
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
|
||||
* @description
|
||||
* Embedded httpd for Cordova apps. Light weight HTTP server.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {Httpd, HttpdOptions} from 'ionic-native';
|
||||
*
|
||||
* let options: HttpdOptions = {
|
||||
* www_root: 'httpd_root', // relative path to app's www directory
|
||||
* port: 80,
|
||||
* localhost_only: false
|
||||
* };
|
||||
*
|
||||
* Httpd.startServer(options).subscribe((data) => {
|
||||
* console.log('Server is live');
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HttpdOptions
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
||||
pluginRef: 'cordova.plugins.CorHttpd',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||
platforms: ['iOS', 'Android']
|
||||
pluginName: 'Httpd',
|
||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
||||
pluginRef: 'cordova.plugins.CorHttpd',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class Httpd {
|
||||
|
||||
/**
|
||||
* Starts a web server.
|
||||
* @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server.
|
||||
* @param options {HttpdOptions}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options: any): Observable<string> {return; }
|
||||
/**
|
||||
* Starts a web server.
|
||||
* @param options {HttpdOptions}
|
||||
* @returns {Observable<string>} Returns an Observable. Subscribe to receive the URL for your web server (if succeeded). Unsubscribe to stop the server.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options?: HttpdOptions): Observable<string> { return; }
|
||||
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
static getUrl(): Promise<string> {return; }
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
static getUrl(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Get the local path of the running webserver
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocalPath(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Get the local path of the running webserver
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
|
||||
*/
|
||||
@Cordova()
|
||||
static getLocalPath(): Promise<string> {return; }
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
714
src/plugins/ibeacon.ts
Normal file
714
src/plugins/ibeacon.ts
Normal file
@@ -0,0 +1,714 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface Beacon {
|
||||
/**
|
||||
* The physical device's identifier.
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number.
|
||||
*/
|
||||
major: number;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number.
|
||||
*/
|
||||
minor: number;
|
||||
|
||||
/**
|
||||
* The proximity of the beacon relative to the phone.
|
||||
*
|
||||
* Possible options are:
|
||||
* ProximityImmediate
|
||||
* ProximityNear
|
||||
* ProximityFar
|
||||
* ProximityUnknown
|
||||
*/
|
||||
proximity: 'ProximityImmediate' | 'ProximityNear' | 'ProximityFar' | 'ProximityUnknown';
|
||||
|
||||
/**
|
||||
* Transmission Power of the beacon. A constant emitted by the beacon which indicates what's the expected RSSI at a distance of 1 meter to the beacon.
|
||||
*/
|
||||
tx: number;
|
||||
|
||||
/**
|
||||
* Received Signal Strength Indicator. The strength of the beacon's signal when it reaches the device.
|
||||
* RSSI ranges from aprox -26 (a few inches) to -100 (40-50 m distance).
|
||||
*/
|
||||
rssi: number;
|
||||
|
||||
/**
|
||||
* The accuracy of the ranging.
|
||||
*/
|
||||
accuracy: number;
|
||||
|
||||
}
|
||||
|
||||
export interface BeaconRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
*/
|
||||
identifier: string;
|
||||
|
||||
/**
|
||||
* The the beacon identifier the device will "watch" for. Many beacons can share the same uuid.
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number. Optional, of nothing is supplied
|
||||
* the plugin will treat it as a wildcard.
|
||||
*/
|
||||
major?: number;
|
||||
|
||||
/**
|
||||
* The beacon's minor identifier number. Optional, of nothing is supplied
|
||||
* the plugin will treat it as a wildcard.
|
||||
*/
|
||||
minor?: number;
|
||||
|
||||
/**
|
||||
* If set to true the device will scan for beacons and determine region state anytime
|
||||
* the device's screen is turned on or off. Useful for debugging.
|
||||
*/
|
||||
notifyEntryStateOnDisplay?: boolean;
|
||||
}
|
||||
|
||||
export interface CircularRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
*/
|
||||
identifier: string;
|
||||
|
||||
/**
|
||||
* The latitude of this region.
|
||||
*/
|
||||
latitude: number;
|
||||
|
||||
/**
|
||||
* The longitude of this region.
|
||||
*/
|
||||
longitude: number;
|
||||
|
||||
/**
|
||||
* The radius of the geofence for this region.
|
||||
*/
|
||||
radius: number;
|
||||
}
|
||||
|
||||
export type Region = BeaconRegion | CircularRegion;
|
||||
|
||||
export interface IBeaconPluginResult {
|
||||
|
||||
/**
|
||||
* The name of the delegate function that produced the PluginResult object.
|
||||
*/
|
||||
eventType: string;
|
||||
|
||||
/**
|
||||
* The region that triggered the event.
|
||||
*/
|
||||
region: Region;
|
||||
|
||||
/**
|
||||
* An array of beacon objects
|
||||
*/
|
||||
beacons: Beacon[];
|
||||
|
||||
/**
|
||||
* The status of the location permission for iOS.
|
||||
*/
|
||||
authorizationStatus: string;
|
||||
|
||||
/**
|
||||
* The state of the phone in relation to the region. Inside/outside for example.
|
||||
*/
|
||||
state: 'CLRegionStateInside' | 'CLRegionStateOutside';
|
||||
|
||||
/**
|
||||
* Error message, used only with monitoringDidFailForRegionWithError delegate.
|
||||
*/
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface IBeaconDelegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
* @returns {Observable<string>} Returns a string.
|
||||
*/
|
||||
didChangeAuthorizationStatus(): Observable<string>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the native layer is able to determine the device's state.
|
||||
*
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didDetermineStateForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone enters a region that it was asked to monitor.
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* 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<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didEnterRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone exits a region that it was asked to monitor.
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* 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<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
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<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didRangeBeaconsInRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins monitoring a region.
|
||||
*
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didStartMonitoringForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device fails to monitor a region.
|
||||
*
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
monitoringDidFailForRegionWithError(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins advertising as an iBeacon.
|
||||
*
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
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<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidUpdateState(): Observable<IBeaconPluginResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name IBeacon
|
||||
* @description
|
||||
* This plugin provides functions for working with iBeacons.
|
||||
*
|
||||
* The plugin's API closely mimics the one exposed through the [CLLocationManager](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html) introduced in iOS 7.
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { IBeacon } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Request permission to use location on iOS
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.Delegate();
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didRangeBeaconsInRegion: ', data),
|
||||
* error => console.error();
|
||||
* );
|
||||
* delegate.didStartMonitoringForRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didStartMonitoringForRegion: ', data),
|
||||
* error => console.error();
|
||||
* );
|
||||
* delegate.didEnterRegion()
|
||||
* .subscribe(
|
||||
* data => {
|
||||
* console.log('didEnterRegion: ', data);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* let beaconRegion = IBeacon.BeaconRegion('deskBeacon','F7826DA6-ASDF-ASDF-8024-BC5B71E0893E');
|
||||
*
|
||||
* IBeacon.startMonitoringForRegion(beaconRegion)
|
||||
* .then(
|
||||
* () => console.log('Native layer recieved the request to monitoring'),
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* Beacon
|
||||
* BeaconRegion
|
||||
* CircularRegion
|
||||
* IBeaconPluginResult
|
||||
* IBeaconDelegate
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IBeacon',
|
||||
plugin: 'cordova-plugin-ibeacon',
|
||||
pluginRef: 'cordova.plugins.locationManager',
|
||||
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
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 {IBeaconDelegate} An instance of the type {@type Delegate}.
|
||||
*/
|
||||
static Delegate(): IBeaconDelegate {
|
||||
let delegate = new cordova.plugins.locationManager.Delegate();
|
||||
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didChangeAuthorizationStatus = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didDetermineStateForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didEnterRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didExitRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didRangeBeaconsInRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didStartMonitoringForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.monitoringDidFailForRegionWithError = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidStartAdvertising = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidUpdateState = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
cordova.plugins.locationManager.setDelegate(delegate);
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new BeaconRegion
|
||||
*
|
||||
* @param {String} identifier @see {CLRegion}
|
||||
* @param {String} uuid The proximity ID of the beacon being targeted.
|
||||
* This value must not be blank nor invalid as a UUID.
|
||||
* @param {Number} major The major value that you use to identify one or more beacons.
|
||||
* @param {Number} minor The minor value that you use to identify a specific beacon.
|
||||
* @param {BOOL} notifyEntryStateOnDisplay
|
||||
*
|
||||
* @returns {BeaconRegion} Returns the BeaconRegion that was created
|
||||
*/
|
||||
static BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
|
||||
return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
static getDelegate(): IBeaconDelegate { return; }
|
||||
|
||||
/**
|
||||
* @param {IBeaconDelegate} delegate An instance of a delegate to register with the native layer.
|
||||
*
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
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 {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 {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 {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.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the request and started to send events.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static onDomDelegateReady(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Determines if bluetooth is switched on, according to the native layer.
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether bluetooth is active.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static isBluetoothEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Enables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static enableBluetooth(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Disables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static disableBluetooth(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Start monitoring the specified region.
|
||||
*
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* monitored for this application,
|
||||
* it will be removed from monitoring. For circular regions, the region
|
||||
* monitoring service will prioritize
|
||||
* regions by their size, favoring smaller regions over larger regions.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<string>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static startMonitoringForRegion(region: BeaconRegion): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for monitoring
|
||||
* with a different location manager object, during this or previous
|
||||
* launches of your application.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static stopMonitoringForRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Request state the for specified region. When result is ready
|
||||
* didDetermineStateForRegion is triggered. This can be any region,
|
||||
* also those which is not currently monitored.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static requestStateForRegion(region: Region): Promise<void> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Start ranging the specified beacon region.
|
||||
*
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* monitored for this application, it will be removed from monitoring.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in rangedRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static startRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for ranging
|
||||
* with a different location manager object, during this or previous
|
||||
* launches of your application.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in rangedRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static stopRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise which is resolved with the
|
||||
* requested authorization status.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static getAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* For iOS 8 and above only. The permission model has changed by Apple in iOS 8, making it necessary for apps to
|
||||
* explicitly request permissions via methods like these:
|
||||
* <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestWhenInUseAuthorization">requestWhenInUseAuthorization</a>
|
||||
* <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestAlwaysAuthorization">requestAlwaysAuthorization</a>
|
||||
*
|
||||
* If you are using this plugin on Android devices only, you will never have to use this, nor {@code requestAlwaysAuthorization}
|
||||
* @returns {Promise<void>} Returns a promise that is resolved when the request dialog is shown.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static requestWhenInUseAuthorization(): Promise<void> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* See the docuemntation of {@code requestWhenInUseAuthorization} for further details.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved when the native layer
|
||||
* shows the request dialog.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static requestAlwaysAuthorization(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<Region[]>} Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being monitored by the native layer.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static getMonitoredRegions(): Promise<Region[]> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<Region[]>} Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being ranged by the native layer.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static getRangedRegions(): Promise<Region[]> { return; }
|
||||
|
||||
/**
|
||||
* Determines if ranging is available or not, according to the native layer.
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether ranging is available or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static isRangingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Determines if region type is supported or not, according to the native layer.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be checked
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether the region type is supported or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static isMonitoringAvailableForClass(region: Region): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Start advertising the specified region.
|
||||
*
|
||||
* If a region a different identifier is already being advertised for
|
||||
* 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 {IBeaconDelegate.}
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be advertised
|
||||
* by the operating system.
|
||||
* @param {Integer} measuredPower: Optional parameter, if left empty, the device will
|
||||
* use it's own default value.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the advertising request.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static startAdvertising(region: Region, measuredPower: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop advertising as a beacon.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in isAdvertising.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop advertising.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static stopAdvertising(region: Region): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Determines if advertising is available or not, according to the native layer.
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is available or not.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static isAdvertisingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Determines if advertising is currently active, according to the native layer.
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is active.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static isAdvertising(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Disables debug logging in the native layer. Use this method if you want
|
||||
* to prevent this plugin from writing to the device logs.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static disableDebugLogs(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Enables the posting of debug notifications in the native layer. Use this method if you want
|
||||
* to allow the plugin the posting local notifications.
|
||||
* This can be very helpful when debugging how to apps behave when launched into the background.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to enabled.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static enableDebugNotifications(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Disables the posting of debug notifications in the native layer. Use this method if you want
|
||||
* to prevent the plugin from posting local notifications.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to disabled.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static disableDebugNotifications(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Enables debug logging in the native layer. Use this method if you want
|
||||
* a debug the inner workings of this plugin.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static enableDebugLogs(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Appends the provided [message] to the device logs.
|
||||
* Note: If debug logging is turned off, this won't do anything.
|
||||
*
|
||||
* @param {String} message The message to append to the device logs.
|
||||
*
|
||||
* @returns {Promise<void>} Returns a promise which is resolved with the log
|
||||
* message received by the native layer for appending. The returned message
|
||||
* is expected to be equivalent to the one provided in the original call.
|
||||
*/
|
||||
@Cordova({otherPromise: true})
|
||||
static appendToDeviceLog(message: string): Promise<void> { return; }
|
||||
|
||||
}
|
||||
@@ -1,20 +1,25 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface ImagePickerOptions {
|
||||
// max images to be selected, defaults to 15. If this is set to 1, upon
|
||||
// selection of a single image, the plugin will return it.
|
||||
maximumImagesCount?: number;
|
||||
/**
|
||||
* max images to be selected, defaults to 15. If this is set to 1, upon selection of a single image, the plugin will return it.
|
||||
*/
|
||||
maximumImagesCount?: number;
|
||||
|
||||
// max width and height to allow the images to be. Will keep aspect
|
||||
// ratio no matter what. So if both are 800, the returned image
|
||||
// will be at most 800 pixels wide and 800 pixels tall. If the width is
|
||||
// 800 and height 0 the image will be 800 pixels wide if the source
|
||||
// is at least that wide.
|
||||
width?: number;
|
||||
height?: number;
|
||||
/**
|
||||
* Max width to allow images to be
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* Max height to allow images to be
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
// quality of resized image, defaults to 100
|
||||
quality?: number;
|
||||
/**
|
||||
* Quality of images, defaults to 100
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,8 +31,8 @@ export interface ImagePickerOptions {
|
||||
* For more info, please see the https://github.com/wymsee/cordova-imagePicker
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {ImagePicker} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { ImagePicker } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -35,24 +40,45 @@ export interface ImagePickerOptions {
|
||||
* for (var i = 0; i < results.length; i++) {
|
||||
* console.log('Image URI: ' + results[i]);
|
||||
* }
|
||||
* }, (err) => {
|
||||
* });
|
||||
* }, (err) => { });
|
||||
* ```
|
||||
* @interfaces
|
||||
* ImagePickerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-image-picker',
|
||||
pluginName: 'ImagePicker',
|
||||
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||
pluginRef: 'window.imagePicker',
|
||||
repo: 'https://github.com/wymsee/cordova-imagePicker'
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker'
|
||||
})
|
||||
export class ImagePicker {
|
||||
/**
|
||||
* Pick pictures from the library.
|
||||
* @param {ImagePickerOptions} options
|
||||
* @return Returns a Promise that resolves the image file URI
|
||||
* @returns {Promise<any>} Returns a Promise that resolves the image file URI
|
||||
* otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getPictures(options: ImagePickerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if we have permission to read images
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that indicates whether we have permission
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static hasReadPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Request permission to read images
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static requestReadPermission(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
83
src/plugins/imageresizer.ts
Normal file
83
src/plugins/imageresizer.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface ImageResizerOptions {
|
||||
/**
|
||||
* The URI for the image on the device to get scaled
|
||||
*/
|
||||
uri: string;
|
||||
|
||||
/**
|
||||
* The width of the new image
|
||||
*/
|
||||
width: number;
|
||||
|
||||
/**
|
||||
* The height of the new image
|
||||
*/
|
||||
height: number;
|
||||
|
||||
/**
|
||||
* The name of the folder the image should be put
|
||||
* (Android only)
|
||||
*/
|
||||
folderName?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
* Quality given as Number for the quality of the new image
|
||||
* (Android and iOS only)
|
||||
*/
|
||||
quality?: number;
|
||||
|
||||
/**
|
||||
* A custom name for the file. Default name is a timestamp
|
||||
* (Android and Windows only)
|
||||
*/
|
||||
fileName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name ImageResizer
|
||||
* @description
|
||||
* Cordova Plugin For Image Resize
|
||||
*
|
||||
* Requires plugin `info.protonet.imageresizer` - use the Ionic CLI and type in the following command:
|
||||
* `ionic plugin add https://github.com/protonet/cordova-plugin-image-resizer.git`
|
||||
*
|
||||
* For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ImageResizer, ImageResizerOptions } from 'ionic-native';
|
||||
*
|
||||
* let options = {
|
||||
* uri: uri,
|
||||
* folderName: 'Protonet',
|
||||
* quality: 90,
|
||||
* width: 1280,
|
||||
* height: 1280
|
||||
* } as ImageResizerOptions;
|
||||
*
|
||||
* ImageResizer
|
||||
* .resize(options)
|
||||
* .then(
|
||||
* (filePath: string) => { console.log('FilePath', filePath); },
|
||||
* () => { console.log('Error occured'); }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ImageResizerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ImageResizer',
|
||||
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
|
||||
pluginRef: 'ImageResizer',
|
||||
repo: 'https://github.com/protonet/cordova-plugin-image-resizer'
|
||||
})
|
||||
export class ImageResizer {
|
||||
/**
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static resize(options: ImageResizerOptions): Promise<any> { return; }
|
||||
}
|
||||
@@ -1,85 +1,103 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
/** the URL that was loaded. */
|
||||
url: string;
|
||||
/** the error code, only in the case of loaderror. */
|
||||
code: number;
|
||||
/** the error message, only in the case of loaderror. */
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface InAppBrowserRef {
|
||||
/**
|
||||
* Adds a listener for an event from the InAppBrowser.
|
||||
* @param type the event to listen for
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
addEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/**
|
||||
* Removes a listener for an event from the InAppBrowser.
|
||||
* @param type The event to stop listening for.
|
||||
* loadstart: event fires when the InAppBrowser starts to load a URL.
|
||||
* loadstop: event fires when the InAppBrowser finishes loading a URL.
|
||||
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
|
||||
* exit: event fires when the InAppBrowser window is closed.
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
removeEventListener(type: string, callback: (event: InAppBrowserEvent) => void);
|
||||
|
||||
/** Closes the InAppBrowser window. */
|
||||
close();
|
||||
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
show();
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param callback The function that executes after the JavaScript code is injected.
|
||||
* If the injected script is of type code, the callback executes with
|
||||
* a single parameter, which is the return value of the script, wrapped in an Array.
|
||||
* For multi-line scripts, this is the return value of the last statement,
|
||||
* or the last expression evaluated.
|
||||
*/
|
||||
executeScript(script: {file?: string, code?: string}, callback?: (result?: any) => void);
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param css Details of the script to run, specifying either a file or code key.
|
||||
* @param callback The function that executes after the CSS is injected.
|
||||
*/
|
||||
insertCSS(css: {file?: string, code?: string}, callback?: () => void);
|
||||
}
|
||||
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser'
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
||||
* @param url The URL to load.
|
||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
||||
* 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.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }
|
||||
}
|
||||
import { Plugin, CordovaInstance } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
/** the URL that was loaded. */
|
||||
url: string;
|
||||
/** the error code, only in the case of loaderror. */
|
||||
code: number;
|
||||
/** the error message, only in the case of loaderror. */
|
||||
message: string;
|
||||
}
|
||||
/**
|
||||
* @name InAppBrowser
|
||||
* @description Launches in app Browser
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {InAppBrowser} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* let browser = new InAppBrowser('https://ionic.io', '_system');
|
||||
* browser.executeScript(...);
|
||||
* browser.insertCSS(...);
|
||||
* browser.close();
|
||||
* ```
|
||||
* @interfaces
|
||||
* InAppBrowserEvent
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'InAppBrowser',
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser',
|
||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser'
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
/**
|
||||
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
|
||||
* @param url The URL to load.
|
||||
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
|
||||
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
|
||||
* 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) {
|
||||
try {
|
||||
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
|
||||
} catch (e) {
|
||||
window.open(url);
|
||||
console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open, all instance methods will NOT work.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
show(): void { }
|
||||
|
||||
/**
|
||||
* Closes the InAppBrowser window.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
close(): void { }
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeScript(script: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param css {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; }
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
* @param {string} name of the event
|
||||
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
||||
*/
|
||||
on(event: string): Observable<InAppBrowserEvent> {
|
||||
return new Observable<InAppBrowserEvent>((observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
123
src/plugins/inapppurchase.ts
Normal file
123
src/plugins/inapppurchase.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name InAppPurchase
|
||||
* @description
|
||||
* A lightweight Cordova plugin for in app purchases on iOS/Android.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {InAppPurchase} from 'ionic-native';
|
||||
*
|
||||
* InAppPurchase
|
||||
* .getProducts(['com.yourapp.prod1', 'com.yourapp.prod2', ...])
|
||||
* .then((products) => {
|
||||
* console.log(products);
|
||||
* // [{ productId: 'com.yourapp.prod1', 'title': '...', description: '...', price: '...' }, ...]
|
||||
* })
|
||||
* .catch((err) => {
|
||||
* console.log(err);
|
||||
* });
|
||||
*
|
||||
*
|
||||
* InAppPurchase
|
||||
* .buy('com.yourapp.prod1')
|
||||
* .then((data)=> {
|
||||
* console.log(data);
|
||||
* // {
|
||||
* // transactionId: ...
|
||||
* // receipt: ...
|
||||
* // signature: ...
|
||||
* // }
|
||||
* })
|
||||
* .catch((err)=> {
|
||||
* console.log(err);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* ```ts
|
||||
* // fist buy the product...
|
||||
* InAppPurchase
|
||||
* .buy('com.yourapp.consumable_prod1')
|
||||
* .then(data => InAppPurchase.consume(data.productType, data.receipt, data.signature))
|
||||
* .then(() => console.log('product was successfully consumed!'))
|
||||
* .catch( err=> console.log(err))
|
||||
* ```
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'InAppPurchase',
|
||||
plugin: 'cordova-plugin-inapppurchase',
|
||||
pluginRef: 'inAppPurchase',
|
||||
platforms: ['Android', 'iOS'],
|
||||
repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase'
|
||||
})
|
||||
export class InAppPurchase {
|
||||
|
||||
/**
|
||||
* Retrieves a list of full product data from Apple/Google. This method must be called before making purchases.
|
||||
* @param {array<string>} productId an array of product ids.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with an array of objects.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
static getProducts(productId: string[]): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Buy a product that matches the productId.
|
||||
* @param {string} productId A string that matches the product you want to buy.
|
||||
* @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
static buy(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
||||
|
||||
/**
|
||||
* Same as buy, but for subscription based products.
|
||||
* @param {string} productId A string that matches the product you want to subscribe to.
|
||||
* @returns {Promise<{transactionId: string, receipt: string, signature: string, productType: string}>} Returns a Promise that resolves with the transaction details.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
static subscribe(productId: string): Promise<{transactionId: string, receipt: string, signature: string, productType: string}> { return; }
|
||||
|
||||
/**
|
||||
* Call this function after purchasing a "consumable" product to mark it as consumed. On Android, you must consume products that you want to let the user purchase multiple times. If you will not consume the product after a purchase, the next time you will attempt to purchase it you will get the error message:
|
||||
* @param {string} productType
|
||||
* @param {string} receipt
|
||||
* @param {string} signature
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
static consume(productType: string, receipt: string, signature: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Restore all purchases from the store
|
||||
* @returns {Promise<any>} Returns a promise with an array of purchases.
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
static restorePurchases(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the receipt.
|
||||
* @returns {Promise<string>} Returns a promise that contains the string for the receipt
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true,
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static getReceipt(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Insomnia
|
||||
@@ -6,8 +7,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
* Prevent the screen of the mobile device from falling asleep.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Insomnia} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Insomnia } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Insomnia.keepAwake()
|
||||
* .then(
|
||||
@@ -24,6 +26,7 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Insomnia',
|
||||
plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git',
|
||||
pluginRef: 'plugins.insomnia',
|
||||
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
|
||||
@@ -33,15 +36,16 @@ export class Insomnia {
|
||||
|
||||
/**
|
||||
* Keeps awake the application
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static keepAwake(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Allows the application to sleep again
|
||||
* @returns {Promise}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static allowSleepAgain(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
58
src/plugins/instagram.ts
Normal file
58
src/plugins/instagram.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Instagram
|
||||
* @description Share a photo with the instagram app
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {Instagram} from 'ionic-native';
|
||||
*
|
||||
* Instagram.share('data:image/png;uhduhf3hfif33', 'Caption')
|
||||
* .then(() => console.log('Shared!'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Instagram',
|
||||
plugin: 'cordova-instagram-plugin',
|
||||
pluginRef: 'Instagram',
|
||||
repo: 'https://github.com/vstirbu/InstagramPlugin'
|
||||
})
|
||||
export class Instagram {
|
||||
|
||||
/**
|
||||
* Detect if the Instagram application is installed on the device.
|
||||
*
|
||||
* @returns {Promise<boolean|string>} Returns a promise that returns a boolean value if installed, or the app version on android
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
static isInstalled(): Promise<boolean|string> { return; }
|
||||
|
||||
/**
|
||||
* Share an image on Instagram
|
||||
* Note: Instagram app stopped accepting pre-filled captions on both iOS and Android. As a work-around, the caption is copied to the clipboard. You have to inform your users to paste the caption.
|
||||
*
|
||||
* @param canvasIdOrDataUrl The canvas element id or the dataURL of the image to share
|
||||
* @param caption The caption of the image
|
||||
* @returns {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
static share(canvasIdOrDataUrl: string, caption?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Share a library asset or video
|
||||
* @param assetLocalIdentifier A local fileURI
|
||||
* @returns {Promise<any>} Returns a promise that resolves if the image was shared
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static shareAsset(assetLocalIdentifier: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
36
src/plugins/is-debug.ts
Normal file
36
src/plugins/is-debug.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name IsDebug
|
||||
* @description
|
||||
* Detect if the app is running in debug mode or not.
|
||||
* Debug mode is when the app is built and installed locally via xcode / eclipse / the cordova cli etc, compared to release mode when the app was downloaded from the app / play store via an end user.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {IsDebug} from 'ionic-native';
|
||||
*
|
||||
* IsDebug.getIsDebug()
|
||||
* .then((isDebug: boolean) => console.log('Is debug:', isDebug))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IsDebug',
|
||||
plugin: 'cordova-plugin-is-debug',
|
||||
pluginRef: 'cordova.plugins.IsDebug',
|
||||
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
|
||||
})
|
||||
export class IsDebug {
|
||||
|
||||
/**
|
||||
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIsDebug(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Keyboard} from 'ionic-native';
|
||||
* ```typescript
|
||||
* import { Keyboard } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Keyboard',
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
|
||||
@@ -23,9 +25,8 @@ export class Keyboard {
|
||||
* Hide the keyboard accessory bar with the next, previous and done buttons.
|
||||
* @param hide {boolean}
|
||||
*/
|
||||
static hideKeyboardAccessoryBar(hide: boolean): void {
|
||||
console.log('hideKeyboardAccessoryBar method has been removed temporarily.');
|
||||
}
|
||||
@Cordova({sync: true})
|
||||
static hideKeyboardAccessoryBar(hide: boolean): void { }
|
||||
|
||||
/**
|
||||
* Force keyboard to be shown.
|
||||
@@ -34,7 +35,7 @@ export class Keyboard {
|
||||
sync: true,
|
||||
platforms: ['Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static show(): void {}
|
||||
static show(): void { }
|
||||
|
||||
/**
|
||||
* Close the keyboard if open.
|
||||
@@ -43,7 +44,7 @@ export class Keyboard {
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static close(): void {}
|
||||
static close(): void { }
|
||||
|
||||
/**
|
||||
* Prevents the native UIScrollView from moving when an input is focused.
|
||||
@@ -53,26 +54,28 @@ export class Keyboard {
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Windows']
|
||||
})
|
||||
static disableScroll(disable: boolean): void {}
|
||||
static disableScroll(disable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardshow',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static onKeyboardShow(): Observable<any> {return; }
|
||||
static onKeyboardShow(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardhide',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
})
|
||||
static onKeyboardHide(): Observable<any> {return; }
|
||||
static onKeyboardHide(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
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,49 +1,60 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
/**
|
||||
* iOS, Android, Windows
|
||||
* If true, the plugin will NOT attempt to use the geolocation plugin to determine the current device position when the start location parameter is omitted. Defaults to false.
|
||||
* name of the navigation app to use for directions. Specify using launchnavigator.APP constants. If not specified, defaults to User Selection.
|
||||
*/
|
||||
disableAutoGeolocation?: boolean;
|
||||
app?: string;
|
||||
|
||||
/**
|
||||
* nickname to display in app for destination. e.g. "Bob's House".
|
||||
*/
|
||||
destinationName?: string;
|
||||
|
||||
/**
|
||||
* Start point of the navigation
|
||||
*/
|
||||
start?: string | number[];
|
||||
|
||||
/**
|
||||
* nickname to display in app for start . e.g. "My House".
|
||||
*/
|
||||
startName?: string;
|
||||
|
||||
/**
|
||||
* iOS, Android, Windows
|
||||
* Transportation mode for navigation: "driving", "walking" or "transit". Defaults to "driving" if not specified.
|
||||
*/
|
||||
transportMode?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If true, plugin will attempt to launch Google Maps instead of Apple Maps. If Google Maps is not available, it will fall back to Apple Maps.
|
||||
*/
|
||||
preferGoogleMaps?: boolean;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If using Google Maps and the app has a URL scheme, passing this to Google Maps will display a button which returns to the app.
|
||||
*/
|
||||
urlScheme?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If using Google Maps with a URL scheme, this specifies the text of the button in Google Maps which returns to the app. Defaults to "Back" if not specified.
|
||||
*/
|
||||
backButtonText?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If true, debug log output will be generated by the plugin. Defaults to false.
|
||||
*/
|
||||
enableDebug?: boolean;
|
||||
|
||||
/**
|
||||
* Android
|
||||
* Navigation mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified.
|
||||
* a key/value map of extra app-specific parameters. For example, to tell Google Maps on Android to display Satellite view in "maps" launch mode: `{"t": "k"}`
|
||||
*/
|
||||
navigationMode?: string;
|
||||
extras?: any;
|
||||
|
||||
/**
|
||||
* (Android only) mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified. Specify using launchnavigator.LAUNCH_MODE constants.
|
||||
*/
|
||||
launchMode?: string;
|
||||
|
||||
/**
|
||||
* text to display in the native picker which enables user to select which navigation app to launch. Defaults to "Select app for navigation" if not specified.
|
||||
*/
|
||||
appSelectionDialogHeader?: string;
|
||||
|
||||
/**
|
||||
* text to display for the cancel button in the native picker which enables user to select which navigation app to launch. Defaults to "Cancel" if not specified.
|
||||
*/
|
||||
appSelectionCancelButton?: string;
|
||||
|
||||
successCallback?: Function;
|
||||
|
||||
errorCallback?: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,19 +63,27 @@ export interface LaunchNavigatorOptions {
|
||||
* Requires Cordova plugin: uk.co.workingedge.phonegap.plugin.launchnavigator. For more info, please see the [LaunchNavigator plugin docs](https://github.com/dpa99c/phonegap-launch-navigator).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {LaunchNavigator} from 'ionic-native';
|
||||
* Please refer to the plugin's repo for detailed usage. This docs page only explains the Native wrapper.
|
||||
*
|
||||
* ```typescript
|
||||
* import { LaunchNavigator, LaunchNavigatorOptions } from 'ionic-native';
|
||||
*
|
||||
* let options: LaunchNavigatorOptions = {
|
||||
* start: 'London, ON',
|
||||
* app: LaunchNavigator.APPS.UBER
|
||||
* };
|
||||
*
|
||||
* LaunchNavigator.navigate("Toronto, ON", "London, ON")
|
||||
* LaunchNavigator.navigate('Toronto, ON', options)
|
||||
* .then(
|
||||
* success => console.log("Launched navigator"),
|
||||
* error => console.log("Error launching navigator", error)
|
||||
* success => console.log('Launched navigator'),
|
||||
* error => console.log('Error launching navigator', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* LaunchNavigatorOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LaunchNavigator',
|
||||
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
|
||||
pluginRef: 'launchnavigator',
|
||||
repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git'
|
||||
@@ -73,19 +92,131 @@ export class LaunchNavigator {
|
||||
|
||||
/**
|
||||
* Launches navigator app
|
||||
* @param destination Location name or coordinates
|
||||
* @param start Location name or coordinates
|
||||
* @param options
|
||||
* @param destination {string|number[]} Location name or coordinates (as string or array)
|
||||
* @param options {LaunchNavigatorOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static navigate(
|
||||
destination: any,
|
||||
start: any = null,
|
||||
destination: string | number[],
|
||||
options?: LaunchNavigatorOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determines if the given app is installed and available on the current device.
|
||||
* @param app {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAppAvailable(app: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns a list indicating which apps are installed and available on the current device.
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
static availableApps(): Promise<string[]> { return; }
|
||||
|
||||
/**
|
||||
* Returns the display name of the specified app.
|
||||
* @param app {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getAppDisplayName(app: string): string { return; }
|
||||
|
||||
/**
|
||||
* Returns list of supported apps on a given platform.
|
||||
* @param platform {string}
|
||||
* @returns {string[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getAppsForPlatform(platform: string): string[] { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of transport mode.
|
||||
* @param app {string} specified as a string, you can use one of the constants, e.g `LaunchNavigator.APP.GOOGLE_MAPS`
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsTransportMode(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Returns the list of transport modes supported by an app on a given platform.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {string[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static getTransportModes(app: string, platform: string): string[] { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of launch mode.
|
||||
* Note that currently only Google Maps on Android does.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsLaunchMode(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of start location.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsStart(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsStartName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static supportsDestName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param destination {string | number[]}
|
||||
* @param options {LaunchNavigatorOptions}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
|
||||
|
||||
static APP: any = {
|
||||
USER_SELECT: 'user_select',
|
||||
APPLE_MAPS: 'apple_maps',
|
||||
GOOGLE_MAPS: 'google_maps',
|
||||
WAZE: 'waze',
|
||||
CITYMAPPER: 'citymapper',
|
||||
NAVIGON: 'navigon',
|
||||
TRANSIT_APP: 'transit_app',
|
||||
YANDEX: 'yandex',
|
||||
UBER: 'uber',
|
||||
TOMTOM: 'tomtom',
|
||||
BING_MAPS: 'bing_maps',
|
||||
SYGIC: 'sygic',
|
||||
HERE_MAPS: 'here_maps',
|
||||
MOOVIT: 'moovit'
|
||||
};
|
||||
|
||||
static TRANSPORT_MODE: any = {
|
||||
DRIVING: 'driving',
|
||||
WALKING: 'walking',
|
||||
BICYCLING: 'bicycling',
|
||||
TRANSIT: 'transit'
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,198 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* @name Local Notifications
|
||||
* @description
|
||||
* This plugin allows you to display local notifications on the device
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {LocalNotifications} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: "Single Notification",
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf'
|
||||
* data: { secret: key }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: "Multi Notification 1",
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: "Local Notification Example",
|
||||
* text: "Multi Notification 2",
|
||||
* icon: "http://example.com/icon.png"
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: "Delayed Notification",
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: "FF0000",
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
|
||||
})
|
||||
export class LocalNotifications {
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: Notification|Array<Notification>): void {}
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: Notification): void {}
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(notificationId: any): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Clears all notifications
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static clearAll(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Cancels single or multiple notifications
|
||||
* @param notificationId A single notification id, or an array of notification ids.
|
||||
*/
|
||||
@Cordova()
|
||||
static cancel(notificationId: any): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Cancels all notifications
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static cancelAll(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Checks presence of a notification
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isPresent (notificationId: number): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Checks is a notification is scheduled
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isScheduled (notificationId: number): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Checks if a notification is triggered
|
||||
* @param notificationId
|
||||
*/
|
||||
@Cordova()
|
||||
static isTriggered (notificationId: number): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Get all the notification ids
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllIds (): Promise<Array<number>> {return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggeredIds (): Promise<Array<number>> {return; }
|
||||
|
||||
/**
|
||||
* Get the ids of scheduled notifications
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduledIds (): Promise<Array<number>> {return; }
|
||||
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static get (notificationId: any): Promise <Notification> {return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled (notificationId: any): Promise <Notification> {return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered (notificationId: any): Promise <Notification> {return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<Notification>> {return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<Notification>> {return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<Notification>> {return; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
export interface ILocalNotification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
@@ -274,3 +82,227 @@ export interface Notification {
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
* @description
|
||||
* This plugin allows you to display local notifications on the device
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { LocalNotifications } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: 'Single ILocalNotification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret: key }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: 'Multi ILocalNotification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: 'Local ILocalNotification Example',
|
||||
* text: 'Multi ILocalNotification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: 'Delayed ILocalNotification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* ILocalNotification
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
|
||||
})
|
||||
export class LocalNotifications {
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options {Notification | Array<ILocalNotification>} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options {ILocalNotification} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: ILocalNotification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
* @param notificationId {any} A single notification id, or an array of notification ids.
|
||||
* @returns {Promise<any>} Returns a promise when the notification had been cleared
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications have cleared
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels single or multiple notifications
|
||||
* @param notificationId {any} A single notification id, or an array of notification ids.
|
||||
* @returns {Promise<any>} Returns a promise when the notification is canceled
|
||||
*/
|
||||
@Cordova()
|
||||
static cancel(notificationId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancels all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications are canceled
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
static cancelAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks presence of a notification
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isPresent(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks is a notification is scheduled
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isScheduled(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if a notification is triggered
|
||||
* @param notificationId {number}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isTriggered(notificationId: number): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Get all the notification ids
|
||||
* @returns {Promise<Array<number>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
* @returns {Promise<Array<number>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggeredIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of scheduled notifications
|
||||
* @returns {Promise<Array<number>>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduledIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Informs if the app has the permission to show notifications.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<boolean> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
68
src/plugins/location-accuracy.ts
Normal file
68
src/plugins/location-accuracy.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* @name LocationAccuracy
|
||||
* @description
|
||||
* This Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog from within the app, avoiding the need for the user to leave your app to change location settings manually.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { LocationAccuracy } from 'ionic-native';
|
||||
*
|
||||
* LocationAccuracy.canRequest().then((canRequest: boolean) => {
|
||||
*
|
||||
* if(canRequest) {
|
||||
* // the accuracy option will be ignored by iOS
|
||||
* LocationAccuracy.request(LocationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(
|
||||
* () => console.log('Request successful'),
|
||||
* error => console.log('Error requesting location permissions', error)
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocationAccuracy',
|
||||
plugin: 'cordova-plugin-request-location-accuracy',
|
||||
pluginRef: 'cordova.plugins.locationAccuracy',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'
|
||||
})
|
||||
export class LocationAccuracy {
|
||||
/**
|
||||
* Indicates if you can request accurate location
|
||||
* @returns {Promise<boolean>} Returns a promise that resovles with a boolean that indicates if you can request accurate location
|
||||
*/
|
||||
@Cordova()
|
||||
static canRequest(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if a request is currently in progress
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that indicates if a request is currently in progress
|
||||
*/
|
||||
@Cordova()
|
||||
static isRequesting(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests accurate location
|
||||
* @param accuracy {number} Accuracy, from 0 to 4. You can use the static properties of this class that start with REQUEST_PRIORITY_
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects if an error occurred
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse' })
|
||||
static request(accuracy: number): Promise<any> { return; }
|
||||
|
||||
static REQUEST_PRIORITY_NO_POWER = 0;
|
||||
static REQUEST_PRIORITY_LOW_POWER = 1;
|
||||
static REQUEST_PRIORITY_BALANCED_POWER_ACCURACY = 2;
|
||||
static REQUEST_PRIORITY_HIGH_ACCURACY = 3;
|
||||
static SUCCESS_SETTINGS_SATISFIED = 0;
|
||||
static SUCCESS_USER_AGREED = 1;
|
||||
static ERROR_ALREADY_REQUESTING = -1;
|
||||
static ERROR_INVALID_ACTION = 0;
|
||||
static ERROR_INVALID_ACCURACY = 1;
|
||||
static ERROR_EXCEPTION = 1;
|
||||
static ERROR_CANNOT_CHANGE_ACCURACY = 3;
|
||||
static ERROR_USER_DISAGREED = 4;
|
||||
static ERROR_GOOGLE_API_CONNECTION_FAILED = 4;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user