Compare commits

...

153 Commits

Author SHA1 Message Date
Ibby Hadeed
4639bf9a94 fix(google-maps): remove type from GoogleMapsEvent constant 2017-10-17 17:37:15 -04:00
William Pelrine
abb77e3e08 Merge pull request #2042 from ionic-team/pro-js-update
feat(pro): support corova-plugin-ionic v2.0.0
2017-10-13 09:28:53 -05:00
William Pelrine
975f08b7b5 feat(pro): support corova-plugin-ionic v2.0.0 2017-10-12 14:54:13 -05:00
Niklas Merz
773722b767 docs(DEVELOPER) Add documentation for CordovaFunctionOverride decorator (#2029) 2017-10-10 23:48:27 -04:00
Daniel Sogl
447aa56e3c chore(package): bump Angular (#2036) 2017-10-10 23:46:31 -04:00
Max Lynch
8d22798278 RxJS 5.4.2 -> 5.4.3 2017-10-10 09:12:49 -05:00
Max Lynch
30297fb81d Merge pull request #1799 from GulinSS/master
Use RxJS 5.4.2 to fix generics checking in TS 2.4.1
2017-10-10 09:12:17 -05:00
Max Lynch
ac777fca40 Merge branch 'master' into master 2017-10-10 09:11:48 -05:00
Max Lynch
43b70a12b5 Merge branch 'master' into master 2017-10-10 09:10:54 -05:00
Ibby Hadeed
ef28078815 Merge branch 'master' of github.com:ionic-team/ionic-native 2017-10-06 13:45:10 -04:00
Ibby Hadeed
e304ce0e53 chore(): fix readmes script 2017-10-06 13:44:58 -04:00
William Pelrine
9e5f03f15d chore(): update changelog 2017-10-06 10:41:37 -05:00
William Pelrine
465d5519d0 feat(pro): Add support for Ionic Pro by incorporating cordova-plugin-ionic 2017-10-06 10:35:54 -05:00
Ibby Hadeed
d683b9e5df chore(): update changelog 2017-10-05 23:28:48 -04:00
Ibby Hadeed
2b2476e873 4.3.1 2017-10-05 23:28:42 -04:00
Sandip Gadekar
196adc8b2f docs(): added methods that can guide how to create document and get all docs (#2005)
* adding detailed usage for couchbase lite

* added get url method

* create database method added

* delete database method added

* get all database method added

* space added in comments

* comments added unwanted import removed

* whitespaces added

* usage added in commented section

* get all documents,create document methods added

* spell mistake corrected
2017-10-05 23:26:43 -04:00
Daniel Olivares
363b41e075 fix(BLE): make readRSSI() not static (#2011) 2017-10-05 23:24:07 -04:00
Dmitry Smolyakov
2179699622 feat(regula-document-reader): separate initialization and scanning, add android (#2013) 2017-10-05 23:23:51 -04:00
Quentin Ligier
e65406cc2f refactor(photo-viewer): improve options documentation (#2014) 2017-10-05 23:23:09 -04:00
Thomas S
ddb6d43ffa docs(geolocation): update install command (#2016)
Hello guys,

I make this pull request to add the installation variable `GEOLOCATION_USAGE_DESCRIPTION` needed on iOS, since version 10.

Without this variable, using `getCurrentPosition` do nothing on iOS because phone wait user authorization. But that authorization is not display because there is no message defined.

This variable make this part of code in `info.plist` : 

```
<key>NSLocationWhenInUseUsageDescription</key>
<string>To allow locate you</string>
``` 

Source : https://github.com/apache/cordova-plugin-geolocation#ios-quirks

Have a good coding day :)
2017-10-05 23:22:43 -04:00
Kamil Piskorski
30ed33a046 fix(onesignal): fix property name (#2019) 2017-10-05 23:22:03 -04:00
Rene Escobar
3d0a12d40d refactor(): update return value in hasPermission() (#2023) 2017-10-05 23:21:34 -04:00
Masashi Katsumata
6ca5beaf0b fix(google-maps): various fixed introduced in previous release (#2024)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions

* Bug fix: the zoom option is missing

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1712

* Update index.ts

* fix: need to convert instance type from the JS class to the wrapper class

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1706

* remove test file

* fix: Error: Illegal use of "@private" tag.

* fix: The Environment, Encode, and Spherical  are static class

* fix:  convert JS instance to the ionic instance
add: BaseClass.destroy()
add: getId() method for all instance classes

* Documentation Error https://github.com/ionic-team/ionic-native/issues/1994

* Need to create another way to convert the instance for marker cluster

* save

* Remove the instance of wrapper class if the JS instance is removed.
2017-10-05 23:20:40 -04:00
Ibby Hadeed
536a906366 chore(): update changelog 2017-09-27 18:06:52 -04:00
Ibby Hadeed
7fcafaae81 4.3.0 2017-09-27 18:06:43 -04:00
Ibby Hadeed
1a7a0e7cc0 Merge branch 'master' of github.com:ionic-team/ionic-native 2017-09-27 17:58:55 -04:00
Euler Menezes Junior
34bf136703 feat(push): update PushOptions interfaces to match new version (#1908)
BREAKING CHANGE: this wrapper will work only with `phonegap-plugin-push@2.0.0`
2017-09-27 17:56:43 -04:00
Ibby Hadeed
bb798340c5 Merge branch 'master' of github.com:ionic-team/ionic-native 2017-09-27 17:48:54 -04:00
Iván Pérez
1b04ebb5e2 Zerconf: Action can also be resolved (#1924) 2017-09-27 17:48:45 -04:00
mflynnKVD
a150d4d522 fix(launch-navigator): fix navigate method (#1940) 2017-09-27 17:48:23 -04:00
Josh Armstrong
4246d47a6c feat(android-full-screen): add support for setSystemUiVisiblity (#1942) 2017-09-27 17:47:51 -04:00
Jan Piotrowski
024099a772 add note about limitation (#1953) 2017-09-27 17:47:15 -04:00
Buddy Reno
fff99694ba feat(music-controls): add support for next/prev track and skip forward/backward in control center (#1927) 2017-09-27 17:47:05 -04:00
Ibby Hadeed
429529a5ee Merge branch 'master' of github.com:ionic-team/ionic-native 2017-09-27 17:45:49 -04:00
Gordeev Artem
e2419a26b2 feat(uid): add UID plugin (#1946) 2017-09-27 17:45:44 -04:00
Inconspicuously
10eb3eeeeb feat(qr-scanner): added destroy method (#1916) (#1971)
fix(qr-scanner): added destroy method (#1916)
2017-09-27 17:44:38 -04:00
Ibby Hadeed
533cc4efc9 docs(): update docs 2017-09-27 17:44:06 -04:00
Ibby Hadeed
6b433b5373 Refactor 2017-09-27 17:42:40 -04:00
Niklas Merz
e684db479e feat(index-app-content) add Index-App-Content plugin (#1954) 2017-09-27 17:42:01 -04:00
Everett
81c576c28e docs(firebase-dynamic-links): update docs (#1964)
Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.

See: https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks
2017-09-27 17:39:05 -04:00
excelulous
e2f3702d0b fix(zeroconf): extend the ZeroconfResult.action definition (#1985)
This now includes the value 'resolved', as it is a valid action passed by the service browser on iOS (at least) when IP addresses for the chosen service have been resolved.
2017-09-27 17:36:32 -04:00
Daniel Ehrhardt
806766e33e feat(extended-device-information): add Extended Device Info plugin (#1980)
* Added Cordova Device Information Wrapper

* Updated Usage Description

* Removed unsued line

* Added Total Storage
2017-09-27 17:36:00 -04:00
Sandip Gadekar
432c0e901d docs(couchbase-lite): add usage (#1988)
* adding detailed usage for couchbase lite

* added get url method

* create database method added

* delete database method added

* get all database method added

* space added in comments

* comments added unwanted import removed

* whitespaces added

* usage added in commented section
2017-09-27 17:03:10 -04:00
Ibby Hadeed
fb70a24c61 refactor(regula-document-reader): rename plugin 2017-09-27 17:01:12 -04:00
Ibby Hadeed
202c680643 refactor(document-reader): add beta and paid tags 2017-09-27 16:59:06 -04:00
Dmitry Smolyakov
7b94d4fccf feat(document-reader): add cordova-plugin-documentreader (#1996) 2017-09-27 16:58:31 -04:00
Akshay Dwivedi
5b15bb9f46 fix(stripe): fix stripe create card token (#2002)
fix stripe create card token promise
2017-09-27 16:56:25 -04:00
Ibby Hadeed
c3930c814a refactor(google-maps): use es6 syntax 2017-09-27 16:52:06 -04:00
Masashi Katsumata
57af5c5e73 fix(google-maps): convert JS classes to Ionic Native (#1956)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions

* Bug fix: the zoom option is missing

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1712

* Update index.ts

* fix: need to convert instance type from the JS class to the wrapper class

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1706

* remove test file

* fix: Error: Illegal use of "@private" tag.

* fix: The Environment, Encode, and Spherical  are static class

* fix:  convert JS instance to the ionic instance
add: BaseClass.destroy()
add: getId() method for all instance classes
2017-09-27 15:56:30 -04:00
Ibby Hadeed
29604d6d3d Update README.md 2017-09-11 09:56:07 -04:00
AniketPant02
76effe98f8 docs(): fix typo
Typo
2017-09-11 04:12:23 -04:00
Ibby Hadeed
0783520723 chore(): bump core dependency to 4.2.0 2017-09-06 02:36:48 -04:00
Masashi Katsumata
ef898efcc6 fix(google-maps): the zoom option is missing in the GoogleMapOptions class (#1948)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions

* Bug fix: the zoom option is missing

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1712

* Update index.ts
2017-09-06 02:34:18 -04:00
fredroo
fdd12b58b3 fix(twitter-connect (#1903)
* Update index.ts

* Update index.ts

* Update index.ts

* Update index.ts
2017-09-01 23:24:28 -04:00
Masashi Katsumata
80047907ea fix(google-maps): fix icons property of MarkerClusterOptions (#1937)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions
2017-09-01 21:38:26 -04:00
Raman Rasliuk
3a1034eab0 fix(http): fix plugin ref (#1934) 2017-08-30 15:06:32 -04:00
Ibby Hadeed
c8586927c3 chore(): update changelog 2017-08-29 19:44:23 -04:00
Ibby Hadeed
f22c603c30 4.2.1 2017-08-29 19:44:15 -04:00
Masashi Katsumata
957396b5e5 fix(google-maps): fix issue when creating new instance of BaseArrayClass (#1931)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass
2017-08-29 18:58:44 -04:00
Perry Govier
d891c3eea0 Merge pull request #1867 from janpio/patch-10
docs(navigation): add trailing slash to navigation items
2017-08-28 10:59:19 -05:00
Ibby Hadeed
37aa9a82fe chore(): update changelog 2017-08-26 04:04:12 -04:00
Ibby Hadeed
392b11bd05 4.2.0 2017-08-26 04:03:34 -04:00
Ibby Hadeed
d4fe051d56 update 2017-08-26 04:03:29 -04:00
Raman Rasliuk
a2d33963b1 feat(http): use a different plugin source with better features (#1921) 2017-08-26 03:57:23 -04:00
Leonardo Ruhland
332f9aefe5 docs(safariview): usage fix (#1923)
The show method returns a Observable, not a Promise.
2017-08-26 03:55:06 -04:00
Heather Lemieux
4942b88873 docs(google-maps): update docs (#1833)
Since the new googlemaps plugin uses the native code, you need to wait for the platform to be ready before loading the map.
2017-08-26 03:53:57 -04:00
frank10gm
39ec5158a0 fix(google-maps): add missing debug option (#1832)
added debug option to TileOverlayOptions.
2017-08-26 03:51:39 -04:00
Masashi Katsumata
c11aec33a7 feat(google-maps): update plugin and fix a few issues (#1834)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

* Bug fix: HtmlInfoWindow does not work
https://github.com/ionic-team/ionic-native/pull/1815#issuecomment-318909795

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* It seems the ionViewDidLoad() is enough delayed after platform.ready()

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

* Bug fix: Geocoder.geocode() returns array of GeocoderResult

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

* Revert: BaseClass.empty() method does not have the noNotify option

* Add `destruct` option to the CordovaOption.

- This allows BaseClass.on() is able to pass multiple retuned values from the cordova plugin side to the event lister.

* A semicolon is mixing

* update: event names

* Update: BaseClass.addEventListener(), addEventListenerOnce(), on(), and one()

* Add: destruct option for otherPromise
Change: inside event names (must use the version 2.0.0-beta3-20170808-1950 or higher)

* Build for working group

* Bug fix: map.getCameraTarget() definition is incorrect

* Bug fix: The definition of VisibleRegion interface is incorrect

* Fix: LatLng, LatLngBounds, and PolylineOptions classes
Update: map.getVisibleRegion()

Add: VisibleRegion class

* Bug fix: the definition of map.clear() method is incorrect

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class
2017-08-26 03:37:40 -04:00
Keepertje
21045ea535 fix(ms-adal): make userId optional (#1894)
The docs say User Identifier is optional but the method does not reflect it.
2017-08-23 19:55:46 -04:00
Rohin Mohanadas
955c450483 docs(): update supported platforms (#1879)
Removing browser from the list of supported platforms.
2017-08-23 19:55:05 -04:00
Ibby Hadeed
00c0707dad fix(geofence): remove duplicate onTransitionReceived method 2017-08-23 19:54:11 -04:00
Ibby Hadeed
79f88d6a02 Merge branch 'master' of github.com:ionic-team/ionic-native 2017-08-23 19:47:05 -04:00
Yasin Simsek
ce5966bf10 feat(local-notifications): add un method to unsubscribe from events (#1871) 2017-08-23 19:46:58 -04:00
Ibby Hadeed
fb8dbe5fc0 Merge branch 'master' of github.com:ionic-team/ionic-native 2017-08-23 19:42:51 -04:00
martinhanke
cde87e2113 feat(paypal): add payeeEmail for third party merchants (#1864) 2017-08-23 19:42:47 -04:00
Fatih Kızmaz
262e18f409 fix(native-spinner): update pluginRef (#1859)
Wrong pluginRef causes errors:
Native: tried calling SpinnerDialog.show, but the SpinnerDialog plugin is not installed.
Install the SpinnerDialog plugin: 'ionic cordova plugin add cordova-plugin-native-spinner'

Fix pluginRef to work properly.
2017-08-23 19:41:03 -04:00
Davor Peic
39ef066875 docs(cardio): update docs (#1858)
Added iOS10 permission message and corrected requireCVV use
2017-08-23 19:40:14 -04:00
Chris
35d317f7f3 docs(): add missing import (#1853)
BackgroundGeolocationResponse was not declared in classes to import from @ionic-native/background-geolocation
2017-08-23 19:39:29 -04:00
Tom Sundstrom
5505e5f064 docs(): adjust log messages in photo library example callbacks (#1851)
* Move error message to the error callback

* Log a debug message in complete callback
2017-08-23 19:39:04 -04:00
Ibby Hadeed
e6b0250d97 refactor 2017-08-23 19:38:30 -04:00
Mario Mol
aa4c3b3787 feat(push): add Browser Push notification support (#1848)
* Browser Push interface with options to use push notification with browsers , as a proxy to phonegap-plush-plugin

* making both properties optional
2017-08-23 19:38:04 -04:00
foysal
57bbcdebfb docs(nfc): update usage doc of the nfc plugin (#1846)
* docs(nfc): update usage doc of the nfc plugin

show an example of how the event listeners work with observable subscription and implement an nfc share within the event listener.

* docs(AndroidPermissions): requestPermissions->requestPermission
2017-08-23 19:37:31 -04:00
Josh McRae
85825c7b91 fix(fingerprint-aio): add missing FingerprintOptions properties (#1845)
* docs(fingerprint-aio): add missing FingerprintOptions properties

* fix(fingerprint-aio): fix circle lint error
2017-08-23 19:37:04 -04:00
Josh Miles
1acade4883 fix(serial): add missing options for the open method (#1844) 2017-08-23 19:36:41 -04:00
Sebastian Baar
7c1b409542 fix(native-geocoder): update NativeGeocoderReverse result (#1840)
* feat(nativegeocoder): add NativeGeocoder plugin

* add district

* update NativeGeocoderReverseResult & refactor code

* delete plugins

* delete index.ts
2017-08-23 19:35:51 -04:00
Ibby Hadeed
fe02c84fd9 clean up 2017-08-23 19:34:55 -04:00
Moamen Mostafa
a2cc1870b4 feat(keychain-touch-id): add KeychainTouchId plugin (#1837) 2017-08-23 19:33:12 -04:00
Ibby Hadeed
1c6a3a3bc5 update package-lock 2017-08-23 19:31:23 -04:00
Robert Coie
0c097ba2be fix(sqlite): add optional key parameter to SQLiteDatabaseConfig to support sqlcipher-adapter (#1917) 2017-08-23 19:21:57 -04:00
Animesh Kumar
0dd507ff03 docs(): fix typo (#1914)
corrected `to` to `two` on line number 14
2017-08-23 19:21:25 -04:00
Jan Piotrowski
4e0673c8e9 only add trailing slash on plugin pages
fixes that the trailing slash would have been added to the root and browser-usage.html as well
2017-08-05 17:37:16 +02:00
Jan Piotrowski
0cecf4e43f add trailing slash to navigation items
fixes the problem that each navigation item first has to redirected to the version with trailing slash

closes https://github.com/ionic-team/ionic-site/issues/1223
2017-08-05 17:27:02 +02:00
Ibby Hadeed
9ab458bba2 chore(): update changelog 2017-07-21 01:16:05 -04:00
Ibby Hadeed
7e900dae22 4.1.0 2017-07-21 01:15:59 -04:00
Ibby Hadeed
0fa82e5c56 feat(open-native-settings): add Open Native Settings plugin
closes #1821
2017-07-21 01:15:51 -04:00
Ibby Hadeed
4af3d5bcc1 fix(media): add setRate method
closes #1825
2017-07-21 01:07:38 -04:00
Masashi Katsumata
976401a4e9 feat(google-maps): add missing features and fix wrong definitions (#1815)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

* Update: getMap() methods return the instance of the wrapper plugin

* Update: getMap() methods return the instance of the wrapper plugin

* Remove `@CordovaInstance` decorators from getMap()

* Update: GoogleMapOptions (all fields are not optional).

* Follow up:  version `2.0.0-beta2-20170719-2226` of cordova-plugin-googlemaps

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.
2017-07-20 17:06:37 -07:00
Hayato OKUMOTO
6230958585 feat(firebase): add unregister method (#1823) 2017-07-18 22:12:59 -07:00
Daniel Olivares
47fa44c932 feat(hyper-track): add HyperTrack plugin (#1816)
* feat(HyperTrack): add base implementation for HyperTrack

* feat(HyperTrack): fix getOrCreateUser()

* docs(HyperTrack): add note about publishable key

* feat(HyperTrack): add requestPermissions

* feat(HyperTrack): add startTracking

* docs(HyperTrack): add usage for calls

* feat(HyperTrack): add stopTracking

* docs(HyperTrack): add stopTracking note

* feat(HyperTrack): add setUserId

* feat(HyperTrack): add getCurrentLocation

* style(HyperTrack): reorder functions

* feat(HyperTrack): add createAndAssignAction

* feat(HyperTrack): add completeAction

* feat(HyperTrack): add completeActionWithLookupId

* feat(HyperTrack): add checkLocationPermission

* docs(HyperTrack): add usage for requestPermissions

* docs(HyperTrack): add android note

* feat(HyperTrack): add checkLocationServices

* feat(HyperTrack): add requestLocationServices

* feat(HyperTrack): add base implementation for HyperTrack

* feat(HyperTrack): fix getOrCreateUser()

* docs(HyperTrack): add note about publishable key

* feat(HyperTrack): add requestPermissions

* feat(HyperTrack): add startTracking

* docs(HyperTrack): add usage for calls

* feat(HyperTrack): add stopTracking

* docs(HyperTrack): add stopTracking note

* feat(HyperTrack): add setUserId

* feat(HyperTrack): add getCurrentLocation

* style(HyperTrack): reorder functions

* feat(HyperTrack): add createAndAssignAction

* feat(HyperTrack): add completeAction

* feat(HyperTrack): add completeActionWithLookupId

* feat(HyperTrack): add checkLocationPermission

* docs(HyperTrack): add usage for requestPermissions

* docs(HyperTrack): add android note

* feat(HyperTrack): add checkLocationServices

* feat(HyperTrack): add requestLocationServices

* docs(HyperTrack): Fix plugin usage

* fix(HyperTrack): helloWorld param and docs

* docs(HyperTrack): document all functions

* docs(HyperTrack): move all usage documentation up

* docs(HyperTrack): fix documentation

* Add beta tag
2017-07-17 21:50:08 -04:00
Corentin H
f1dd8d61f5 docs(): improve docs (#1813)
* Improve method description grammar

* Fix some doc typos (#1)

* Fix doc
2017-07-17 18:53:47 -04:00
!Cogentx
3d387798b6 docs(local-notifications): fix package name (#1817)
$ ionic cordova plugin add phonegap-local-notifications -- should be -- 
$ ionic cordova plugin add phonegap-plugin-local-notification -- in Docs --
2017-07-17 18:51:35 -04:00
Ibby Hadeed
380eb88a39 chore(): update changelog 2017-07-15 15:52:34 -04:00
Ibby Hadeed
6e2c998dad 4.0.1 2017-07-15 15:52:10 -04:00
Ibby Hadeed
7105048b89 fix(media): fix success/error/statusUpdate observables
closes #1806
2017-07-15 14:49:18 -04:00
Ibby Hadeed
6061af6238 feat(camera): add enums for camera options 2017-07-15 14:38:09 -04:00
Ibby Hadeed
1decedd899 feat(media): add MEDIA_STATUS and MEDIA_ERROR enums 2017-07-15 14:35:00 -04:00
Ibby Hadeed
b5fe6631fe Merge branch 'master' of github.com:ionic-team/ionic-native 2017-07-15 14:29:59 -04:00
Ibby Hadeed
25c1cf4058 fix(social-sharing): fix issues caused by omitting optional params
closes #1805
2017-07-15 14:29:51 -04:00
Samuel Goodell
b265b5bd0c docs(): escape < and > from plugin install command in doc template (#1791)
* Escape < and > from plugin install command in doc template

* Fix another issue with a missing closing code fence in the same plugin file
2017-07-13 12:41:53 -05:00
Serge S. Gulin
247efa656a Use RxJS 5.4.2 to fix generics checking in TS 2.4.1 2017-07-13 11:42:17 +04:00
Ibby Hadeed
238e2ab26c tests(): add test to verify new way of creating classes 2017-07-12 14:06:06 -04:00
Ibby Hadeed
146c823f2a refactor(): remove unused import 2017-07-11 17:29:17 -04:00
Ibby Hadeed
1b55513bc4 docs(clipboard): update plugin source 2017-07-11 10:43:26 -04:00
Ibby Hadeed
953841681c feat(launch-navigator): update plugin wrapper to support v4
closes #1738
2017-07-11 10:38:22 -04:00
Ibby Hadeed
76a45a3834 refactor(launch-navigator): move constants to the top of the class 2017-07-11 10:29:26 -04:00
Ibby Hadeed
eff9bc376c refactor(action-sheet): add values for ANDROID_THEMES to prevent errors in dev environments 2017-07-11 10:04:10 -04:00
Ibby Hadeed
b9993c24f0 docs(image-picker): add npm package instead of git repo
closes #1787
2017-07-11 09:58:07 -04:00
Ibby Hadeed
9752c865fc docs(): hide AuthenticationContext class 2017-07-11 09:39:09 -04:00
Ibby Hadeed
4c4cf76f7a docs(): hide IAPError class 2017-07-11 09:37:32 -04:00
Ibby Hadeed
70cbcbf1e9 docs(google-maps): add temporary note to notify about 4.x changes 2017-07-11 09:29:12 -04:00
Ibby Hadeed
2caf0684ef docs(admob-pro): change name to AdMob Pro 2017-07-11 09:23:10 -04:00
Ibby Hadeed
aa4b2cd2ae chore(): update changelog 2017-07-11 09:22:48 -04:00
Ibby Hadeed
c56aa7e3ae 4.0.0 2017-07-11 09:22:27 -04:00
nbamj
3f8f97f015 Typo fix (#1785) 2017-07-11 05:53:18 -04:00
huli1234
1f3b97cef2 Change import for FileTransfer ... (#1786)
Changed the import, it didnt work with only transfer (seems to stem from when the plugin was called transfer instead of file-transfer)
2017-07-11 05:52:53 -04:00
Samuel Goodell
927bd1a9ba chore(): add paid tag to documentation 2017-07-10 14:16:11 -05:00
Samuel Goodell
c43a51e2bb Inline paid and beta labels for sidebar 2017-07-10 14:03:39 -05:00
Samuel Goodell
1a9a843cde Fix indentation on paid label in doc title 2017-07-10 14:01:27 -05:00
Samuel Goodell
2e543291ef Resolve conflicts with master 2017-07-10 13:58:38 -05:00
Ibby Hadeed
ad9556ca03 amend(): remove space 2017-07-10 13:02:50 -04:00
Ibby Hadeed
cbdde57681 chore(): update @ionic-native/core dependency version
no changes were made in 4.0, so older versions should work fine
2017-07-10 13:02:06 -04:00
Ibby Hadeed
d8bac2f0ab docs(google-maps): show all classes and interfaces 2017-07-10 09:59:35 -04:00
jasonmamy
12a83831c8 refactor(): added default items interface (#1725) 2017-07-10 09:55:40 -04:00
Jan Piotrowski
cdb99a74cc docs(readme) improve link to 2.x README (#1764)
link to branch instead of specific version so possible future updates are reflected after clicking the link
2017-07-10 09:55:16 -04:00
Brad Grzesiak
dd12be6722 docs(): provide "see also" for the Secure Storage plugin (#1773) 2017-07-10 09:54:53 -04:00
Ibby Hadeed
cf0c740269 feat(ms-adal): add Azure Active Directory Authentication plugin
closes #372
2017-07-10 09:40:53 -04:00
Ibby Hadeed
bde2b38668 feat(qr-scanner): add QRScanner plugin
closes #715
2017-07-10 09:15:50 -04:00
Ibby Hadeed
b35dab2634 feat(onesignal): add new methods
closes #1677
2017-07-10 09:14:56 -04:00
Ibby Hadeed
ff793d649b docs(onesignal): add iOS platform to iOSSettings method 2017-07-10 09:14:35 -04:00
Ibby Hadeed
e8faf22357 fix(sqlite): fix param type for sqlBatch method
closes #1596
2017-07-10 09:13:58 -04:00
Ibby Hadeed
a6f9714422 fix(safari-view-controller): show should return an Observable
BREAKING CHANGE: `show` method now returns an Observable

closes #1619
2017-07-10 09:13:24 -04:00
Jason Kim
71349655c0 docs(image-resizer): update plugin source (#1781)
* Update image-resizer index.ts

Running original command "ionic cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git" will throw a Cordova error shown below. Installing the plugin via the plugin cordova id (per the original repo's package.json) will allow this plugin to install correctly and work with the ionic native "image-resizer"

An error occurred while running ionic cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git
... (exit code 1):
Error: Failed to fetch plugin https://github.com/protonet/cordova-plugin-image-resizer.git via registry
...

* Update index.ts
2017-07-10 05:15:56 -04:00
Jan Piotrowski
f1a036d8b0 docs(printer): fix isAvailable description (#1782) 2017-07-10 05:10:40 -04:00
victor sosa
7bbd25c1a2 fix(google-analytics): fix parameter types in the trackMetric method (#1780)
* Fix parameter in the trackMetric method

In the trackMetric the first parameter is a number type;

* Update index.ts
2017-07-10 05:10:03 -04:00
Ibby Hadeed
01ae8e11fc refactor(google-maps): use MapType interface instead of string 2017-07-08 08:45:09 -04:00
Ibby Hadeed
aff653de2e feat(google-maps): add GoogleMapOptions interface 2017-07-08 08:43:11 -04:00
Ibby Hadeed
0867cfff3f fix(media): wrap plugin callbacks with Observables
BREAKING CHANGE: the plugin's `create` method no longer takes callback functions. You must use the
observables provided by the `MediaObject` instance. Refer to the updated documentation for more
information.

closes #1591
2017-07-07 19:29:03 -04:00
Ibby Hadeed
d395b42788 feat(email-composer): update plugin to latest version and use original plugin (#1771)
* change source and document interface

* document addAlias example

* feat(email-composer): add requestPermission and hasPermission methods

* refactor(): use getPlugin() instead of referencing cordova
2017-07-07 19:13:45 -04:00
Ibby Hadeed
bc6bf6671e refactor(admob-pro): rename plugin from AdMob to AdMobPro (#1770)
BREAKING CHANGE: `@ionic-native/admob` is now `@ionic-native/admob-pro`. Also, class name is changed
from `AdMob` to `AdMobPro`.
2017-07-07 19:13:35 -04:00
Ibby Hadeed
9f1a0f9585 refactor(media): rename main class to Media (#1769)
BREAKING CHANGE: `MediaObject` class is now `Media`
2017-07-07 19:13:25 -04:00
Ibby Hadeed
3c54a1c7f5 refactor(rename plugin to FileTransfer to match original plugin): (#1768)
BREAKING CHANGE: Package name is now `@ionic-native/file-transfer`. `Transfer` class has been
renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `FileTransferObject`.
2017-07-07 19:13:14 -04:00
Ibby Hadeed
06e666d6a0 feat(google-maps): update wrapper to support v2 of the plugin (#1759)
* update google maps

* more updates

* add BaseClass

* add BaseArrayClass

* add BaseArrayClass constructor

* finish up BaseArrayClass

* add Environment class

* improve docs and add missing functions to GoogleMap class

* improve TileOverlayOptions interface

* add types to constants

* add ILatLng interface

* improve types in BaseArrayClass

* fix geocoder return type

* use Cordova decorator for geocoder

* document CameraPosition and add missing duration property

* document circle class and add update functions

* tslint

* remove extra decorator

* add setVisible and getVisible to Circle class

* complete Environment class

* add convenience method to return instance of environment

* add more classes to docs

* re-organize plugin definition

* document GroundOverlayOptions

* complete GroundOverlay class

* add and complete HtmlInfoWindow class

* complete LatLngBounds class

* update MyLocation interface

* complete GoogleMap class

* fix TERRAIN spelling

* complete Marker class

* complete Polygon class

* complete TileOverlay class

* remove setDebuggable and isAvailable

developer said they're not suited for users
2017-07-07 19:13:04 -04:00
Ibby Hadeed
73d0d57bbc docs(): add paid tag 2017-07-07 05:49:45 -04:00
77 changed files with 10338 additions and 5416 deletions

2
.gitignore vendored
View File

@@ -3,5 +3,5 @@ node_modules/
.idea
.tmp
aot/
dist/
scripts/ionic-native-bower
dist/

View File

@@ -1,3 +1,160 @@
<a name="4.3.1"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.2) (2017-10-06)
### Bug Fixes
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
<a name="4.3.0"></a>
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
### Bug Fixes
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
* **stripe:** fix stripe create card token ([#2002](https://github.com/ionic-team/ionic-native/issues/2002)) ([5b15bb9](https://github.com/ionic-team/ionic-native/commit/5b15bb9))
* **zeroconf:** extend the ZeroconfResult.action definition ([#1985](https://github.com/ionic-team/ionic-native/issues/1985)) ([e2f3702](https://github.com/ionic-team/ionic-native/commit/e2f3702))
### Features
* **android-full-screen:** add support for setSystemUiVisiblity ([#1942](https://github.com/ionic-team/ionic-native/issues/1942)) ([4246d47](https://github.com/ionic-team/ionic-native/commit/4246d47))
* **document-reader:** add cordova-plugin-documentreader ([#1996](https://github.com/ionic-team/ionic-native/issues/1996)) ([7b94d4f](https://github.com/ionic-team/ionic-native/commit/7b94d4f))
* **extended-device-information:** add Extended Device Info plugin ([#1980](https://github.com/ionic-team/ionic-native/issues/1980)) ([806766e](https://github.com/ionic-team/ionic-native/commit/806766e))
* **music-controls:** add support for next/prev track and skip forward/backward in control center ([#1927](https://github.com/ionic-team/ionic-native/issues/1927)) ([fff9969](https://github.com/ionic-team/ionic-native/commit/fff9969))
* **push:** update PushOptions interfaces to match new version ([#1908](https://github.com/ionic-team/ionic-native/issues/1908)) ([34bf136](https://github.com/ionic-team/ionic-native/commit/34bf136))
* **qr-scanner:** added destroy method ([#1916](https://github.com/ionic-team/ionic-native/issues/1916)) ([#1971](https://github.com/ionic-team/ionic-native/issues/1971)) ([10eb3ee](https://github.com/ionic-team/ionic-native/commit/10eb3ee))
* **uid:** add UID plugin ([#1946](https://github.com/ionic-team/ionic-native/issues/1946)) ([e2419a2](https://github.com/ionic-team/ionic-native/commit/e2419a2))
### BREAKING CHANGES
* **push:** this wrapper will work only with `phonegap-plugin-push@2.0.0`
<a name="4.2.0"></a>
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
### Bug Fixes
* **fingerprint-aio:** add missing FingerprintOptions properties ([#1845](https://github.com/ionic-team/ionic-native/issues/1845)) ([85825c7](https://github.com/ionic-team/ionic-native/commit/85825c7))
* **geofence:** remove duplicate onTransitionReceived method ([00c0707](https://github.com/ionic-team/ionic-native/commit/00c0707))
* **google-maps:** add missing debug option ([#1832](https://github.com/ionic-team/ionic-native/issues/1832)) ([39ec515](https://github.com/ionic-team/ionic-native/commit/39ec515))
* **ms-adal:** make userId optional ([#1894](https://github.com/ionic-team/ionic-native/issues/1894)) ([21045ea](https://github.com/ionic-team/ionic-native/commit/21045ea))
* **native-geocoder:** update NativeGeocoderReverse result ([#1840](https://github.com/ionic-team/ionic-native/issues/1840)) ([7c1b409](https://github.com/ionic-team/ionic-native/commit/7c1b409))
* **native-spinner:** update pluginRef ([#1859](https://github.com/ionic-team/ionic-native/issues/1859)) ([262e18f](https://github.com/ionic-team/ionic-native/commit/262e18f))
* **serial:** add missing options for the open method ([#1844](https://github.com/ionic-team/ionic-native/issues/1844)) ([1acade4](https://github.com/ionic-team/ionic-native/commit/1acade4))
* **sqlite:** add optional key parameter to SQLiteDatabaseConfig to support sqlcipher-adapter ([#1917](https://github.com/ionic-team/ionic-native/issues/1917)) ([0c097ba](https://github.com/ionic-team/ionic-native/commit/0c097ba))
### Features
* **google-maps:** update plugin and fix a few issues ([#1834](https://github.com/ionic-team/ionic-native/issues/1834)) ([c11aec3](https://github.com/ionic-team/ionic-native/commit/c11aec3))
* **http:** use a different plugin source with better features ([#1921](https://github.com/ionic-team/ionic-native/issues/1921)) ([a2d3396](https://github.com/ionic-team/ionic-native/commit/a2d3396))
* **keychain-touch-id:** add KeychainTouchId plugin ([#1837](https://github.com/ionic-team/ionic-native/issues/1837)) ([a2cc187](https://github.com/ionic-team/ionic-native/commit/a2cc187))
* **local-notifications:** add `un` method to unsubscribe from events ([#1871](https://github.com/ionic-team/ionic-native/issues/1871)) ([ce5966b](https://github.com/ionic-team/ionic-native/commit/ce5966b))
* **paypal:** add payeeEmail for third party merchants ([#1864](https://github.com/ionic-team/ionic-native/issues/1864)) ([cde87e2](https://github.com/ionic-team/ionic-native/commit/cde87e2))
* **push:** add Browser Push notification support ([#1848](https://github.com/ionic-team/ionic-native/issues/1848)) ([aa4c3b3](https://github.com/ionic-team/ionic-native/commit/aa4c3b3))
<a name="4.1.0"></a>
# [4.1.0](https://github.com/ionic-team/ionic-native/compare/v4.0.1...v4.1.0) (2017-07-21)
### Bug Fixes
* **media:** add setRate method ([4af3d5b](https://github.com/ionic-team/ionic-native/commit/4af3d5b)), closes [#1825](https://github.com/ionic-team/ionic-native/issues/1825)
### Features
* **firebase:** add unregister method ([#1823](https://github.com/ionic-team/ionic-native/issues/1823)) ([6230958](https://github.com/ionic-team/ionic-native/commit/6230958))
* **google-maps:** add missing features and fix wrong definitions ([#1815](https://github.com/ionic-team/ionic-native/issues/1815)) ([976401a](https://github.com/ionic-team/ionic-native/commit/976401a))
* **hyper-track:** add HyperTrack plugin ([#1816](https://github.com/ionic-team/ionic-native/issues/1816)) ([47fa44c](https://github.com/ionic-team/ionic-native/commit/47fa44c))
* **open-native-settings:** add Open Native Settings plugin ([0fa82e5](https://github.com/ionic-team/ionic-native/commit/0fa82e5)), closes [#1821](https://github.com/ionic-team/ionic-native/issues/1821)
<a name="4.0.1"></a>
## [4.0.1](https://github.com/ionic-team/ionic-native/compare/v4.0.0...v4.0.1) (2017-07-15)
### Bug Fixes
* **media:** fix success/error/statusUpdate observables ([7105048](https://github.com/ionic-team/ionic-native/commit/7105048)), closes [#1806](https://github.com/ionic-team/ionic-native/issues/1806)
* **social-sharing:** fix issues caused by omitting optional params ([25c1cf4](https://github.com/ionic-team/ionic-native/commit/25c1cf4)), closes [#1805](https://github.com/ionic-team/ionic-native/issues/1805)
### Features
* **camera:** add enums for camera options ([6061af6](https://github.com/ionic-team/ionic-native/commit/6061af6))
* **launch-navigator:** update plugin wrapper to support v4 ([9538416](https://github.com/ionic-team/ionic-native/commit/9538416)), closes [#1738](https://github.com/ionic-team/ionic-native/issues/1738)
* **media:** add MEDIA_STATUS and MEDIA_ERROR enums ([1decedd](https://github.com/ionic-team/ionic-native/commit/1decedd))
<a name="4.0.0"></a>
# [4.0.0](https://github.com/ionic-team/ionic-native/compare/v3.14.0...v4.0.0) (2017-07-11)
### Bug Fixes
* **google-analytics:** fix parameter types in the trackMetric method ([#1780](https://github.com/ionic-team/ionic-native/issues/1780)) ([7bbd25c](https://github.com/ionic-team/ionic-native/commit/7bbd25c))
* **media:** wrap plugin callbacks with Observables ([0867cff](https://github.com/ionic-team/ionic-native/commit/0867cff)), closes [#1591](https://github.com/ionic-team/ionic-native/issues/1591)
* **safari-view-controller:** show should return an Observable ([a6f9714](https://github.com/ionic-team/ionic-native/commit/a6f9714)), closes [#1619](https://github.com/ionic-team/ionic-native/issues/1619)
* **sqlite:** fix param type for `sqlBatch` method ([e8faf22](https://github.com/ionic-team/ionic-native/commit/e8faf22)), closes [#1596](https://github.com/ionic-team/ionic-native/issues/1596)
### Code Refactoring
* **admob-pro:** rename plugin from AdMob to AdMobPro ([#1770](https://github.com/ionic-team/ionic-native/issues/1770)) ([bc6bf66](https://github.com/ionic-team/ionic-native/commit/bc6bf66))
* **media:** rename main class to Media ([#1769](https://github.com/ionic-team/ionic-native/issues/1769)) ([9f1a0f9](https://github.com/ionic-team/ionic-native/commit/9f1a0f9))
* **rename plugin to FileTransfer to match original plugin:** ([#1768](https://github.com/ionic-team/ionic-native/issues/1768)) ([3c54a1c](https://github.com/ionic-team/ionic-native/commit/3c54a1c))
### Features
* **email-composer:** update plugin to latest version and use original plugin ([#1771](https://github.com/ionic-team/ionic-native/issues/1771)) ([d395b42](https://github.com/ionic-team/ionic-native/commit/d395b42))
* **google-maps:** add GoogleMapOptions interface ([aff653d](https://github.com/ionic-team/ionic-native/commit/aff653d))
* **google-maps:** update wrapper to support v2 of the plugin ([#1759](https://github.com/ionic-team/ionic-native/issues/1759)) ([06e666d](https://github.com/ionic-team/ionic-native/commit/06e666d))
* **ms-adal:** add Azure Active Directory Authentication plugin ([cf0c740](https://github.com/ionic-team/ionic-native/commit/cf0c740)), closes [#372](https://github.com/ionic-team/ionic-native/issues/372)
* **onesignal:** add new methods ([b35dab2](https://github.com/ionic-team/ionic-native/commit/b35dab2)), closes [#1677](https://github.com/ionic-team/ionic-native/issues/1677)
* **qr-scanner:** add QRScanner plugin ([bde2b38](https://github.com/ionic-team/ionic-native/commit/bde2b38)), closes [#715](https://github.com/ionic-team/ionic-native/issues/715)
### BREAKING CHANGES
* **safari-view-controller:** `show` method now returns an Observable
* **media:** the plugin's `create` method no longer takes callback functions. You must use the
observables provided by the `MediaObject` instance. Refer to the updated documentation for more
information.
* **admob-pro:** `@ionic-native/admob` is now `@ionic-native/admob-pro`. Also, class name is changed
from `AdMob` to `AdMobPro`.
* **media:** `MediaObject` class is now `Media`
* **rename plugin to FileTransfer to match original plugin:** Package name is now `@ionic-native/file-transfer`. `Transfer` class has been
renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `FileTransferObject`.
<a name="3.14.0"></a>
# [3.14.0](https://github.com/ionic-team/ionic-native/compare/v3.13.1...v3.14.0) (2017-07-07)
@@ -1641,13 +1798,13 @@ The whole implementation has changed now. You must update your code.
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
### Features
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))

View File

@@ -209,4 +209,13 @@ Example:
someMethod(): Promise<any> {
// anything here will only run if the plugin is available
}
```
#### CordovaFunctionOverride
Wrap a stub function in a call to a Cordova plugin, checking if both Cordova and the required plugin are installed.
Example:
```ts
@CordovaFunctionOverride()
someMethod(): Observable<any> { return; }
```

View File

@@ -52,38 +52,28 @@ import { NgZone } from '@angular/core';
@Component({ ... })
export class MyComponent {
constructor(private geolocation: Geolocation, private platform: Platform, private ngZone: NgZone) {
constructor(private geolocation: Geolocation, private platform: Platform) {
platform.ready().then(() => {
// get position
geolocation.getCurrentPosition().then(pos => {
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
});
// watch position
const watch = geolocation.watchPosition().subscribe(pos => {
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
// Currently, observables from Ionic Native plugins
// need to run inside of zone to trigger change detection
ngZone.run(() => {
this.position = pos;
})
this.position = pos;
});
// to stop watching
watch.unsubscribe();
});
}
}
```
@@ -171,9 +161,9 @@ Spent way too long diagnosing an issue only to realize a plugin wasn't firing or
## Plugin Missing?
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
## Ionic V1/Angular 1 support
## Ionic v1 (AngularJS, Angular 1.x) support
For Ionic V1/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
For Ionic v1 (AngularJS, Angular 1.x) support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/v2.x/README.md) for usage information.
# Credits

8991
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,14 @@
{
"name": "ionic-native",
"version": "3.14.0",
"version": "4.3.1",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"devDependencies": {
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/compiler": "4.4.4",
"@angular/compiler-cli": "4.4.4",
"@angular/core": "4.4.4",
"@types/cordova": "0.0.34",
"@types/jasmine": "^2.5.51",
"@types/node": "^7.0.27",
@@ -39,12 +39,12 @@
"q": "1.5.0",
"queue": "4.2.1",
"rimraf": "2.6.1",
"rxjs": "5.4.0",
"rxjs": "5.4.3",
"semver": "5.3.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "2.3.3",
"zone.js": "0.8.12"
"typescript": "2.3.4",
"zone.js": "0.8.18"
},
"scripts": {
"start": "npm run test:watch",

View File

@@ -19,7 +19,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
// dependency versions
const ANGULAR_VERSION = '*',
RXJS_VERSION = '^5.0.1',
MIN_CORE_VERSION = '^3.6.0',
MIN_CORE_VERSION = '^4.2.0',
IONIC_NATIVE_VERSION = require(path.resolve(ROOT, 'package.json')).version;
// package dependencies

View File

@@ -41,7 +41,7 @@ module.exports = currentVersion => {
docTypes: ['class'],
getOutputPath: doc => doc.originalModule.replace(config.pluginDir + '/', '')
.replace('/plugins', '')
.replace('/index', '/README.md')
.replace(/\/index$/, '/README.md')
}];
})

View File

@@ -22,8 +22,24 @@ module.exports = function jekyll(renderDocsProcessor) {
doc.URL = doc.outputPath.replace('docs//', 'docs/')
.replace('/index.md', '')
.replace('content/', '');
// add trailing slash to plugin pages
if(!doc.URL.endsWith("/") && !doc.URL.endsWith(".html")) {
doc.URL = doc.URL+'/';
}
});
const betaDocs = [];
docs = docs.filter(doc => {
if (doc.beta === true) {
betaDocs.push(doc);
return false;
}
return true;
});
docs = docs.concat(betaDocs);
// add side menu
docs.push({
docType: 'nativeMenu',

View File

@@ -6,5 +6,6 @@ module.exports = [
{'name': 'usage'},
{'name': 'hidden'}, // hide from docs
{'name': 'classes'}, // related classes
{'name': 'interfaces'} // related interfaces
{'name': 'interfaces'}, // related interfaces
{'name': 'paid', transforms: (doc, tag, value) => typeof value !== 'undefined'} // paid plugin, set value to true
];

View File

@@ -147,6 +147,9 @@ docType: "<$ doc.docType $>"
<@- if doc.beta == true -@>
<span class="beta" title="beta">&beta;</span>
<@- endif -@>
<@- if doc.paid == true -@>
<span class="paid" title="paid">Paid</span>
<@- endif -@>
</h1>
<a class="improve-v2-docs" href="http://github.com/ionic-team/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
@@ -163,6 +166,12 @@ docType: "<$ doc.docType $>"
href="<$ prop.repo $>/issues">plugin repo</a>.
</p>
<@ endif @>
<@ if doc.paid == true @>
<p class="paid-notice">
This plugin might require a paid license, or might take a share of your app's earnings.
Check the <a target="_blank" rel="nofollow" href="<$ prop.repo $>">plugin's repo</a> for more information.
</p>
<@ endif @>
<# --- Plugin description --- #>
<$ doc.description | marked $>
@@ -177,7 +186,7 @@ docType: "<$ doc.docType $>"
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
<ol class="installation">
<li>Install the Cordova and Ionic Native plugins:<br>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '&lt;').replace('>', '&gt;') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install --save @ionic-native/<$ doc.npmId $>
</code></pre>
</li>

View File

@@ -4,11 +4,7 @@
<li class="capitalize {% if page.id == 'mocking' %}active{% endif %}">
<a href="/docs/native/browser.html">Browser Usage</a>
</li>
<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
<@- for doc in docs @><@ if doc.URL and doc.private != true @>
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}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|dashify $>' %}active{% endif %}">
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">&beta;</span></a>
<a href="/<$ doc.URL $>"><$ doc.name $><@ if doc.paid == true @> <span class="paid">Paid</span><@ endif @><@ if doc.beta == true @> <span class="beta">&beta;</span><@ endif @></a>
</li><@ endif @><@ endfor @>

View File

@@ -2,6 +2,7 @@ import 'core-js';
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
import { IonicNativePlugin } from './ionic-native-plugin';
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
import { Observable } from 'rxjs/Observable';
declare const window: any;
@@ -47,6 +48,17 @@ class TestPlugin extends IonicNativePlugin {
return new TestObject(TestPlugin.getPlugin().create());
}
@Cordova({
destruct: true
})
destructPromise(): Promise<any> { return; }
@Cordova({
destruct: true,
observable: true
})
destructObservable(): Observable<any> { return; }
}
function definePlugin() {
@@ -59,7 +71,9 @@ function definePlugin() {
this.ping = (success: Function, error: Function) => success('pong');
this.name = 'John Smith';
return this;
}
},
destructPromise: (success: Function) => success('hello', 'world'),
destructObservable: (success: Function) => success('hello', 'world')
};
}
@@ -177,6 +191,30 @@ describe('Regular Decorators', () => {
});
describe('CordovaOptions', () => {
describe('destruct', () => {
it('should destruct values returned by a Promise', (done) => {
plugin.destructPromise()
.then((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
});
it('should destruct values returned by an Observable', (done) => {
plugin.destructObservable()
.subscribe((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
});
});
});
});
describe('Instance Decorators', () => {

View File

@@ -37,6 +37,7 @@ export interface PluginConfig {
}
export interface CordovaOptions {
destruct?: boolean;
/**
* Set to true if the wrapped method is a sync function
*/
@@ -252,7 +253,7 @@ export function Cordova(opts: CordovaOptions = {}) {
*
* Wrap an instance method
*/
export function CordovaInstance(opts: any = {}) {
export function CordovaInstance(opts: CordovaOptions = {}) {
return (target: Object, methodName: string) => {
return {
value: function(...args: any[]) {

View File

@@ -0,0 +1,69 @@
// This is to verify that new (FileTransfer.getPlugin)() works
import { Plugin, CordovaInstance } from './decorators';
import { checkAvailability } from './plugin';
import { IonicNativePlugin } from './ionic-native-plugin';
class FT {
hello(): string {
return 'world';
}
}
(window as any).FileTransfer = () => new FT();
@Plugin({
plugin: 'cordova-plugin-file-transfer',
pluginRef: 'FileTransfer',
repo: '',
pluginName: 'FileTransfer'
})
export class FileTransfer extends IonicNativePlugin {
create(): FileTransferObject {
let instance: any;
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
instance = new (FileTransfer.getPlugin())();
}
return new FileTransferObject(instance);
}
}
export class FileTransferObject {
constructor(public _objectInstance: any) {
console.info('Creating a new FileTransferObject with instance: ', _objectInstance);
}
@CordovaInstance({ sync: true })
hello(): string { return; }
}
describe('Mock FileTransfer Plugin', () => {
let plugin: FileTransfer,
instance: FileTransferObject;
beforeAll(() => {
plugin = new FileTransfer();
instance = plugin.create();
});
it('should create a new FileTransfer plugin instance', () => {
expect(plugin instanceof FileTransfer).toBeTruthy();
});
it('should create new FileTransferObject instance', () => {
expect(instance instanceof FileTransferObject).toBeTruthy();
});
it('FileTransferObject instance should have _objectInstance property', () => {
expect(instance._objectInstance).toBeDefined();
});
it('FileTransferObject.hello should return world', () => {
console.info('instance hello is', instance.hello());
expect(instance.hello()).toEqual('world');
});
});

View File

@@ -136,7 +136,11 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
let pluginResult: any, rej: Function;
const p = getPromise((resolve: Function, reject: Function) => {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
if (opts.destruct) {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
} else {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});
// Angular throws an error on unhandled rejection, but in this case we have already printed
@@ -166,7 +170,14 @@ function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts:
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
return new Observable(observer => {
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
let pluginResult;
if (opts.destruct) {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
} else {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
}
if (pluginResult && pluginResult.error) {
observer.error(pluginResult.error);
observer.complete();
@@ -266,7 +277,14 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
} else if (opts.observable) {
return new Observable(observer => {
let pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
let pluginResult;
if (opts.destruct) {
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
} else {
pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
}
if (pluginResult && pluginResult.error) {
observer.error(pluginResult.error);
@@ -287,9 +305,13 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
});
} else if (opts.otherPromise) {
return getPromise((resolve: Function, reject: Function) => {
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
let result;
if (opts.destruct) {
result = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
} else {
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
if (result && !!result.then) {
result.then(resolve, reject);
} else {
@@ -298,8 +320,24 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
});
} else {
let pluginResult: any, rej: Function;
const p = getPromise((resolve: Function, reject: Function) => {
if (opts.destruct) {
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
} else {
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});
// Angular throws an error on unhandled rejection, but in this case we have already printed
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
// to error
if (pluginResult && pluginResult.error) {
p.catch(() => { });
typeof rej === 'function' && rej(pluginResult.error);
}
return p;
return getPromise((resolve: Function, reject: Function) => callInstance(pluginObj, methodName, args, opts, resolve, reject));
}
};

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface ActionSheetOptions {
@@ -99,13 +99,21 @@ export interface ActionSheetOptions {
@Injectable()
export class ActionSheet extends IonicNativePlugin {
@CordovaProperty
/**
* Convenience property to select an Android theme value
*/
ANDROID_THEMES: {
THEME_TRADITIONAL: number;
THEME_HOLO_DARK: number;
THEME_HOLO_LIGHT: number;
THEME_DEVICE_DEFAULT_DARK: number;
THEME_DEVICE_DEFAULT_LIGHT: number;
} = {
THEME_TRADITIONAL: 1,
THEME_HOLO_DARK: 2,
THEME_HOLO_LIGHT: 3,
THEME_DEVICE_DEFAULT_DARK: 4,
THEME_DEVICE_DEFAULT_LIGHT: 5
};
/**

View File

@@ -32,7 +32,7 @@ export interface AdMobOptions {
overlap?: boolean;
/**
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMobPro.AD_POSITION` property to select other values.
*/
position?: number;
@@ -90,17 +90,18 @@ export interface AdExtras {
}
/**
* @name AdMob
* @paid
* @name AdMob Pro
* @description
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
* Plugin for Google Ads, including AdMob / DFP (DoubleClick for publisher) and mediations to other Ad networks.
*
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMob Free](../admob-free).
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMobPro Free](../admob-free).
* @usage
* ```typescript
* import { AdMob } from '@ionic-native/admob';
* import { AdMobPro } from '@ionic-native/admob-pro';
* import { Platform } from 'ionic-angular';
*
* constructor(private admob: AdMob, private platform: Platform ) { }
* constructor(private admob: AdMobPro, private platform: Platform ) { }
*
* ionViewDidLoad() {
* this.admob.onAdDismiss()
@@ -125,14 +126,14 @@ export interface AdExtras {
* AdExtras
*/
@Plugin({
pluginName: 'AdMob',
pluginName: 'AdMob Pro',
plugin: 'cordova-plugin-admobpro',
pluginRef: 'AdMob',
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class AdMob extends IonicNativePlugin {
export class AdMobPro extends IonicNativePlugin {
AD_POSITION: {
NO_CHANGE: number;
@@ -178,7 +179,7 @@ export class AdMob extends IonicNativePlugin {
/**
* Show banner at position
* @param position {number} Position. Use `AdMob.AD_POSITION` to set values.
* @param position {number} Position. Use `AdMobPro.AD_POSITION` to set values.
*/
@Cordova({
sync: true

View File

@@ -1,6 +1,35 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* Bit flag values for setSystemUiVisibility()
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
*/
export enum AndroidSystemUiFlags {
/** View has requested the system UI (status bar) to be visible (the default). SYSTEM_UI_FLAG_VISIBLE */
Visible = 0,
/** View has requested the system UI to enter an unobtrusive "low profile" mode. SYSTEM_UI_FLAG_LOW_PROFILE */
LowProfile = 1,
/** View has requested that the system navigation be temporarily hidden. SYSTEM_UI_FLAG_HIDE_NAVIGATION */
HideNavigation = 2,
/** View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. SYSTEM_UI_FLAG_FULLSCREEN */
Fullscreen = 4,
/** Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds. SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR */
LightNavigationBar = 16,
/** When using other layout flags, we would like a stable view of the content insets given to fitSystemWindows(Rect). SYSTEM_UI_FLAG_LAYOUT_STABLE */
LayoutStable = 256,
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_HIDE_NAVIGATION, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION */
LayoutHideNavigation = 512,
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_FULLSCREEN, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN */
LayoutFullscreen = 1024,
/** View would like to remain interactive when hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE */
Immersive = 2048,
/** View would like to remain interactive when hiding the status bar with SYSTEM_UI_FLAG_FULLSCREEN and/or hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE_STICKY */
ImmersiveSticky = 4096,
/** Requests the status bar to draw in a mode that is compatible with light status bar backgrounds. SYSTEM_UI_FLAG_LIGHT_STATUS_BAR */
LightStatusBar = 8192
}
/**
* @name Android Full Screen
* @description
@@ -92,4 +121,13 @@ export class AndroidFullScreen extends IonicNativePlugin {
*/
@Cordova()
immersiveMode(): Promise<void> { return; }
/**
* Manually set the the system UI to a custom mode. This mirrors the Android method of the same name. (Android 4.4+ only).
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
* @param {AndroidSystemUiFlags} visibility Bitwise-OR of flags in AndroidSystemUiFlags
* @return {Promise<void>}
*/
@Cordova()
setSystemUiVisibility(visibility: AndroidSystemUiFlags): Promise<void> { return; }
}

View File

@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
*
* this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
* success => console.log('Permission granted'),
* err => this.androidPermissions.requestPermissions(this.androidPermissions.PERMISSION.CAMERA)
* err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
* );
*
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);

View File

@@ -264,7 +264,7 @@ export interface BackgroundGeolocationConfig {
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
*
* ```typescript
* import { BackgroundGeolocation, BackgroundGeolocationConfig } from '@ionic-native/background-geolocation';
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
*
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
*

View File

@@ -19,14 +19,14 @@ export interface BackgroundModeConfiguration {
text?: String;
/**
* This will look for <icon name>.png in platforms/android/res/drawable|mipmap
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
*/
icon?: string;
color?: string;
/**
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
* By default the app will come to foreground when taping on the notification. If false, plugin won't come to foreground when tapped.
*/
resume?: boolean;
@@ -50,7 +50,7 @@ export interface BackgroundModeConfiguration {
* @name Background Mode
* @description
* Cordova plugin to prevent the app from going to sleep while in background.
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, visit: https://github.com/katzer/cordova-plugin-background-mode
*@usage
* ```typescript
* import { BackgroundMode } from '@ionic-native/background-mode';
@@ -179,7 +179,7 @@ export class BackgroundMode extends IonicNativePlugin {
overrideBackButton(): void { }
/**
* Exclude the app from the recent task list works on Android 5.0+.
* Exclude the app from the recent task list. Works on Android 5.0+.
*/
@Cordova({
platforms: ['Android'],

View File

@@ -441,7 +441,7 @@ export class BLE extends IonicNativePlugin {
*@returns {Promise<any>}
*/
@Cordova()
static readRSSI(
readRSSI(
deviceId: string,
): Promise<any> { return; }
}

View File

@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
/**
* @name Bluetooth Serial
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino (not Android to Android or iOS to iOS).
* @usage
* ```typescript
* import { BluetoothSerial } from '@ionic-native/bluetooth-serial';

View File

@@ -85,6 +85,42 @@ export interface CameraPopoverOptions {
arrowDir: number;
}
export enum DestinationType {
DATA_URL = 0,
FILE_URL,
NATIVE_URI
}
export enum EncodingType {
JPEG = 0,
PNG
}
export enum MediaType {
PICTURE = 0,
VIDEO,
ALLMEDIA
}
export enum PictureSourceType {
PHOTOLIBRARY = 0,
CAMERA,
SAVEDPHOTOALBUM
}
export enum PopoverArrowDirection {
ARROW_UP = 1,
ARROW_DOWN,
ARROW_LEFT,
ARROW_RIGHT,
ARROW_ANY
}
export enum Direction {
BACK = 0,
FRONT
}
/**
* @name Camera
* @description

View File

@@ -133,6 +133,11 @@ export interface CardIOResponse {
* @name Card IO
* @description
* @usage
* Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element.
* ```xml
*<key>NSCameraUsageDescription</key>
*<string>To scan credit cards.</string>
*```
* ```typescript
* import { CardIO } from '@ionic-native/card-io';
*
@@ -147,7 +152,7 @@ export interface CardIOResponse {
* if(res){
* let options = {
* requireExpiry: true,
* requireCCV: false,
* requireCVV: false,
* requirePostalCode: false
* };
* CardIO.scan(options);

View File

@@ -29,10 +29,10 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
*/
@Plugin({
pluginName: 'Clipboard',
plugin: 'danielsogl-cordova-plugin-clipboard',
plugin: 'cordova-clipboard',
pluginRef: 'cordova.plugins.clipboard',
repo: 'https://github.com/danielsogl/cordova-plugin-clipboard',
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
repo: 'https://github.com/ihadeed/cordova-clipboard',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Clipboard extends IonicNativePlugin {

View File

@@ -10,14 +10,53 @@ import { Injectable } from '@angular/core';
* @usage
* ```typescript
* import { CouchbaseLite } from '@ionic-native/couchbase-lite';
*
* constructor(private couchbase: CouchbaseLite) {
*
* couchbase.getURL()
* .then(url => console.log(url))
* .catch(error => console.error(error));
*
* import { Http } from '@angular/http';
* import { Observable } from 'rxjs/Observable'
* constructor(private couchbase: CouchbaseLite, private platform:Platform,private _http:Http) {
* this.initMethod();
* }
* url:string;
* initMethod() {
* this.couchbase.getURL().then((url)=> {
* this.url = url;
* })
* }
* getUrl() {
* return this.url;
* }
* // DATABASES //
* createDatabase(database_name:string) {
* let url = this.getUrl();
* url = url+database_name;
* return this._http
* .put(url)
* .map(data => { this.results = data['results'] })
* .catch((error:any) => {
* return Observable.throw(error.json() || 'Couchbase Lite error');
* })
* }
* deleteDatabase(database_name:string) {
* let url = this.getUrl();
* url = url+database_name;
* return this._http
* .delete(url)
* .map(data => { this.results = data['results'] })
* .catch((error:any) => {
* return Observable.throw(error.json() || 'Couchbase Lite error');
* })
* }
*
* getAllDbs() {
* let url = this.getUrl();
* url = url+'_all_dbs';
* return this._http
* .get(url)
* .map(data => { this.results = data['results'] })
* .catch((error:any) => {
* return Observable.throw(error.json() || 'Couchbase Lite error');
* })
* }
*
*
* ```
*/

View File

@@ -1,28 +1,46 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
interface Cordova {
plugins: CordovaPlugins & { email: any };
}
declare const cordova: Cordova;
export interface EmailComposerOptions {
/**
* App to send the email with
*/
app?: string;
/**
* Email address(es) for To field
*/
to?: string | Array<string>;
/**
* Email address(es) for CC field
*/
cc?: string | Array<string>;
/**
* Email address(es) for BCC field
*/
bcc?: string | Array<string>;
attachments?: Array<any>;
/**
* File paths or base64 data streams
*/
attachments?: string[];
/**
* Subject of the email
*/
subject?: string;
/**
* Email body (for HTML, set isHtml to true)
*/
body?: string;
/**
* Indicates if the body is HTML or plain text
*/
isHtml?: boolean;
}
@@ -67,16 +85,27 @@ export interface EmailComposerOptions {
*
* // Send a text message using default options
* this.emailComposer.open(email);
* ```
*
* You can also assign aliases to email apps
* ```ts
* // add alias
* this.email.addAlias('gmail', 'com.google.android.gm');
*
* // then use alias when sending email
* this.email.open({
* app: 'gmail',
* ...
* });
* ```
* @interfaces
* EmailComposerOptions
*/
@Plugin({
pluginName: 'EmailComposer',
plugin: 'cordova-plugin-email',
plugin: 'cordova-plugin-email-composer',
pluginRef: 'cordova.plugins.email',
repo: 'https://github.com/hypery2k/cordova-email-plugin',
repo: 'https://github.com/katzer/cordova-plugin-email-composer',
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
@@ -92,7 +121,7 @@ export class EmailComposer extends IonicNativePlugin {
isAvailable(app?: string): Promise<any> {
return new Promise<boolean>((resolve, reject) => {
if (app) {
cordova.plugins.email.isAvailable(app, (isAvailable: boolean) => {
EmailComposer.getPlugin().isAvailable(app, (isAvailable: boolean) => {
if (isAvailable) {
resolve();
} else {
@@ -100,7 +129,7 @@ export class EmailComposer extends IonicNativePlugin {
}
});
} else {
cordova.plugins.email.isAvailable((isAvailable: boolean) => {
EmailComposer.getPlugin().isAvailable((isAvailable: boolean) => {
if (isAvailable) {
resolve();
} else {
@@ -111,6 +140,26 @@ export class EmailComposer extends IonicNativePlugin {
});
}
/**
* Request permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> { return; }
/**
* Checks if the app has a permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
hasPermission(): Promise<boolean> { return; }
/**
* Adds a new mail app alias.
*

View File

@@ -0,0 +1,49 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Extended Device Information
* @description
* Retrieves additional device information that is not provided by other plugins
*
* @usage
* ```typescript
* import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information';
*
*
* constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { }
*
* ...
*
* console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
* ```
*/
@Plugin({
pluginName: 'ExtendedDeviceInformation',
plugin: 'cordova-plugin-extended-device-information',
pluginRef: 'extended-device-information',
repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
platforms: ['Android']
})
@Injectable()
export class ExtendedDeviceInformation extends IonicNativePlugin {
/**
* Get the device's memory size
*/
@CordovaProperty
memory: number;
/**
* Get the device's CPU mhz
*/
@CordovaProperty
cpumhz: string;
/**
* Get the total storage
*/
@CordovaProperty
totalstorage: string;
}

View File

@@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
declare const FileTransfer: any;
export interface FileUploadOptions {
/**
@@ -109,21 +107,21 @@ export interface FileTransferError {
}
/**
* @name Transfer
* @name File Transfer
*
* @description
* This plugin allows you to upload and download files.
*
* @usage
* ```typescript
* import { Transfer, FileUploadOptions, TransferObject } from '@ionic-native/transfer';
* import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';
* import { File } from '@ionic-native/file';
*
* constructor(private transfer: Transfer, private file: File) { }
* constructor(private transfer: FileTransfer, private file: File) { }
*
* ...
*
* const fileTransfer: TransferObject = this.transfer.create();
* const fileTransfer: FileTransferObject = this.transfer.create();
*
* // Upload a file:
* fileTransfer.upload(..).then(..).catch(..);
@@ -170,7 +168,7 @@ export interface FileTransferError {
* FileUploadResult
* FileTransferError
* @classes
* TransferObject
* FileTransferObject
*/
@Plugin({
pluginName: 'FileTransfer',
@@ -180,7 +178,7 @@ export interface FileTransferError {
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Transfer extends IonicNativePlugin {
export class FileTransfer extends IonicNativePlugin {
/**
* Error code rejected from upload with FileTransferError
@@ -202,10 +200,10 @@ export class Transfer extends IonicNativePlugin {
/**
* Creates a new FileTransfer object
* @return {TransferObject}
* @return {FileTransferObject}
*/
create(): TransferObject {
return new TransferObject();
create(): FileTransferObject {
return new FileTransferObject();
}
}
@@ -217,12 +215,12 @@ export class Transfer extends IonicNativePlugin {
plugin: 'cordova-plugin-file-transfer',
pluginName: 'FileTransfer'
})
export class TransferObject {
export class FileTransferObject {
private _objectInstance: any;
constructor() {
if (checkAvailability('FileTransfer', null, 'FileTransfer') === true) {
this._objectInstance = new FileTransfer();
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
this._objectInstance = new (FileTransfer.getPlugin())();
}
}
@@ -239,9 +237,7 @@ export class TransferObject {
successIndex: 2,
errorIndex: 3
})
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
return;
}
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> { return; }
/**
* Downloads a file from server.
@@ -256,9 +252,7 @@ export class TransferObject {
successIndex: 2,
errorIndex: 3
})
download(source: string, target: string, trustAllHosts?: boolean, options?: { [s: string]: any; }): Promise<any> {
return;
}
download(source: string, target: string, trustAllHosts?: boolean, options?: { [s: string]: any; }): Promise<any> { return; }
/**
* Registers a listener that gets called whenever a new chunk of data is transferred.
@@ -276,5 +270,5 @@ export class TransferObject {
@CordovaInstance({
sync: true
})
abort(): void { }
abort(): void {}
}

View File

@@ -17,6 +17,16 @@ export interface FingerprintOptions {
* Disable 'use backup' option. Only for android (optional)
*/
disableBackup?: boolean;
/**
* Title of fallback button. Only for iOS
*/
localizedFallbackTitle?: string;
/**
* Description in authentication dialogue. Only for iOS
*/
localizedReason?: string;
}
/**
@@ -36,7 +46,9 @@ export interface FingerprintOptions {
* this.faio.show({
* clientId: 'Fingerprint-Demo',
* clientSecret: 'password', //Only necessary for Android
* disableBackup:true //Only for Android(optional)
* disableBackup:true, //Only for Android(optional)
* localizedFallbackTitle: 'Use Pin', //Only for iOS
* localizedReason: 'Please authenticate' //Only for iOS
* })
* .then((result: any) => console.log(result))
* .catch((error: any) => console.log(error));

View File

@@ -7,7 +7,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
* @description
* Cordova plugin for Firebase Analytics
*
* Go yo firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
*
* NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
*
@@ -49,7 +49,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
/**
* Sets the user ID property.
* This feature must be used in accordance with Google's Privacy Policy.
* @param id {string} THe user ID
* @param id {string} The user ID
* @return {Promise<any>} Returns a promise
*/
@Cordova()

View File

@@ -15,7 +15,8 @@ export interface DynamicLinksOptions {
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
*
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
*
* Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
* Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
*
* Preferences:

View File

@@ -71,10 +71,10 @@ export class Firebase extends IonicNativePlugin {
/**
* Check permission to receive push notifications
* @return {Promise<any>}
* @return {Promise<{isEnabled: boolean}>}
*/
@Cordova()
hasPermission(): Promise<any> { return; }
hasPermission(): Promise<{isEnabled: boolean}> { return; }
/**
* Set icon badge number. Set to 0 to clear the badge.
@@ -107,6 +107,13 @@ export class Firebase extends IonicNativePlugin {
@Cordova()
unsubscribe(topic: string): Promise<any> { return; }
/**
* Unregister from firebase, used to stop receiving push notifications.
* Call this when you logout user from your app.
*/
@Cordova()
unregister(): Promise<any> { return; }
/**
* Log an event using Analytics
* @param type {string}

View File

@@ -85,7 +85,7 @@ declare const window: any;
@Injectable()
export class Geofence extends IonicNativePlugin {
public TransitionType = {
TransitionType = {
ENTER: 1,
EXIT: 2,
BOTH: 3
@@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
* @return {Observable<any>}
*/
@CordovaFunctionOverride()
onTrasitionReceived(): Observable<any> { return; };
onTransitionReceived(): Observable<any> { return; };
/**
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
@@ -139,20 +139,6 @@ export class Geofence extends IonicNativePlugin {
@Cordova()
getWatched(): Promise<string> { return; };
/**
* Called when a geofence is crossed in the direction specified by `TransitType`.
*
* @returns {Observable<any>}
*/
onTransitionReceived(): Observable<any> {
return new Observable<any>((observer) => {
window && window.geofence && (window.geofence.onTransitionReceived = observer.next.bind(observer));
return () => window.geofence.onTransitionReceived = () => { };
});
}
/**
* Called when the user clicks a geofence notification. iOS and Android only.
*

View File

@@ -153,6 +153,8 @@ export interface GeolocationOptions {
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation',
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()

View File

@@ -102,7 +102,7 @@ export class GoogleAnalytics extends IonicNativePlugin {
/**
* Track custom metric
* @param key {string}
* @param key {number}
* @param value {any}
* @returns {Promise<any>}
*/
@@ -110,7 +110,7 @@ export class GoogleAnalytics extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
trackMetric(key: string, value?: any): Promise<any> { return; }
trackMetric(key: number, value?: number): Promise<any> { return; }
/**
* Track a screen

File diff suppressed because it is too large Load Diff

View File

@@ -59,9 +59,9 @@ export interface HTTPResponse {
*/
@Plugin({
pluginName: 'HTTP',
plugin: 'cordova-plugin-http',
pluginRef: 'cordovaHTTP',
repo: 'https://github.com/wymsee/cordova-HTTP',
plugin: 'cordova-plugin-advanced-http',
pluginRef: 'cordova.plugin.http',
repo: 'https://github.com/silkimen/cordova-plugin-advanced-http',
platforms: ['Android', 'iOS']
})
@Injectable()
@@ -92,6 +92,34 @@ export class HTTP extends IonicNativePlugin {
@Cordova({ sync: true })
setHeader(header: string, value: string): void { }
/**
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
* @param serializer {string} The name of the serializer. Can be urlencoded or json
*/
@Cordova({ sync: true })
setDataSerializer(serializer: string): void { }
/**
* Clear all cookies
*/
@Cordova({ sync: true })
clearCookies(): void { }
/**
* Remove cookies
* @param url {string}
* @param cb
*/
@Cordova({ sync: true })
removeCookies(url: string, cb: () => void): void { }
/**
* Set request timeout
* @param timeout {number} The timeout in seconds. Default 60
*/
@Cordova({ sync: true })
setRequestTimeout(timeout: number): void { }
/**
* Enable or disable SSL Pinning. This defaults to false.
*
@@ -131,7 +159,7 @@ export class HTTP extends IonicNativePlugin {
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
/**
*
* Make a GET request
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
@@ -140,6 +168,36 @@ export class HTTP extends IonicNativePlugin {
@Cordova()
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
/**
* Make a PUT request
* @param url {string} The url to send the request to
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
/**
* Make a DELETE request
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
/**
* Make a HEAD request
* @param url {string} The url to send the request to
* @param parameters {Object} Parameters to send with the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
/**
*
* @param url {string} The url to send the request to

View File

@@ -0,0 +1,180 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @beta
* @name HyperTrack
* @description
* HyperTrack cordova plugin wrapper for Ionic Native. Location-based services provider.
* Make sure to include your publishable key at config.xml (see [HyperTrack Cordova Setup](https://docs.hypertrack.com/sdks/cordova/setup.html#step-2-configure-the-sdk)).
*
* @usage
* ```typescript
* import { HyperTrack } from '@ionic-native/hyper-track';
*
* constructor(private hyperTrack: HyperTrack) { }
*
* // Check if app has location permissions enabled
* this.hyperTrack.checkLocationPermission().then(response => {
* // response (String) can be "true" or "false"
* if (response != "true") {
* // Ask for permissions
* this.hyperTrack.requestPermissions().then(response => {}, error => {});
* }
* }, error => {});
*
* // Check if app has location services enabled
* this.hyperTrack.checkLocationServices().then(response => {
* // response (String) can be "true" or "false"
* if (response != "true") {
* // Request services to be enabled
* this.hyperTrack.requestLocationServices().then(response => {}, error => {});
* }
* }, error => {});
*
* // First set the current user. This can be done via getOrCreateUser() or setUserId()
* this.hyperTrack.setUserId("xxx").then(user => {
* // user (String) is a String representation of a User's JSON
*
* this.hyperTrack.startTracking().then(userId => {}, trackingError => {});
*
* this.hyperTrack.createAndAssignAction('visit', 'lookupId','address', 20.12, -100.3).then(action => {
* // Handle action. It's a String representation of the Action's JSON. For example:
* // '{"eta":"Jul 17, 2017 12:50:03 PM","assigned_at":"Jul 17, 2017 12:34:38 PM",,"distance":"0.0",...}'
* }, error => {});
*
* // You can complete an action with completeAction() or completeActionWithLookupId()
* this.hyperTrack.completeAction('action-id').then(response => {
* // Handle response (String). Should be "OK".
* }, error => {});
*
* this.hyperTrack.getCurrentLocation().then(location => {
* // Handle location. It's a String representation of a Location's JSON.For example:
* // '{"mAccuracy":22.601,,"mLatitude":23.123456, "mLongitude":-100.1234567, ...}'
* }, error => {});
*
* this.hyperTrack.stopTracking().then(success => {
* // Handle success (String). Should be "OK".
* }, error => {});
*
* }, error => {});*
* ```
*/
@Plugin({
pluginName: 'HyperTrack',
plugin: 'cordova-plugin-hypertrack',
pluginRef: 'cordova.plugins.HyperTrack',
repo: 'https://github.com/hypertrack/hypertrack-cordova',
platforms: ['Android']
})
@Injectable()
export class HyperTrack extends IonicNativePlugin {
/**
* Returns given text. For testing purposes.
* @param {String} text Given text to print
* @returns {Promise<any>} Returns a Promise that resolves with the result text (which is the same as the given text) if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
helloWorld(text: String): Promise<String> { return; }
/**
* Create a new user to identify the current device or get a user from a lookup id.
* @param {String} name User's name
* @param {String} phone User's phone
* @param {String} photo User's photo as URL or a Base64 converted string
* @param {String} lookupId User's lookupId, which is used to check if a new user is to be created (in this case you could set it to an internal reference for the user that you can use later to identify it), or if one with an existing lookupId is to be used.
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the User's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
getOrCreateUser(name: String, phone: String, photo: String, lookupId: String): Promise<any> { return; }
/**
* Set UserId for the SDK created using HyperTrack APIs. This is useful if you already have a user previously created.
* @param {String} userId User's ID
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred. An "OK" response doesn't necessarily mean that the userId was found. It just means that it was set correctly.
*/
@Cordova()
setUserId(userId: String): Promise<any> { return; }
/**
* Enable the SDK and start tracking. This will fail if there is no user set.
* @returns {Promise<any>} Returns a Promise that resolves with the userId (String) of the User being tracked if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
startTracking(): Promise<any> { return; }
/**
* Create and assign an action to the current user using specified parameters
* @param {String} type The action type. Can be one from "pickup", "delivery", "dropoff", "visit", "stopover" or "task"
* @param {String} lookupId The Action's desired lookupId
* @param {String} expectedPlaceAddress The address of the Action
* @param {Number} expectedPlaceLatitude The latitude of the Action
* @param {Number} expectedPlaceLongitude The longitude of the Action
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Action's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
createAndAssignAction(type: String, lookupId: String, expectedPlaceAddress: String, expectedPlaceLatitude: Number, expectedPlaceLongitude: Number): Promise<any> { return; }
/**
* Complete an action from the SDK by its ID
* @param {String} actionId ID of the Action that will be marked as completed
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeAction(actionId: String): Promise<any> { return; }
/**
* Complete an action from the SDK using Action's lookupId as parameter
* @param {String} lookupId Lookup ID of the Action that will be marked as completed
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeActionWithLookupId(lookupId: String): Promise<any> { return; }
/**
* Disable the SDK and stop tracking.
* Needs user setting (via getOrCreateUser() or setUserId()) first.
* @returns {Promise<any>} Returns a Promise that resolves with the an "OK" string if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
stopTracking(): Promise<any> { return; }
/**
* Get user's current location from the SDK
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Location's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
getCurrentLocation(): Promise<any> { return; }
/**
* Check if Location permission has been granted to the app (for Android).
* Returns "true" or "false" in success method accordingly.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location permission was granted, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationPermission(): Promise<any> { return; }
/**
* Request user to grant Location access to the app (for Anrdoid).
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location access was given to the app, or it gets rejected if an error ocurred.
*/
@Cordova()
requestPermissions(): Promise<any> { return; }
/**
* Check if Location services are enabled on the device (for Android).
* Returns "true" or "false" in success method accordingly.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location services are enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationServices(): Promise<any> { return; }
/**
* Request user to enable Location services on the device.
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location services were enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
requestLocationServices(): Promise<any> { return; }
}

View File

@@ -57,10 +57,10 @@ export interface ImagePickerOptions {
*/
@Plugin({
pluginName: 'ImagePicker',
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker.git',
plugin: 'cordova-plugin-telerik-imagepicker',
pluginRef: 'window.imagePicker',
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
install: 'ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
install: 'ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
platforms: ['Android', 'iOS']
})

View File

@@ -42,11 +42,6 @@ export interface ImageResizerOptions {
* @description
* Cordova Plugin For Image Resize
*
* Requires plugin `info.protonet.imageresizer` - use the Ionic CLI and type in the following command:
* `ionic cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git`
*
* For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer
*
* @usage
* ```typescript
* import { ImageResizer, ImageResizerOptions } from '@ionic-native/image-resizer';
@@ -74,9 +69,9 @@ export interface ImageResizerOptions {
*/
@Plugin({
pluginName: 'ImageResizer',
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
plugin: 'info.protonet.imageresizer',
pluginRef: 'ImageResizer',
repo: 'https://github.com/protonet/cordova-plugin-image-resizer',
repo: 'https://github.com/JoschkaSchulz/cordova-plugin-image-resizer',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()

View File

@@ -13,9 +13,10 @@ import { Injectable } from '@angular/core';
* constructor(private store: InAppPurchase2) { }
*
* ...
*
* ```
*
* * @advanced
*
*
* ```typescript
* // After Platform Ready
* this.store.verbosity = this.store.DEBUG;
@@ -34,12 +35,12 @@ import { Injectable } from '@angular/core';
* this.store.when(productId).updated( (product: IAPProduct) => {
* console.log('Loaded' + JSON.stringify(product));
* });
*
*
* // Issue with buying
* this.store.when(productId).cancelled( (product) => {
* alert('Purchase was Cancelled');
* });
*
*
* // Track All Store Errors
* this.store.error( (err) => {
* alert('Store Error ' + JSON.stringify(err));
@@ -54,15 +55,15 @@ import { Injectable } from '@angular/core';
*
* // Errors
* this.store.when(productId).error( (error) => {
* this.loader.dismiss();
* this.loader.dismiss();
* alert('An Error Occured' + JSON.stringify(error));
* });
* // Refresh Starts Handlers
* // Refresh Starts Handlers
* console.log('Refresh Store');
* this.store.refresh();
*
*
* ...
*
*
* // To Purchase
* this.store.order(productId);
*
@@ -168,6 +169,9 @@ export interface IAPProductEvents {
downloaded: (callback: IAPQueryCallback) => void;
}
/**
* @hidden
*/
export class IAPError {
code: number;
message: string;

View File

@@ -0,0 +1,136 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface IndexItem {
domain: string;
identifier: string;
title: string;
description: string;
/**
* Url to image
*/
url: string;
/**
* Item keywords
*/
keywords?: Array<string>;
/**
* Lifetime in minutes
*/
lifetime?: number;
}
/**
* @name Index App Content
* @description
* This plugin gives you a Javascript API to interact with Core Spotlight on iOS (=> iOS 9).
* You can add, update and delete items to the spotlight search index.
* Spotlight Search will include these items in the result list. You can deep-link the search results with your app.
*
* @usage
* ```typescript
* import { IndexAppContent } from '@ionic-native/index-app-content';
*
*
* constructor(private indexAppContent: IndexAppContent) { }
*
* ...
*
* var items = [
* {
* domain: 'com.my.domain',
* identifier: '88asdf7dsf',
* title: 'Foo',
* description: 'Bar',
* url: 'http://location/of/my/image.jpg',
* },
* {
* domain: 'com.other.domain',
* identifier: '9asd67g6a',
* title: 'Baz',
* description: 'Woot',
* url: 'http://location/of/my/image2.jpg',
* }
* ];
*
* this.indexAppContent.setItems(items)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'IndexAppContent',
plugin: 'cordova-plugin-indexappcontent',
pluginRef: 'window.plugins.indexAppContent',
repo: 'https://github.com/johanblomgren/cordova-plugin-indexappcontent',
platforms: ['iOS']
})
@Injectable()
export class IndexAppContent extends IonicNativePlugin {
/**
* The option to index app content might not be available at all due to device limitations or user settings.
* Therefore it's highly recommended to check upfront if indexing is possible.
* @return {Promise<boolean>} Returns a promise that resolves with true if indexing is available, false if not
*/
@Cordova()
isIndexingAvailable(): Promise<boolean> {
return;
}
/**
* Add or change items to spotlight index
* @param {Array<IndexItem>} Array of items to index
* @return {Promise<any>} Returns if index set was successfull
*/
@Cordova()
setItems(items: Array<IndexItem>): Promise<any> {
return;
}
/**
* If user taps on a search result in spotlight then the app will be launched.
* You can register a Javascript handler to get informed when this happens.
* @param {IndexItem} Clicked Item
* @return {Promise<any>} Returns promise
*/
@Cordova()
onItemPressed(payload: IndexItem) {
return;
}
/**
* Clear all items stored for a given array of domains
* @param {Array<string>} Array of domains to clear
* @return {Promise<any>} Resolve if successfull
*/
@Cordova()
clearItemsForDomains(domains: Array<string>): Promise<any> {
return;
}
/**
* Clear all items stored for a given array of identifiers
* @param {Array<string>} Array of identifiers to clear
* @return {Promise<any>} Resolve if successfull
*/
@Cordova()
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
return;
}
/**
* You might want to avoid to update spotlight index too frequently.
* Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)!
* @param {number} Numeric value => 0
*/
@Cordova()
setIndexingInterval(intervalMinutes: number) {
return;
}
}

View File

@@ -0,0 +1,88 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Keychain Touch Id
* @description
* A cordova plugin adding the iOS TouchID / Android fingerprint to your
* app and allowing you to store a password securely in the device keychain.
*
* @usage
* ```typescript
* import { KeychainTouchId } from '@ionic-native/keychain-touch-id';
*
*
* constructor(private keychainTouchId: KeychainTouchId) { }
*
* ...
*
*
* this.keychainTouchId.isAvailable()
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'KeychainTouchId',
plugin: 'cordova-plugin-keychain-touch-id',
pluginRef: 'plugins.touchid',
repo: 'https://github.com/sjhoeksma/cordova-plugin-keychain-touch-id',
platforms: ['Android', 'iOS']
})
@Injectable()
export class KeychainTouchId extends IonicNativePlugin {
/**
* Check if Touch ID / Fingerprint is supported by the device
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
*/
@Cordova()
isAvailable(): Promise<any> {
return;
}
/**
* Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
* successful authentication using fingerprint
* @param key {string} the key you want to store
* @param password {string} the password you want to encrypt and store
* @return {Promise<any>} Returns a promise that resolves when there is a result
*/
@Cordova()
save(key: string, password: string): Promise<any> { return; }
/**
* Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve
* with the password stored in keychain or will resolve an error code, where -1 indicated not available.
* @param key {string} the key you want to retrieve from keychain
* @param message {string} a message to the user
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
*/
@Cordova()
verify(key: string, message: string): Promise<any> { return; }
/**
* Checks if there is a password stored within the keychain for the given key.
* @param key {string} the key you want to check from keychain
* @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
*/
@Cordova()
has(key: string): Promise<any> { return; }
/**
* Deletes the password stored under given key from the keychain.
* @param key {string} the key you want to delete from keychain
* @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
*/
@Cordova()
delete(key: string): Promise<any> { return; }
/**
* Sets the language of the fingerprint dialog
* @param locale {string} locale subtag from [this list](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
*/
@Cordova()
setLocale(locale: string): void {}
}

View File

@@ -9,6 +9,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
*
* Requires Cordova plugin: `cordova-plugin-ios-keychain`. For more info, please see the [Keychain plugin docs](https://github.com/ionic-team/cordova-plugin-ios-keychain).
*
* See also [Secure Storage](https://ionicframework.com/docs/native/secure-storage/) for more supported platforms.
*
* @usage
* ```typescript
* import { Keychain } from '@ionic-native/keychain';

View File

@@ -1,10 +1,125 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface PromptsOptions {
/**
* a function to pass the user's decision whether to remember their choice of app.
* This will be passed a single boolean value indicating the user's decision.
* @param rememberChoice
*/
callback?: (rememberChoice: boolean) => void;
/**
* text to display in the native prompt header asking user whether to remember their choice.
* Defaults to "Remember your choice?" if not specified.
*/
headerText?: string;
/**
* text to display in the native prompt body asking user whether to remember their choice.
* Defaults to "Use the same app for navigating next time?" if not specified.
*/
bodyText?: string;
/**
* text to display for the Yes button.
* Defaults to "Yes" if not specified.
*/
yesButtonText?: string;
/**
* text to display for the No button.
* Defaults to "No" if not specified.
*/
noButtonText?: string;
}
export interface RememberChoiceOptions {
/**
* whether to remember user choice of app for next time, instead of asking again for user choice.
* `"prompt"` - Prompt user to decide whether to remember choice.
* - Default value if unspecified.
* - If `promptFn` is defined, this will be used for user confirmation.
* - Otherwise (by default), a native dialog will be displayed to ask user.
* `false` - Do not remember user choice.
* `true` - Remember user choice.
*/
enabled?: boolean | string;
/**
* a function which asks the user whether to remember their choice of app.
* If this is defined, then the default dialog prompt will not be shown, allowing for a custom UI for asking the user.
* This will be passed a callback function which should be invoked with a single boolean argument which indicates the user's decision to remember their choice.
* @param callback
*/
promptFn?: (callback: (rememberChoice: boolean) => void) => void;
/**
* options related to the default dialog prompt used to ask the user whether to remember their choice of app.
*/
prompt?: PromptsOptions;
}
export interface AppSelectionOptions {
/**
* text to display in the native picker which enables user to select which navigation app to launch.
* Defaults to "Select app for navigation" if not specified.
*/
dialogHeaderText?: string;
/**
* text to display for the cancel button in the native picker which enables user to select which navigation app to launch.
* Defaults to "Cancel" if not specified.
*/
cancelButtonText?: string;
/**
* List of apps, defined as `launchnavigator.APP` constants, which should be displayed in the picker if the app is available.
* This can be used to restrict which apps are displayed, even if they are installed.
* By default, all available apps will be displayed.
*/
list?: string[];
/**
* Callback to invoke when the user selects an app in the native picker.
* A single string argument is passed which is the app what was selected defined as a `launchnavigator.APP` constant.
*/
callback?: (app: string) => void;
/**
* (Android only) native picker theme. Specify using `actionsheet.ANDROID_THEMES` constants.
* Default `actionsheet.ANDROID_THEMES.THEME_HOLO_LIGHT`
*/
androidTheme?: number;
/**
* options related to whether to remember user choice of app for next time, instead of asking again for user choice.
*/
rememberChoice?: RememberChoiceOptions;
}
export interface LaunchNavigatorOptions {
/**
* name of the navigation app to use for directions. Specify using launchnavigator.APP constants. If not specified, defaults to User Selection.
* A callback to invoke when the navigation app is successfully launched.
*/
successCallback?: Function;
/**
* A callback to invoke if an error is encountered while launching the app.
* A single string argument containing the error message will be passed in.
*/
errorCallback?: (error: string) => void;
/**
* name of the navigation app to use for directions.
* Specify using launchnavigator.APP constants.
* e.g. `launchnavigator.APP.GOOGLE_MAPS`.
* If not specified, defaults to User Selection.
*/
app?: string;
@@ -14,7 +129,12 @@ export interface LaunchNavigatorOptions {
destinationName?: string;
/**
* Start point of the navigation
* Start point of the navigation.
* If not specified, the current device location will be used.
* Either:
* - a {string} containing the address. e.g. "Buckingham Palace, London"
* - a {string} containing a latitude/longitude coordinate. e.g. "50.1. -4.0"
* - an {array}, where the first element is the latitude and the second element is a longitude, as decimal numbers. e.g. [50.1, -4.0]
*/
start?: string | number[];
@@ -39,23 +159,82 @@ export interface LaunchNavigatorOptions {
extras?: any;
/**
* (Android only) mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified. Specify using launchnavigator.LAUNCH_MODE constants.
* (Android only) mode in which to open Google Maps app.
* `launchnavigator.LAUNCH_MODE.MAPS` or `launchnavigator.LAUNCH_MODE.TURN_BY_TURN`
* Defaults to `launchnavigator.LAUNCH_MODE.MAPS` if not specified.
*/
launchMode?: string;
launchModeGoogleMaps?: string;
/**
* text to display in the native picker which enables user to select which navigation app to launch. Defaults to "Select app for navigation" if not specified.
* (iOS only) method to use to open Apple Maps app.
* `launchnavigator.LAUNCH_MODE.URI_SCHEME` or `launchnavigator.LAUNCH_MODE.MAPKIT`
* Defaults to `launchnavigator.LAUNCH_MODE.URI_SCHEME` if not specified.
*/
appSelectionDialogHeader?: string;
launchModeAppleMaps?: string;
/**
* text to display for the cancel button in the native picker which enables user to select which navigation app to launch. Defaults to "Cancel" if not specified.
* If true, and input location type(s) doesn't match those required by the app, use geocoding to obtain the address/coords as required. Defaults to true.
*/
appSelectionCancelButton?: string;
enableGeolocation?: boolean;
successCallback?: Function;
/**
* options related to the default native actionsheet picker which enables user to select which navigation app to launch if `app` is not specified.
*/
appSelection?: AppSelectionOptions;
}
errorCallback?: Function;
export interface UserChoice {
/**
* Indicates whether a user choice exists for a preferred navigator app.
* @param callback - function to pass result to: will receive a boolean argument.
*/
exists: (callback: (exists: boolean) => void) => void;
/**
* Returns current user choice of preferred navigator app.
* @param callback - function to pass result to: will receive a string argument indicating the app, which is a constant in `launchnavigator.APP`.
*/
get: (callback: (app: string) => void) => void;
/**
* Sets the current user choice of preferred navigator app.
* @param app - app to set as preferred choice as a constant in `launchnavigator.APP`.
* @param callback - function to call once operation is complete.
*/
set: (app: string, callback: () => void) => void;
/**
* Clears the current user choice of preferred navigator app.
* @param callback - function to call once operation is complete.
*/
clear: (callback: () => void) => void;
}
export interface UserPrompted {
/**
* Indicates whether user has already been prompted whether to remember their choice a preferred navigator app.
* @param callback - function to pass result to: will receive a boolean argument.
*/
get: (callback: (exists: boolean) => void) => void;
/**
* Sets flag indicating user has already been prompted whether to remember their choice a preferred navigator app.
* @param callback - function to call once operation is complete.
*/
set: ( callback: () => void) => void;
/**
* Clears flag which indicates if user has already been prompted whether to remember their choice a preferred navigator app.
* @param callback - function to call once operation is complete.
*/
clear: ( callback: () => void) => void;
}
export interface AppSelection {
userChoice: UserChoice;
userPrompted: UserPrompted;
}
/**
@@ -86,6 +265,12 @@ export interface LaunchNavigatorOptions {
* ```
* @interfaces
* LaunchNavigatorOptions
* PromptsOptions
* RememberChoiceOptions
* AppSelectionOptions
* UserChoice
* UserPrompted
* AppSelection
*/
@Plugin({
pluginName: 'LaunchNavigator',
@@ -97,6 +282,30 @@ export interface LaunchNavigatorOptions {
@Injectable()
export class LaunchNavigator extends IonicNativePlugin {
APP: any = {
USER_SELECT: 'user_select',
APPLE_MAPS: 'apple_maps',
GOOGLE_MAPS: 'google_maps',
WAZE: 'waze',
CITYMAPPER: 'citymapper',
NAVIGON: 'navigon',
TRANSIT_APP: 'transit_app',
YANDEX: 'yandex',
UBER: 'uber',
TOMTOM: 'tomtom',
BING_MAPS: 'bing_maps',
SYGIC: 'sygic',
HERE_MAPS: 'here_maps',
MOOVIT: 'moovit'
};
TRANSPORT_MODE: any = {
DRIVING: 'driving',
WALKING: 'walking',
BICYCLING: 'bicycling',
TRANSIT: 'transit'
};
/**
* Launches navigator app
* @param destination {string|number[]} Location name or coordinates (as string or array)
@@ -104,13 +313,10 @@ export class LaunchNavigator extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
successIndex: 2,
errorIndex: 3
})
navigate(
destination: string | number[],
options?: LaunchNavigatorOptions
): Promise<any> { return; }
navigate(destination: string | number[], options?: LaunchNavigatorOptions): Promise<any> { return; }
/**
* Determines if the given app is installed and available on the current device.
@@ -162,14 +368,12 @@ export class LaunchNavigator extends IonicNativePlugin {
getTransportModes(app: string, platform: string): string[] { return; }
/**
* Indicates if an app on a given platform supports specification of launch mode.
* Note that currently only Google Maps on Android does.
* @param app {string}
* @param platform {string}
* @returns {boolean}
*/
@Cordova({ sync: true })
supportsLaunchMode(app: string, platform: string): boolean { return; }
supportsDestName(app: string, platform: string): boolean { return; }
/**
* Indicates if an app on a given platform supports specification of start location.
@@ -189,41 +393,21 @@ export class LaunchNavigator extends IonicNativePlugin {
supportsStartName(app: string, platform: string): boolean { return; }
/**
* Indicates if an app on a given platform supports specification of launch mode.
* Note that currently only Google Maps on Android does.
* @param app {string}
* @param platform {string}
* @returns {boolean}
*/
@Cordova({ sync: true })
supportsDestName(app: string, platform: string): boolean { return; }
supportsLaunchMode(app: string, platform: string): boolean { return; }
/**
* @param destination {string | number[]}
* @param options {LaunchNavigatorOptions}
*/
@Cordova({ sync: true })
userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
userSelect(destination: string | number[], options: LaunchNavigatorOptions): void {}
APP: any = {
USER_SELECT: 'user_select',
APPLE_MAPS: 'apple_maps',
GOOGLE_MAPS: 'google_maps',
WAZE: 'waze',
CITYMAPPER: 'citymapper',
NAVIGON: 'navigon',
TRANSIT_APP: 'transit_app',
YANDEX: 'yandex',
UBER: 'uber',
TOMTOM: 'tomtom',
BING_MAPS: 'bing_maps',
SYGIC: 'sygic',
HERE_MAPS: 'here_maps',
MOOVIT: 'moovit'
};
TRANSPORT_MODE: any = {
DRIVING: 'driving',
WALKING: 'walking',
BICYCLING: 'bicycling',
TRANSIT: 'transit'
};
appSelection: AppSelection;
}

View File

@@ -324,5 +324,15 @@ export class LocalNotifications extends IonicNativePlugin {
})
on(eventName: string, callback: any): void { }
/**
* Removes a callback of a specific event
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
*/
@Cordova({
sync: true
})
un(eventName: string, callback: any): void { }
}

View File

@@ -1,15 +1,62 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
declare const Media: any;
// TODO for ionic native 4.x ... rename plugin class to Media and use Media.getPlugin() to retrieve the original media object
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin, InstanceProperty } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
/**
* @hidden
*/
export class MediaObject {
constructor(private _objectInstance: any) {}
/**
* An observable that notifies you on actions success
*/
onSuccess: Observable<any>;
/**
* An observable that notifies you when an error occurs
*/
onError: Observable<MEDIA_ERROR>;
/**
* An observable that notifies you when the file status changes
*/
onStatusUpdate: Observable<MEDIA_STATUS>;
/**
* @hidden
*/
@InstanceProperty
successCallback: Function;
/**
* @hidden
*/
@InstanceProperty
errorCallback: Function;
/**
* @hidden
*/
@InstanceProperty
statusCallback: Function;
constructor(private _objectInstance: any) {
this.onSuccess = new Observable<any>((observer: Observer<any>) => {
this.successCallback = observer.next.bind(observer);
return () => this.successCallback = () => {};
});
this.onError = new Observable<MEDIA_ERROR>((observer: Observer<MEDIA_ERROR>) => {
this.errorCallback = observer.next.bind(observer);
return () => this.errorCallback = () => {};
});
this.onStatusUpdate = new Observable<MEDIA_STATUS>((observer: Observer<MEDIA_STATUS>) => {
this.statusCallback = observer.next.bind(observer);
return () => this.statusCallback = () => {};
});
}
/**
* Get the current amplitude of the current recording.
@@ -67,6 +114,9 @@ export class MediaObject {
@CordovaInstance({ sync: true })
setVolume(volume: number): void { }
@CordovaInstance({ sync: true })
setRate(speedRate: number): void {}
/**
* Starts recording an audio file.
*/
@@ -115,6 +165,21 @@ export interface MediaError {
}
export enum MEDIA_STATUS {
NONE = 0,
STARTING,
RUNNING,
PAUSED,
STOPPED
}
export enum MEDIA_ERROR {
ABORTED = 1,
NETWORK,
DECODE,
SUPPORTED
}
export type MediaErrorCallback = (error: MediaError) => void;
/**
@@ -122,50 +187,29 @@ export type MediaErrorCallback = (error: MediaError) => void;
* @description
* This plugin provides the ability to record and play back audio files on a device.
*
* Some hints if you are using iOS and recording doesn't work:
* 1.) Try to use a absolute file path but remove beginning "file://".
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
* Example: `this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a')`
* 2.) If that's not working, too, create the file before using.
* Example:
* ```typescript
* import { MediaPlugin, MediaObject } from '@ionic-native/media';
* import { File } from '@ionic-native/file';
*
* ...
*
* constructor(private media: MediaPlugin, private file: File) { }
*
* ...
*
* this.file.createFile(this.file.tempDirectory, 'my_file.m4a', true).then(() => {
* let file = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a');
* file.startRecord();
* window.setTimeout(() => file.stopRecord(), 10000);
* });
* ```
*
* You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906
*
* @usage
* ```typescript
* import { MediaPlugin, MediaObject } from '@ionic-native/media';
* import { Media, MediaObject } from '@ionic-native/media';
*
*
* constructor(private media: MediaPlugin) { }
* constructor(private media: Media) { }
*
*
* ...
*
*
* // Create a MediaPlugin instance. Expects path to file or url as argument
* // Create a Media instance. Expects path to file or url as argument
* // We can optionally pass a second argument to track the status of the media
*
* const onStatusUpdate = (status) => console.log(status);
* const onSuccess = () => console.log('Action is successful.');
* const onError = (error) => console.error(error.message);
* const file: MediaObject = this.media.create('file.mp3');
*
* const file: MediaObject = this.media.create('path/to/file.mp3', onStatusUpdate, onSuccess, onError);
* // to listen to plugin events:
*
* file.onStatusUpdate.subscribe(status => console.log(status)); // fires when file status changes
*
* file.onSuccess.subscribe(() => console.log('Action is successful'));
*
* file.onError.subscribe(error => console.log('Error!', error));
*
* // play the file
* file.play();
@@ -205,20 +249,45 @@ export type MediaErrorCallback = (error: MediaError) => void;
*
*
* ```
*
* Some hints if you are using iOS and recording doesn't work:
* 1.) Try to use a absolute file path but remove beginning "file://".
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
* Example: `this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a')`
* 2.) If that's not working, too, create the file before using.
* Example:
* ```typescript
* import { Media, MediaObject } from '@ionic-native/media';
* import { File } from '@ionic-native/file';
*
* ...
*
* constructor(private media: Media, private file: File) { }
*
* ...
*
* this.file.createFile(this.file.tempDirectory, 'my_file.m4a', true).then(() => {
* let file = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a');
* file.startRecord();
* window.setTimeout(() => file.stopRecord(), 10000);
* });
* ```
*
* You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906
* @classes
* MediaObject
* @interfaces
* MediaError
*/
@Plugin({
pluginName: 'MediaPlugin',
pluginName: 'Media',
repo: 'https://github.com/apache/cordova-plugin-media',
plugin: 'cordova-plugin-media',
pluginRef: 'Media',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class MediaPlugin extends IonicNativePlugin {
export class Media extends IonicNativePlugin {
// Constants
/**
@@ -263,25 +332,17 @@ export class MediaPlugin extends IonicNativePlugin {
/**
* Open a media file
* @param src {string} A URI containing the audio content.
* @param [onStatusUpdate] {MediaStatusUpdateCallback} A callback function to be invoked when the status of the file changes
* @param [onSuccess] {Function} A callback function to be invoked after the current play, record, or stop action is completed
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
* @return {MediaObject}
*/
create(src: string,
onStatusUpdate?: MediaStatusUpdateCallback,
onSuccess?: Function,
onError?: MediaErrorCallback): MediaObject {
create(src: string): MediaObject {
let instance: any;
if (checkAvailability(MediaPlugin.getPluginRef(), null, MediaPlugin.getPluginName()) === true) {
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
// Creates a new media object
instance = new Media(src, onSuccess, onError, onStatusUpdate);
instance = new (Media.getPlugin())(src);
}
return new MediaObject(instance);
}
}

View File

@@ -0,0 +1,157 @@
import { Plugin, IonicNativePlugin, checkAvailability, InstanceProperty, CordovaInstance } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface AuthenticationResult {
accessToken: string;
accesSTokenType: string;
expiresOn: Date;
idToken: string;
isMultipleResourceRefreshToken: boolean;
status: string;
statusCode: number;
tenantId: string;
/**
* Creates authorization header for web requests.
* @returns {String} The authorization header.
*/
createAuthorizationHeader(): string;
}
export interface TokenCache {
clear(): void;
readItems(): Promise<TokenCacheItem[]>;
deleteItem(item: TokenCacheItem): void;
}
export interface TokenCacheItem {
accessToken: string;
authority: string;
clientId: string;
displayableId: string;
expiresOn: Date;
isMultipleResourceRefreshToken: boolean;
resource: string;
tenantId: string;
userInfo: UserInfo;
}
export interface UserInfo {
displayableId: string;
userId: string;
familyName: string;
givenName: string;
identityProvider: string;
passwordChangeUrl: string;
passwordExpiresOn: Date;
uniqueId: string;
}
/**
* @name MS ADAL
* @description
* Active Directory Authentication Library (ADAL) plugin.
* Active Directory Authentication Library ([ADAL](https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory?view=azure-dotnet))
* plugin provides easy to use authentication functionality for your Apache Cordova apps by taking advantage of
* Windows Server Active Directory and Windows Azure Active Directory. Here you can find the source code for the library.
* @usage
* ```typescript
* import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal';
*
*
* constructor(private msAdal: MSAdal) {}
*
* ...
*
* let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
*
* authContext.acquireTokenAsync('https://graph.windows.net', 'a5d92493-ae5a-4a9f-bcbf-9f1d354067d3', 'http://MyDirectorySearcherApp')
* .then((authResponse: AuthenticationResult) => {
* console.log('Token is' , authResponse.accessToken);
* console.log('Token will expire on', authResponse.expiresOn);
* })
* .catch((e: any) => console.log('Authentication failed', e));
*
*
* ```
*
* @classes
* AuthenticationContext
* @interfaces
* AuthenticationResult
* TokenCache
* TokenCacheItem
* UserInfo
*/
@Plugin({
pluginName: 'MSADAL',
plugin: 'cordova-plugin-ms-adal',
pluginRef: 'Microsoft.ADAL',
repo: 'https://github.com/AzureAD/azure-activedirectory-library-for-cordova',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class MSAdal extends IonicNativePlugin {
createAuthenticationContext(authority: string, validateAuthority: boolean = true) {
let authContext: any;
if (checkAvailability(MSAdal.getPluginRef(), null, MSAdal.getPluginName()) === true) {
authContext = new (MSAdal.getPlugin()).AuthenticationContext(authority);
}
return new AuthenticationContext(authContext);
}
}
/**
* @hidden
*/
export class AuthenticationContext {
@InstanceProperty
authority: string;
@InstanceProperty
validateAuthority: boolean;
@InstanceProperty
tokenCache: any;
constructor(private _objectInstance: any) {}
/**
* Acquires token using interactive flow. It always shows UI and skips token from cache.
*
* @param {String} resourceUrl Resource identifier
* @param {String} clientId Client (application) identifier
* @param {String} redirectUrl Redirect url for this application
* @param {String} userId User identifier (optional)
* @param {String} extraQueryParameters
* Extra query parameters (optional)
* Parameters should be escaped before passing to this method (e.g. using 'encodeURI()')
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
*/
@CordovaInstance({
otherPromise: true
})
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
/**
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
* if not expired. It tries to use refresh token if available. If it fails to get token without
* displaying UI it will fail. This method guarantees that no UI will be shown to user.
*
* @param {String} resourceUrl Resource identifier
* @param {String} clientId Client (application) identifier
* @param {String} userId User identifier (optional)
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
*/
@CordovaInstance({
otherPromise: true
})
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise<AuthenticationResult> { return; }
}

View File

@@ -10,6 +10,10 @@ export interface MusicControlsOptions {
dismissable: boolean;
hasPrev: boolean;
hasNext: boolean;
hasSkipForward: boolean;
hasSkipBackward: boolean;
skipForwardInterval: number;
skipBackwardInterval: number;
hasClose: boolean;
album: string;
duration: number;
@@ -50,6 +54,10 @@ export interface MusicControlsOptions {
* album : 'Absolution' // optional, default: ''
* duration : 60, // optional, default: 0
* elapsed : 10, // optional, default: 0
* hasSkipForward : true, // show skip forward button, optional, default: false
* hasSkipBackward : true, // show skip backward button, optional, default: false
* skipForwardInterval: 15, // display number for skip forward, optional, default: 0
* skipBackwardInterval: 15, // display number for skip backward, optional, default: 0
*
* // Android only, optional
* // text displayed in the status bar when the notification (and the ticker) are updated
@@ -89,6 +97,12 @@ export interface MusicControlsOptions {
* });
* // Do something
* break;
* case 'music-controls-skip-forward':
* // Do something
* break;
* case 'music-controls-skip-backward':
* // Do something
* break;
*
* // Headset events (Android only)
* // All media button events are listed below
@@ -164,7 +178,7 @@ export class MusicControls extends IonicNativePlugin {
/**
* Update elapsed time, optionally toggle play/pause:
* @param args {Object}
* @param args {Object}
*/
@Cordova({
platforms: ['iOS']

View File

@@ -15,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
* ...
*
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
* .then((result: NativeGeocoderReverseResult) => console.log('The address is ' + result.street + ' in ' + result.countryCode))
* .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
* .catch((error: any) => console.log(error));
*
* this.nativeGeocoder.forwardGeocode('Berlin')
@@ -40,7 +40,7 @@ export class NativeGeocoder extends IonicNativePlugin {
* Reverse geocode a given latitude and longitude to find location address
* @param latitude {number} The latitude
* @param longitude {number} The longitude
* @return {Promise<any>}
* @return {Promise<NativeGeocoderReverseResult>}
*/
@Cordova({
callbackOrder: 'reverse'
@@ -50,48 +50,59 @@ export class NativeGeocoder extends IonicNativePlugin {
/**
* Forward geocode a given address to find coordinates
* @param addressString {string} The address to be geocoded
* @return {Promise<any>}
* @return {Promise<NativeGeocoderForwardResult>}
*/
@Cordova({
callbackOrder: 'reverse'
})
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
}
/**
* Encapsulates format information about a reverse geocoding result.
* more Info:
* - https://developer.apple.com/documentation/corelocation/clplacemark
* - https://developer.android.com/reference/android/location/Address.html
*/
export interface NativeGeocoderReverseResult {
/**
* The street.
* The country code.
*/
street: string;
/**
* The house number.
*/
houseNumber: string;
/**
* The postal code.
*/
postalCode: string;
/**
* The city.
*/
city: string;
/**
* The district.
*/
district: string;
countryCode: string;
/**
* The country name.
*/
countryName: string;
/**
* The country code.
* The postal code.
*/
countryCode: string;
postalCode: string;
/**
* The administrativeArea.
*/
administrativeArea: string;
/**
* The subAdministrativeArea.
*/
subAdministrativeArea: string;
/**
* The locality.
*/
locality: string;
/**
* The subLocality.
*/
subLocality: string;
/**
* The thoroughfare.
*/
thoroughfare: string;
/**
* The subThoroughfare.
*/
subThoroughfare: string;
}
/**
* Encapsulates format information about a forward geocoding result.
*/

View File

@@ -172,14 +172,12 @@ export interface NativeKeyboardUpdateMessengerOptions {
}
/**
* @paid
* @name Native Keyboard
* @description
* A cross platform WhatsApp / Messenger / Slack -style keyboard even. For your Cordova app.
*
*
* IMPORTANT NOTICE: this plugin is paid, please read more about this at the [plugin's repo](https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard#i-like-it-hook-me-up).
*
*
* @usage
* ```
* import { NativeKeyboard } from '@ionic-native/native-keyboard';

View File

@@ -23,8 +23,17 @@ declare let window: any;
*
* ...
*
* let message = this.ndef.textRecord('Hello world');
* this.nfc.share([message]).then(onSuccess).catch(onError);
* this.nfc.addNdefListener(() => {
* console.log('successfully attached ndef listener');
* }, (err) => {
* console.log('error attaching ndef listener', err);
* }).subscribe((event) => {
* console.log('received ndef message. the tag contains: ', event.tag);
* console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
*
* let message = this.ndef.textRecord('Hello world');
* this.nfc.share([message]).then(onSuccess).catch(onError);
* });
*
* ```
*/

View File

@@ -97,13 +97,13 @@ export enum OSLockScreenVisibility {
* Fully visible (default)
*/
Public = 1,
/**
* Contents are hidden
*/
/**
* Contents are hidden
*/
Private = 0,
/**
* Not shown
*/
/**
* Not shown
*/
Secret = -1
}
@@ -115,13 +115,13 @@ export enum OSDisplayType {
* notification is silent, or inFocusDisplaying is disabled.
*/
None = 0,
/**
* (**DEFAULT**) - native alert dialog display.
*/
/**
* (**DEFAULT**) - native alert dialog display.
*/
InAppAlert = 1,
/**
* native notification display.
*/
/**
* native notification display.
*/
Notification = 2
}
@@ -165,7 +165,7 @@ export interface OSNotificationPayload {
/**
* URL to open when opening the notification.
*/
launchUrl?: string;
launchURL?: string;
/**
* Sound resource to play when the notification is shown.
*/
@@ -236,10 +236,10 @@ export interface OSPermissionState {
* OSSubscriptionState
*/
export interface OSSubscriptionState {
subscribed: boolean;
userSubscriptionSetting: any;
userId: any;
pushToken: any;
subscribed: boolean;
userSubscriptionSetting: any;
userId: any;
pushToken: any;
}
/**
* Subscription and permissions status
@@ -305,14 +305,14 @@ export enum OSActionType {
*
* #### Icons
* If you want to use generated icons with command `ionic cordova resources`:
*
*
* 1. Add a file to your `hooks` directory inside the `after_prepare` folder called `030_copy_android_notification_icons.js`
*
* 2. Put the following code in it:
*
* ```
* #!/usr/bin/env node
*
*
* var filestocopy = [{
* "resources/android/icon/drawable-hdpi-icon.png":
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
@@ -329,13 +329,13 @@ export enum OSActionType {
* "resources/android/icon/drawable-xxxhdpi-icon.png":
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
* } ];
*
*
* var fs = require('fs');
* var path = require('path');
*
*
* // no need to configure below
* var rootdir = process.argv[2];
*
*
* filestocopy.forEach(function(obj) {
* Object.keys(obj).forEach(function(key) {
* var val = obj[key];
@@ -449,7 +449,10 @@ export class OneSignal extends IonicNativePlugin {
* Launch notifications with a launch URL as an in app webview.
* @returns {any}
*/
@Cordova({ sync: true })
@Cordova({
sync: true,
platforms: ['iOS']
})
iOSSettings(settings: {
kOSSettingsKeyAutoPrompt: boolean;
kOSSettingsKeyInAppLaunchURL: boolean;
@@ -463,6 +466,15 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ sync: true })
endInit(): any { return; }
/**
* Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
* @returns {Promise<boolean>}
*/
@Cordova({
platforms: ['iOS']
})
promptForPushNotificationsWithUserResponse(): Promise<boolean> { return; }
/**
* Retrieve a list of tags that have been set on the user from the OneSignal server.
*
@@ -530,67 +542,74 @@ export class OneSignal extends IonicNativePlugin {
registerForPushNotifications(): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
*
* @param {boolean} false to disable vibrate, true to re-enable it.
*/
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
*
* @param {boolean} false to disable vibrate, true to re-enable it.
*/
@Cordova({ sync: true })
enableVibrate(enable: boolean): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
*
* @param {boolean} false to disable sound, true to re-enable it.
*/
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
*
* @param {boolean} false to disable sound, true to re-enable it.
*/
@Cordova({ sync: true })
enableSound(enable: boolean): void { }
/**
*
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
*
* @param {DisplayType} displayOption
* @returns {any}
*/
*
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
*
* @param {DisplayType} displayOption
* @returns {any}
*/
@Cordova({ sync: true })
inFocusDisplaying(displayOption: OSDisplayType): any { return; }
/**
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
* You can pass true later to opt users back into notifications.
*
* @param {boolean} enable
*/
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
* You can pass true later to opt users back into notifications.
*
* @param {boolean} enable
*/
@Cordova({ sync: true })
setSubscription(enable: boolean): void { }
/**
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
*
* @returns {Promise<OSPermissionSubscriptionState>}
*/
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
*
* @returns {Promise<OSPermissionSubscriptionState>}
*/
@Cordova()
getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> { return; }
/**
*
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
*/
*
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
*/
@Cordova()
postNotification(notificationObj: OSNotification): Promise<any> { return; }
/**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
*/
* Cancels a single OneSignal notification based on its Android notification integer id. Use instead of NotificationManager.cancel(id); otherwise the notification will be restored when your app is restarted.
* @param notificationId {string}
*/
@Cordova({ sync: true })
cancelNotification(notificationId: string): void {}
/**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
*/
@Cordova({ sync: true })
promptLocation(): void { }
@@ -602,17 +621,44 @@ export class OneSignal extends IonicNativePlugin {
syncHashedEmail(email: string): void { }
/**
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
@Cordova({ sync: true })
setLogLevel(logLevel: {
logLevel: number,
visualLevel: number
}): void { }
/**
* The passed in function will be fired when a notification permission setting changes.
* This includes the following events:
* - Notification permission prompt shown
* - The user accepting or declining the permission prompt
* - Enabling/disabling notifications for your app in the device Settings after returning to your app.
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
addPermissionObserver(): Observable<any> { return; }
/**
* The passed in function will be fired when a notification subscription property changes.
* This includes the following events:
* - Getting a push token from Apple / Google.
* - Getting a player / user id from OneSignal
* - OneSignal.setSubscription is called
* - User disables or enables notifications
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
addSubscriptionObserver(): Observable<any> { return; }
}

View File

@@ -0,0 +1,111 @@
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name Open Native Settings
* @description
* Plugin to open native screens of iOS/android settings
* @usage
* You can open any of these settings:
* ```
* "about", // ios
"accessibility", // ios, android
"account", // ios, android
"airplane_mode", // ios, android
"apn", // android
"application_details", // ios, android
"application_development", // android
"application", // android
"autolock", // ios
"battery_optimization", // android
"bluetooth", // ios, android
"castle", // ios
"captioning", // android
"cast", // android
"cellular_usage", // ios
"configuration_list", // ios
"data_roaming", // android
"date", // ios, android
"display", // ios, android
"dream", // android
"facetime", // ios
"home", // android
"keyboard", // ios, android
"keyboard_subtype", // android
"locale", // ios, android
"location", // ios, android
"locations", // ios
"manage_all_applications", // android
"manage_applications", // android
"memory_card", // android
"music", // ios
"music_equalizer", // ios
"music_volume", // ios
"network", // ios, android
"nike_ipod", // ios
"nfcsharing", // android
"nfc_payment", // android
"nfc_settings", // android
"notes", // ios
"notification_id", // ios
"passbook", // ios
"phone", // ios
"photos", // ios
"print", // android
"privacy", // android
"quick_launch", // android
"reset", // ios
"ringtone", // ios
"browser", // ios
"search", // ios, android
"security", // android
"settings", // ios, android
"show_regulatory_info",
"sound", // ios, android
"software_update", // ios
"storage", // ios, android
"store", // ios, android
"sync", // android
"tethering", // ios
"twitter", // ios
"touch", // ios
"usage", // ios, android
"user_dictionary", // android
"video", // ios
"voice_input", // android
"vpn", // ios
"wallpaper", // ios
"wifi_ip", // android
"wifi", // ios, android
"wireless" // android
```
* ```typescript
* import { OpenNativeSettings } from '@ionic-native/open-native-settings';
*
*
* constructor(private openNativeSettings: OpenNativeSettings) { }
*
* ...
*
*
* ```
*/
@Plugin({
pluginName: 'OpenNativeSettings',
plugin: 'cordova-open-native-settings',
pluginRef: 'cordova.plugins.settings',
repo: 'https://github.com/guyromb/Cordova-open-native-settings',
platforms: ['Android', 'iOS']
})
@Injectable()
export class OpenNativeSettings extends IonicNativePlugin {
/**
* Opens a setting dialog
* @param setting {string} setting name
* @return {Promise<any>}
*/
@Cordova()
open(setting: string): Promise<any> { return; }
}

View File

@@ -204,6 +204,12 @@ export class PayPalPayment {
*/
items: Array<PayPalItem>;
/**
* Optional payee email, if your app is paying a third-party merchant.
* The payee's email. It must be a valid PayPal email address.
*/
payeeEmail: string;
/**
* Optional customer shipping address, if your app wishes to provide this to the SDK.
*/

View File

@@ -87,7 +87,7 @@ export interface LocalNotificationOptions {
*/
@Plugin({
pluginName: 'Phonegap Local Notifications',
plugin: 'phonegap-local-notifications',
plugin: 'phonegap-plugin-local-notification',
pluginRef: 'Notification',
repo: 'https://github.com/phonegap/phonegap-plugin-local-notification',
platforms: ['Android', 'Browser', 'iOS', 'Windows']

View File

@@ -31,8 +31,8 @@ import { Injectable } from '@angular/core';
* console.log(libraryItem.albumIds); // array of ids of appropriate AlbumItem, only of includeAlbumsData was used
* });
* },
* error: err => {},
* complete: () => { console.log('could not get photos'); }
* error: err => { console.log('could not get photos'); },
* complete: () => { console.log('done getting photos'); }
* });
* })
* .catch(err => console.log('permissions weren\'t granted'));

View File

@@ -1,5 +1,13 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface PhotoViewerOptions {
/**
* Set to false to disable the share button (Android only). Default: true
*/
share?: boolean;
}
/**
* @name Photo Viewer
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
@@ -29,8 +37,8 @@ export class PhotoViewer extends IonicNativePlugin {
* Shows an image in full screen
* @param url {string} URL or path to image
* @param title {string}
* @param options {any}
* @param options {PhotoViewerOptions}
*/
@Cordova({sync: true})
show(url: string, title?: string, options?: {share?: boolean}): void { }
show(url: string, title?: string, options?: PhotoViewerOptions): void { }
}

View File

@@ -76,7 +76,7 @@ export interface PrintOptions {
export class Printer extends IonicNativePlugin {
/**
* Checks whether to device is capable of printing.
* Checks whether the device is capable of printing (uses `check()` internally)
* @returns {Promise<boolean>}
*/
isAvailable(): Promise<boolean> {

View File

@@ -0,0 +1,173 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* Information about the currently running app
*/
export interface AppInfo {
platform: string;
platformVersion: string;
version: string;
bundleName: string;
bundleVersion: string;
}
/**
* Information about the current live update
*/
export interface DeployInfo {
deploy_uuid: string;
channel: string;
binary_version: string;
}
/**
* Object for manually configuring deploy
*/
export interface DeployConfig {
appId?: string;
host?: string;
channel?: string;
}
/**
* @hidden
*/
export class ProDeploy {
constructor(private _objectInstance: any) { }
/**
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
* @param config A valid Deploy config object
*/
@CordovaInstance()
init(config: DeployConfig): Promise<any> { return; }
/**
* Check a channel for an available update
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
*/
@CordovaInstance({
observable: true
})
check(): Promise<string> { return; }
/**
* Download an available version
* @return {Observable<any>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance({
observable: true
})
download(): Observable<any> { return; }
/**
* Unzip the latest downloaded version
* @return {Observable<any>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance()
extract(): Observable<any> { return; }
/**
* Reload app with the deployed version
*/
@CordovaInstance()
redirect(): Promise<any> { return; }
/**
* Get info about the version running on the device
* @return {Promise<DeployInfo>} Information about the current version running on the app.
*/
@CordovaInstance()
info(): Promise<DeployInfo> { return; }
/**
* List versions stored on the device
*/
@CordovaInstance()
getVersions(): Promise<any> { return; }
/**
* Delete a version stored on the device by UUID
* @param version A version UUID
*/
@CordovaInstance()
deleteVersion(version: string): Promise<any> { return; }
}
/**
* @name Pro
* @description
* This plugin enables Ionic Pro services like live updates and error monitoring
*
* @usage
* ```typescript
* import { Pro, AppInfo, DeployInfo } from '@ionic-native/pro';
*
*
* constructor(private pro: Pro) { }
*
* // Get app info
* this.pro.getAppInfo().then((res: AppInfo) => {
* console.log(res)
* })
*
* // Get live update info
* this.pro.deploy.info().then((res: DeployInfo) => {
* console.log(res)
* })
* ```
*/
@Plugin({
pluginName: 'Pro',
plugin: 'cordova-plugin-ionic',
pluginRef: 'IonicCordova',
repo: 'https://github.com/ionic-team/cordova-plugin-ionic',
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
})
@Injectable()
export class Pro extends IonicNativePlugin {
/**
* Ionic Pro Deploy .js API.
*/
deploy: ProDeploy = new ProDeploy(Pro.getPlugin().deploy);
/**
* Not yet implemented
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
enableCrashLogging(): Promise<any> { return; }
/**
* Not yet implemented
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
checkForPendingCrash(): Promise<any> { return; }
/**
* Not yet implemented
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
loadPendingCrash(): Promise<any> { return; }
/**
* Not yet implemented
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
forceCrash(): Promise<any> { return; }
/**
* Get information about the currently running app
* @return {Promise<any>} Returns a promise that resolves with current app info
*/
@Cordova()
getAppInfo(): Promise<AppInfo> { return; }
}

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var window: any;
declare const window: any;
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
@@ -62,16 +62,10 @@ export interface NotificationEventAdditionalData {
}
export interface IOSPushOptions {
/**
* Maps to the project number in the Google Developer Console. Setting this
* uses GCM for notifications instead of native.
*/
senderID?: string;
/**
* Whether to use prod or sandbox GCM setting.
*/
gcmSandbox?: boolean | string;
fcmSandbox?: boolean | string;
/**
* If true the device shows an alert on receipt of notification.
@@ -137,11 +131,6 @@ export interface CategoryActionData {
}
export interface AndroidPushOptions {
/**
* Maps to the project number in the Google Developer Console.
*/
senderID: string;
/**
* The name of a drawable resource to use as the small-icon. The name should
* not include the extension.
@@ -186,12 +175,37 @@ export interface AndroidPushOptions {
* subscribe to a GcmPubSub topic.
*/
topics?: string[];
/**
* The key to search for text of notification.
*/
messageKey?: string;
/**
* The key to search for title of notification.
*/
titleKey?: string;
}
export interface BrowserPushOptions {
/**
* Optional. Your GCM API key if you are using VAPID keys.
*/
applicationServerKey?: string;
/**
* URL for the push server you want to use.
* Default: http://push.api.phonegap.com/v1/push Optional.
*/
pushServiceURL?: string;
}
export interface PushOptions {
ios?: IOSPushOptions;
android?: AndroidPushOptions;
windows?: any;
browser?: BrowserPushOptions;
}
export type PushEvent = 'registration' | 'error' | 'notification';
@@ -229,15 +243,16 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* // to initialize push notifications
*
* const options: PushOptions = {
* android: {
* senderID: '12345679'
* },
* android: {},
* ios: {
* alert: 'true',
* badge: true,
* sound: 'false'
* },
* windows: {}
* windows: {},
* browser: {
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
* }
* };
*
* const pushObject: PushObject = this.push.init(options);
@@ -257,6 +272,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* NotificationEventAdditionalData
* IOSPushOptions
* AndroidPushOptions
* BrowserPushOptions
* PushOptions
*/
@Plugin({
@@ -264,8 +280,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
plugin: 'phonegap-plugin-push',
pluginRef: 'PushNotification',
repo: 'https://github.com/phonegap/phonegap-plugin-push',
install: 'ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX',
installVariables: ['SENDER_ID'],
install: 'ionic cordova plugin add phonegap-plugin-push',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()

View File

@@ -0,0 +1,235 @@
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
export interface QRScannerStatus {
/**
* On iOS and Android 6.0+, camera access is granted at runtime by the user (by clicking "Allow" at the dialog).
* The authorized property is a boolean value which is true only when the user has allowed camera access to your app (AVAuthorizationStatus.Authorized).
* On platforms with permissions granted at install (Android pre-6.0, Windows Phone) this property is always true.
*/
authorized: boolean;
/**
* A boolean value which is true if the user permanently denied camera access to the app (AVAuthorizationStatus.Denied).
* Once denied, camera access can only be gained by requesting the user change their decision (consider offering a link to the setting via openSettings()).
*/
denied: boolean;
/**
* A boolean value which is true if the user is unable to grant permissions due to parental controls, organization security configuration profiles, or similar reasons.
*/
restricted: boolean;
/**
* A boolean value which is true if QRScanner is prepared to capture video and render it to the view.
*/
prepared: boolean;
/**
* A boolean value which is true when the preview layer is visible (and on all platforms but browser, the native webview background is transparent).
*/
showing: boolean;
/**
* A boolean value which is true if QRScanner is actively scanning for a QR code.
*/
scanning: boolean;
/**
* A boolean value which is true if QRScanner is displaying a live preview from the device's camera. Set to false when the preview is paused.
*/
previewing: boolean;
/**
* A boolean value which is true if the light is enabled.
*/
lightEnabled: boolean;
/**
* A boolean value which is true only if the users' operating system is able to QRScanner.openSettings().
*/
canOpenSettings: boolean;
/**
* A boolean value which is true only if the users' device can enable a light in the direction of the currentCamera.
*/
canEnableLight: boolean;
/**
* A boolean value which is true only if the current device "should" have a front camera.
* The camera may still not be capturable, which would emit error code 3, 4, or 5 when the switch is attempted.
* (On the browser platform, this value is false until the prepare method is called.)
*/
canChangeCamera: boolean;
/**
* A number representing the index of the currentCamera. 0 is the back camera, 1 is the front.
*/
currentCamera: number;
}
/**
* @name QR Scanner
* @description
*
* @usage
* ```typescript
* import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner';
*
*
* constructor(private qrScanner: QRScanner) { }
*
* ...
*
* // Optionally request the permission early
* this.qrScanner.prepare()
* .then((status: QRScannerStatus) => {
* if (status.authorized) {
* // camera permission was granted
*
*
* // start scanning
* let scanSub = this.qrScanner.scan().subscribe((text: string) => {
* console.log('Scanned something', text);
*
* this.qrScanner.hide(); // hide camera preview
* scanSub.unsubscribe(); // stop scanning
* });
*
* // show camera preview
* this.qrScanner.show();
*
* // wait for user to scan something, then the observable callback will be called
*
* } else if (status.denied) {
* // camera permission was permanently denied
* // you must use QRScanner.openSettings() method to guide the user to the settings page
* // then they can grant the permission from there
* } else {
* // permission was denied, but not permanently. You can ask for permission again at a later time.
* }
* })
* .catch((e: any) => console.log('Error is', e));
*
*
* ```
* @interfaces
* QRScannerStatus
*/
@Plugin({
pluginName: 'QRScanner',
plugin: 'cordova-plugin-qrscanner',
pluginRef: 'QRScanner',
repo: 'https://github.com/bitpay/cordova-plugin-qrscanner',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class QRScanner extends IonicNativePlugin {
/**
* Request permission to use QR scanner.
* @return {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
prepare(): Promise<QRScannerStatus> { return; }
/**
* Call this method to enable scanning. You must then call the `show` method to make the camera preview visible.
* @return {Observable<string>} returns an Observable that emits the scanned text. Unsubscribe from the observable to stop scanning.
*/
@Cordova({
callbackStyle: 'node',
observable: true,
clearFunction: 'cancelScan'
})
scan(): Observable<string> { return; }
/**
* Configures the native webview to have a transparent background, then sets the background of the <body> and <html> DOM elements to transparent, allowing the webview to re-render with the transparent background.
* @returns {Promise<QRScannerStatus>}
*/
@Cordova()
show(): Promise<QRScannerStatus> { return; }
/**
* Configures the native webview to be opaque with a white background, covering the video preview.
* @returns {Promise<QRScannerStatus>}
*/
@Cordova()
hide(): Promise<QRScannerStatus> { return; }
/**
* Enable the device's light (for scanning in low-light environments).
* @returns {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
enableLight(): Promise<QRScannerStatus> { return; }
/**
* Destroy the scanner instance.
* @returns {Promise<QRScannerStatus>}
*/
@Cordova()
destroy(): Promise<QRScannerStatus> { return; }
/**
* Disable the device's light.
* @return {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
disableLight(): Promise<QRScannerStatus> { return; }
/**
* Use front camera
* @return {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
useFrontCamera(): Promise<QRScannerStatus> { return; }
/**
* Use back camera
* @return {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
useBackCamera(): Promise<QRScannerStatus> { return; }
/**
* Set camera to be used.
* @param camera {number} Provide `0` for back camera, and `1` for front camera.
* @return {Promise<QRScannerStatus>}
*/
@Cordova({
callbackStyle: 'node'
})
useCamera(camera: number): Promise<QRScannerStatus> { return; }
/**
* Pauses the video preview on the current frame and pauses scanning.
* @return {Promise<QRScannerStatus>}
*/
@Cordova()
pausePreview(): Promise<QRScannerStatus> { return; }
/**
* Resumse the video preview and resumes scanning.
* @return {Promise<QRScannerStatus>}
*/
@Cordova()
resumePreview(): Promise<QRScannerStatus> { return; }
/**
* Returns permission status
* @return {Promise<QRScannerStatus>}
*/
@Cordova()
getStatus(): Promise<QRScannerStatus> { return; }
/**
* Opens settings to edit app permissions.
*/
@Cordova({
sync: true
})
openSettings(): void {}
}

View File

@@ -0,0 +1,46 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @paid
* @beta
* @name Regula Document Reader
* @description
* Plugin for reading and validation of identification documents.
*
* @usage
* ```typescript
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
*
* let license; // read regula.license file
* RegulaDocumentReader.initReader(license); // initialize reader
* RegulaDocumentReader.scanDocument().then((result) => {
* // read result
* })
* ```
*/
@Plugin({
pluginName: 'Regula Document Reader',
plugin: 'cordova-plugin-documentreader',
pluginRef: 'DocumentReader',
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
platforms: ['iOS', 'Android'],
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
})
@Injectable()
export class RegulaDocumentReader extends IonicNativePlugin {
/**
* Initialize the scanner
* @param license {any} License data
*/
@Cordova()
initReader(license: any): void {}
/**
* Run the scanner
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
*/
@Cordova()
scanDocument(): Promise<string[]> { return; }
}

View File

@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface SafariViewControllerOptions {
animated?: boolean;
@@ -37,7 +38,7 @@ export interface SafariViewControllerOptions {
* enterReaderModeIfAvailable: true,
* tintColor: '#ff0000'
* })
* .then((result: any) => {
* .subscribe((result: any) => {
* if(result.event === 'opened') console.log('Opened');
* else if(result.event === 'loaded') console.log('Loaded');
* else if(result.event === 'closed') console.log('Closed');
@@ -74,13 +75,14 @@ export class SafariViewController extends IonicNativePlugin {
/**
* Shows Safari View Controller
* @param options {SafariViewControllerOptions} optional
* @returns {Promise<any>}
* @returns {Observable<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
errorIndex: 2,
observable: true
})
show(options?: SafariViewControllerOptions): Promise<any> { return; }
show(options?: SafariViewControllerOptions): Observable<any> { return; }
/**
* Hides Safari View Controller

View File

@@ -12,6 +12,12 @@ export interface SerialPermissionOptions {
export interface SerialOpenOptions {
baudRate: number;
dataBits: number;
stopBits: number;
parity: number;
dtr: boolean;
rts: boolean;
sleepOnPause: boolean;
}
/**
@@ -29,7 +35,13 @@ export interface SerialOpenOptions {
*
* this.serial.requestPermission().then(() => {
* this.serial.open({
* baudRate: 9800
* baudRate: 9800,
* dataBits: 4,
* stopBits: 1,
* parity: 0,
* dtr: true,
* rts: true,
* sleepOnPause: false
* }).then(() => {
* console.log('Serial connection opened');
* });

View File

@@ -49,7 +49,10 @@ export class SocialSharing extends IonicNativePlugin {
* @param url {string} A URL to share
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 4,
errorIndex: 5
})
share(message?: string, subject?: string, file?: string | string[], url?: string): Promise<any> { return; }
/**

View File

@@ -29,7 +29,7 @@ export interface SpinnerDialogIOSOptions {
@Plugin({
pluginName: 'SpinnerDialog',
plugin: 'cordova-plugin-native-spinner',
pluginRef: 'window.plugins.spinnerDialog',
pluginRef: 'SpinnerDialog',
repo: 'https://github.com/greybax/cordova-plugin-native-spinner',
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows']
})

View File

@@ -20,6 +20,10 @@ export interface SQLiteDatabaseConfig {
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
*/
createFromLocation?: number;
/**
* support encrypted databases with https://github.com/litehelpers/Cordova-sqlcipher-adapter
*/
key?: string;
}
/**
@@ -95,11 +99,11 @@ export class SQLiteObject {
executeSql(statement: string, params: any): Promise<any> { return; }
/**
* @param sqlStatements {Array<string | string[]>}
* @param sqlStatements {Array<string | string[] | any>}
* @returns {Promise<any>}
*/
@CordovaInstance()
sqlBatch(sqlStatements: Array<string | string[]>): Promise<any> { return; }
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any> { return; }
@CordovaInstance({
sync: true

View File

@@ -79,6 +79,31 @@ export interface StripeBankAccountParams {
account_holder_type?: string;
}
export interface StripeCardTokenRes {
/**
* Card Object.
*/
card: {
brand: string,
exp_month: number,
exp_year: number,
funding: string,
last4: string
};
/**
* Token Request Date Time.
*/
created: string;
/**
* Card Token.
*/
id: string;
/**
* Source Type (card or account).
*/
type: string;
}
/**
* @name Stripe
* @description
@@ -102,7 +127,7 @@ export interface StripeBankAccountParams {
* };
*
* this.stripe.createCardToken(card)
* .then(token => console.log(token))
* .then(token => console.log(token.id))
* .catch(error => console.error(error));
*
* ```
@@ -131,10 +156,10 @@ export class Stripe extends IonicNativePlugin {
/**
* Create Credit Card Token
* @param params {StripeCardTokenParams} Credit card information
* @return {Promise<string>} returns a promise that resolves with the token, or rejects with an error
* @return {Promise<StripeCardTokenRes>} returns a promise that resolves with the token object, or rejects with an error
*/
@Cordova()
createCardToken(params: StripeCardTokenParams): Promise<string> { return; }
createCardToken(params: StripeCardTokenParams): Promise<StripeCardTokenRes> { return; }
/**
* Create a bank account token

View File

@@ -55,9 +55,9 @@ export interface TwitterConnectResponse {
pluginName: 'TwitterConnect',
plugin: 'twitter-connect-plugin',
pluginRef: 'TwitterConnect',
repo: 'https://github.com/ManifestWebDesign/twitter-connect-plugin',
install: 'ionic cordova plugin add twitter-connect-plugin --variable FABRIC_KEY=fabric_API_key',
installVariables: ['FABRIC_KEY'],
repo: 'https://github.com/chroa/twitter-connect-plugin',
install: 'ionic cordova plugin add https://github.com/chroa/twitter-connect-plugin --variable FABRIC_KEY=<Fabric API Key> --variable TWITTER_KEY=<Twitter Consumer Key> --variable TWITTER_SECRET=<Twitter Consumer Secret>',
installVariables: ['FABRIC_KEY', 'TWITTER_KEY', 'TWITTER_SECRET'],
platforms: ['Android', 'iOS']
})
@Injectable()

View File

@@ -0,0 +1,69 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Uid
* @description
* Get unique identifiers: UUID, IMEI, IMSI, ICCID and MAC.
*
* @usage
* ```typescript
* import { Uid } from '@ionic-native/uid';
* import { AndroidPermissions } from '@ionic-native/android-permissions';
*
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
*
*
* async getImei() {
* const { hasPermission } = await this.androidPermissions.checkPermission(
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
* );
*
* if (!hasPermission) {
* const result = await this.androidPermissions.requestPermission(
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
* );
*
* if (!result.hasPermission) {
* throw new Error('Permissions required');
* }
*
* // ok, a user gave us permission, we can get him identifiers after restart app
* return;
* }
*
* return this.uid.IMEI
* }
* ```
*/
@Plugin({
pluginName: 'Uid',
plugin: 'https://github.com/hygieiasoft/cordova-plugin-uid',
pluginRef: 'cordova.plugins.uid',
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
platforms: ['Android']
})
@Injectable()
export class Uid extends IonicNativePlugin {
/** Get the device Universally Unique Identifier (UUID). */
@CordovaProperty
UUID: string;
/** Get the device International Mobile Station Equipment Identity (IMEI). */
@CordovaProperty
IMEI: string;
/** Get the device International mobile Subscriber Identity (IMSI). */
@CordovaProperty
IMSI: string;
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
@CordovaProperty
ICCID: string;
/** Get the Media Access Control address (MAC). */
@CordovaProperty
MAC: string;
}

View File

@@ -11,7 +11,7 @@ export interface VideoOptions {
*/
volume?: number;
/**
* There are to options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
* There are two options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
* These strings are the only ones which can be passed as option.
*/
scalingMode?: number;

View File

@@ -5,6 +5,11 @@ export interface WheelSelectorItem {
description?: string;
}
export interface DefaultItem {
index: number;
value: string;
}
export interface WheelSelectorOptions {
/**
* The title of the selector's input box
@@ -17,9 +22,9 @@ export interface WheelSelectorOptions {
items: Array<Array<WheelSelectorItem>>;
/**
* Which items to display by default, example ["2","Apple"] (if items.length is 2 for instance)
* Which items to display by default.
*/
defaultItems?: Array<WheelSelectorItem>;
defaultItems?: Array<DefaultItem>;
/**
* The 'ok' button text
@@ -127,9 +132,9 @@ export interface WheelSelectorData {
* positiveButtonText: "Ok",
* negativeButtonText: "Nope",
* defaultItems: [
* this.jsonData.numbers[2], // '3'
* this.jsonData.fruits[3] // 'Banana'
* ]
* {index:0, value: this.jsonData.numbers[2].description},
* {index: 1, value: this.jsonData.fruits[3].description}
* ]
* }).then(
* result => {
* console.log(result[0].description + ' ' + result[1].description);
@@ -150,8 +155,8 @@ export interface WheelSelectorData {
* ],
* displayKey: 'name',
* defaultItems: [
* this.jsonData.firstNames[2],
* this.jsonData.lastNames[3]
* {index:0, value: this.jsonData.firstNames[2].name},
* {index: 0, value: this.jsonData.lastNames[3].name}
* ]
* }).then(
* result => {

View File

@@ -14,7 +14,7 @@ export interface ZeroconfService {
}
export interface ZeroconfResult {
action: 'registered' | 'added' | 'removed';
action: 'registered' | 'added' | 'removed' | 'resolved';
service: ZeroconfService;
}