mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
154 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78fcdc8d80 | ||
|
|
53f7056b16 | ||
|
|
b7701cdb16 | ||
|
|
94a4519f2b | ||
|
|
6fe52b610b | ||
|
|
434a6c8ad3 | ||
|
|
97489ba573 | ||
|
|
f525a25b49 | ||
|
|
add49e8b4d | ||
|
|
4ab87d8abb | ||
|
|
69ff7afb48 | ||
|
|
62a30c7d8f | ||
|
|
dc37d8f71c | ||
|
|
8864d1360a | ||
|
|
613141998a | ||
|
|
c2fbb4fb64 | ||
|
|
f0cf86076c | ||
|
|
a03afcf0fa | ||
|
|
3abe0bb97d | ||
|
|
a5b4632ceb | ||
|
|
1c78f77c0f | ||
|
|
cb7d3ef3e0 | ||
|
|
5e83a09056 | ||
|
|
b85393de89 | ||
|
|
68c535fd79 | ||
|
|
1c09ee1fbc | ||
|
|
8b921165bb | ||
|
|
0c837de499 | ||
|
|
a44500d206 | ||
|
|
e063613c8c | ||
|
|
416071a5a1 | ||
|
|
93fdb7eabb | ||
|
|
466437a683 | ||
|
|
a34723b53c | ||
|
|
b9bd5100a2 | ||
|
|
51bafccf38 | ||
|
|
c3127d35bb | ||
|
|
1322c1b089 | ||
|
|
9bf7895386 | ||
|
|
538dcb98eb | ||
|
|
3da0efe38e | ||
|
|
b983de2145 | ||
|
|
9f98f8ef46 | ||
|
|
3e2964b385 | ||
|
|
77ab2c21da | ||
|
|
94025a7fd2 | ||
|
|
8c021bcaa0 | ||
|
|
da7a3707fa | ||
|
|
cb293639bc | ||
|
|
16f0712462 | ||
|
|
e9b2b93486 | ||
|
|
a8258ec998 | ||
|
|
09747cd746 | ||
|
|
2f89ae0e84 | ||
|
|
ac748abf78 | ||
|
|
1279114b73 | ||
|
|
7c30718369 | ||
|
|
9c75a06131 | ||
|
|
1e38a6c005 | ||
|
|
23639ee859 | ||
|
|
be20c51996 | ||
|
|
1615b74065 | ||
|
|
5638f90783 | ||
|
|
47b6164e99 | ||
|
|
229f5509e9 | ||
|
|
70c15c31ca | ||
|
|
a98ccc726f | ||
|
|
538ebfe9fe | ||
|
|
8e98481609 | ||
|
|
0ec46b03b5 | ||
|
|
f10f152d2c | ||
|
|
d746a98ef4 | ||
|
|
dbf95ea4bd | ||
|
|
911537b61b | ||
|
|
db55342329 | ||
|
|
d54ce83c8f | ||
|
|
2e926f4a94 | ||
|
|
292a9f08e9 | ||
|
|
b2cd106aae | ||
|
|
ab681cccbe | ||
|
|
9008aa264b | ||
|
|
33ca56a151 | ||
|
|
d8892e195b | ||
|
|
0ab14a085e | ||
|
|
a88cf7034b | ||
|
|
c44071d117 | ||
|
|
fb275e0d9f | ||
|
|
5c7d7ac527 | ||
|
|
1134ac96b6 | ||
|
|
e902856089 | ||
|
|
67adb23a14 | ||
|
|
028a568515 | ||
|
|
7a8d30f4e1 | ||
|
|
9541009742 | ||
|
|
9dee2fbc0c | ||
|
|
60b9c69763 | ||
|
|
b98fa28b4b | ||
|
|
603aa9f6d2 | ||
|
|
f4fa8c31f0 | ||
|
|
8e787fdd5f | ||
|
|
c5ec7c33b5 | ||
|
|
c6dbf343fb | ||
|
|
fa311e6a7c | ||
|
|
04347c3df8 | ||
|
|
8adb36e2a0 | ||
|
|
c700c31127 | ||
|
|
5981622f3a | ||
|
|
77d6308bca | ||
|
|
92e0bb55c3 | ||
|
|
452aa5d8c9 | ||
|
|
2ddb8be775 | ||
|
|
ebf07161b6 | ||
|
|
6ddd2aa184 | ||
|
|
9974a1fbd8 | ||
|
|
67edb835f2 | ||
|
|
5b6cb6e19f | ||
|
|
9a5a62bc3a | ||
|
|
d192dee1ee | ||
|
|
0d6997cbdd | ||
|
|
49325e8b93 | ||
|
|
de07df6f20 | ||
|
|
ca60c5b912 | ||
|
|
54d1a9891b | ||
|
|
2c57bc965c | ||
|
|
d62779a2a6 | ||
|
|
009a20608e | ||
|
|
ca14bf6a75 | ||
|
|
49fe24dee2 | ||
|
|
d9d89341d2 | ||
|
|
bbf75bcbd7 | ||
|
|
9441928884 | ||
|
|
8eb656cce8 | ||
|
|
bf0486cb8b | ||
|
|
e681761f56 | ||
|
|
84ec3fa8d2 | ||
|
|
c618ceb693 | ||
|
|
46a9b6d50d | ||
|
|
44fe04bbbd | ||
|
|
3385c1b6dc | ||
|
|
a1b0f885a7 | ||
|
|
56e8eaeb5d | ||
|
|
ba77fd70c3 | ||
|
|
1841220359 | ||
|
|
c44fb75adc | ||
|
|
ad6badef1f | ||
|
|
7bcf1bfc74 | ||
|
|
0c36988544 | ||
|
|
71e49da8ad | ||
|
|
c28df732d5 | ||
|
|
d5dfdf83f3 | ||
|
|
3fdc4a8acd | ||
|
|
db99482157 | ||
|
|
bab2971c58 | ||
|
|
93696d53f7 |
192
CHANGELOG.md
192
CHANGELOG.md
@@ -1,3 +1,192 @@
|
||||
<a name="2.5.1"></a>
|
||||
## [2.5.1](https://github.com/driftyco/ionic-native/compare/v2.5.0...v2.5.1) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **pin-dialog:** add missing errorIndex ([b7701cd](https://github.com/driftyco/ionic-native/commit/b7701cd))
|
||||
|
||||
|
||||
|
||||
<a name="2.5.0"></a>
|
||||
# [2.5.0](https://github.com/driftyco/ionic-native/compare/v2.4.1...v2.5.0) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **file-transfer:** fix return type of upload method ([a5b4632](https://github.com/driftyco/ionic-native/commit/a5b4632)), closes [#1002](https://github.com/driftyco/ionic-native/issues/1002)
|
||||
* **pinterest:** fix PinterestPin interface ([a03afcf](https://github.com/driftyco/ionic-native/commit/a03afcf))
|
||||
* **safari-view-controller:** fix issue caused by calling show without options ([dc37d8f](https://github.com/driftyco/ionic-native/commit/dc37d8f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add missing properties for Android ([f0cf860](https://github.com/driftyco/ionic-native/commit/f0cf860))
|
||||
* **barcodescanner:** add option disableSuccessBeep ([#1035](https://github.com/driftyco/ionic-native/issues/1035)) ([97489ba](https://github.com/driftyco/ionic-native/commit/97489ba))
|
||||
* **inappbrowser:** add hide function ([#1018](https://github.com/driftyco/ionic-native/issues/1018)) ([4ab87d8](https://github.com/driftyco/ionic-native/commit/4ab87d8))
|
||||
|
||||
|
||||
|
||||
<a name="2.4.1"></a>
|
||||
## [2.4.1](https://github.com/driftyco/ionic-native/compare/v2.4.0...v2.4.1) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **screen-orientation:** lockOrientation returns a promise ([1c09ee1](https://github.com/driftyco/ionic-native/commit/1c09ee1)), closes [#939](https://github.com/driftyco/ionic-native/issues/939)
|
||||
|
||||
|
||||
|
||||
<a name="2.4.0"></a>
|
||||
# [2.4.0](https://github.com/driftyco/ionic-native/compare/v2.3.3...v2.4.0) (2017-01-24)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.3"></a>
|
||||
## [2.3.3](https://github.com/driftyco/ionic-native/compare/v2.3.2...v2.3.3) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** fix event listeners ([416071a](https://github.com/driftyco/ionic-native/commit/416071a)), closes [#999](https://github.com/driftyco/ionic-native/issues/999)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pinterest:** add pinterest plugin ([466437a](https://github.com/driftyco/ionic-native/commit/466437a))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.2"></a>
|
||||
## [2.3.2](https://github.com/driftyco/ionic-native/compare/v2.3.1...v2.3.2) (2017-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** fix GoogleMapsLaLngBounds ([c3127d3](https://github.com/driftyco/ionic-native/commit/c3127d3)), closes [#972](https://github.com/driftyco/ionic-native/issues/972)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.1"></a>
|
||||
## [2.3.1](https://github.com/driftyco/ionic-native/compare/v2.3.0...v2.3.1) (2017-01-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add clearAllNotifications() ([8c021bc](https://github.com/driftyco/ionic-native/commit/8c021bc))
|
||||
* **battery-status:** add missing pluginRef ([3da0efe](https://github.com/driftyco/ionic-native/commit/3da0efe))
|
||||
* **core:** fix exception in CordovaProperty ([#998](https://github.com/driftyco/ionic-native/issues/998)) ([cb29363](https://github.com/driftyco/ionic-native/commit/cb29363)), closes [#992](https://github.com/driftyco/ionic-native/issues/992)
|
||||
* **core:** fix plugin check ([da7a370](https://github.com/driftyco/ionic-native/commit/da7a370))
|
||||
* **plugin:** adds subscribe() and unsubscribe() ([94025a7](https://github.com/driftyco/ionic-native/commit/94025a7))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** add PluginConfig interface ([b983de2](https://github.com/driftyco/ionic-native/commit/b983de2)), closes [#996](https://github.com/driftyco/ionic-native/issues/996)
|
||||
* **google-maps:** add base class functions ([#993](https://github.com/driftyco/ionic-native/issues/993)) ([9f98f8e](https://github.com/driftyco/ionic-native/commit/9f98f8e))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.0"></a>
|
||||
# [2.3.0](https://github.com/driftyco/ionic-native/compare/v2.2.17...v2.3.0) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **native-geocoder:** fix callback order ([dbf95ea](https://github.com/driftyco/ionic-native/commit/dbf95ea))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **backlight:** add Backlight plugin ([#973](https://github.com/driftyco/ionic-native/issues/973)) ([1279114](https://github.com/driftyco/ionic-native/commit/1279114))
|
||||
* **broadcaster:** add Broadcaster plugin ([#877](https://github.com/driftyco/ionic-native/issues/877)) ([1e38a6c](https://github.com/driftyco/ionic-native/commit/1e38a6c))
|
||||
* **fingerprint-aio:** add cordova-plugin-fingerprint-aio ([#845](https://github.com/driftyco/ionic-native/issues/845)) ([1615b74](https://github.com/driftyco/ionic-native/commit/1615b74))
|
||||
* **firebase:** add firebase plugin ([#914](https://github.com/driftyco/ionic-native/issues/914)) ([8e98481](https://github.com/driftyco/ionic-native/commit/8e98481)), closes [#608](https://github.com/driftyco/ionic-native/issues/608)
|
||||
* **launch-review:** add LaunchReview plugin ([#949](https://github.com/driftyco/ionic-native/issues/949)) ([9c75a06](https://github.com/driftyco/ionic-native/commit/9c75a06))
|
||||
* **nativegeocoder:** add NativeGeocoder plugin ([#800](https://github.com/driftyco/ionic-native/issues/800)) ([911537b](https://github.com/driftyco/ionic-native/commit/911537b))
|
||||
* **navigationbar:** add NavigationBar plugin ([#826](https://github.com/driftyco/ionic-native/issues/826)) ([70c15c3](https://github.com/driftyco/ionic-native/commit/70c15c3))
|
||||
* **rollbar:** add Rollbar plugin ([#832](https://github.com/driftyco/ionic-native/issues/832)) ([229f550](https://github.com/driftyco/ionic-native/commit/229f550))
|
||||
* **serial:** add Serial plugin ([#952](https://github.com/driftyco/ionic-native/issues/952)) ([ac748ab](https://github.com/driftyco/ionic-native/commit/ac748ab))
|
||||
* **speech-recognition:** add SpeechRecognition plugin ([#897](https://github.com/driftyco/ionic-native/issues/897)) ([7c30718](https://github.com/driftyco/ionic-native/commit/7c30718))
|
||||
* **stripe:** add stripe plugin ([#913](https://github.com/driftyco/ionic-native/issues/913)) ([0ec46b0](https://github.com/driftyco/ionic-native/commit/0ec46b0))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.17"></a>
|
||||
## [2.2.17](https://github.com/driftyco/ionic-native/compare/v2.2.16...v2.2.17) (2017-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **app-rate:** onRateDialogShow callback ([#985](https://github.com/driftyco/ionic-native/issues/985)) ([ab681cc](https://github.com/driftyco/ionic-native/commit/ab681cc))
|
||||
* **core:** increase deviceready timeout for sanity ([0ab14a0](https://github.com/driftyco/ionic-native/commit/0ab14a0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **barcodescanner:** add missing options ([#966](https://github.com/driftyco/ionic-native/issues/966)) ([e902856](https://github.com/driftyco/ionic-native/commit/e902856)), closes [#965](https://github.com/driftyco/ionic-native/issues/965)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.16"></a>
|
||||
## [2.2.16](https://github.com/driftyco/ionic-native/compare/v2.2.15...v2.2.16) (2017-01-11)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.15"></a>
|
||||
## [2.2.15](https://github.com/driftyco/ionic-native/compare/v2.2.14...v2.2.15) (2017-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **apprate:** captialize URL in storeAppURL property ([b98fa28](https://github.com/driftyco/ionic-native/commit/b98fa28))
|
||||
* **ble:** stopScan takes no args when used as clear function ([#944](https://github.com/driftyco/ionic-native/issues/944)) ([6ddd2aa](https://github.com/driftyco/ionic-native/commit/6ddd2aa))
|
||||
* **onesignal:** OSNotification.app_id is optional ([#946](https://github.com/driftyco/ionic-native/issues/946)) ([ebf0716](https://github.com/driftyco/ionic-native/commit/ebf0716))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.14"></a>
|
||||
## [2.2.14](https://github.com/driftyco/ionic-native/compare/v2.2.13...v2.2.14) (2017-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** fix startTrackerWithId when interval is not provided ([49fe24d](https://github.com/driftyco/ionic-native/commit/49fe24d))
|
||||
* **google-plus:** fixes login without options ([ca14bf6](https://github.com/driftyco/ionic-native/commit/ca14bf6)), closes [#932](https://github.com/driftyco/ionic-native/issues/932)
|
||||
* **inappbrowser:** fix insertCSS method name ([de07df6](https://github.com/driftyco/ionic-native/commit/de07df6)), closes [#921](https://github.com/driftyco/ionic-native/issues/921)
|
||||
* **mixpanel:** fix issue when not passing eventProperties ([#927](https://github.com/driftyco/ionic-native/issues/927)) ([bbf75bc](https://github.com/driftyco/ionic-native/commit/bbf75bc))
|
||||
* **nfc:** add missing param for addMimeTypeListener ([#937](https://github.com/driftyco/ionic-native/issues/937)) ([ca60c5b](https://github.com/driftyco/ionic-native/commit/ca60c5b))
|
||||
* **push:** fix typing for additionalData ([0d6997c](https://github.com/driftyco/ionic-native/commit/0d6997c)), closes [#868](https://github.com/driftyco/ionic-native/issues/868)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add altitudeAccuracy into response typings ([#922](https://github.com/driftyco/ionic-native/issues/922)) ([8eb656c](https://github.com/driftyco/ionic-native/commit/8eb656c))
|
||||
* **market:** add search method, return promises ([d62779a](https://github.com/driftyco/ionic-native/commit/d62779a))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.13"></a>
|
||||
## [2.2.13](https://github.com/driftyco/ionic-native/compare/v2.2.12...v2.2.13) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob:** add adId prop to AdMobOptions ([d5dfdf8](https://github.com/driftyco/ionic-native/commit/d5dfdf8))
|
||||
* **background-mode:** isEnabled and isActive return booleans ([ba77fd7](https://github.com/driftyco/ionic-native/commit/ba77fd7)), closes [#908](https://github.com/driftyco/ionic-native/issues/908)
|
||||
* **diagnostic:** add missing types ([1841220](https://github.com/driftyco/ionic-native/commit/1841220)), closes [#905](https://github.com/driftyco/ionic-native/issues/905)
|
||||
* **diagnostic:** add permissionStatus types ([#890](https://github.com/driftyco/ionic-native/issues/890)) ([3385c1b](https://github.com/driftyco/ionic-native/commit/3385c1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-fingerprint-auth:** update to v1.2.1 ([#910](https://github.com/driftyco/ionic-native/issues/910)) ([a1b0f88](https://github.com/driftyco/ionic-native/commit/a1b0f88))
|
||||
* **nfc:** add new functions ([#853](https://github.com/driftyco/ionic-native/issues/853)) ([c44fb75](https://github.com/driftyco/ionic-native/commit/c44fb75))
|
||||
* **onesignal:** improve typings ([#888](https://github.com/driftyco/ionic-native/issues/888)) ([56e8eae](https://github.com/driftyco/ionic-native/commit/56e8eae))
|
||||
* **sim:** add new methods ([#894](https://github.com/driftyco/ionic-native/issues/894)) ([0c36988](https://github.com/driftyco/ionic-native/commit/0c36988))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.12"></a>
|
||||
## [2.2.12](https://github.com/driftyco/ionic-native/compare/v2.2.11...v2.2.12) (2016-12-16)
|
||||
|
||||
@@ -61,8 +250,10 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add return ([3fdc4a8](https://github.com/driftyco/ionic-native/commit/3fdc4a8))
|
||||
* **card-io:** fix typo in options ([e6700a3](https://github.com/driftyco/ionic-native/commit/e6700a3))
|
||||
* **globalization:** add missing parameter to numberToString function ([1072ab1](https://github.com/driftyco/ionic-native/commit/1072ab1)), closes [#835](https://github.com/driftyco/ionic-native/issues/835)
|
||||
* **headercolor:** solve typo in usage and chore ([bab2971](https://github.com/driftyco/ionic-native/commit/bab2971))
|
||||
|
||||
|
||||
### Features
|
||||
@@ -94,6 +285,7 @@
|
||||
* **camera-preview:** add disable method ([6ad54ec](https://github.com/driftyco/ionic-native/commit/6ad54ec))
|
||||
* **google-analytics:** new interval period parameter ([abd910d](https://github.com/driftyco/ionic-native/commit/abd910d)), closes [#816](https://github.com/driftyco/ionic-native/issues/816)
|
||||
* **google-map:** add get and set methods to Marker class ([51ab03d](https://github.com/driftyco/ionic-native/commit/51ab03d)), closes [#798](https://github.com/driftyco/ionic-native/issues/798)
|
||||
* **headercolor:** add HeaderColor plugin ([93696d5](https://github.com/driftyco/ionic-native/commit/93696d5)), closes [#760](https://github.com/driftyco/ionic-native/issues/760)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Let us know or submit a PR! Take a look at [the Developer Guide](https://github.
|
||||
|
||||
# Credits
|
||||
|
||||
Ibrahim Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
Ibby Hadeed - [@ihadeed](http://github.com/ihadeed)
|
||||
|
||||
Tim Lancina - [@timlancina](http://twitter.com/timlancina)
|
||||
|
||||
|
||||
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.2.12",
|
||||
"version": "2.5.1",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/es5/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@@ -9,40 +9,40 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"rxjs": "^5.0.0-beta.6"
|
||||
"rxjs": "5.0.0-beta.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.0.1",
|
||||
"browserify": "^13.3.0",
|
||||
"canonical-path": "0.0.2",
|
||||
"conventional-changelog-cli": "^1.2.0",
|
||||
"conventional-github-releaser": "^1.1.3",
|
||||
"cpr": "^1.0.0",
|
||||
"cz-conventional-changelog": "^1.1.6",
|
||||
"cpr": "^2.0.2",
|
||||
"cz-conventional-changelog": "^1.2.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"dgeni": "^0.4.2",
|
||||
"dgeni-packages": "^0.10.18",
|
||||
"es6-shim": "~0.35.1",
|
||||
"glob": "^6.0.4",
|
||||
"es6-shim": "~0.35.2",
|
||||
"glob": "^7.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-tslint": "^6.1.2",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"jasmine-core": "~2.5.0",
|
||||
"karma": "~1.2.0",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"jasmine-core": "~2.5.2",
|
||||
"karma": "~1.3.0",
|
||||
"karma-browserify": "~5.1.0",
|
||||
"karma-jasmine": "~1.0.2",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-phantomjs-launcher": "~1.0.2",
|
||||
"lodash": "3.10.1",
|
||||
"lodash": "4.17.4",
|
||||
"minimist": "^1.1.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"node-html-encoder": "0.0.2",
|
||||
"q": "1.4.1",
|
||||
"semver": "^5.0.1",
|
||||
"tsify": "~1.0.4",
|
||||
"semver": "^5.3.0",
|
||||
"tsify": "~3.0.0",
|
||||
"tslint": "^3.15.1",
|
||||
"tslint-ionic-rules": "0.0.5",
|
||||
"typescript": "^2.0.1",
|
||||
"tslint-ionic-rules": "0.0.7",
|
||||
"typescript": "~2.0.10",
|
||||
"watchify": "~3.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -50,7 +50,6 @@
|
||||
"test:watch": "npm test -- --watch",
|
||||
"start": "npm run test:watch",
|
||||
"lint": "gulp lint",
|
||||
"watch": "tsc -w",
|
||||
"build": "npm run lint && npm run build:js && npm run build:esm && npm run build:bundle && npm run build:minify",
|
||||
"build:js": "tsc -p tsconfig-es5.json",
|
||||
"build:esm": "tsc -p tsconfig-esm.json",
|
||||
|
||||
@@ -76,7 +76,7 @@ module.exports = function(currentVersion) {
|
||||
|
||||
versions = [];
|
||||
// new version, add it to the versions list
|
||||
if (currentVersion != 'nightly' && !_.contains(versions, currentVersion)) {
|
||||
if (currentVersion != 'nightly' && !_.includes(versions, currentVersion)) {
|
||||
versions.unshift(currentVersion);
|
||||
}
|
||||
//First semver valid version is latest
|
||||
|
||||
@@ -30,7 +30,7 @@ function run {
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf content/docs/v2/native/*/
|
||||
git rm -rf content/docs/v2/native/*/ || true
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@ module.exports = function collectInputsOutputs() {
|
||||
$process: function(docs) {
|
||||
docs.forEach(function(doc) {
|
||||
|
||||
if (doc.statics && doc.statics.length) {
|
||||
for (var i in doc.statics) {
|
||||
// identify properties to differentiate from methods
|
||||
if (typeof doc.statics[i].parameters == 'undefined') {
|
||||
doc.statics[i].isProperty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doc.members && doc.members.length) {
|
||||
var members = [];
|
||||
var inputs = [];
|
||||
|
||||
@@ -20,7 +20,9 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
|
||||
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
|
||||
.replace('/index.md', '')
|
||||
.replace('content/','');
|
||||
.replace('content/', '');
|
||||
|
||||
docs[i].demo = !!docs[i].demo;
|
||||
});
|
||||
|
||||
docs.push({
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'beta', transforms: function(doc, tag, value) {
|
||||
// make the value true or undefined instead of '' or undefined
|
||||
return typeof value !== 'undefined';
|
||||
}},
|
||||
{'name': 'usage'},
|
||||
{'name': 'classes'}, // related classes
|
||||
{'name': 'interfaces'} // related interfaces
|
||||
|
||||
15
scripts/docs/templates/common.template.html
vendored
15
scripts/docs/templates/common.template.html
vendored
@@ -200,7 +200,9 @@ docType: "<$ doc.docType $>"
|
||||
Delegate: <$ doc.delegate $>
|
||||
</small>
|
||||
<@ endif @>
|
||||
|
||||
<@- if doc.beta == true -@>
|
||||
<span class="beta" title="beta">β</span>
|
||||
<@- endif -@>
|
||||
</h1>
|
||||
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
@@ -213,6 +215,15 @@ docType: "<$ doc.docType $>"
|
||||
<@- if doc.decorators @>
|
||||
|
||||
<@ for prop in doc.decorators[0].argumentInfo @>
|
||||
|
||||
<@ if doc.beta == true @>
|
||||
<p class="beta-notice">
|
||||
This plugin is still in beta stage and may not work as expected. Please
|
||||
submit any issues to the <a target="_blank"
|
||||
href="<$ prop.repo $>/issues">plugin repo</a>.
|
||||
</p>
|
||||
<@ endif @>
|
||||
|
||||
<pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif -@></code></pre>
|
||||
<p>Repo:
|
||||
<a href="<$ prop.repo $>">
|
||||
@@ -244,7 +255,7 @@ docType: "<$ doc.docType $>"
|
||||
<!-- @platforms tag end -->
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
<@ endif -@><!-- if doc.decorators -->
|
||||
|
||||
<!-- @usage tag -->
|
||||
<@ if doc.usage @>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">β</span></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
41
src/index.ts
41
src/index.ts
@@ -1,6 +1,6 @@
|
||||
import { initAngular1 } from './ng1';
|
||||
|
||||
const DEVICE_READY_TIMEOUT = 2000;
|
||||
const DEVICE_READY_TIMEOUT = 5000;
|
||||
|
||||
declare var window;
|
||||
|
||||
@@ -13,12 +13,14 @@ import { AppVersion } from './plugins/appversion';
|
||||
import { Badge } from './plugins/badge';
|
||||
import { BackgroundGeolocation } from './plugins/background-geolocation';
|
||||
import { BackgroundMode } from './plugins/backgroundmode';
|
||||
import { Backlight } from './plugins/backlight';
|
||||
import { BarcodeScanner } from './plugins/barcodescanner';
|
||||
import { Base64ToGallery } from './plugins/base64togallery';
|
||||
import { BatteryStatus } from './plugins/batterystatus';
|
||||
import { Brightness } from './plugins/brightness';
|
||||
import { BLE } from './plugins/ble';
|
||||
import { BluetoothSerial } from './plugins/bluetoothserial';
|
||||
import { Broadcaster } from './plugins/broadcaster';
|
||||
import { Calendar } from './plugins/calendar';
|
||||
import { CallNumber } from './plugins/call-number';
|
||||
import { Camera } from './plugins/camera';
|
||||
@@ -46,6 +48,8 @@ import { FileChooser } from './plugins/file-chooser';
|
||||
import { FileOpener } from './plugins/file-opener';
|
||||
import { FilePath } from './plugins/filepath';
|
||||
import { Transfer } from './plugins/filetransfer';
|
||||
import { FingerprintAIO } from './plugins/fingerprint-aio';
|
||||
import { Firebase } from './plugins/firebase';
|
||||
import { Flashlight } from './plugins/flashlight';
|
||||
import { Geofence } from './plugins/geofence';
|
||||
import { Geolocation } from './plugins/geolocation';
|
||||
@@ -53,6 +57,7 @@ import { Globalization } from './plugins/globalization';
|
||||
import { GooglePlus } from './plugins/google-plus';
|
||||
import { GoogleMap } from './plugins/googlemap';
|
||||
import { GoogleAnalytics } from './plugins/googleanalytics';
|
||||
import { HeaderColor } from './plugins/headercolor';
|
||||
import { Hotspot } from './plugins/hotspot';
|
||||
import { HTTP } from './plugins/http';
|
||||
import { Httpd } from './plugins/httpd';
|
||||
@@ -66,12 +71,15 @@ import { Instagram } from './plugins/instagram';
|
||||
import { IsDebug } from './plugins/is-debug';
|
||||
import { Keyboard } from './plugins/keyboard';
|
||||
import { LaunchNavigator } from './plugins/launchnavigator';
|
||||
import { LaunchReview } from './plugins/launch-review';
|
||||
import { LocalNotifications } from './plugins/localnotifications';
|
||||
import { LocationAccuracy } from './plugins/location-accuracy';
|
||||
import { MediaCapture } from './plugins/media-capture';
|
||||
import { NativeAudio } from './plugins/native-audio';
|
||||
import { NativeGeocoder } from './plugins/native-geocoder';
|
||||
import { NativePageTransitions } from './plugins/native-page-transitions';
|
||||
import { NativeStorage } from './plugins/nativestorage';
|
||||
import { NavigationBar } from './plugins/navigationbar';
|
||||
import { Market } from './plugins/market';
|
||||
import { MediaPlugin } from './plugins/media';
|
||||
import { Mixpanel } from './plugins/mixpanel';
|
||||
@@ -83,22 +91,27 @@ import { PhotoViewer } from './plugins/photo-viewer';
|
||||
import { ScreenOrientation } from './plugins/screen-orientation';
|
||||
import { PayPal } from './plugins/pay-pal';
|
||||
import { PinDialog } from './plugins/pin-dialog';
|
||||
import { Pinterest } from './plugins/pinterest';
|
||||
import { PowerManagement } from './plugins/power-management';
|
||||
import { Printer } from './plugins/printer';
|
||||
import { Push } from './plugins/push';
|
||||
import { Rollbar } from './plugins/rollbar';
|
||||
import { SafariViewController } from './plugins/safari-view-controller';
|
||||
import { Screenshot } from './plugins/screenshot';
|
||||
import { SecureStorage } from './plugins/securestorage';
|
||||
import { Serial } from './plugins/serial';
|
||||
import { Shake } from './plugins/shake';
|
||||
import { Sim } from './plugins/sim';
|
||||
import { SMS } from './plugins/sms';
|
||||
import { SocialSharing } from './plugins/socialsharing';
|
||||
import { SpeechRecognition } from './plugins/speech-recognition';
|
||||
import { SpinnerDialog } from './plugins/spinnerdialog';
|
||||
import { Splashscreen } from './plugins/splashscreen';
|
||||
import { SQLite } from './plugins/sqlite';
|
||||
import { StatusBar } from './plugins/statusbar';
|
||||
import { Stepcounter } from './plugins/stepcounter';
|
||||
import { StreamingMedia } from './plugins/streaming-media';
|
||||
import { Stripe } from './plugins/stripe';
|
||||
import { ThreeDeeTouch } from './plugins/3dtouch';
|
||||
import { Toast } from './plugins/toast';
|
||||
import { TouchID } from './plugins/touchid';
|
||||
@@ -121,6 +134,7 @@ export * from './plugins/apprate';
|
||||
export * from './plugins/appversion';
|
||||
export * from './plugins/background-geolocation';
|
||||
export * from './plugins/backgroundmode';
|
||||
export * from './plugins/backlight';
|
||||
export * from './plugins/badge';
|
||||
export * from './plugins/barcodescanner';
|
||||
export * from './plugins/base64togallery';
|
||||
@@ -128,6 +142,7 @@ export * from './plugins/batterystatus';
|
||||
export * from './plugins/ble';
|
||||
export * from './plugins/bluetoothserial';
|
||||
export * from './plugins/brightness';
|
||||
export * from './plugins/broadcaster';
|
||||
export * from './plugins/calendar';
|
||||
export * from './plugins/call-number';
|
||||
export * from './plugins/camera';
|
||||
@@ -154,7 +169,9 @@ export * from './plugins/file';
|
||||
export * from './plugins/file-chooser';
|
||||
export * from './plugins/file-opener';
|
||||
export * from './plugins/filetransfer';
|
||||
export * from './plugins/firebase';
|
||||
export * from './plugins/filepath';
|
||||
export * from './plugins/fingerprint-aio';
|
||||
export * from './plugins/flashlight';
|
||||
export * from './plugins/geofence';
|
||||
export * from './plugins/geolocation';
|
||||
@@ -162,6 +179,7 @@ export * from './plugins/globalization';
|
||||
export * from './plugins/google-plus';
|
||||
export * from './plugins/googleanalytics';
|
||||
export * from './plugins/googlemap';
|
||||
export * from './plugins/headercolor';
|
||||
export * from './plugins/hotspot';
|
||||
export * from './plugins/http';
|
||||
export * from './plugins/httpd';
|
||||
@@ -175,6 +193,7 @@ export * from './plugins/instagram';
|
||||
export * from './plugins/is-debug';
|
||||
export * from './plugins/keyboard';
|
||||
export * from './plugins/launchnavigator';
|
||||
export * from './plugins/launch-review';
|
||||
export * from './plugins/localnotifications';
|
||||
export * from './plugins/location-accuracy';
|
||||
export * from './plugins/market';
|
||||
@@ -183,32 +202,39 @@ export * from './plugins/media-capture';
|
||||
export * from './plugins/mixpanel';
|
||||
export * from './plugins/music-controls';
|
||||
export * from './plugins/native-audio';
|
||||
export * from './plugins/native-geocoder';
|
||||
export * from './plugins/native-page-transitions';
|
||||
export * from './plugins/nativestorage';
|
||||
export * from './plugins/navigationbar';
|
||||
export * from './plugins/network';
|
||||
export * from './plugins/nfc';
|
||||
export * from './plugins/onesignal';
|
||||
export * from './plugins/pay-pal';
|
||||
export * from './plugins/photo-viewer';
|
||||
export * from './plugins/pin-dialog';
|
||||
export * from './plugins/pinterest';
|
||||
export * from './plugins/plugin';
|
||||
export * from './plugins/power-management';
|
||||
export * from './plugins/printer';
|
||||
export * from './plugins/push';
|
||||
export * from './plugins/rollbar';
|
||||
export * from './plugins/safari-view-controller';
|
||||
export * from './plugins/screen-orientation';
|
||||
export * from './plugins/screenshot';
|
||||
export * from './plugins/securestorage';
|
||||
export * from './plugins/serial';
|
||||
export * from './plugins/shake';
|
||||
export * from './plugins/sim';
|
||||
export * from './plugins/sms';
|
||||
export * from './plugins/socialsharing';
|
||||
export * from './plugins/speech-recognition';
|
||||
export * from './plugins/spinnerdialog';
|
||||
export * from './plugins/splashscreen';
|
||||
export * from './plugins/sqlite';
|
||||
export * from './plugins/statusbar';
|
||||
export * from './plugins/stepcounter';
|
||||
export * from './plugins/streaming-media';
|
||||
export * from './plugins/stripe';
|
||||
export * from './plugins/text-to-speech';
|
||||
export * from './plugins/themeable-browser';
|
||||
export * from './plugins/toast';
|
||||
@@ -233,12 +259,14 @@ window['IonicNative'] = {
|
||||
Badge,
|
||||
BackgroundGeolocation,
|
||||
BackgroundMode,
|
||||
Backlight,
|
||||
BarcodeScanner,
|
||||
Base64ToGallery,
|
||||
BatteryStatus,
|
||||
Brightness,
|
||||
BLE,
|
||||
BluetoothSerial,
|
||||
Broadcaster,
|
||||
Calendar,
|
||||
CallNumber,
|
||||
Camera,
|
||||
@@ -265,13 +293,16 @@ window['IonicNative'] = {
|
||||
FileChooser,
|
||||
FileOpener,
|
||||
FilePath,
|
||||
FingerprintAIO,
|
||||
Flashlight,
|
||||
Firebase,
|
||||
Geofence,
|
||||
Geolocation,
|
||||
Globalization,
|
||||
GooglePlus,
|
||||
GoogleMap,
|
||||
GoogleAnalytics,
|
||||
HeaderColor,
|
||||
Hotspot,
|
||||
HTTP,
|
||||
Httpd,
|
||||
@@ -285,6 +316,7 @@ window['IonicNative'] = {
|
||||
IsDebug,
|
||||
Keyboard,
|
||||
LaunchNavigator,
|
||||
LaunchReview,
|
||||
LocalNotifications,
|
||||
LocationAccuracy,
|
||||
Market,
|
||||
@@ -293,8 +325,10 @@ window['IonicNative'] = {
|
||||
Mixpanel,
|
||||
MusicControls,
|
||||
NativeAudio,
|
||||
NativeGeocoder,
|
||||
NativePageTransitions,
|
||||
NativeStorage,
|
||||
NavigationBar,
|
||||
Network,
|
||||
PayPal,
|
||||
NFC,
|
||||
@@ -304,10 +338,13 @@ window['IonicNative'] = {
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
Pinterest,
|
||||
PowerManagement,
|
||||
Rollbar,
|
||||
SafariViewController,
|
||||
Screenshot,
|
||||
SecureStorage,
|
||||
Serial,
|
||||
Shake,
|
||||
Sim,
|
||||
SMS,
|
||||
@@ -316,8 +353,10 @@ window['IonicNative'] = {
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
SpeechRecognition,
|
||||
Stepcounter,
|
||||
StreamingMedia,
|
||||
Stripe,
|
||||
ThreeDeeTouch,
|
||||
Toast,
|
||||
TouchID,
|
||||
|
||||
@@ -5,6 +5,11 @@ export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL
|
||||
|
||||
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`
|
||||
*/
|
||||
|
||||
@@ -3,14 +3,26 @@ 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 encrypt the token returned upon successful fingerprint authentication.
|
||||
* Used to create credential string for encrypted token and as alias to retrieve the cipher.
|
||||
*/
|
||||
clientSecret: string;
|
||||
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
|
||||
@@ -22,6 +34,33 @@ export interface AndroidFingerprintAuthOptions {
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,15 +76,20 @@ export interface AndroidFingerprintAuthOptions {
|
||||
* if(result.isAvailable){
|
||||
* // it is available
|
||||
*
|
||||
* AndroidFingerprintAuth.show({ clientId: "myAppName", clientSecret: "so_encrypted_much_secure_very_secret" })
|
||||
* AndroidFingerprintAuth.encrypt({ clientId: "myAppName", username: "myUsername", password: "myPassword" })
|
||||
* .then(result => {
|
||||
* if(result.withFingerprint) {
|
||||
* console.log('Successfully authenticated with fingerprint!');
|
||||
* } else if(result.withPassword) {
|
||||
* if (result.withFingerprint) {
|
||||
* console.log("Successfully encrypted credentials.");
|
||||
* console.log("Encrypted credentials: " + result.token);
|
||||
* } else if (result.withBackup) {
|
||||
* console.log('Successfully authenticated with backup password!');
|
||||
* } else console.log('Didn\'t authenticate!');
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* .catch(error => {
|
||||
* if (error === "Cancelled") {
|
||||
* console.log("Fingerprint authentication cancelled");
|
||||
* } else console.error(error)
|
||||
* });
|
||||
*
|
||||
* } else {
|
||||
* // fingerprint auth isn't available
|
||||
@@ -70,15 +114,41 @@ export class AndroidFingerprintAuth {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
static encrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Base64 encoded string
|
||||
* Biometric authentication
|
||||
*/
|
||||
withFingerprint: string;
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
*
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withPassword: boolean;
|
||||
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; }
|
||||
|
||||
/**
|
||||
@@ -86,6 +156,12 @@ export class AndroidFingerprintAuth {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> {return; }
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> { return; }
|
||||
|
||||
/**
|
||||
* Delete the cipher used for encryption and decryption by username
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(options: {clientId: string; username: string; }): Promise<{deleted: boolean}> { return; }
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* if (Device.platform === 'iOS') {
|
||||
* app = 'twitter://';
|
||||
* } else if (device.platform === 'Android') {
|
||||
* } else if (Device.platform === 'Android') {
|
||||
* app = 'com.twitter.android';
|
||||
* }
|
||||
*
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface AppRatePreferences {
|
||||
/**
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppUrl?: AppRateStoreAppUrls;
|
||||
storeAppURL?: AppRateStoreAppUrls;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export interface AppRateCallbacks {
|
||||
/**
|
||||
* call back function. called when rate-dialog showing
|
||||
*/
|
||||
onRateDialogShowed?: Function;
|
||||
onRateDialogShow?: Function;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ export interface BackgroundGeolocationResponse {
|
||||
*/
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
* bearing, in degrees.
|
||||
*/
|
||||
@@ -121,10 +126,14 @@ export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* ANDROID, WP8 ONLY
|
||||
* The minimum time interval between location updates in seconds.
|
||||
* When using BackgroundGeolocation.LocationProvider.ANDROID_DISTANCE_FILTER_PROVIDER:
|
||||
* The minimum time interval between location updates in milliseconds.
|
||||
* @see Android docs (http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,%20float,%20android.location.Criteria,%20android.app.PendingIntent))
|
||||
* and the MS doc (http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geolocator.reportinterval)
|
||||
* for more information
|
||||
* When using BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER:
|
||||
* Rate in milliseconds at which your app prefers to receive location updates.
|
||||
* @see Android docs (https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#getInterval())
|
||||
*/
|
||||
interval?: number;
|
||||
|
||||
@@ -220,6 +229,28 @@ export interface BackgroundGeolocationConfig {
|
||||
* Defaults to 10000
|
||||
*/
|
||||
maxLocations?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* Fastest rate in milliseconds at which your app can handle location updates.
|
||||
* @see Android docs (https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#getFastestInterval())
|
||||
*/
|
||||
fastestInterval?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* Rate in milliseconds at which activity recognition occurs. Larger values will result in fewer activity detections while improving battery life.
|
||||
*/
|
||||
activitiesInterval?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY with BackgroundGeolocation.LocationProvider.ANDROID_ACTIVITY_PROVIDER
|
||||
*
|
||||
* stop() is forced, when the STILL activity is detected (default is true)
|
||||
*/
|
||||
stopOnStillActivity?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,17 +76,21 @@ export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is enabled.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is enabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isEnabled(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is active.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is active.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isActive(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -22,6 +22,11 @@ export interface BarcodeScannerOptions {
|
||||
*/
|
||||
disableAnimations?: boolean;
|
||||
|
||||
/**
|
||||
* Disable success beep. Supported on iOS only.
|
||||
*/
|
||||
disableSuccessBeep?: boolean;
|
||||
|
||||
/**
|
||||
* Prompt text. Supported on Android only.
|
||||
*/
|
||||
@@ -37,6 +42,16 @@ export interface BarcodeScannerOptions {
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,6 +42,7 @@ export interface 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']
|
||||
})
|
||||
|
||||
@@ -205,7 +205,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
@@ -218,7 +218,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ export interface CameraPreviewSize {
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
|
||||
@@ -66,12 +66,12 @@ export class Diagnostic {
|
||||
|
||||
@CordovaProperty
|
||||
static permissionStatus: {
|
||||
GRANTED;
|
||||
DENIED;
|
||||
NOT_REQUESTED;
|
||||
DENIED_ALWAYS;
|
||||
RESTRICTED;
|
||||
GRANTED_WHEN_IN_USE;
|
||||
GRANTED: string;
|
||||
DENIED: string;
|
||||
NOT_REQUESTED: string;
|
||||
DENIED_ALWAYS: string;
|
||||
RESTRICTED: string;
|
||||
GRANTED_WHEN_IN_USE: string;
|
||||
};
|
||||
|
||||
static locationAuthorizationMode = {
|
||||
|
||||
@@ -24,6 +24,7 @@ export interface EmailComposerOptions {
|
||||
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Email Composer
|
||||
* @description
|
||||
*
|
||||
|
||||
@@ -11,8 +11,8 @@ import { Plugin, Cordova } from './plugin';
|
||||
* import {FileChooser} from 'ionic-native';
|
||||
*
|
||||
* FileChooser.open()
|
||||
* .then(uri => console.log(uri);
|
||||
* .catch(e => console.log(e);
|
||||
* .then(uri => console.log(uri));
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -385,8 +385,8 @@ export class File {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get free disk space
|
||||
* @returns {Promise<number>} Returns a promise that resolves with the remaining free disk space
|
||||
* Get free disk space in Bytes
|
||||
* @returns {Promise<number>} Returns a promise that resolves with the remaining free disk space in Bytes
|
||||
*/
|
||||
static getFreeDiskSpace(): Promise<number> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
|
||||
@@ -173,6 +173,10 @@ export interface FileTransferError {
|
||||
* cd files
|
||||
* ls
|
||||
* ```
|
||||
*
|
||||
* To store files in a different/publicly accessible directory, please refer to the following link
|
||||
* https://github.com/apache/cordova-plugin-file#where-to-store-files
|
||||
*
|
||||
* @interfaces
|
||||
* FileUploadOptions
|
||||
* FileUploadResult
|
||||
@@ -223,7 +227,7 @@ export class Transfer {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult | FileTransferError> {
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -167,7 +167,7 @@ export class Geolocation {
|
||||
*
|
||||
* ```typescript
|
||||
* var subscription = Geolocation.watchPosition()
|
||||
* .filter((p) => p.code === undefined) //Filter Out Errors
|
||||
* .filter((p) => p.coords !== undefined) //Filter Out Errors
|
||||
* .subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
|
||||
@@ -14,7 +14,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
pluginName: 'Globalization',
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization'
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
|
||||
})
|
||||
export class Globalization {
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
* GooglePlus.login()
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -25,7 +28,10 @@ export class GooglePlus {
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,20 @@ declare var window;
|
||||
* - A Cordova 3.0+ project for iOS and/or Android
|
||||
* - A Mobile App property through the Google Analytics Admin Console
|
||||
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GoogleAnalytics } from 'ionic-native';
|
||||
*
|
||||
* GoogleAnalytics.startTrackerWithId('YOUR_TRACKER_ID')
|
||||
* .then(() => {
|
||||
* console.log('Google analytics is ready now');
|
||||
* // Tracker is ready
|
||||
* // You can now track pages or set additional information such as AppVersion or UserId
|
||||
* })
|
||||
* .catch(e => console.log('Error starting GoogleAnalytics', e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'GoogleAnalytics',
|
||||
@@ -27,7 +41,10 @@ export class GoogleAnalytics {
|
||||
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Cordova, CordovaInstance, Plugin, InstanceProperty, getPlugin, pluginWarn } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
declare var plugin: any;
|
||||
|
||||
@@ -60,8 +61,9 @@ export const GoogleMapsAnimation = {
|
||||
*
|
||||
* loadMap() {
|
||||
* // make sure to create following structure in your view.html file
|
||||
* // and add a height (for example 100%) to it, else the map won't be visible
|
||||
* // <ion-content>
|
||||
* // <div #map id="map"></div>
|
||||
* // <div #map id="map" style="height:100%;"></div>
|
||||
* // </ion-content>
|
||||
*
|
||||
* // create a new map by passing HTMLElement
|
||||
@@ -118,7 +120,7 @@ export class GoogleMap {
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
constructor(element: string|HTMLElement, options?: any) {
|
||||
constructor(element: string | HTMLElement, options?: any) {
|
||||
if (!!getPlugin('plugin.google.maps.Map')) {
|
||||
if (typeof element === 'string') {
|
||||
element = document.getElementById(<string>element);
|
||||
@@ -132,12 +134,50 @@ export class GoogleMap {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(event: any): Observable<any> {
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
@@ -146,7 +186,7 @@ export class GoogleMap {
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
@@ -157,15 +197,21 @@ export class GoogleMap {
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(event: any): Promise<any> {
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(event, resolve)
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setDebuggable(isDebuggable: boolean): void { }
|
||||
|
||||
@@ -575,12 +621,26 @@ export class GoogleMapsMarker {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -588,7 +648,7 @@ export class GoogleMapsMarker {
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
@@ -596,9 +656,49 @@ export class GoogleMapsMarker {
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
/**
|
||||
* Return true if the marker is visible
|
||||
*/
|
||||
@@ -796,15 +896,84 @@ export class GoogleMapsCircle {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getCenter(): GoogleMapsLatLng { return; }
|
||||
|
||||
@@ -866,15 +1035,84 @@ export interface GoogleMapsPolylineOptions {
|
||||
export class GoogleMapsPolyline {
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@@ -937,15 +1175,84 @@ export class GoogleMapsPolygon {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@@ -1010,6 +1317,84 @@ export class GoogleMapsTileOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@@ -1061,6 +1446,84 @@ export class GoogleMapsGroundOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setBearing(bearing: number): void { }
|
||||
|
||||
@@ -1103,6 +1566,84 @@ export class GoogleMapsKmlOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
addEventListener(eventName: string): Observable<any> {
|
||||
return Observable.fromEvent(this._objectInstance, eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event listener that works once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
addListenerOnce(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value
|
||||
* @param key
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
get(key: string): any { return; }
|
||||
|
||||
/**
|
||||
* Sets a value
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
set(key: string, value: any): void { }
|
||||
|
||||
/**
|
||||
* Listen to a map event.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
on(eventName: string): Observable<any> {
|
||||
if (!this._objectInstance) {
|
||||
return new Observable((observer) => {
|
||||
observer.error({ error: 'plugin_not_installed' });
|
||||
});
|
||||
}
|
||||
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
this._objectInstance.on(eventName, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to a map event only once.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
one(eventName: string): Promise<any> {
|
||||
if (!this._objectInstance) {
|
||||
return Promise.reject({ error: 'plugin_not_installed' });
|
||||
}
|
||||
return new Promise<any>(
|
||||
resolve => this._objectInstance.one(eventName, resolve)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all stored values
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
empty(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void { }
|
||||
|
||||
@@ -1116,9 +1657,9 @@ export class GoogleMapsKmlOverlay {
|
||||
export class GoogleMapsLatLngBounds {
|
||||
private _objectInstance: any;
|
||||
|
||||
@InstanceProperty get northeast(): GoogleMapsLatLng { return; }
|
||||
@InstanceProperty get southwest(): GoogleMapsLatLng { return; }
|
||||
@InstanceProperty get type(): string { return; }
|
||||
@InstanceProperty northeast: GoogleMapsLatLng;
|
||||
@InstanceProperty southwest: GoogleMapsLatLng;
|
||||
@InstanceProperty type: string;
|
||||
|
||||
constructor(southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], northeast?: GoogleMapsLatLng) {
|
||||
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
|
||||
|
||||
36
src/plugins/headercolor.ts
Normal file
36
src/plugins/headercolor.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name HeaderColor
|
||||
* @description
|
||||
* Cordova plugin to change color of header in multitask view
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { HeaderColor } from 'ionic-native';
|
||||
*
|
||||
* HeaderColor.tint("#becb29");
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HeaderColor',
|
||||
plugin: 'cordova-plugin-headercolor',
|
||||
pluginRef: 'plugins.headerColor',
|
||||
repo: 'https://github.com/tomloprod/cordova-plugin-headercolor',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class HeaderColor {
|
||||
|
||||
/**
|
||||
* Set a color to the task header
|
||||
* @param color {string} The hex value of the color
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static tint(color: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -103,6 +103,7 @@ export interface HotspotDevice {
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* @usage
|
||||
|
||||
@@ -237,7 +237,7 @@ export interface IBeaconDelegate {
|
||||
* // Request permission to use location on iOS
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.IBeaconDelegate();
|
||||
* let delegate = IBeacon.Delegate();
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
|
||||
@@ -40,13 +40,6 @@ export interface InAppBrowserEvent extends Event {
|
||||
})
|
||||
export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static open(url: string, target?: string, options?: string): void {
|
||||
console.warn('Native: Your current usage of the InAppBrowser plugin is deprecated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.');
|
||||
}
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
/**
|
||||
@@ -79,9 +72,16 @@ export class InAppBrowser {
|
||||
@CordovaInstance({sync: true})
|
||||
close(): void { }
|
||||
|
||||
/**
|
||||
* Hides an InAppBrowser window that is currently shown. Calling this has no effect
|
||||
* if the InAppBrowser was already hidden.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
hide(): void { }
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param script {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
@@ -89,11 +89,11 @@ export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @param css {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
insertCSS(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin';
|
||||
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
|
||||
})
|
||||
export class Market {
|
||||
|
||||
/**
|
||||
* Opens an app in Google Play / App Store
|
||||
* @param appId {string} Package name
|
||||
* @param callbacks {Object} Optional callbacks in the format {success?: Function, failure?: Function}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static open(appId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Search apps by keyword
|
||||
* @param keyword {string} Keyword
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure',
|
||||
platforms: ['Android']
|
||||
})
|
||||
static search(keyword: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,11 @@ export interface MediaError {
|
||||
*
|
||||
*
|
||||
* // Create a MediaPlugin instance. Expects path to file or url as argument
|
||||
* var file = new MediaPlugin('path/to/file.mp3');
|
||||
* // We can optionally pass a second argument to track the status of the media
|
||||
*
|
||||
* const onStatusUpdate = (status) => console.log(status);
|
||||
*
|
||||
* const file = new MediaPlugin('path/to/file.mp3', onStatusUpdate);
|
||||
*
|
||||
* // Catch the Success & Error Output
|
||||
* // Platform Quirks
|
||||
|
||||
@@ -85,7 +85,10 @@ export class Mixpanel {
|
||||
* @param eventProperties {any} optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static track(eventName: string, eventProperties?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
98
src/plugins/native-geocoder.ts
Normal file
98
src/plugins/native-geocoder.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name NativeGeocoder
|
||||
* @description
|
||||
* Cordova plugin for native forward and reverse geocoding
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from 'ionic-native';
|
||||
*
|
||||
* NativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
||||
* .then((result: NativeGeocoderReverseResult) => console.log("The address is " + result.address + " in " + result.countryCode))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* NativeGeocoder.forwardGeocode("Berlin")
|
||||
* .then((coordinates: NativeGeocoderForwardResult) => console.log("The coordinates are latitude=" + coordinates.latitude + " and longitude=" + coordinates.longitude))
|
||||
* .catch((error: any) => console.log(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* NativeGeocoderReverseResult
|
||||
* NativeGeocoderForwardResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NativeGeocoder',
|
||||
plugin: 'cordova-plugin-nativegeocoder',
|
||||
pluginRef: 'nativegeocoder',
|
||||
repo: 'https://github.com/sebastianbaar/cordova-plugin-nativegeocoder',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class NativeGeocoder {
|
||||
|
||||
/**
|
||||
* Reverse geocode a given latitude and longitude to find location address
|
||||
* @param latitude {number} The latitude
|
||||
* @param longitude {number} The longitude
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static reverseGeocode(latitude: number, longitude: number): Promise<NativeGeocoderReverseResult> { return; }
|
||||
|
||||
/**
|
||||
* Forward geocode a given address to find coordinates
|
||||
* @param addressString {string} The address to be geocoded
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates format information about a reverse geocoding result.
|
||||
*/
|
||||
export interface NativeGeocoderReverseResult {
|
||||
/**
|
||||
* The street.
|
||||
*/
|
||||
street: string;
|
||||
/**
|
||||
* The house number.
|
||||
*/
|
||||
houseNumber: string;
|
||||
/**
|
||||
* The postal code.
|
||||
*/
|
||||
postalCode: string;
|
||||
/**
|
||||
* The city.
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* The country name.
|
||||
*/
|
||||
countryName: string;
|
||||
/**
|
||||
* The country code.
|
||||
*/
|
||||
countryCode: string;
|
||||
}
|
||||
/**
|
||||
* Encapsulates format information about a forward geocoding result.
|
||||
*/
|
||||
export interface NativeGeocoderForwardResult {
|
||||
/**
|
||||
* The latitude.
|
||||
*/
|
||||
latitude: string;
|
||||
/**
|
||||
* The longitude.
|
||||
*/
|
||||
longitude: string;
|
||||
}
|
||||
50
src/plugins/navigationbar.ts
Normal file
50
src/plugins/navigationbar.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name NavigationBar
|
||||
* @description
|
||||
* The NavigationBar plugin can you to hide and auto hide the android navigation bar.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NavigationBar } from 'ionic-native';
|
||||
*
|
||||
* let autoHide: boolean = true;
|
||||
* NavigationBar.hide(autoHide);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NavigationBar',
|
||||
plugin: 'cordova-plugin-navigationbar',
|
||||
pluginRef: 'navigationbar',
|
||||
repo: 'https://github.com/cranberrygame/cordova-plugin-navigationbar',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class NavigationBar {
|
||||
|
||||
/**
|
||||
* hide automatically (or not) the navigation bar.
|
||||
* @param autohide {boolean}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static setUp(autohide?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Hide the navigation bar.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static hideNavigationBar(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ declare var navigator: any;
|
||||
*
|
||||
* ```
|
||||
* @advanced
|
||||
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
* The `type` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Network',
|
||||
|
||||
@@ -47,6 +47,21 @@ export class NFC {
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param mimeType
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
@@ -56,25 +71,10 @@ export class NFC {
|
||||
observable: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 4,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'removeMimeTypeListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addMimeTypeListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
static addMimeTypeListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for formatable NDEF tags.
|
||||
@@ -152,6 +152,27 @@ export class NFC {
|
||||
*/
|
||||
@Cordova()
|
||||
static enabled(): Promise<any> {return; }
|
||||
/**
|
||||
* Convert bytes to string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToString(bytes: number[]): string {return; }
|
||||
/**
|
||||
* Convert string to bytes
|
||||
* @param str {string}
|
||||
* @returns {number[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static stringToBytes(str: string): number[] {return; };
|
||||
/**
|
||||
* Convert bytes to hex string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToHexString(bytes: number[]): string {return; };
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface OneSignalNotification {
|
||||
app_id: string;
|
||||
export interface OSNotification {
|
||||
/**
|
||||
* Was app in focus.
|
||||
*/
|
||||
isAppInFocus: boolean;
|
||||
/**
|
||||
* Was notification shown to the user. Will be false for silent notifications.
|
||||
*/
|
||||
shown: boolean;
|
||||
/**
|
||||
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
|
||||
*/
|
||||
androidNotificationId?: number;
|
||||
/**
|
||||
* Payload received from OneSignal.
|
||||
*/
|
||||
payload: OSNotificationPayload;
|
||||
/**
|
||||
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
|
||||
*/
|
||||
displayType: OSDisplayType;
|
||||
/**
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
groupedNotifications?: OSNotificationPayload[];
|
||||
app_id?: string;
|
||||
contents: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
@@ -64,6 +88,177 @@ export interface OneSignalNotification {
|
||||
ios_category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
|
||||
*/
|
||||
export enum OSLockScreenVisibility {
|
||||
/**
|
||||
* Fully visible (default)
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
* Contents are hidden
|
||||
*/
|
||||
Private = 0,
|
||||
/**
|
||||
* Not shown
|
||||
*/
|
||||
Secret = -1
|
||||
}
|
||||
|
||||
/**
|
||||
* How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used.
|
||||
*/
|
||||
export enum OSDisplayType {
|
||||
/**
|
||||
* notification is silent, or inFocusDisplaying is disabled.
|
||||
*/
|
||||
None = 0,
|
||||
/**
|
||||
* (**DEFAULT**) - native alert dialog display.
|
||||
*/
|
||||
InAppAlert = 1,
|
||||
/**
|
||||
* native notification display.
|
||||
*/
|
||||
Notification = 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Contents and settings of the notification the user received.
|
||||
*/
|
||||
export interface OSNotificationPayload {
|
||||
/**
|
||||
* OneSignal notification UUID.
|
||||
*/
|
||||
notificationID: string;
|
||||
/**
|
||||
* Title of the notification.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Body of the notification.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data
|
||||
* or with the 'data' field on the REST API.
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* **ANDROID** - Small icon resource name set on the notification.
|
||||
*/
|
||||
smallIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Large icon set on the notification.
|
||||
*/
|
||||
largeIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Big picture image set on the notification.
|
||||
*/
|
||||
bigPicture?: string;
|
||||
/**
|
||||
* **ANDROID** - Accent color shown around small notification icon on Android 5+ devices. ARGB format.
|
||||
*/
|
||||
smallIconAccentColor?: string;
|
||||
/**
|
||||
* URL to open when opening the notification.
|
||||
*/
|
||||
launchUrl?: string;
|
||||
/**
|
||||
* Sound resource to play when the notification is shown.
|
||||
*/
|
||||
sound: string;
|
||||
/**
|
||||
* **ANDROID** - Devices that have a notification LED will blink in this color. ARGB format.
|
||||
*/
|
||||
ledColor?: string;
|
||||
lockScreenVisibility?: OSLockScreenVisibility;
|
||||
/**
|
||||
* **ANDROID** - Notifications with this same key will be grouped together as a single summary notification.
|
||||
*/
|
||||
groupKey?: string;
|
||||
/**
|
||||
* **ANDROID** - Summary text displayed in the summary notification.
|
||||
*/
|
||||
groupMessage?: string;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
actionButtons: OSActionButton[];
|
||||
/**
|
||||
* **ANDROID** - The Google project number the notification was sent under.
|
||||
*/
|
||||
fromProjectNumber?: string;
|
||||
/**
|
||||
* **ANDROID** - If a background image was set this object will be available.
|
||||
*/
|
||||
backgroundImageLayout?: OSBackgroundImageLayout;
|
||||
priority?: number;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
rawPayload: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
export interface OSActionButton {
|
||||
/**
|
||||
* Id assigned to the button.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Text show on the button to the user.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* **ANDROID** - Icon shown on the button.
|
||||
*/
|
||||
icon: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - If a background image was set, this object will be available.
|
||||
*/
|
||||
export interface OSBackgroundImageLayout {
|
||||
/**
|
||||
* Image URL or name used as the background image.
|
||||
*/
|
||||
image: string;
|
||||
/**
|
||||
* Text color of the title on the notification. ARGB Format.
|
||||
*/
|
||||
titleTextColor: string;
|
||||
/**
|
||||
* Text color of the body on the notification. ARGB Format.
|
||||
*/
|
||||
bodyTextColor: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The information returned from a notification the user received.
|
||||
*/
|
||||
export interface OSNotificationOpenedResult {
|
||||
action: {
|
||||
/**
|
||||
* Was the notification opened normally (`Opened`) or was a button pressed on the notification (`ActionTaken`).
|
||||
*/
|
||||
type: OSActionType;
|
||||
/**
|
||||
* If `type` == `ActionTaken` then this will contain the id of the button pressed.
|
||||
*/
|
||||
actionID?: string;
|
||||
};
|
||||
notification: OSNotification;
|
||||
}
|
||||
|
||||
export enum OSActionType {
|
||||
Opened = 0,
|
||||
ActionTake = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
@@ -91,13 +286,21 @@ export interface OneSignalNotification {
|
||||
* OneSignal.endInit();
|
||||
* ```
|
||||
* @interfaces
|
||||
* OneSignalNotification
|
||||
* OSNotification
|
||||
* OSLockScreenVisibility
|
||||
* OSDisplayType
|
||||
* OSNotificationPayload
|
||||
* OSActionButton
|
||||
* OSBackgroundImageLayout
|
||||
* OSNotificationOpenedResult
|
||||
* OSActionType
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OneSignal',
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'FireOS']
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
@@ -111,45 +314,57 @@ export class OneSignal {
|
||||
};
|
||||
|
||||
/**
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the endInit function.
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the `endInit` function.
|
||||
*
|
||||
* @param {string} appId Your AppId from your OneSignal app
|
||||
* @param {string} googleProjectNumber The Google Project Number (which you can get from the Google Developer Portal) and the autoRegister option.
|
||||
* @param {string} appId Your OneSignal app id
|
||||
* @param {string} googleProjectNumber **ANDROID** - your Google project number; only required for Android GCM/FCM pushes.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static startInit(appId: string, googleProjectNumber: string): any { return; }
|
||||
static startInit(appId: string, googleProjectNumber?: string): any { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is received
|
||||
* @return {Observable<any>}
|
||||
* Callback to run when a notification is received, whether it was displayed or not.
|
||||
*
|
||||
* @return {Observable<OneSignalReceivedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationReceived(): Observable<any> { return; }
|
||||
static handleNotificationReceived(): Observable<OSNotification> { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is opened
|
||||
* @return {Observable<any>}
|
||||
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
|
||||
* center (**iOS**), or when closing an Alert notification shown in the app (if InAppAlert is enabled in
|
||||
* inFocusDisplaying).
|
||||
*
|
||||
* @return {Observable<OneSignalOpenedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationOpened(): Observable<any> { return; }
|
||||
static handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; }
|
||||
|
||||
/**
|
||||
* **iOS** - Settings for iOS apps
|
||||
*
|
||||
* @param settings
|
||||
* kOSSettingsKeyAutoPrompt: boolean = true
|
||||
* Auto prompt user for notification permissions.
|
||||
*
|
||||
* kOSSettingsKeyInAppLaunchURL: boolean = false
|
||||
* Launch notifications with a launch URL as an in app webview.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static iOSSettings(settings: {
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
}): any { return; }
|
||||
|
||||
/**
|
||||
* Must be called after `startInit` to complete initialization of OneSignal.
|
||||
*
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
@@ -167,11 +382,14 @@ export class OneSignal {
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
* @returns {Promise<Object>} Returns a Promise that resolves if the device was successfully registered.
|
||||
*
|
||||
* userId {string} OneSignal userId is a UUID formatted string. (unique per device per app)
|
||||
*
|
||||
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
static getIds(): Promise<{userId: string; pushToken: string}> { return; }
|
||||
|
||||
|
||||
/**
|
||||
@@ -211,7 +429,7 @@ export class OneSignal {
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only use if you passed false to autoRegister when calling init.
|
||||
* Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerForPushNotifications(): void { }
|
||||
@@ -244,10 +462,11 @@ export class OneSignal {
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {number} displayOption Options are 0 = None, 1 = InAppAlert, and 2 = Notification.
|
||||
* @param {DisplayType} displayOption
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static inFocusDisplaying(displayOption: number): void { }
|
||||
static inFocusDisplaying(displayOption: OSDisplayType): any { return; }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
@@ -264,7 +483,7 @@ export class OneSignal {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
static postNotification(notificationObj: OneSignalNotification): Promise<any> { return; }
|
||||
static postNotification(notificationObj: OSNotification): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
|
||||
@@ -34,7 +34,8 @@ export class PinDialog {
|
||||
* @returns {Promise<{ buttonIndex: number, input1: string }>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1
|
||||
successIndex: 1,
|
||||
errorIndex: 4 // no error callback
|
||||
})
|
||||
static prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number, input1: string }> { return; }
|
||||
|
||||
|
||||
361
src/plugins/pinterest.ts
Normal file
361
src/plugins/pinterest.ts
Normal file
@@ -0,0 +1,361 @@
|
||||
import { Plugin, Cordova, CordovaProperty } from './plugin';
|
||||
|
||||
export interface PinterestUser {
|
||||
/**
|
||||
* The unique string of numbers and letters that identifies the user on Pinterest.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The user’s Pinterest username.
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* The user’s first name.
|
||||
*/
|
||||
first_name?: string;
|
||||
/**
|
||||
* The user’s last name.
|
||||
*/
|
||||
last_name?: string;
|
||||
/**
|
||||
* The text in the user’s “About you” section in their profile.
|
||||
*/
|
||||
bio?: string;
|
||||
/**
|
||||
* The date the user created their account in ISO 8601 format
|
||||
*/
|
||||
created_at?: string;
|
||||
/**
|
||||
* The user’s stats, including how many Pins, follows, boards and likes they have.
|
||||
*/
|
||||
counts?: any;
|
||||
/**
|
||||
* The user’s profile image. The response returns the image’s URL, width and height.
|
||||
*/
|
||||
image?: any;
|
||||
}
|
||||
|
||||
export interface PinterestBoard {
|
||||
/**
|
||||
* The unique string of numbers and letters that identifies the board on Pinterest.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The name of the board.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The link to the board.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* The user-entered description of the board.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The first and last name, ID and profile URL of the user who created the board.
|
||||
*/
|
||||
creator?: PinterestUser;
|
||||
/**
|
||||
* The date the user created the board.
|
||||
*/
|
||||
created_at?: string;
|
||||
/**
|
||||
* The board’s stats, including how many Pins, followers, user's following and collaborators it has.
|
||||
*/
|
||||
counts?: any;
|
||||
/**
|
||||
* The user’s profile image. The response returns the image’s URL, width and height.
|
||||
*/
|
||||
image?: any;
|
||||
}
|
||||
|
||||
export interface PinterestPin {
|
||||
/**
|
||||
* The unique string of numbers and letters that identifies the Pin on Pinterest.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The URL of the webpage where the Pin was created.
|
||||
*/
|
||||
link?: string;
|
||||
/**
|
||||
* The URL of the Pin on Pinterest.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* The first and last name, ID and profile URL of the user who created the board.
|
||||
*/
|
||||
creator?: PinterestUser;
|
||||
/**
|
||||
* The board that the Pin is on.
|
||||
*/
|
||||
board?: PinterestBoard;
|
||||
/**
|
||||
* The date the Pin was created.
|
||||
*/
|
||||
created_at?: string;
|
||||
/**
|
||||
* The user-entered description of the Pin.
|
||||
*/
|
||||
note?: string;
|
||||
/**
|
||||
* The dominant color of the Pin’s image in hex code format.
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* The Pin’s stats, including the number of repins, comments and likes.
|
||||
*/
|
||||
counts?: any;
|
||||
/**
|
||||
* The media type of the Pin (image or video).
|
||||
*/
|
||||
media?: any;
|
||||
/**
|
||||
* The source data for videos, including the title, URL, provider, author name, author URL and provider name.
|
||||
*/
|
||||
attribution?: any;
|
||||
/**
|
||||
* The Pin’s image. The default response returns the image’s URL, width and height.
|
||||
*/
|
||||
image?: any;
|
||||
/**
|
||||
* Extra information about the Pin for Rich Pins. Includes the Pin type (e.g., article, recipe) and related information (e.g., ingredients, author).
|
||||
*/
|
||||
metadata?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Pinterest
|
||||
* @description
|
||||
* Cordova plugin for Pinterest
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Pinterest, PinterestUser, PinterestPin, PinterestBoard } from 'ionic-native';
|
||||
*
|
||||
* const scopes = [
|
||||
* Pinterest.SCOPES.READ_PUBLIC,
|
||||
* Pinterest.SCOPES.WRITE_PUBLIC,
|
||||
* Pinterest.SCOPES.READ_RELATIONSHIPS,
|
||||
* Pinterest.SCOPES.WRITE_RELATIONSHIPS
|
||||
* ];
|
||||
*
|
||||
* Pinterest.login(scopes)
|
||||
* .then(res => console.log('Logged in!', res))
|
||||
* .catch(err => console.error('Error loggin in', err));
|
||||
*
|
||||
* Pinterest.getMyPins()
|
||||
* .then((pins: Array<PinterestPin>) => console.log(pins))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* Pinterest.getMe()
|
||||
* .then((user: PinterestUser) => console.log(user));
|
||||
*
|
||||
* Pinterest.getMyBoards()
|
||||
* .then((boards: Array<PinterestBoard>) => console.log(boards));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* PinterestUser
|
||||
* PinterestBoard
|
||||
* PinterestPin
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Pinterest',
|
||||
plugin: 'cordova-plugin-pinterest',
|
||||
pluginRef: 'cordova.plugins.Pinterest',
|
||||
repo: 'https://github.com/zyramedia/cordova-plugin-pinterest',
|
||||
install: 'ionic plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class Pinterest {
|
||||
|
||||
/**
|
||||
* Convenience constant for authentication scopes
|
||||
*/
|
||||
@CordovaProperty
|
||||
SCOPES: {
|
||||
READ_PUBLIC: string;
|
||||
WRITE_PUBLIC: string;
|
||||
READ_RELATIONSHIPS: string;
|
||||
WRITE_RELATIONSHIPS: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Logs the user in using their Pinterest account.
|
||||
* @param scopes {Array<string>} Array of scopes that you need access to. You can use Pinterest.SCOPES constant for convenience.
|
||||
* @returns {Promise<any>} The response object will contain the user's profile data, as well as the access token (if you need to use it elsewhere, example: send it to your server and perform actions on behalf of the user).
|
||||
*/
|
||||
@Cordova()
|
||||
static login(scopes: string[]): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Gets the authenticated user's profile
|
||||
* @param fields {string} Fields to retrieve, separated by commas. Defaults to all available fields.
|
||||
* @returns {Promise<PinterestUser>} Returns a promise that resolves with the user's object
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMe(fields?: string): Promise<PinterestUser> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestPin>>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyPins(fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestBoard>>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyBoards(fields?: string, limit?: number): Promise<Array<PinterestBoard>> { return; }
|
||||
|
||||
/**
|
||||
* Get the authenticated user's likes.
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestPin>>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyLikes(fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
|
||||
|
||||
/**
|
||||
* Get the authenticated user's followers.
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestUser>>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyFollowers(fields?: string, limit?: number): Promise<Array<PinterestUser>> { return; }
|
||||
|
||||
/**
|
||||
* Get the authenticated user's followed boards.
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestBoard>>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyFollowedBoards(fields?: string, limit?: number): Promise<Array<PinterestBoard>> { return; }
|
||||
|
||||
/**
|
||||
* Get the authenticated user's followed interests.
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static getMyFollowedInterests(fields?: string, limit?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get a user's profile.
|
||||
* @param username
|
||||
* @param fields
|
||||
* @returns {Promise<PinterestUser>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getUser(username: string, fields?: string): Promise<PinterestUser> { return; }
|
||||
|
||||
/**
|
||||
* Get a board's data.
|
||||
* @param boardId
|
||||
* @param fields
|
||||
* @returns {Promise<PinterestBoard>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getBoard(boardId: string, fields?: string): Promise<PinterestBoard> { return; }
|
||||
|
||||
/**
|
||||
* Get Pins of a specific board.
|
||||
* @param boardId {string} The ID of the board
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @param limit {number} Optional limit, defaults to 100, maximum is 100.
|
||||
* @returns {Promise<Array<PinterestPin>>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getBoardPins(boardId: string, fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
|
||||
|
||||
/**
|
||||
* Delete a board.
|
||||
* @param boardId {string} The ID of the board
|
||||
* @returns {Promise<PinterestUser>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deleteBoard(boardId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Create a new board for the authenticated user.
|
||||
* @param name {string} Name of the board
|
||||
* @param desc {string} Optional description of the board
|
||||
* @returns {Promise<PinterestBoard>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static createBoard(name: string, desc?: string): Promise<PinterestBoard> { return; }
|
||||
|
||||
/**
|
||||
* Get a Pin by ID.
|
||||
* @param pinId {string} The ID of the Pin
|
||||
* @param fields {string} Optional fields separated by comma
|
||||
* @returns {Promise<PinterestPin>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static getPin(pinId: string, fields?: string): Promise<PinterestPin> { return; }
|
||||
|
||||
/**
|
||||
* Deletes a pin
|
||||
* @param pinId {string} The ID of the pin
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static deletePin(pinId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Creates a Pin
|
||||
* @param note {string} Note/Description of the pin
|
||||
* @param boardId {string} Board ID to put the Pin under
|
||||
* @param imageUrl {string} URL of the image to share
|
||||
* @param link {string} Optional link to share
|
||||
* @returns {Promise<PinterestPin>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 4,
|
||||
errorIndex: 5
|
||||
})
|
||||
static createPin(note: string, boardId: string, imageUrl: string, link?: string): Promise<PinterestPin> { return; }
|
||||
|
||||
}
|
||||
@@ -1,9 +1,106 @@
|
||||
import { get } from '../util';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
declare var window;
|
||||
declare var Promise;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface PluginConfig {
|
||||
/**
|
||||
* Plugin name, this should match the class name
|
||||
*/
|
||||
pluginName: string;
|
||||
/**
|
||||
* Plugin NPM package name
|
||||
*/
|
||||
plugin: string;
|
||||
/**
|
||||
* Plugin object reference
|
||||
*/
|
||||
pluginRef: string;
|
||||
/**
|
||||
* Github repository URL
|
||||
*/
|
||||
repo: string;
|
||||
/**
|
||||
* Custom install command
|
||||
*/
|
||||
install?: string;
|
||||
/**
|
||||
* Supported platforms
|
||||
*/
|
||||
platforms?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface CordovaOptions {
|
||||
/**
|
||||
* Set to true if the wrapped method is a sync function
|
||||
*/
|
||||
sync?: boolean;
|
||||
/**
|
||||
* Callback order. Set to reverse if the success/error callbacks are the first 2 arguments that the wrapped method takes.
|
||||
*/
|
||||
callbackOrder?: 'reverse';
|
||||
/**
|
||||
* Callback style
|
||||
*/
|
||||
callbackStyle?: 'node' | 'object';
|
||||
/**
|
||||
* Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
|
||||
*/
|
||||
successIndex?: number;
|
||||
/**
|
||||
* Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
|
||||
*/
|
||||
errorIndex?: number;
|
||||
/**
|
||||
* Success function property name. This must be set if callbackStyle is set to object.
|
||||
*/
|
||||
successName?: string;
|
||||
/**
|
||||
* Error function property name. This must be set if callbackStyle is set to object.
|
||||
*/
|
||||
errorName?: string;
|
||||
/**
|
||||
* Set to true to return an observable
|
||||
*/
|
||||
observable?: boolean;
|
||||
/**
|
||||
* If observable is set to true, this can be set to a different function name that will cancel the observable.
|
||||
*/
|
||||
clearFunction?: string;
|
||||
/**
|
||||
* This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used in the initial function.
|
||||
*/
|
||||
clearWithArgs?: boolean;
|
||||
/**
|
||||
* Creates an observable that wraps a global event. Replaces document.addEventListener
|
||||
*/
|
||||
eventObservable?: boolean;
|
||||
/**
|
||||
* Event name, this must be set if eventObservable is set to true
|
||||
*/
|
||||
event?: string;
|
||||
/**
|
||||
* Element to attach the event listener to, this is optional, defaults to `window`
|
||||
*/
|
||||
element?: any;
|
||||
/**
|
||||
* Set to true if the wrapped method returns a promise
|
||||
*/
|
||||
otherPromise?: boolean;
|
||||
/**
|
||||
* Supported platforms
|
||||
*/
|
||||
platforms?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param pluginRef
|
||||
@@ -108,7 +205,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
|
||||
let pluginInstance = getPlugin(pluginObj.pluginRef);
|
||||
|
||||
if (!pluginInstance) {
|
||||
if (!pluginInstance || pluginInstance[methodName] === 'undefined') {
|
||||
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
|
||||
if (!window.cordova) {
|
||||
cordovaWarn(pluginObj.pluginName, methodName);
|
||||
@@ -123,8 +220,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: Illegal invocation needs window context
|
||||
return get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||
return pluginInstance[methodName].apply(pluginInstance, args);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,14 +342,12 @@ function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
|
||||
|
||||
/**
|
||||
* Wrap the event with an observable
|
||||
* @param event
|
||||
* @param event even name
|
||||
* @param element The element to attach the event listener to
|
||||
* @returns {Observable}
|
||||
*/
|
||||
function wrapEventObservable(event: string): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
window.addEventListener(event, observer.next.bind(observer), false);
|
||||
return () => window.removeEventListener(event, observer.next.bind(observer), false);
|
||||
});
|
||||
function wrapEventObservable(event: string, element: any = window): Observable<any> {
|
||||
return Observable.fromEvent(element, event);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +398,7 @@ function overrideFunction(pluginObj: any, methodName: string, args: any[], opts:
|
||||
* @param opts
|
||||
* @returns {function(...[any]): (undefined|*|Observable|*|*)}
|
||||
*/
|
||||
export const wrap = function(pluginObj: any, methodName: string, opts: any = {}) {
|
||||
export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOptions = {}) {
|
||||
return (...args) => {
|
||||
if (opts.sync) {
|
||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||
@@ -312,7 +406,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
|
||||
} else if (opts.observable) {
|
||||
return wrapObservable(pluginObj, methodName, args, opts);
|
||||
} else if (opts.eventObservable && opts.event) {
|
||||
return wrapEventObservable(opts.event);
|
||||
return wrapEventObservable(opts.event, opts.element);
|
||||
} else if (opts.otherPromise) {
|
||||
return wrapOtherPromise(pluginObj, methodName, args, opts);
|
||||
} else {
|
||||
@@ -321,6 +415,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
@@ -340,7 +435,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export function Plugin(config) {
|
||||
export function Plugin(config: PluginConfig) {
|
||||
return function(cls) {
|
||||
|
||||
// Add these fields to the class
|
||||
@@ -376,7 +471,7 @@ export function Plugin(config) {
|
||||
* Wrap a stub function in a call to a Cordova plugin, checking if both Cordova
|
||||
* and the required plugin are installed.
|
||||
*/
|
||||
export function Cordova(opts: any = {}) {
|
||||
export function Cordova(opts: CordovaOptions = {}) {
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
@@ -410,7 +505,7 @@ export function CordovaInstance(opts: any = {}) {
|
||||
export function CordovaProperty(target: any, key: string) {
|
||||
const exists = () => {
|
||||
let pluginInstance = getPlugin(target.pluginRef);
|
||||
if (!pluginInstance) {
|
||||
if (!pluginInstance || typeof pluginInstance[key] === 'undefined') {
|
||||
pluginWarn(target, key);
|
||||
return false;
|
||||
}
|
||||
@@ -422,7 +517,7 @@ export function CordovaProperty(target: any, key: string) {
|
||||
if (exists()) {
|
||||
return getPlugin(target.pluginRef)[key];
|
||||
} else {
|
||||
return {};
|
||||
return null;
|
||||
}
|
||||
},
|
||||
set: (value) => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface NotificationEventResponse {
|
||||
/**
|
||||
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
|
||||
*/
|
||||
additionalData: NotificationEventAdditionalData;
|
||||
additionalData: NotificationEventAdditionalData | any;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,6 +110,25 @@ export interface PushNotification {
|
||||
unregister(successHandler: () => any, errorHandler?: () => any): void;
|
||||
|
||||
/**
|
||||
* The subscribe method is used when the application wants to subscribe a new topic to receive push notifications.
|
||||
* @param {string} topic: Topic to subscribe to.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
subscribe(topic: string, successHandler: () => any, errorHandler?: () => any): void;
|
||||
|
||||
/**
|
||||
* The unsubscribe method is used when the application no longer wants to receive push notifications
|
||||
* from a specific topic but continue to receive other push messages.
|
||||
* @param {string} topic: Topic to subscribe to.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
unsubscribe(topic: string, successHandler: () => any, errorHandler?: () => any): void;
|
||||
|
||||
/**
|
||||
* iOS & android only
|
||||
*
|
||||
* Set the badge count visible when the app is not running
|
||||
*
|
||||
* The count is an integer indicating what number should show up in the badge.
|
||||
@@ -121,6 +140,8 @@ export interface PushNotification {
|
||||
*/
|
||||
setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count?: number): void;
|
||||
/**
|
||||
* iOS only
|
||||
*
|
||||
* Get the current badge count visible when the app is not running
|
||||
* successHandler gets called with an integer which is the current badge count
|
||||
* @param successHandler
|
||||
@@ -130,6 +151,7 @@ export interface PushNotification {
|
||||
|
||||
/**
|
||||
* iOS only
|
||||
*
|
||||
* Tells the OS that you are done processing a background push notification.
|
||||
* successHandler gets called when background push processing is successfully completed.
|
||||
* @param successHandler
|
||||
@@ -137,6 +159,16 @@ export interface PushNotification {
|
||||
* @param id
|
||||
*/
|
||||
finish(successHandler: () => any, errorHandler: () => any, id?: string): void;
|
||||
|
||||
/**
|
||||
* iOS & android only
|
||||
*
|
||||
* Tells the OS to clear all notifications from the Notification Center.
|
||||
* successHandler gets called when the api successfully clears the notifications
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
clearAllNotifications(successHandler: () => any, errorHandler: () => any): void;
|
||||
}
|
||||
|
||||
export interface IOSPushOptions {
|
||||
|
||||
34
src/plugins/rollbar.ts
Normal file
34
src/plugins/rollbar.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Rollbar
|
||||
* @description
|
||||
* This plugin adds Rollbar App monitoring to your application
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Rollbar } from 'ionic-native';
|
||||
*
|
||||
* Rollbar.init();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Rollbar',
|
||||
plugin: 'resgrid-cordova-plugins-rollbar',
|
||||
pluginRef: 'Rollbar',
|
||||
repo: 'https://github.com/Resgrid/cordova-plugins-rollbar',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"'
|
||||
})
|
||||
export class Rollbar {
|
||||
|
||||
/**
|
||||
* This function initializes the monitoring of your application
|
||||
* @return {Promise<any>} Returns a promise that resolves when the plugin successfully initializes
|
||||
*/
|
||||
@Cordova()
|
||||
static init(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -71,7 +71,10 @@ export class SafariViewController {
|
||||
* @param options {SafariViewControllerOptions} optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static show(options?: SafariViewControllerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,9 +49,10 @@ export class ScreenOrientation {
|
||||
* Lock the orientation to the passed value.
|
||||
* See below for accepted values
|
||||
* @param orientation {string} The orientation which should be locked. Accepted values see table below.
|
||||
* @returns {Promise<any>} returns a promise that resolves when the screen orientation is locked, and rejects when an error occurs.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static lockOrientation(orientation: string): void { }
|
||||
@Cordova({ otherPromise: true })
|
||||
static lockOrientation(orientation: string): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Unlock and allow all orientations.
|
||||
|
||||
111
src/plugins/serial.ts
Normal file
111
src/plugins/serial.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var serial: any;
|
||||
|
||||
export interface SerialPermissionOptions {
|
||||
vid: string;
|
||||
pid: string;
|
||||
driver: string;
|
||||
}
|
||||
|
||||
export interface SerialOpenOptions {
|
||||
baudRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Serial
|
||||
* @description
|
||||
* This plugin provides functions for working with Serial connections
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```
|
||||
* import { Serial } from 'ionic-native';
|
||||
*
|
||||
* Serial.requestPermission({
|
||||
* vid: '0403',
|
||||
* pid: '6001',
|
||||
* driver: 'FtdiSerialDriver'
|
||||
* }).then(() => {
|
||||
* Serial.open({
|
||||
* baudRate: 38400
|
||||
* }).then(() => {
|
||||
* console.log('Serial connection opened');
|
||||
* });
|
||||
* }).catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Serial',
|
||||
plugin: 'cordovarduino',
|
||||
pluginRef: 'serial',
|
||||
repo: 'https://github.com/xseignard/cordovarduino',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class Serial {
|
||||
|
||||
/**
|
||||
* Request permission to connect to a serial device
|
||||
*
|
||||
* @param options {SerialPermissionOptions} Options used to request serial permissions
|
||||
* @return {Promise<any>} Returns a promise that resolves when permissions are granted
|
||||
*/
|
||||
@Cordova()
|
||||
static requestPermission(options: SerialPermissionOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Open connection to a serial device
|
||||
*
|
||||
* @param options {SerialOpenOptions} Options used to open serial connection
|
||||
* @return {Promise<any>} Returns a promise that resolves when the serial connection is opened
|
||||
*/
|
||||
@Cordova()
|
||||
static open(options: SerialOpenOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write to a serial connection
|
||||
*
|
||||
* @param data {any} data to write to the serial connection
|
||||
* @return {Promise<any>} Returns a promise that resolves when the write is complete
|
||||
*/
|
||||
@Cordova()
|
||||
static write(data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Write hex to a serial connection
|
||||
*
|
||||
* @param data {any} data to write to the serial connection
|
||||
* @return {Promise<any>} Returns a promise that resolves when the write is complete
|
||||
*/
|
||||
@Cordova()
|
||||
static writeHex(data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Read from a serial connection
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves with data read from the serial connection
|
||||
*/
|
||||
@Cordova()
|
||||
static read(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Watch the incoming data from the serial connection. Clear the watch by unsubscribing from the observable
|
||||
*
|
||||
* @returns {Observable<any>} Observable returns an observable that you can subscribe to
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static registerReadCallback(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Close the serial connection
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the serial connection is closed
|
||||
*/
|
||||
@Cordova()
|
||||
static close(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -17,6 +17,15 @@ import { Cordova, Plugin } from './plugin';
|
||||
* (info) => console.log('Sim info: ', info),
|
||||
* (err) => console.log('Unable to get sim info: ', err)
|
||||
* );
|
||||
*
|
||||
* Sim.hasReadPermission().then(
|
||||
* (info) => console.log('Has permission: ', info)
|
||||
* );
|
||||
*
|
||||
* Sim.requestReadPermission().then(
|
||||
* () => console.log('Permission granted'),
|
||||
* () => console.log('Permission denied')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -34,4 +43,21 @@ export class Sim {
|
||||
@Cordova()
|
||||
static getSimInfo(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static hasReadPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static requestReadPermission(): Promise<any> { return; }
|
||||
}
|
||||
|
||||
157
src/plugins/speech-recognition.ts
Normal file
157
src/plugins/speech-recognition.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type SpeechRecognitionListeningOptions = SpeechRecognitionListeningOptionsIOS | SpeechRecognitionListeningOptionsAndroid;
|
||||
|
||||
export interface SpeechRecognitionListeningOptionsIOS {
|
||||
/**
|
||||
* used language for recognition (default `"en-US"`)
|
||||
*/
|
||||
language?: string;
|
||||
|
||||
/**
|
||||
* umber of return matches (default `5`)
|
||||
*/
|
||||
matches?: number;
|
||||
|
||||
/**
|
||||
* Allow partial results to be returned (default `false`)
|
||||
*/
|
||||
showPartial?: boolean;
|
||||
}
|
||||
|
||||
export interface SpeechRecognitionListeningOptionsAndroid {
|
||||
/**
|
||||
* used language for recognition (default `"en-US"`)
|
||||
*/
|
||||
language?: string;
|
||||
|
||||
/**
|
||||
* number of return matches (maximum number of matches)
|
||||
*/
|
||||
matches?: number;
|
||||
|
||||
/**
|
||||
* displayed prompt of listener popup window
|
||||
*/
|
||||
prompt?: string;
|
||||
|
||||
/**
|
||||
* display listener popup window with prompt (default `true`)
|
||||
*/
|
||||
showPopup?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name SpeechRecognition
|
||||
* @description
|
||||
* This plugin does speech recognition using cloud services
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { SpeechRecognition } from 'ionic-native';
|
||||
*
|
||||
* // Check feature available
|
||||
* SpeechRecognition.isRecognitionAvailable()
|
||||
* .then((available: boolean) => console.log(available))
|
||||
*
|
||||
* // Start the recognition process
|
||||
* SpeechRecognition.startListening(options)
|
||||
* .subscribe(
|
||||
* (matches: Array<string>) => console.log(matches),
|
||||
* (onerror) => console.log('error:', onerror)
|
||||
* )
|
||||
*
|
||||
* // Stop the recognition process (iOS only)
|
||||
* SpeechRecognition.stopListening()
|
||||
*
|
||||
* // Get the list of supported languages
|
||||
* SpeechRecognition.getSupportedLanguages()
|
||||
* .then(
|
||||
* (languages: Array<string>) => console.log(languages),
|
||||
* (error) => console.log(error)
|
||||
* )
|
||||
*
|
||||
* // Check permission
|
||||
* SpeechRecognition.hasPermission()
|
||||
* .then((hasPermission: boolean) => console.log(hasPermission))
|
||||
*
|
||||
* // Request permissions
|
||||
* SpeechRecognition.requestPermission()
|
||||
* .then(
|
||||
* () => console.log('Granted'),
|
||||
* () => console.log('Denied')
|
||||
* )
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SpeechRecognition',
|
||||
plugin: 'cordova-plugin-speechrecognition',
|
||||
pluginRef: 'plugins.speechRecognition',
|
||||
repo: 'https://github.com/pbakondy/cordova-plugin-speechrecognition',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class SpeechRecognition {
|
||||
|
||||
/**
|
||||
* Check feature available
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isRecognitionAvailable(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the recognition process
|
||||
* @return {Promise< Array<string> >} list of recognized terms
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
|
||||
})
|
||||
static startListening(options?: SpeechRecognitionListeningOptions): Observable<Array<string>> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the recognition process
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static stopListening(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of supported languages
|
||||
* @return {Promise< Array<string> >} list of languages
|
||||
*/
|
||||
@Cordova()
|
||||
static getSupportedLanguages(): Promise<Array<string>> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
* @return {Promise<boolean>} has permission
|
||||
*/
|
||||
@Cordova()
|
||||
static hasPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permissions
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static requestPermission(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ declare var sqlitePlugin;
|
||||
* })
|
||||
* .then((db: SQLite) => {
|
||||
*
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))').then(() => {}).catch(() => {});
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {}).catch(() => {});
|
||||
*
|
||||
* })
|
||||
* .catch(error => console.error('Error opening database', error);
|
||||
|
||||
@@ -21,9 +21,9 @@ import { Plugin, Cordova } from './plugin';
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Stepcounter',
|
||||
plugin: 'https://github.com/texh/cordova-plugin-stepcounter',
|
||||
plugin: 'https://github.com/Slidee/cordova-plugin-stepcounter',
|
||||
pluginRef: 'stepcounter',
|
||||
repo: 'https://github.com/texh/cordova-plugin-stepcounter',
|
||||
repo: 'https://github.com/Slidee/cordova-plugin-stepcounter',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class Stepcounter {
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface StreamingAudioOptions {
|
||||
* orientation: 'landscape'
|
||||
* };
|
||||
*
|
||||
* StreamingMedia.('https://path/to/video/stream', options);
|
||||
* StreamingMedia.playVideo('https://path/to/video/stream', options);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
|
||||
106
src/plugins/stripe.ts
Normal file
106
src/plugins/stripe.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
export interface StripeCardTokenParams {
|
||||
/**
|
||||
* Card number
|
||||
*/
|
||||
number: string;
|
||||
/**
|
||||
* Expiry month
|
||||
*/
|
||||
expMonth: number;
|
||||
/**
|
||||
* Expiry year
|
||||
*/
|
||||
expYear: number;
|
||||
/**
|
||||
* CVC / CVV
|
||||
*/
|
||||
cvc?: string;
|
||||
/**
|
||||
* Cardholder name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Address line 1
|
||||
*/
|
||||
address_line1?: string;
|
||||
/**
|
||||
* Address line 2
|
||||
*/
|
||||
address_line2?: string;
|
||||
/**
|
||||
* City
|
||||
*/
|
||||
address_city?: string;
|
||||
/**
|
||||
* State / Province
|
||||
*/
|
||||
address_state?: string;
|
||||
/**
|
||||
* Country
|
||||
*/
|
||||
address_country?: string;
|
||||
/**
|
||||
* Postal code / ZIP Code
|
||||
*/
|
||||
postal_code?: string;
|
||||
/**
|
||||
* 3-letter ISO code for currency
|
||||
*/
|
||||
currency?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Stripe
|
||||
* @description
|
||||
* A plugin that allows you to use Stripe's Native SDKs for Android and iOS.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Stripe } from 'ionic-native';
|
||||
*
|
||||
* Stripe.setPublishableKey('my_publishable_key');
|
||||
*
|
||||
* let card = {
|
||||
* number: '4242424242424242',
|
||||
* expMonth: 12,
|
||||
* expYear: 2020,
|
||||
* cvc: 220
|
||||
* };
|
||||
*
|
||||
* Stripe.createToken(card)
|
||||
* .then(token => console.log(token))
|
||||
* .catch(error => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* StripeCardTokenParams
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Stripe',
|
||||
plugin: 'cordova-plugin-stripe',
|
||||
pluginRef: 'cordova.plugins.stripe',
|
||||
repo: 'https://github.com/zyramedia/cordova-plugin-stripe'
|
||||
})
|
||||
export class Stripe {
|
||||
|
||||
/**
|
||||
* Set publishable key
|
||||
* @param publishableKey {string} Publishable key
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setPublishableKey(publishableKey: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Create Credit Card Token
|
||||
* @param params {StripeCardTokenParams} Credit card information
|
||||
* @return {Promise<string>} returns a promise that resolves with the token, or reject with an error
|
||||
*/
|
||||
@Cordova()
|
||||
static createCardToken(params: StripeCardTokenParams): Promise<string> { return; }
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export interface VideoOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'VideoPlayer',
|
||||
plugin: 'cordova-plugin-videoplayer',
|
||||
plugin: 'https://github.com/moust/cordova-plugin-videoplayer',
|
||||
pluginRef: 'VideoPlayer',
|
||||
repo: 'https://github.com/moust/cordova-plugin-videoplayer',
|
||||
platforms: ['Android']
|
||||
|
||||
@@ -9,6 +9,7 @@ window.plugins = {
|
||||
};
|
||||
|
||||
const testPluginMeta = {
|
||||
pluginName: 'Test',
|
||||
plugin: 'cordova-plugin-test',
|
||||
pluginRef: 'plugins.test',
|
||||
repo: 'https://github.com/apache/cordova-plugin-test',
|
||||
|
||||
40
test/plugins/googlemap.spec.ts
Normal file
40
test/plugins/googlemap.spec.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { GoogleMapsLatLngBounds, GoogleMapsLatLng } from '../../src/plugins/googlemap';
|
||||
|
||||
declare var window: any;
|
||||
|
||||
class LatLngBounds {
|
||||
public southwest: GoogleMapsLatLng;
|
||||
public northeast: GoogleMapsLatLng;
|
||||
|
||||
constructor(latLngArray: GoogleMapsLatLng[]) {
|
||||
this.southwest = latLngArray[0];
|
||||
this.northeast = latLngArray[1];
|
||||
}
|
||||
}
|
||||
|
||||
window.plugin = {
|
||||
google: {
|
||||
maps: {
|
||||
LatLngBounds
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
describe('GoogleMapsLatLngBounds', () => {
|
||||
|
||||
const southwest = new GoogleMapsLatLng(1,1);
|
||||
const northeast = new GoogleMapsLatLng(4,4);
|
||||
let object;
|
||||
|
||||
it('should create an object', () => {
|
||||
object = new GoogleMapsLatLngBounds([southwest, northeast]);
|
||||
expect(object).toBeDefined();
|
||||
});
|
||||
|
||||
it('northwest property should be defined', () => expect(object.northeast).toBeDefined());
|
||||
|
||||
it('southwest property should be defined', () => expect(object.southwest).toBeDefined());
|
||||
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user