Compare commits

...

117 Commits

Author SHA1 Message Date
Ibby
78fcdc8d80 chore(): update changelog 2017-02-07 11:32:53 -05:00
Ibby
53f7056b16 2.5.1 2017-02-07 11:32:28 -05:00
Ibby
b7701cdb16 fix(pin-dialog): add missing errorIndex 2017-02-07 10:19:32 -05:00
Ibby
94a4519f2b chore(): update changelog 2017-02-07 07:27:35 -05:00
Ibby
6fe52b610b 2.5.0 2017-02-07 07:27:16 -05:00
Ibby Hadeed
434a6c8ad3 Update stepcounter.ts 2017-02-06 08:33:10 -05:00
Tom Sundstrom
97489ba573 feat(barcodescanner): add option disableSuccessBeep (#1035)
https://github.com/phonegap/phonegap-plugin-barcodescanner/pull/408
2017-02-05 05:41:49 -05:00
Ibby Hadeed
f525a25b49 refractor(google-maps): use Observable.fromEvent instead of addEventListener (#1032) 2017-02-04 04:32:41 -05:00
Ibby
add49e8b4d refractor(): use Observable.fromEvent in wrapEventObservable 2017-02-04 04:16:57 -05:00
Eds
4ab87d8abb feat(inappbrowser): add hide function (#1018) 2017-02-01 01:42:07 -05:00
Prateek Kathal
69ff7afb48 docs(file): add link to additional information (#1022)
Adding a link to **cordova plugin file** for ease of understanding file management using cordova.

It took me almost a day to figure out how to properly save things like a pdf/image in a publicly accessible directory. Having a link to the main **cordova file** documentation will save a lot of time.
2017-02-01 01:40:55 -05:00
Ibby
62a30c7d8f Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-31 04:14:40 -05:00
Ibby
dc37d8f71c fix(safari-view-controller): fix issue caused by calling show without options 2017-01-31 04:14:28 -05:00
Huan LI
8864d1360a docs(streaming-media): add missing method name (#1016) 2017-01-31 01:39:21 -05:00
Ibby
613141998a docs(header-color): fix doc name 2017-01-30 11:45:36 -05:00
Ibby
c2fbb4fb64 docs(geolocation): update watchPosition example 2017-01-30 11:43:58 -05:00
Josh Strange
f0cf86076c feat(background-geolocation): add missing properties for Android 2017-01-30 05:45:42 -05:00
Ibby
a03afcf0fa fix(pinterest): fix PinterestPin interface 2017-01-29 06:49:28 -05:00
Ibby
3abe0bb97d Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-26 20:30:51 -05:00
Ibby
a5b4632ceb fix(file-transfer): fix return type of upload method
fixes #1002
2017-01-26 20:30:44 -05:00
Ibby Hadeed
1c78f77c0f docs(stepcounter): update repo and plugin
closes #1003
2017-01-25 22:22:05 -05:00
Ibby
cb7d3ef3e0 chore(): update changelog 2017-01-24 15:14:36 -05:00
Ibby
5e83a09056 2.4.1 2017-01-24 15:14:07 -05:00
Ibby
b85393de89 chore(): add CordovaOptions interface 2017-01-24 15:12:35 -05:00
Ibby
68c535fd79 style(): missing semicolon 2017-01-24 15:00:43 -05:00
Ibby
1c09ee1fbc fix(screen-orientation): lockOrientation returns a promise
closes #939
2017-01-24 15:00:20 -05:00
Ibby
8b921165bb fix merge conflict 2017-01-24 00:49:14 -05:00
Ibby
0c837de499 chore(): update changelog 2017-01-24 00:48:42 -05:00
Ibby
a44500d206 2.4.0 2017-01-24 00:48:07 -05:00
Ibby
e063613c8c 2.3.3 2017-01-24 00:46:51 -05:00
Ibby
416071a5a1 fix(google-maps): fix event listeners
fixes #999
2017-01-24 00:46:37 -05:00
Ibby
93fdb7eabb fix typo 2017-01-23 23:00:56 -05:00
Ibby
466437a683 feat(pinterest): add pinterest plugin 2017-01-23 22:59:37 -05:00
Ibby
a34723b53c legal name change 2017-01-23 22:22:19 -05:00
Ibby
b9bd5100a2 chore(): update changelog 2017-01-23 22:20:09 -05:00
Ibby
51bafccf38 2.3.2 2017-01-23 22:19:48 -05:00
Ibby
c3127d35bb fix(googlemaps): fix GoogleMapsLaLngBounds
closes #972
2017-01-23 22:02:31 -05:00
Ibby
1322c1b089 test(): fix test plugin meta 2017-01-22 17:37:04 -05:00
Ibby
9bf7895386 chore(): update changelog 2017-01-22 17:34:13 -05:00
Ibby
538dcb98eb 2.3.1 2017-01-22 17:33:59 -05:00
Ibby
3da0efe38e fix(battery-status): add missing pluginRef 2017-01-22 17:27:52 -05:00
Ibby
b983de2145 feat(core): add PluginConfig interface
closes #996
2017-01-22 17:24:43 -05:00
Guille
9f98f8ef46 feat(google-maps): add base class functions (#993) 2017-01-22 17:17:13 -05:00
Ibby
3e2964b385 Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-22 17:13:59 -05:00
Guille
77ab2c21da refractor(): name to pluginName (#994) 2017-01-22 17:13:42 -05:00
guille
94025a7fd2 fix(plugin): adds subscribe() and unsubscribe() 2017-01-22 17:13:13 -05:00
guille
8c021bcaa0 fix(): add clearAllNotifications() 2017-01-22 17:13:13 -05:00
Ibby
da7a3707fa fix(core): fix plugin check 2017-01-22 17:12:24 -05:00
Peter Kelly
cb293639bc fix(core): fix exception in CordovaProperty (#998)
This reverts part of commit 67adb23, which moved the call to getPlugin()
from within CordovaProperty() to a point where it was called too early.

When the CordovaProperty decorator is called on a property, the class
containing that call has not yet had its Plugin decorator called. Only
when the latter happens does pluginRef get set. Thus, attempting to
access pluginRef within CordovaProperty at the time of the call will
give undefined, and attemping to call getPlugin with an undefined value
will throw an exception:

    Runtime Error
    Cannot read property 'split' of undefined

    TypeError: Cannot read property 'split' of undefined
        at get
        at getPlugin
        at CordovaProperty
        at __decorate
        ...

The above message can be seen in the browser after running the 'ionic
serve' command.

This commit moves the getPlugin call back to the getters and setters
established by CordovaProperty, which are only called *after* the Plugin
decorator has finished executing.

closes #992
2017-01-22 17:11:52 -05:00
Ibby
16f0712462 chore(): update changelog 2017-01-20 16:34:25 -05:00
Ibby
e9b2b93486 2.3.0 2017-01-20 16:33:57 -05:00
Ibby
a8258ec998 docs(): add beta tags 2017-01-20 16:33:43 -05:00
Ibby
09747cd746 docs(firebase): improve docs 2017-01-20 16:29:15 -05:00
Ibby
2f89ae0e84 Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-20 16:24:22 -05:00
Megan Kearl
ac748abf78 feat(serial): add Serial plugin (#952)
* style: fix whitespace lint issue

* feat(serial): add serial plugin

* docs(serial): remove unnecessary comments
2017-01-20 16:16:12 -05:00
Guillaume
1279114b73 feat(backlight): add Backlight plugin (#973)
* feat(backlight): add Backlight plugin

* fix(backlight): set as beta
2017-01-20 16:14:29 -05:00
Peter Bakondy
7c30718369 feat(speech-recognition): add SpeechRecognition plugin (#897) 2017-01-20 16:13:58 -05:00
Kim Biesbjerg
9c75a06131 feat(launch-review): add LaunchReview plugin (#949)
* Add LaunchReview

* Fix pluginRef
2017-01-20 16:11:57 -05:00
Guillaume
1e38a6c005 feat(broadcaster): add Broadcaster plugin (#877)
* feat(broadcaster): add Broadcaster plugin

* fix(broadcaster): return Obserable for addEventListener

- also remove the listener when clearing observable
2017-01-20 16:11:19 -05:00
Ibby
23639ee859 docs(): add beta tag 2017-01-20 16:10:39 -05:00
Ibby
be20c51996 Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-20 16:09:27 -05:00
Niklas Merz
1615b74065 feat(fingerprint-aio): add cordova-plugin-fingerprint-aio (#845) 2017-01-20 16:09:21 -05:00
Ibby
5638f90783 refractor(): remove default value from optional param 2017-01-20 16:07:28 -05:00
Ibby
47b6164e99 docs(): add beta tags 2017-01-20 16:07:05 -05:00
Lucas A. Moulin
229f5509e9 feat(rollbar): add Rollbar plugin (#832)
* Add Rollbar plugin

* Add documentation

* Add return type to init function

* Remove init params
2017-01-20 16:05:06 -05:00
John-Luke
70c15c31ca feat(navigationbar): add NavigationBar plugin (#826)
* feat(navigationbar): add NavigationBar plugin

* fix(navigationbar) typo in chore

* Implement changes requested

* fix(): add return

* fix(docs): remove callback parameter

* Update navigationbar.ts
2017-01-20 16:04:31 -05:00
Ibby
a98ccc726f Merge branch 'John-Luke-master' 2017-01-20 16:04:09 -05:00
Ibby
538ebfe9fe fix merge conflict 2017-01-20 16:03:58 -05:00
Ibby Hadeed
8e98481609 feat(firebase): add firebase plugin (#914)
closes #608
2017-01-20 16:02:33 -05:00
Ibby Hadeed
0ec46b03b5 feat(stripe): add stripe plugin (#913)
* feat(stripe): add stripe plugin

* add stripe to index

* add param doc
2017-01-20 16:02:17 -05:00
Ibby
f10f152d2c docs(native-geocoder): add interfaces 2017-01-20 16:01:54 -05:00
Ibby
d746a98ef4 refractor(native-geocoder): refractor interface names 2017-01-20 16:01:29 -05:00
Ibby
dbf95ea4bd fix(native-geocoder): fix callback order 2017-01-20 16:00:05 -05:00
Sebastian Baar
911537b61b feat(nativegeocoder): add NativeGeocoder plugin (#800) 2017-01-20 15:56:16 -05:00
Ibby
db55342329 chore(): update changelog 2017-01-20 15:53:35 -05:00
Ibby
d54ce83c8f 2.2.17 2017-01-20 15:52:47 -05:00
John-Luke
2e926f4a94 Update headercolor.ts 2017-01-19 09:06:58 -03:00
John-Luke
292a9f08e9 solve conflict 2017-01-18 19:06:27 -02:00
John-Luke
b2cd106aae Update headercolor.ts 2017-01-18 18:58:27 -02:00
elless
ab681cccbe fix(app-rate): onRateDialogShow callback (#985) 2017-01-18 12:52:36 -05:00
Dennis Bruijn
9008aa264b docs(google-maps): make it clear that the map element needs a height (#984)
I added a change that makes it clear that the map element needs a height to be visible.

I tried to follow the docs but It didn't work, after that I thought my API keys were invalid, at the end it turned out the map wasn't visible at all.
2017-01-18 10:37:02 -05:00
Ibby Hadeed
33ca56a151 remove static method open 2017-01-18 10:34:52 -05:00
Attila Oláh
d8892e195b docs(file): clarify what unit getFreeDiskSpace returns with (#981) 2017-01-18 10:30:38 -05:00
Max Lynch
0ab14a085e fix(core): increase deviceready timeout for sanity 2017-01-16 15:33:59 -06:00
Vlado Velichkovski
a88cf7034b docs(nfc): fix return type (#961)
Doc fix for stringToBytes function
2017-01-15 22:48:23 -05:00
Diego
c44071d117 docs(file-chooser): added missing ")" (#971) 2017-01-13 14:02:19 -05:00
perry
fb275e0d9f amend(docs): typo in the last commit 2017-01-11 13:02:00 -06:00
perry
5c7d7ac527 chore(docs): add beta warning to docs pages 2017-01-11 13:00:52 -06:00
perry
1134ac96b6 chore(docs): mark static properties as properties Closes #962 2017-01-11 11:28:59 -06:00
Abdelaziz Bennouna
e902856089 feat(barcodescanner): add missing options (#966)
Fixes #965
2017-01-11 11:31:29 -05:00
Ibby
67adb23a14 chore(): optimize CordovaProperty
closes #954
2017-01-10 20:45:11 -05:00
Ibby
028a568515 chore(): update changelog 2017-01-10 20:39:12 -05:00
Ibby
7a8d30f4e1 2.2.16 2017-01-10 20:38:53 -05:00
Ibby
9541009742 chore(): fix the callCordovaPlugin check
the previous approach doesn't handle __proto__ methods
2017-01-10 20:38:48 -05:00
Ibby
9dee2fbc0c chore(): update changelog 2017-01-10 19:17:27 -05:00
Ibby
60b9c69763 2.2.15 2017-01-10 19:17:16 -05:00
Ibby
b98fa28b4b fix(apprate): captialize URL in storeAppURL property 2017-01-10 18:49:53 -05:00
Ibby
603aa9f6d2 chore(): ignore errors when deleting old docs 2017-01-10 16:46:35 -05:00
Ibby
f4fa8c31f0 chore(): ignore errors when deleting old docs 2017-01-10 16:42:40 -05:00
Ibby
8e787fdd5f docs(video-player): update install source
closes #959
2017-01-10 16:39:36 -05:00
Ibby
c5ec7c33b5 refractor(): lodash contains to includes 2017-01-10 16:34:56 -05:00
Ibby
c6dbf343fb chore(): add beta tags 2017-01-10 07:41:44 -05:00
Ibby
fa311e6a7c chore(): update packages 2017-01-10 07:40:21 -05:00
Ibby
04347c3df8 chore(): bump tslint ionic rules to 0.0.7 2017-01-10 07:15:57 -05:00
Ibby
8adb36e2a0 chore(): remove old tsconfig 2017-01-10 07:15:00 -05:00
Ibby
c700c31127 chore(): bump rxjs to 5.0.0-beta.12 2017-01-10 07:13:08 -05:00
Ibby Hadeed
5981622f3a chore(): replace try/catch with better approach (#956)
* chore(): replace try/catch with better approach

* optimize last commit
2017-01-10 07:06:44 -05:00
perry
77d6308bca chore(dgeni): add beta tag support 2017-01-09 13:59:03 -06:00
Ibby
92e0bb55c3 Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-09 07:13:04 -05:00
Ibby
452aa5d8c9 chore(): lock typescript to 2.0.x 2017-01-09 07:12:58 -05:00
MSadiqR
2ddb8be775 Typescript error solved (#947)
Added a placeholder parameter to resolve typescript error
2017-01-09 06:10:08 -05:00
Josh Gibbs
ebf07161b6 fix(onesignal): OSNotification.app_id is optional (#946)
OSNotification::app_id is not required when sending a selfNotification.
2017-01-09 05:07:57 -05:00
Thomas Kemmer
6ddd2aa184 fix(ble): stopScan takes no args when used as clear function (#944) 2017-01-09 05:06:33 -05:00
John-Luke
3fdc4a8acd fix(): add return 2016-12-01 16:27:50 -03:00
John-Luke
db99482157 Implement changes requested 2016-11-30 20:24:33 -03:00
John-Luke
bab2971c58 fix(headercolor): solve typo in usage and chore 2016-11-24 14:37:57 -03:00
John Luke
93696d53f7 feat(headercolor): add HeaderColor plugin
fix [#760](https://github.com/driftyco/ionic-native/issues/760)
2016-11-23 16:47:34 -03:00
51 changed files with 2424 additions and 103 deletions

View File

@@ -1,3 +1,150 @@
<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)
@@ -103,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
@@ -136,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)

View File

@@ -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)

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "2.2.14",
"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",

View File

@@ -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

View File

@@ -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
}

View File

@@ -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 = [];

View File

@@ -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({

View File

@@ -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

View File

@@ -200,7 +200,9 @@ docType: "<$ doc.docType $>"
Delegate: <$ doc.delegate $>
</small>
<@ endif @>
<@- if doc.beta == true -@>
<span class="beta" title="beta">&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 @>

View File

@@ -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">&beta;</span></a>
</li><@ endif @><@ endfor @>

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -126,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;
@@ -225,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;
}
/**

44
src/plugins/backlight.ts Normal file
View 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; }
}

View File

@@ -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;
}
/**

View File

@@ -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']
})

View File

@@ -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; }

View 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; }
}

View File

@@ -22,6 +22,7 @@ export interface CameraPreviewSize {
}
/**
* @beta
* @name CameraPreview
* @description
* Showing camera preview in HTML

View File

@@ -24,6 +24,7 @@ export interface EmailComposerOptions {
/**
* @beta
* @name Email Composer
* @description
*

View File

@@ -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));
*
* ```
*/

View File

@@ -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) => {

View File

@@ -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;
}

View 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
View 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; }
}

View File

@@ -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);
* });

View File

@@ -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;

View 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; }
}

View File

@@ -103,6 +103,7 @@ export interface HotspotDevice {
}
/**
* @beta
* @name Hotspot
* @description
* @usage

View File

@@ -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,6 +72,13 @@ 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 {Object} Details of the script to run, specifying either a file or code key.

View 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; }
}

View 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;
}

View 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; }
}

View File

@@ -162,7 +162,7 @@ export class NFC {
/**
* Convert string to bytes
* @param str {string}
* @returns {string}
* @returns {number[]}
*/
@Cordova({ sync: true })
static stringToBytes(str: string): number[] {return; };

View File

@@ -26,7 +26,7 @@ export interface OSNotification {
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
*/
groupedNotifications?: OSNotificationPayload[];
app_id: string;
app_id?: string;
contents: any;
headings?: any;
isIos?: boolean;

View File

@@ -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
View 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 users Pinterest username.
*/
username?: string;
/**
* The users first name.
*/
first_name?: string;
/**
* The users last name.
*/
last_name?: string;
/**
* The text in the users “About you” section in their profile.
*/
bio?: string;
/**
* The date the user created their account in ISO 8601 format
*/
created_at?: string;
/**
* The users stats, including how many Pins, follows, boards and likes they have.
*/
counts?: any;
/**
* The users profile image. The response returns the images 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 boards stats, including how many Pins, followers, user's following and collaborators it has.
*/
counts?: any;
/**
* The users profile image. The response returns the images 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 Pins image in hex code format.
*/
color?: string;
/**
* The Pins 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 Pins image. The default response returns the images 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; }
}

View File

@@ -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,16 +220,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
};
}
// TODO: Illegal invocation needs window context
let value;
try {
value = get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
} catch (e) {
value = {
error: 'cordova_not_available'
};
}
return value;
return pluginInstance[methodName].apply(pluginInstance, args);
}
/**
@@ -254,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);
}
/**
@@ -312,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
@@ -320,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 {
@@ -329,6 +415,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
};
};
/**
* @private
*
@@ -348,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
@@ -384,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[]) {
@@ -418,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;
}
@@ -430,7 +517,7 @@ export function CordovaProperty(target: any, key: string) {
if (exists()) {
return getPlugin(target.pluginRef)[key];
} else {
return {};
return null;
}
},
set: (value) => {

View File

@@ -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
View 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; }
}

View File

@@ -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; }
/**

View File

@@ -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
View 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; }
}

View 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;
}
}

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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
View 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; }
}

View File

@@ -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']

View File

@@ -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',

View 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());
});