by.chemerisuk.cordova.firebase.FirebaseAuthenticationPlugin.signInWithVerificationId argument 2 has type java.lang.String, got java.lang.Integer
smsCode has to be string instead of number
As said in the comment: `if specified, aggregation is grouped an array of "buckets" (windows of time),` the `bucket` field in `HealthQueryOptionsAggregated` should be optional.
* feat(MobileMessaging): add methods for CustomEvents support
* fix(MobileMessaging) change customAttributes type
* fix(MobileMessaging): change methods return type
Co-authored-by: Konstantin Latypov <Konstantin.Latypov@infobip.com>
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
* feat(unvired-cordova-sdk): add method to get log file path
* feat(unvired-cordova-sdk): test push notifications
* fix(unvired-cordova-sdk): define return for logRead
* doc(unvired-cordova-sdk): remove mobile only restriction for some apis
* feat(unvired-cordova-sdk): add new property containing HTTP status code.
* feat(unvired-cordova-sdk): add new functions to lock & unlock sending of data
* fix(unvired-cordova-sdk): update the return type for lock and unlock functions.
* fix(unvired-cordova-sdk): change the return type for lockDataSender api
* fix(unvired-cordova-sdk): fix the data type for ResultType and OutboxLockStatus
Co-authored-by: Srinidhi Anand Rao <srinidhi.rao@unvired.io>
When there are no apps installed that can handle "mail" then the "apps" array is returned as `null` from the plugin. Ensure we don't try to call `length` on `null`.
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
* feat(unvired-cordova-sdk): add method to get log file path
* feat(unvired-cordova-sdk): test push notifications
* fix(unvired-cordova-sdk): define return for logRead
* doc(unvired-cordova-sdk): remove mobile only restriction for some apis
* feat(unvired-cordova-sdk): add new property containing HTTP status code.
* feat(unvired-cordova-sdk): add new functions to lock & unlock sending of data
* fix(unvired-cordova-sdk): update the return type for lock and unlock functions.
* fix(unvired-cordova-sdk): change the return type for lockDataSender api
* fix(fcm): add missing clearAllNotifications
* getAPNSToken method added
New version of `cordova-plugin-fcm-with-dependecy-updated` released: v4.0.0
_“The old FCMPlugin.getToken is focused on retrieving the FCM Token. For the IOS, APNS token can now be retrieved by the new method”_ (Show readme)[https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated#version-400-12102019]
* hasPermission added
[Show readme.md](https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated#version-320-16092019)
#### Checking for permissions
Useful for IOS. On android, it will always return `true`.
```javascript
FCMPlugin.hasPermission(function(doesIt){
// doesIt === true => yes, push was allowed
// doesIt === false => nope, push will not be available
// doesIt === null => still not answered, recommended checking again later
if(doesIt) {
haveFun();
}
});
```
# Conflicts:
# src/@ionic-native/plugins/fcm/index.ts
Co-authored-by: Alexis Caffa <AlexisCaffa@users.noreply.github.com>
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
* feat(unvired-cordova-sdk): add method to get log file path
* feat(unvired-cordova-sdk): test push notifications
* fix(unvired-cordova-sdk): define return for logRead
* doc(unvired-cordova-sdk): remove mobile only restriction for some apis
* feat(unvired-cordova-sdk): add new property containing HTTP status code.
* feat(camera-preview):add getCameraCharacteristics
added getCameraCharacteristics to get the characteristics of all available cameras. #3163
* Update index.ts
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
* feat(unvired-cordova-sdk): add method to get log file path
* feat(unvired-cordova-sdk): test push notifications
* fix(unvired-cordova-sdk): define return for logRead
* doc(unvired-cordova-sdk): remove mobile only restriction for some apis
* Update index.ts
Added description field to IChannelOptions object and changed vibration type to get a number array
* Update index.ts
Added description field to IChannelOptions object and changed vibration type to get a number array
BREAKING CHANGE: update firebase-x-cordova plugin to version 7
* fix(firebase-x): update types to match cordova-plugin-firebasex 7.0.0
* fix(firebase-x): Add getAPNSToken(), add `onApnsTokenReceived()`
* Add getAPNSToken() plugin API method to get the APNS token on iOS.
* (iOS) Add `onApnsTokenReceived()` to register a callback function to be invoked when the APNS token is allocated.
* fix lint errors
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
* feat(unvired-cordova-sdk): add method to get log file path
* feat(unvired-cordova-sdk): test push notifications
* fix(unvired-cordova-sdk): define return for logRead
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add methods to get and set log level
* fix(unvired-cordova-sdk): update the return type for getLog()
* feat(unvired-cordova-sdk): return platform name
It seems like these two definitions were switched around accidentally. I'm just going from the obvious logic of it. I don't know if there is some situation where the names are intentionally switched around? Please only accept PR if you can vouch for my change.
* Add Basic WebSocketServer Class
* Change for custom plugin fork
* Set cordova observable property
* Setup for custom fork of plugin
Using custom fork for better support for
observables. Use original repo when pull request
https://github.com/becvert/cordova-plugin-websocket-server/pull/64 is merged
* Add Documentation
* Remove double quotes with single quotes
* Fix lint issues
* Fix stop() docs
* feat(cordova-plugin-preview-any-file): add new plugin to preview the files in both ios and android
* fix lint error
* add missing descriptions
* add the reop link
* feat(cordova-plugin-preview-any-file): add new plugin to preview the files in both ios and android
* fix lint error
* add missing descriptions
* add the reop link
* Fixes#2972https://github.com/ionic-team/ionic-native/issues/2972
* If window does not exist.
But is there a case where window does not exist? If ionic-native always runs in browsers enviroment (like Cordova / WebView) we could remove the `typeof` checks.
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
* doc(unvired-cordova-sdk): update doc
* feat(unvired-cordova-sdk): add support for metadata JSON
* doc(unvired-cordova-sdk): update doc
* Update index.d.ts
Property comments are omitted if they are not marked with double asterisks. Added missing asterisks
* Update index.d.ts
Updated comments to match linter settings
* Fix lint errors and some missing comments
* add missing options and improve types
* feat(unvired-cordova-sdk): support login via email
* fix(unvired-cordova-sdk): return typed promise object for user settings
* fix(unvired-cordova-sdk): change return type to string for guid()
* doc(unvired-cordova-sdk): doc update
cordova.plugins.diagnostic@5.0.0 introduced breaking change moving from `DENIED` to `DENIED_ONCE` and make the statuses semantically equal for iOS and Android. For backward compatibility `DENIED` is untouched in this PR but marked as deprecated
solves #3050
while diagnostic plugin docs may be confusing, the `requestRemoteNotificationsAuthorization(successCallback, errorCallback, types, omitRegistration)` signature is available in the sources:
0fac4a59d1/www/ios/diagnostic.notifications.js (L162)
* Adding missing functions to index.ts file
The functions were missing, Please refer to the issue #2909https://github.com/ionic-team/ionic-native/issues/2909
* Updated comments
Updated comments which were failing tslint test
* removed trailing whitespace
removed trailing whitespace
* feat: updating device account wrapper with maintained fork with android 8.0 compatibility
* updating func to include getPermission for email permissions on android 8.0+
* revert package-lock as per feedback
* fix conflicts in package-lock.json, revert back to commit 49d7ca7375
Adds missing sendRequest feature that has been implemented to cordova-plugin-advanced
which allows overriding global options for single request being sent via this method
Closes#2824
* Change for new 'headers' option
As of 1.1.19 of PhotoViewer, a new PhotoViewer option was added called 'headers' which allows for HTTP headers to be used when requesting the image. This is useful for authenticated sites.
* Typo in example
* Added new PhotoViewerOptions
There are several other new PhotoViewerOptions besides 'headers' that need to be imported into the latest version. I was selfishly only concerned about the one I needed, but the build really needs them all.
* Change guide color to string|number type
When the platform is Android, the cordova plugin wait for an Int value to set the guide color.
* Update index.ts
* fix(contacts plugin): add the rawId parameter
This adds the rawId parameter to the contact class which allows the rawId value to be passed to Android which is required for saving contacts.
* Update index.ts
The newly added wrapper for Admob __Plus__ had Admob __Free__ as its name.
This resulted in a broken docs-Page, _Admob Free_ occurred twice, both showing infos for _Admob Plus_
* Work on NFC reader-mode
* Remove dist files, not needed in plugin development folder
* Revert package changes
This reverts part of commit 24a893fdcf.
* Update index.ts
* Correct the flags and return types for the wrapper
* Add reader flags.
Thanks @sfaizanh
* feat(plugins): add web-server plugin
Add support of the cordova-plugin-webserver plugin, to start a
a dynamic content web server on iOS and android devices.
* Update index.ts
* Update createAuthenticationContext
Update createAuthenticationContext to include validateAuthority flag since it is throwing Error: Fail to valid authority with errors: [50049].
Without the flag it is throwing Error: Fail to valid authority with errors: [50049].
* Update index.ts
* feat(bluetooth-le): implemented all available methods and refactored existing ones
* fix(bluetooth-le): Removed @memberof jsdoc annotations to avoid ci check failure
* fix(bluetooth-le): Fixed multiple jsdocs typos/misformats preventing CI to pass checks while generating readmes
* fix(bluetooth-le): Removed package-lock.json
* Update index.ts
* fix(bluetooth-le): Fixed stringToBytes method, now properly takes a string as arg and return an Uint8Array
* fix(bluetooth-le): getAdapterInfo now returns an Observable for easier tracking of adapter states
* fix(bluetooth-le): Fixed missing cordova param (observable: true) in initializePeripheral method, fixed getAdapterInfo method, now return an adapterInfo object
* chore(bluetooth-le): Removed @description markup to allow a proper doc auto-format
* fix(bluetooth-le): Reverted getAdapterInfo method to a Promise return
We noticed that in some cases network state listeners are stopped triggering, but `navigator.onLine` still reflects the state correctly. I used the following code to debug and found out an issue with `window` and `document` difference:
```js
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
```
Also, according to plugin documentation, listeners should be bound to `document`: https://github.com/apache/cordova-plugin-network-information#offline
- 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
#### There are no rules, but here are a few things to consider:
###### Before you submit an issue:
* Do a quick search to see if there are similar issues
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/v2/api/platform/Platform/#ready).
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save ionic-native@latest`
* 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
@@ -16,4 +16,4 @@
## Feature request?
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
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).
This is a short guide on creating new plugin wrappers for Ionic Native.
## Creating Plugin Wrappers
First, let's start by creating a new plugin wrapper from template.
```
// Call this command, and replace PluginName with the name of the plugin you wish to add
// Make sure to capitalize the first letter, or use CamelCase if necessary.
gulp plugin:create -n PluginName
// 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):
@@ -70,7 +70,7 @@ export class Geolocation {
Here, `plugin` is the name of the plugin package on npm and used when calling `cordova plugin add`.
`pluginRef` refers to the where on `window` the underlying Cordova plugin is normally exposed. For example, in the case of the Cordova Geolocation plugin, normally you would make calls like `window.navigator.geolocation.getCurrentPosition({}, success, error)`, so the `pluginRef` in this case is `navigator.geolocation`.
`pluginRef` refers to the where on `window` the underlying Cordova plugin is normally exposed. For example, in the case of the Cordova Geolocation plugin, normally you would make calls like `window.navigator.geolocation.getCurrentPosition({}, success, error)`, so the `pluginRef` in this case is `navigator.geolocation`.
#### Class Methods
@@ -85,9 +85,7 @@ Let's take a look at `getCurrentPosition` first.
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>`.
By default, the `@Cordova` decorator wraps the plugin callbacks in a Promise that resolves when the success callback is called and rejects when the error callback is called. It also ensures that Cordova and the underlying plugin are available, and prints helpful diagnostics if they aren't.
You'll also notice that `getCurrentPosition` is a static method. That's because the plugin class is just a utility class to call the underlying Cordova plugin methods, it's not an instance and has no state.
By default, the `@Cordova` decorator wraps the plugin callbacks in a Promise that resolves when the success callback is called and rejects when the error callback is called. It also ensures that Cordova and the underlying plugin are available, and prints helpful diagnostics if they aren't.
Next, let's look at the `watchPosition` method.
@@ -102,23 +100,23 @@ 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.
`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.
### 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
@@ -127,24 +125,108 @@ We have very precise rules over how our git commit messages can be formatted. Th
`type(scope): subject`
#### Type
Must be one of the following:
* **fix**: A bug fix
* **feat**: A new feature
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
- **fix**: A bug fix
- **feat**: A new feature
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
#### Scope
The scope could be anything specifying place of the commit change. For example, the name of the plugin being changed
#### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* do not capitalize first letter
* do not place a period (.) at the end
* entire length of the commit message must not go over 50 characters
- 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
### 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 2](http://ionicframework.com/) 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.
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.
Ionic Native is available in two versions:
1. Ionic Native [Community Edition](https://ionicframework.com/docs/native/community), featuring open source, community-maintained Cordova and Capacitor plugins and APIs.
2. Ionic Native [Enterprise Edition](https://ionicframework.com/docs/enterprise), featuring a library of Premier plugins and solutions that are fully supported and maintained by the Ionic team, with access to Ionic experts and a guaranteed response SLA to mission-critical app development.
## Capacitor Support
In addition to Cordova, Ionic Native also works with [Capacitor](https://capacitor.ionicframework.com), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins).
## Installation
Run following command to install Ionic Native in your project.
```
```bash
npm install @ionic-native/core --save
```
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](http://ionicframework.com/docs/v2/native/) for complete instructions on how to add and use the plugins.
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.
## Documentation
For the full Ionic Native documentation, please visit [http://ionicframework.com/docs/v2/native/](http://ionicframework.com/docs/v2/native/).
For the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).
### Basic Usage
#### Ionic/Angular apps
To use a plugin, import and add the plugin provider to your `@NgModule`, and then inject it where you wish to use it.
Make sure to import the injectable class from the `/ngx` directory as shown in the following examples:
These modules can work in any ES2015+/TypeScript app (including Angular/Ionic apps). To use any plugin, import the class from the appropriate package, and use it's static methods.
```js
import{Camera}from'@ionic-native/camera';
document.addEventListener('deviceready',()=>{
Camera.getPicture()
.then(data=>console.log('Took a picture!',data))
.catch(e=>console.log('Error occurred while taking a picture',e));
});
```
#### AngularJS
Ionic Native generates an AngularJS module in runtime and prepares a service for each plugin. To use the plugins in your AngularJS app:
1. Download the latest bundle from the [Github releases](https://github.com/ionic-team/ionic-native/releases) page.
2. Include it in `index.html` before your app's code.
3. Inject `ionic.native` module in your app.
4. Inject any plugin you would like to use with a `$cordova` prefix.
console.log('Error occurred while taking a picture',err);
}
);
});
```
### Mocking and Browser Development (Ionic/Angular apps only)
Ionic Native 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:
```ts
import{Camera}from'@ionic-native/camera';
```typescript
import{Camera}from'@ionic-native/camera/ngx';
```
Then create a new class that extends the `Camera` class with a mock implementation:
```ts
```typescript
classCameraMockextendsCamera{
getPicture(options){
returnnewPromise((resolve,reject)=>{
resolve("BASE_64_ENCODED_DATA_GOES_HERE");
})
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:
## Ionic 1/Angular 1 support
Ionic Native 3.x supports Ionic 2.x and above. For Ionic/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/driftyco/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
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:
This script reads and generates [typedoc](https://github.com/TypeStrong/typedoc) data for each of the plugins in `src/@ionic-native/plugins`. That data is then formatted and output as `plugins.json` in this directory.
// 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();
// 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;
});
letdidFireReady=false;
win.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.`);
}
},DEVICE_READY_TIMEOUT);
setTimeout(()=>{
if(!didFireReady&&win.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.`
'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.'
`Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which won't trigger an automatic digest when promises resolve.`
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.