- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
The transaction callback function argument is currently typed as `any`, however this isn't very helpful so I have added a base interface which contains only the `executeSql` function. This function is all that is available on the object returned by WebSQL, but is also available on the full SQLite implementation.
* fix(app-version): fix getVersionCode to return number
as is in the actual implementation. Also update and clarify the method docs
* fix(app-version): fix getVersionCode for compatibility
with Android and iOS at the same time
As documented in the image picker plugin, it also supports a data url, just like the camera does. However, this option is not documented in Ionic Native currently. I've added this documentation, and have also added an enum with a naming pattern that matches the DestinationType in Camera.
Docs from the image picker plugin:
```
...
// output type, defaults to FILE_URIs.
// available options are
// window.imagePicker.OutputType.FILE_URI (0) or
// window.imagePicker.OutputType.BASE64_STRING (1)
outputType: int
};
```
Made all properties in OSNotification optional because when you create a push notification the type is OSNotification but it does not have all the same properties required as the OSNotification as a response from a received notification. For example, you don't pass in isAppInFocus when you create a notification but it was causing issues when trying to post a notification because it was showing as required because OSNotification as a response will always have isAppInFocus.
* Correcting format of registerBroadcastReceiver, current implementation provides no way to receive the registered broadcasts.
Usage is as follows:
webintent.registerBroadcastReceiver({
filterActions: [
'com.example.ACTION'
],
filterCategories: [
'android.intent.category.DEFAULT'
]
}).subscribe((intent) => {console.log('Received Intent: ' + JSON.stringify(intent.extras));});
* Resolving linting errors
* Resolving additional linting error
In order to enable background mode data collection we used the cordova-plugin-background-mode plugin in a new Cordova plugin repo, cordova-plugin-jins-meme (vs. cordova-plugin-jins-meme-es.) We opted to maintain the old repository for backwards-compatibility as we have multiple apps using various versions; this is simplest.
Another unrelated change was made to silence unnecessary console logging.
* 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.
* Bug fix: HtmlInfoWindow missing .on and .one methods
https://github.com/ionic-team/ionic-native/issues/2034
* Bug fix: HtmlInfoWindow constructor cause the error
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1661
* Fix: Error when removing map
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1823
* Add: the cssOptions argument for HtmlInfoWindow.setContent() method
* Bug fix: Polyline.getPoints(), Polygon.getPoints() and Polygon.getHoles()
Those methods need to create new instance of BaseArrayClass of wrapper plugin.
* Add: forEachAsync(), mapAsync(), and filterAsync() methods into BaseArray class
* update: use document.querySelector() instead of document.getElementById() if the passed element is string
update: map.setDiv()
Bug fix: can not create empty GoogleMap (pure JS version is available way)
* Fix: wait until the page is fully ready
* Fix: missing `clickable` option for PolygonOptions and PolylineOptions
* Add: accept own properties for `addMarker()` and others #2087
Fix: some properties are required, but specified as optional.
Add: descriptions for properties
* Bug fix: Static classes are defined as non static class
https://stackoverflow.com/questions/47083289/ionic-native-google-maps-plugin-set-app-background-color/47165721#47165721
* Add: poly class (plugin.google.maps.geometory.poly namespace)
* Bug fix: Ionic native googlemaps decodePath() returns undefined
https://forum.ionicframework.com/t/ionic-native-googlemaps-decodepath-returns-undefined/118624/
* PR #2254https://github.com/ionic-team/ionic-native/pull/2254
* PR #2199https://github.com/ionic-team/ionic-native/pull/2199
* Change defined event names for the cordova-plugin-googlemaps v2.0
* Change defined event names for the cordova-plugin-googlemaps v2.2.0
* Add Geolocation class
* Implement the `setMyLocationButtonEnabled()` method
* add: baseArrayClass.mapSeries() method
update: change internal methods
* update: implementation of the LocationService
* Implement the map.addKmlOverlay() method
* Update for the cordova-plugin-googlemaps v2.2.x
The current example in the docs is incomplete and thus quite useless. Just on its own won't manipulate the CSS of a loaded page. It requires the InAppBrowserEvent, and using it in the callback.
As stated in the plugin repo, the options field is optional. Also, the plugin returns a `iana_timezone` property such as 'America/New_York' which was not included.
In line 20, "this.navigationBar.hide(autoHide);". But there is no such a function .hide(). It shoud be correct as "this.navigationBar.setUp(autoHide);".
* Added missing methods beginSession and invalidateSession for iOS support
* Removed invalidateSession function and package-lock.json
* added current package-lock again
trueflywood's fork is currently used for this plugin. I'm changing it back to the original which contains the current changes and also includes type definitions and methods for the new version as well as documentation updates
Add hasScrubbing variable to options - used to enable or disable scrubbing from the iOS control center or lockscreen progress bar
Make optional items actually optional...
* feat(nfc): Add interfaces and missing references to UriHelper and TextHelper
This commit adds the missing references to UriHelper and TextHeler.
There were missing references to some methods of nfc and ndef modules.
The constants for ndef has ben added.
* feat(nfc): add NfcUtil class.
The most important change here is to point to the BlyncSync version of the plugin, which is actively maintained. The jins-meme version lacks a package.json, which causes issues on some platforms that will result in an inability to build.
The BlyncSync plugin uses standard naming convention for cordova plugins (cordova-plugin-jins-meme-es)
The plugin name should be JINS MEME ES (ES for Eye-Sensing,) as this is how the product is actually named: not "Jins Meme."
* 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.
* Bug fix: HtmlInfoWindow missing .on and .one methods
https://github.com/ionic-team/ionic-native/issues/2034
* Bug fix: HtmlInfoWindow constructor cause the error
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1661
* Fix: Error when removing map
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1823
* Add: the cssOptions argument for HtmlInfoWindow.setContent() method
* Bug fix: Polyline.getPoints(), Polygon.getPoints() and Polygon.getHoles()
Those methods need to create new instance of BaseArrayClass of wrapper plugin.
* Add: forEachAsync(), mapAsync(), and filterAsync() methods into BaseArray class
* update: use document.querySelector() instead of document.getElementById() if the passed element is string
update: map.setDiv()
Bug fix: can not create empty GoogleMap (pure JS version is available way)
* Fix: wait until the page is fully ready
* Fix: missing `clickable` option for PolygonOptions and PolylineOptions
* Add: accept own properties for `addMarker()` and others #2087
Fix: some properties are required, but specified as optional.
Add: descriptions for properties
* Bug fix: Static classes are defined as non static class
https://stackoverflow.com/questions/47083289/ionic-native-google-maps-plugin-set-app-background-color/47165721#47165721
* Add: poly class (plugin.google.maps.geometory.poly namespace)
* 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.
* Bug fix: HtmlInfoWindow missing .on and .one methods
https://github.com/ionic-team/ionic-native/issues/2034
* Bug fix: HtmlInfoWindow constructor cause the error
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1661
* Fix: Error when removing map
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1823
* Add: the cssOptions argument for HtmlInfoWindow.setContent() method
* Bug fix: Polyline.getPoints(), Polygon.getPoints() and Polygon.getHoles()
Those methods need to create new instance of BaseArrayClass of wrapper plugin.
* Add: forEachAsync(), mapAsync(), and filterAsync() methods into BaseArray class
* update: use document.querySelector() instead of document.getElementById() if the passed element is string
update: map.setDiv()
Bug fix: can not create empty GoogleMap (pure JS version is available way)
* Fix: wait until the page is fully ready
* Fix: missing `clickable` option for PolygonOptions and PolylineOptions
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 :)
* 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.
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
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.
* 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
* 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
* 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
* 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
* 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
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.
* 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
* 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.
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
* change source and document interface
* document addAlias example
* feat(email-composer): add requestPermission and hasPermission methods
* refactor(): use getPlugin() instead of referencing cordova
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`.
* 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
* Improved the docs for firebase dynamic links
The config.xml example needed to switch the ios and android tag.
Added an example how to use onDynamicLink()
* (doc) Reverted change and expanded example
* (doc) Even more comments for clarity
As seen in the Cordova plugin (https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth) the isAvailable method returns an object that contains 3 parameters, {isAvailable:, isHardwareDetected, hasEnrolledFingerprints}.
If you do a console log on
this.androidFingerprintAuth.isAvailable()
.then(res => console.log(res)) //Outputs the Object {isAvailable: true, isHardwareDetected: true, hasEnrolledFingerprints: true}
.catch(err => console.error(err));
So we are getting the data, just need to make the interface expose it.
CircleCI can only save files one to a specific cache key. I set the cache key to depend on the checksum of package.json, so it updates the cache every time we update Ionic Native. In the long run, CircleCI will have to download the ionic-site changes less often.
Document the fact that confirm() will return a promise that resolves to 0 if the user clicks outside the dialog box. This behavior was previously undocummented and could lead to issues if not handled properly.
* chore(package): bump dependencies
I updated the dependencies to the latest bugfix and feature releases without any breaking changes.
* Update package.json
* Update package.json
Using the example in the previous version of this document, calling prepareInterstitial(adId) resulted in an
"-[__NSCFString count]: unrecognized selector sent to instance"
exception. This was alleviated by changing the call to prepareInterstitial({adId: adId})
(e.g. passing in an options object vs. just the adid string)
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* added phonegap-local-notifications
* update #1
* update #3
* update #4
* cleaned up the usage part
* removed old folder
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Initial commit
* updated interface
* updated interface
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Added AppMinimize plugin
* promisse
* usage
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Initial commit
- added Plugin infos
- added methods
* Added Interface
* Implemented all methods
* fixed retun types
TODO: Improve Interface Docs
* Interface discription
Still needs some improvements
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* initial commit
Added wrapper
* Added usage guide
* Added parms
* refactor(diagnostic plugin): update camera API function signatures to support cordova.plugins.diagnostic@3.6.0. See 515317e89a
* fix(diagnostic plugin): fix whitespace linting errors in previous commit
* * fix(diagnostic plugin): add callback indices to Cordova decorator in camera API so externalStorage parameter can be optionally omitted.
See https://github.com/driftyco/ionic-native/pull/1458#issuecomment-299030833
* fix(diagnostic plugin): fix incorrect return type on getCameraRollAuthorizationStatus()
I struggled to figure out what options I had for target until I read them from the github repo.
I'm assuming that the documentation is generated from the comments and I think addition clarifies the intent of `target` a bit.
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
The function never returns an object of MediaObject. The onSuccess callback is wrongly used to return the object. In fact, onSuccess/onError callbacks are only invoked after the current play, record, or stop action is called.
ShareViaEmail parameter for providing email "must be null or an array" because it's type is "string:[]" and the provided syntax is wrong, so i have updated that syntax.
I made changes to cordova-plugin-health to accept the following array as datatypes. Earlier it was just an array of strings. Now it also contains an object with `read` and `write` array.
```
[
'calories', 'distance', //read and write permissions
{
read : ['steps'], //read only permission
write : ['height', 'weight'] //write only permission
}
]
```
Don't know how to specify this array in typescript so just replaced by 'any'
The sample code does not work...this change returns the observable first with subscribe() before actually calling the Observable's subscribe method.
In fact, the way it's written in the example, the code would not build because of typescript errors.
remove the dash "import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';" to import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob' because typescript will not import the specified clases
* Initial plugin pass
* Remove unneeded imports, or else plugins will not build.
* Add try-catch blocks.
Applications will not bomb if the plugin is not installed or user is running in browser.
* handle missing intel variable.
* Add documentation
* Conform to Cordova decorators.
* Add IntelSecurityDataOptions
* Update plugin to use plain `return` method statements.
* Better conform to Ionic Native
* feat(push): plugin is now instance based
no more callbacks
closes#250
* fix(push): fix typo in PushEvents enum
* fix constructor
* feat(push): add subscribe/unsubscribe
fixes#861
* First try
* Moving to modules
* Removed
* Moving things aroudn
* tsconfig for plugins
* Plugin tsconfigs
* Core kind of buidls
* Core
* Plugin tsconfig
* Test
* Remove core
* Build
* Individual packages
* Build and push
* Some stuff
* Bump
* Update core-package.json.template
* Update plugin-package.json.template
* 3.0.0
* Working on injectable
* Updates
* Checkpoint
* More stuff
* Remove duplicate injectables
* Remove lots of static stuff with a fancy regex
* Fix build errors
* chore(): nodejs build script
* chore(): move fs-extra-promise to devDeps
* feat(): make instance based plugins injectable
* Cleanup
* chore(build): convert dependencies to peer dependencies
* chore(build): add auto install scripts (#1059)
* feat(core): auto install scripts
* minor fixes
* minor fixes
* remove prompt message
* fix(plugins): rename packages/classes
* rename google maps
* gulp task to generate readme files
* readme templates
* automating readme file generation and adding it to CI
# Conflicts:
# src/@ionic-native/plugins/googlemap/index.ts
# src/@ionic-native/plugins/inappbrowser/index.ts
# src/@ionic-native/plugins/media/index.ts
# src/@ionic-native/plugins/sqlite/index.ts
* outputting readmes to dist dir instead of src
* updating package name in usage instructions
* chore(): ngc build
* fix build
* 3.0.1-0
* 3.1.0-alpha.1
* fix AoT support and add publish script
* 3.1.0-alpha.2
* edit publish command
* remove alpha tag
* remove auto-install and cleanup
* 3.1.0-alpha.3
* remove utils from publish command
* refactor(): remove some prefixes
* remove console logs
closes#1145
* chore(): merge master into v3-injectable (#1146)
* 2.5.0
* chore(): update changelog
* fix(pin-dialog): add missing errorIndex
* 2.5.1
* chore(): update changelog
* fix(zip): progress callback is optional (#1049)
* fix(apprate): add missing Windows Store option (#1072)
* Update file-chooser.ts (#1071)
Removed semicolon after .then() in usage instructions
* docs(device-motion): update interface names (#1076)
AccelerationData interface is wrongly named in docs. It should be DeviceMotionAccelerationData. And I added it to import statement.
* feat(inappbrowser): add interface for IAB options (#1065)
* Add InAppBrowserOptions Interface for better tooling.
* feat(inappbrowser): add interface for IAB options
* Add more constructor tests.
* Add missing iOS options.
* docs(media): update method usage (#1089)
* fix(push): add the missing option clearBadge (#1087)
* docs(badge): fix example (#1096)
Error in code example (supplied parameters do not match call signature)
* fix(imagepicker): add outputType option (#1098)
* fix(facebook): fixes issue when not supplying default params (#1088)
* Fix default facebook logEvent parameters
* Implement correct parameters format in facebook logEvent method
* Update ibeacon.ts (#1099)
Return type of `getAuthorizationStatus()` made more explicit.
* fix(file): add missing exports (#1101)
Any declaration that is not being exported is missing from the resulting d.ts declaration files.
* Add InAppBrowserOptions interface to documentation. (#1103)
* Update sqlite.ts (#1106)
Added a bracket to remove the syntax error
* update device orientation docs to reflect renaming of CompassHeading interface (#1107)
* Move marker code inside MAP_READY (#1108)
The code to set the camera position and marker should be moved inside the function handling MAP_READY. Otherwise they execute before the event is fired and it doesn't work.
* refactor(file): accept ArrayBuffer for data to write (#1109)
* docs(google-maps): fix param type
closes#1110
* fix(media): add missing pauseRecord and resumeRecord methods (#1122)
* docs(stripe): fix type and naming issues (#1129)
* refactor(paypal): fix type of items (#1125)
Type of items should be Array<PayPalItem> instead of string.
* fix(serial): Serial.requestPermission() options are optional (#1128)
* add success/error indices
* feat(browser-tab): add browser tab plugin (#1126)
* feature: added hasPermission function to Firebase fixes#1115
* feat: Implemented support for BrowserTab #1077
* docs(browser-tab): add proper docs
* fix(background-geolocation): configure returns a promise
closes#1118
* docs(background-geolocation): add return types and platforms
* fix(contacts): allow passing asterisk as contact field type
closes 1093
* fix(contacts): allow passing asterisk as contact field type
closes#1093
* fix(plugin): revert changes to support stable version (#1116)
fix#1001
* feat(file): add system paths
* feat(app-update): add cordova-plugin-app-update support (#1105)
* add new app-update plugin
* update plugin info
* docs(app-update): add docs
* feat(alipay): add alipay support. (#1097)
* add cordova-alipay-base plugin. to support Alipay payment
* change ALI_PID to APP_ID, make it same with the latest SDK
* rewrite comments
* docs(google-maps): improve docs (#1095)
Move `map.moveCamera(position);` inside the MAP_READY event.
Allow to zoom the map on first launch (both iOS and Android).
* fix(file): remove FileError from return type (#1086)
Promises that reject with a `FileError` are not of the type `Promise<T|FileError>`, but `Promise<T>`.
The previous declarations of `Promise<T|FileError>` would break typing further down the chain where you are trying to use the value that the typing says could be `T|FileError` but in reality could only be `T`.
* feat(google-maps): add constant for map type
* fix(file): platform Browser will raise a an DOMException (#1082)
fix(File): Platform Browser will raise a an DOMException on resoleLocalFilesystemUrl and tries to write on readonly property DOMException err.message in fillErrorMessage
* feat(local-notifications): support for icon background color (#1079)
The Cordova plugin Ionic Natives uses allows specifying the background color of the smallIcon. By not including it in your interface you force users to use the default color for their version of Android. While the LocalNotification plugin is not well documented, it does include this feature, see Options.java line 253:
```
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
public int getColor() {
String hex = options.optString("color", null);
if (hex == null) {
return NotificationCompat.COLOR_DEFAULT;
}
int aRGB = Integer.parseInt(hex, 16);
return aRGB + 0xFF000000;
}
```
I've simply added the option to the interface as well as a short description.
This lets you go from the default color (varies by Android version): https://goo.gl/photos/nERcj4GZgapy8aee9
To any color you'd like: https://goo.gl/photos/t8V9WVba8jDU49aHA
And also works if you also specify a large icon: https://goo.gl/photos/gWQYwa12djmdXfYcA
* feat(unique-device-add): add UniqueDeviceId plugin (#1064)
* fix plugin
* feat(text-to-speech): Add stop method (#1063)
https://github.com/vilic/cordova-plugin-tts/pull/32
* feat(appodeal): adds Appodeal SDK wrappers for iOS and Android (#1031)
* feat(Appodeal) bootrapping
* starting docs
* more docs
* feat(appodeal): add event Observables
* feat(appodeal): replace Cordova Observable events with #.fromEvent()
* feat(appodeal): update decorator metadata
* feat(couchbase-lite): add CouchbaseLite cordova plugin (#1025)
* feat(CouchbaseLite): add CouchbaseLite cordova plugin
* add plugin url
* feat(background-fetch): Adding Background Fetch requested in #990 (#1013)
* Adding Background Fetch (https://github.com/transistorsoft/cordova-plugin-background-fetch) requested in #990
* Adding BackgroundFetch to index
* feat(gyroscope): add Gyroscope plugin (#1004)
* add gyroscope.ts to plugins
* add gyroscope to index
* Update gyroscope.ts
* Update gyroscope.ts
* Revert "fix(File): typing where `FileError` can be thrown" (#1130)
* tslint and fix build issues
* 2.6.0
* chore(): update changelog
* fix(core): dont check if method exists when overriding
fixes#1043
* fix(file): fix writeExistingFile
closes#1044
* feat(diagnostic): add new methods
closes#1045
* feat(background-mode): replace event listeners with on method
The methods onactivate, ondeactive and onfailure no longer exist. You must now use `on` method.
* feat(background-mode): add missing functions
closes#1078
* tslint
* set GoogleMapsMapTypeId to private
* remove beta from stripe
* 2.7.0
* chore(): update changelog
* feat(app-preferences): added cordova-plugin-app-preferences support (#1084)
* (feat) added cordova-plugin-app-preferences support
* replaced callback functions with promises
* updated example
* (feat) added cordova-plugin-browsertab support
* Revert "(feat) added cordova-plugin-browsertab support"
This reverts commit 00eb5cf5d8.
* (update) synchronize fetch
* feat(photo-library): added cordova-plugin-photo-library (#1102)
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* refactor(photo-library): fixed circleci failing in 2.7.0 (#1132)
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* fixed typescript error in 2.7.0
* feat(health): add wrapper for cordova-plugin-health (#1039)
* feat(health): add wrapper for cordova-plugin-health
* fix(Health): add optional params to QueryOptions for .query()
* docs(health): fix javadoc of interfaces
* fix(health): remove unused Plugin option
* docs(health): add missing documentation
* doc(health): add promise to return
* doc(health): remove empty lines
* doc(health): Add description & reference to repo
* doc(health: add "return {Promise<any>}"
* refactor(safari-view-controller): hide returns promise
* fix typo in ibeacon plugin (#1138)
* fix(file): fix return types
fixes#1139
* docs(background-geolocation): fix param docs
* refactor(health): fix return types and prefix interfaces
* 2.8.0
* chore(): update changelog
* docs(sqlite): syntax error resolved (#1142)
* Syntax error resolved
The `{}` should be `[]`, but since there is no binding we do not get error. In case we add one, then the syntax will be incorrect.
* Fixed a syntax error
* fix(background-geolocation): configure returns an observable
* docs(): update docs
* 3.1.0-rc.1
* refactor(background-geolocation): update imports
* docs(background-fetch): fix return type
* docs(health): fix return type
* chore(CI): fixing npm install instructions in generated readmes
* set concurrency to number of cores
* chore(): update deps
* 3.1.0-rc.2
* chore(): update angular to 2.4.8
* 3.1.0-rc.3
* chore(): update angular to 2.4.8
* chore(): update rxjs to 5.0.1
* chore(): organize and enhance decorators (#1171)
* fix/add decorators
* fix google maps design
* chore(): add root tsconfig to resolve imports in IDE
* updates
* more fixes
* chore(): add options to InstanceCheck
* chore(decorators): promise is default for Cordova/Instance check
* chore(): add check decroators
* docs(): update plugin docs
* chore(decorators): fix cordovaCheck and instanceCheck
* 3.1.0-rc.4
* chore(docs): remove gitPackage from doc generator
* chore(docs): update to latest dgeni version
* fix diagnostic
* feat(media): create method now returns a promise
Breaking change: create no longer returns a MediaObject instance. Make changes to your app accordingly.
* docs update + remove any static methods/properties
* remove duplicate method
* remove extra docs
* remove extra docs
* docs(): rename plugins
* chore(decorators): do not check method name on instancecheck
* chore(decorators): do not check method name on cordovacheck
* chore(plugin): fix pluginWarn
* chore(plugin): fix pluginWarn
* fix(decorators): fix InstanceCheck decorator
* 3.1.0-rc.5
* chore(docs): fix readme generation
* fix(transfer): fix v3 implementation
* refactor(paypal): PayPal is brand name
* chore(docs): replace all spaces with dashes
* chore(): add dashify filter
* chore(build): add aot path to core tsconfig
* feat(action-sheet): add ANDROID_THEMES constant
* refactor(): general cleanup (#1193)
* feat(screen-orientation): update wrapper to match v2 of the plugin
The whole implementation has changed now. You must update your code.
* feat(stripe): add new methods
* feat(linkedin): add LinkedIn plugin
* 3.1.0-rc.6
* style(screen-orientation): double quote to single
* tslint
* refactor(pedometer): rename file to index
* Syntax error resolved
The `{}` should be `[]`, but since there is no binding we do not get error. In case we add one, then the syntax will be incorrect.
* Fixed a syntax error
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* fixed typescript error in 2.7.0
The Cordova plugin Ionic Natives uses allows specifying the background color of the smallIcon. By not including it in your interface you force users to use the default color for their version of Android. While the LocalNotification plugin is not well documented, it does include this feature, see Options.java line 253:
```
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
public int getColor() {
String hex = options.optString("color", null);
if (hex == null) {
return NotificationCompat.COLOR_DEFAULT;
}
int aRGB = Integer.parseInt(hex, 16);
return aRGB + 0xFF000000;
}
```
I've simply added the option to the interface as well as a short description.
This lets you go from the default color (varies by Android version): https://goo.gl/photos/nERcj4GZgapy8aee9
To any color you'd like: https://goo.gl/photos/t8V9WVba8jDU49aHA
And also works if you also specify a large icon: https://goo.gl/photos/gWQYwa12djmdXfYcA
fix(File): Platform Browser will raise a an DOMException on resoleLocalFilesystemUrl and tries to write on readonly property DOMException err.message in fillErrorMessage
Promises that reject with a `FileError` are not of the type `Promise<T|FileError>`, but `Promise<T>`.
The previous declarations of `Promise<T|FileError>` would break typing further down the chain where you are trying to use the value that the typing says could be `T|FileError` but in reality could only be `T`.
The code to set the camera position and marker should be moved inside the function handling MAP_READY. Otherwise they execute before the event is fired and it doesn't work.
Adding a link to **cordova plugin file** for ease of understanding file management using cordova.
It took me almost a day to figure out how to properly save things like a pdf/image in a publicly accessible directory. Having a link to the main **cordova file** documentation will save a lot of time.
This reverts part of commit 67adb23, which moved the call to getPlugin()
from within CordovaProperty() to a point where it was called too early.
When the CordovaProperty decorator is called on a property, the class
containing that call has not yet had its Plugin decorator called. Only
when the latter happens does pluginRef get set. Thus, attempting to
access pluginRef within CordovaProperty at the time of the call will
give undefined, and attemping to call getPlugin with an undefined value
will throw an exception:
Runtime Error
Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
at get
at getPlugin
at CordovaProperty
at __decorate
...
The above message can be seen in the browser after running the 'ionic
serve' command.
This commit moves the getPlugin call back to the getters and setters
established by CordovaProperty, which are only called *after* the Plugin
decorator has finished executing.
closes#992
* feat(broadcaster): add Broadcaster plugin
* fix(broadcaster): return Obserable for addEventListener
- also remove the listener when clearing observable
I added a change that makes it clear that the map element needs a height to be visible.
I tried to follow the docs but It didn't work, after that I thought my API keys were invalid, at the end it turned out the map wasn't visible at all.
* update to use plugin v1.1.0
Updated example
Added new configuration options.
Added new show() result fields
Added new delete method
* Update to plugin v1.2.0
Removed show()
Added encrypt()
Added decrypt()
Removed requirement of username
* edit comments
* edited comments
The routeWithNavController method returns an observable, thus it has to be subscribed to, to get it working.
Change the documentation of the method to show that we need to subscribe to the observable, just like when using the route method.
`db.executeSql()` was documented as `db.executeSQL()` that caused error:
main.js:13 Error openening database TypeError: t.executeSQL is not a function
at file:///android_asset/www/build/main.js:13:11718
at t.invoke (file:///android_asset/www/build/polyfills.js:3:13422)
at Object.onInvoke (file:///android_asset/www/build/main.js:3:3341)
at t.invoke (file:///android_asset/www/build/polyfills.js:3:13373)
at e.run (file:///android_asset/www/build/polyfills.js:3:10809)
at file:///android_asset/www/build/polyfills.js:3:8911
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:14051)
at Object.onInvokeTask (file:///android_asset/www/build/main.js:3:3241)
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:13987)
at e.runTask (file:///android_asset/www/build/polyfills.js:3:11411)
The issue is fixed in this commit
* Update camera-preview.ts
This missing parameter would cause TS to spew
* Update camera-preview.ts
Sending preview to back is initially confusing and causes it to appear to not work.
* docs(camera preview): update to correct repo
* docs(camera preview): fix typo
* docs(camera preview): Update to other repo
* fix(camera preview): revert to old plugin and update repo to matching repo
The plugin reference is available as part of the global `cordova` object and not the global `plugins` object. This caused the plugin to `Plugin not installed warning` even though the plugin is installed and works when using through `cordova.plugins.market.open(appId);`
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
## Have an issue?
#### There are no rules, but here are a few things to consider:
###### Before you submit an issue:
* Do a quick search to see if there are similar issues
* **Check that you are using the latest version of**`ionic-native`
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
* **Check that you are using the latest version of**`ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
###### Still having problems? submit an issue with the following details:
* Short description of the issue
* Steps to reproduce
* Stack trace (if available)
## Feature request?
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
**Current behavior:**
<!-- Describe how the bug manifests. -->
**Expected behavior:**
<!-- Describe what the behavior would be without the bug. -->
**Steps to reproduce:**
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce. -->
**Related code:**
```
insert any relevant code here
```
**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):
As contributors and maintainers of the Ionic project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
Communication through any of Ionic's channels (GitHub, Slack, Forum, IRC, mailing lists, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ionic project to do the same.
If any member of the community violates this code of conduct, the maintainers of the Ionic project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [hi@ionicframework.com](mailto:hi@ionicframework.com).
@@ -12,8 +12,12 @@ First, let's start by creating a new plugin wrapper from template.
// Make sure to capitalize the first letter, or use CamelCase if necessary.
gulp plugin:create -n PluginName
// add -m flag to get a minimal template to start with
gulp plugin:create -m -n PluginName
```
Running the command above will create a new directory `src/@ionic-native/plugins/plugin-name/` with a single file in there: `index.ts`. This file is where all the plugin definitions should be.
Let's take a look at the existing plugin wrapper for Geolocation to see what goes into an Ionic Native plugin (comments have been removed for clarity):
@@ -22,17 +26,18 @@ Let's take a look at the existing plugin wrapper for Geolocation to see what goe
It's just a stub. The `return` is only there to keep the TypeScript type-checker from complaining since we indicate that `getCurrentPosition` returns a `Promise<Geoposition>`.
@@ -91,80 +98,28 @@ Next, let's look at the `watchPosition` method.
The `@Cordova` decorator has a few more options now.
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/driftyco/ionic-native#promises-and-observables) instead of a Promise.
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/ionic-team/ionic-native#promises-and-observables) instead of a Promise.
`callbackOrder` refers to the method signature of the underlying Cordova plugin, and tells Ionic Native which arguments are the callbacks to map to the wrapping Promise or Observable. In this case, the signature is [`watchPosition(success, error, options)`](https://github.com/apache/cordova-plugin-geolocation#navigatorgeolocationwatchposition), so we need to tell `@Cordova` that the callbacks are the first arguments, not the last arguments. For rare cases, you can also specify the options `successIndex` and `errorIndex` to indicate where in the argument list the callbacks are located.
`clearFunction` is used in conjunction with the `observable` option and indicates the function to be called when the Observable is disposed.
### Updating index.ts
For new plugins, you will need to update `/src/index.ts` to properly export your plugin and make it available for use.
1. Import the plugin class into `index.ts`:
`import {PluginClassName} from ./plugins/filenameForPlugin`
No need to put the `.ts` extension on the filename.
2. Add the plugin class name to the list in the `export` object:
```
export {
ActionSheet,
AdMob,
AndroidFingerprintAuth,
YourPluginClassName,
...
}
```
3. Add the plugin class name to the `window['IonicNative']` object:
```
window['IonicNative'] = {
ActionSheet: ActionSheet,
AdMob: AdMob,
AndroidFingerprintAuth: AndroidFingerprintAuth,
YourPluginClassName: YourPluginClassName,
...
```
4. If your plugin exports any other objects outside of the plugin class, add an export statement for the file:
`export * from './plugins/filenameForPlugin';`
No need to put the `.ts` extension on the filename.
For example, `googlemaps.ts` exports a const outside of the plugin's main `GoogleMap` class:
```
export const GoogleMapsAnimation = {
BOUNCE: 'BOUNCE',
DROP: 'DROP'
};
```
To properly export `GoogleMapsAnimation`, `index.ts` is updated with:
`export * from './plugins/googlemaps';`
### Testing your changes
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. Then, you must go to your ionic application folder and replace your current `node_modules/ionic-native/dist/` with the newly generated one.
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. The`dist` directory will contain a sub directory `@ionic-native` with all the packages compiled in there. Copy the package(s) you created/modified to your app's node_modules under the `@ionic-native` directory. (e.g. `cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/`).
### Cleaning the code
You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
You need to run `npm run lint` to analyze the code and ensure its consistency with the repository style. Fix any errors before submitting a PR.
### 'Wrapping' Up
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
That's it! The only thing left to do is rigorously document the plugin and its usage. Take a look at some of the other plugins for good documentation styles.
## Commit Message Format
@@ -193,4 +148,74 @@ The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* do not capitalize first letter
* do not place a period (.) at the end
* entire length of the commit message must not go over 50 characters
* entire length of the commit message must not go over 50 characters
### Ionic Native Decorators
#### Plugin
A decorator to wrap the main plugin class, and any other classes that will use `@Cordova` or `@CordovaProperty` decorators. This decorator accepts the following configuration:
- *pluginName*: Plugin name, this should match the class name
- *plugin*: The plugin's NPM package, or Github URL if NPM is not available.
- *pluginRef*: The plugin object reference. Example: 'cordova.file'.
- *repo*: The plugin's Github Repository URL
- *install*: (optional) Install command. This is used in case a plugin has a custom install command (takes variables).
- *platforms*: An array of strings indicating the supported platforms.
#### Cordova
Checks if the plugin and the method are available before executing. By default, the decorator will wrap the callbacks of the function and return a Promise. This decorator takes the following configuration options:
- **observable**: set to true to return an Observable
- **clearFunction**: an optional name of a method to clear the observable we returned
- **clearWithArgs**: This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used in the initial function.
- **sync**: set to true if the method should return the value as-is without wrapping with Observable/Promise
- **callbackOrder**: set to `reverse` if the success and error callbacks are the first two arguements of the method
- **callbackStyle**: set to `node` if the plugin has one callback with a node style (e.g: `function(err, result){}`), or set to `object` if the callbacks are part of an object
- **successName**: Success function property name. This must be set if callbackStyle is set to object.
- **errorName**: Error function property name. This must be set if callbackStyle is set to object.
- **successIndex**: Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **errorIndex**: Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **eventObservable**: set to true to return an observable that wraps an event listener
- **event**: Event name, this must be set if eventObservable is set to true
- **element**: Element to attach the event listener to, this is optional, defaults to `window`
- **otherPromise**: Set to true if the wrapped method returns a promise
- **platforms**: array of strings indicating supported platforms. Specify this if the supported platforms doesn't match the plugin's supported platforms.
Example:
```ts
@Cordova()
someMethod():Promise<any>{return;}
@Cordova({sync: true})
syncMethod():number{}
```
#### CordovaProperty
Checks if the plugin and property exist before getting/setting the property's value
Example:
```ts
@CordovaProperty
someProperty: string;
```
#### CordovaCheck
Checks if the plugin exists before performing a custom written method. By default, the method will return a promise that will reject with an error if the plugin is not available. This wrapper accepts two optional configurations:
- **observable**: set to true to return an empty Observable if the plugin isn't available
- **sync**: set to true to return nothing if the plugin isn't available
Example:
```ts
@CordovaCheck()
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.
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](http://ionicframework.com/), Cordova, or Web View mobile app easy.
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](https://ionicframework.com/) mobile app easy.
### Documentation
Ionic Native wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and making it easy to use plugins with Angular change detection.
For the full Ionic Native documentation, please visit [http://ionicframework.com/docs/v2/native/](http://ionicframework.com/docs/v2/native/).
## Installation
### Promises and Observables
Run following command to install Ionic Native in your project.
Ionic Native wraps plugin callbacks in a Promise or [Observable](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754), providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
Ionic Native works as a stand-in for [ngCordova](http://ngcordova.com/). In many cases, the usage is identical, but we import `ionic.native` instead of `ngCordova` as our module.
## Documentation
As a rule of thumb: take the ES6 class name of the plugin and add `$cordova` to get the service name. For example, `Geolocation` would be `$cordovaGeolocation`, and `Camera` will be `$cordovaCamera`:
For the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).
Ionic Native 3.x makes it possible to mock plugins and develop nearly the entirety of your app in the browser or in `ionic serve`.
To do this, you need to provide a mock implementation of the plugins you wish to use. Here's an example of mocking the `Camera` plugin to return a stock image while in development:
First import the `Camera` class in your `src/app/app.module.ts` file:
```typescript
import{Camera}from'@ionic-native/camera';
```
Then create a new class that extends the `Camera` class with a mock implementation:
```typescript
classCameraMockextendsCamera{
getPicture(options){
returnnewPromise((resolve,reject)=>{
resolve('BASE_64_ENCODED_DATA_GOES_HERE');
});
}
}
```
Finally, override the previous `Camera` class in your `providers` for this module:
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
## Ionic v1 (AngularJS, Angular 1.x) support
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
Ibrahim Hadeed - [@ihadeed](http://github.com/ihadeed)
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
constbefore=Date.now();
letdidFireReady=false;
document.addEventListener('deviceready',()=>{
console.log(
`Ionic Native: deviceready event fired after ${Date.now()-before} ms`
);
didFireReady=true;
});
setTimeout(()=>{
if(!didFireReady&&!!window.cordova){
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
// If the plugin method expects myMethod(success, err, options)
if(opts.callbackOrder==='reverse'){
// Get those arguments in the order [resolve, reject, ...restOfArgs]
args.unshift(reject);
args.unshift(resolve);
}elseif(opts.callbackStyle==='node'){
args.push((err: any,result: any)=>{
if(err){
reject(err);
}else{
resolve(result);
}
});
}elseif(
opts.callbackStyle==='object'&&
opts.successName&&
opts.errorName
){
letobj: any={};
obj[opts.successName]=resolve;
obj[opts.errorName]=reject;
args.push(obj);
}elseif(
typeofopts.successIndex!=='undefined'||
typeofopts.errorIndex!=='undefined'
){
constsetSuccessIndex=()=>{
// If we've specified a success/error index
if(opts.successIndex>args.length){
args[opts.successIndex]=resolve;
}else{
args.splice(opts.successIndex,0,resolve);
}
};
constsetErrorIndex=()=>{
// We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
if(opts.errorIndex>args.length){
args[opts.errorIndex]=reject;// insert the reject fn at the correct specific index
}else{
args.splice(opts.errorIndex,0,reject);// otherwise just splice it into the array
}
};
if(opts.successIndex>opts.errorIndex){
setErrorIndex();
setSuccessIndex();
}else{
setSuccessIndex();
setErrorIndex();
}
}else{
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
returnargs;
}
functioncallCordovaPlugin(
pluginObj: any,
methodName: string,
args: any[],
opts: any={},
resolve?: Function,
reject?: Function
){
// Try to figure out where the success/error callbacks need to be bound
'No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.'
);
}
};
returntryNativePromise();
};
/**
* @private
* @param pluginRef
* @returns {null|*}
*/
exportconstgetPlugin=(pluginRef: string):any=>{
returnget(window,pluginRef);
};
/**
* @private
*/
exportconstpluginWarn=(
pluginName: string,
plugin?: string,
method?: string
):void=>{
if(method){
console.warn(
'Ionic Native: tried calling '+
pluginName+
'.'+
method+
', but the '+
pluginName+
' plugin is not installed.'
);
}else{
console.warn(
`'Ionic Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
}
if(plugin){
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
* The ActionSheet plugin shows a native list of options the user can choose from.
*
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet).
*
* @usage
* ```typescript
* import { ActionSheet, ActionSheetOptions } from '@ionic-native/action-sheet';
* A free, no ad-sharing version of Google AdMob plugin for Cordova.
*
* Requires Cordova plugin: `cordova-plugin-admob-free`. For more info, please see the [AdMob Free plugin docs](https://github.com/ratson/cordova-plugin-admob-free).
*
* @usage
* ```typescript
* import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
*
*
* constructor(private admobFree: AdMobFree) { }
*
*
* ...
*
*
* const bannerConfig: AdMobFreeBannerConfig = {
* // add your config here
* // for the sake of this example we will just use the test config
* isTesting: true,
* autoShow: true
* };
* this.admobFree.banner.config(bannerConfig);
*
* this.admobFree.banner.prepare()
* .then(() => {
* // banner Ad is ready
* // if we set autoShow to false, then we will need to call the show method here
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.