Compare commits

..

24 Commits

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

* added get url method

* create database method added

* delete database method added

* get all database method added

* space added in comments

* comments added unwanted import removed

* whitespaces added

* usage added in commented section

* get all documents,create document methods added

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

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

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

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

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

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

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

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

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

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

* Remove `@CordovaInstance` decorators from getMap()

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

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

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

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

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

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

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

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

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

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

* Add `destruct` option to the CordovaOption.

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

* A semicolon is mixing

* update: event names

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

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

* Build for working group

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

* Bug fix: The definition of VisibleRegion interface is incorrect

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

Add: VisibleRegion class

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

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

* add MarkerCluster class

* Bug fix: Can not create an instance of BaseArrayClass

* Bug fix: the icons property of MarkerClusterOptions

* Bug fix: the zoom option is missing

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

* Update index.ts

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

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

* remove test file

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

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

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

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

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

* save

* Remove the instance of wrapper class if the JS instance is removed.
2017-10-05 23:20:40 -04:00
Serge S. Gulin
247efa656a Use RxJS 5.4.2 to fix generics checking in TS 2.4.1 2017-07-13 11:42:17 +04:00
14 changed files with 7647 additions and 48 deletions

View File

@@ -1,3 +1,21 @@
<a name="4.3.1"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.2) (2017-10-06)
### Bug Fixes
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
<a name="4.3.0"></a>
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
@@ -6,6 +24,7 @@
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
@@ -30,16 +49,6 @@
<a name="4.2.1"></a>
## [4.2.1](https://github.com/ionic-team/ionic-native/compare/v4.2.0...v4.2.1) (2017-08-29)
### Bug Fixes
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
<a name="4.2.0"></a>
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
@@ -1789,13 +1798,13 @@ The whole implementation has changed now. You must update your code.
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
### Features
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))

View File

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

7290
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -24,6 +24,7 @@ import { Injectable } from '@angular/core';
* getUrl() {
* return this.url;
* }
* // DATABASES //
* createDatabase(database_name:string) {
* let url = this.getUrl();
* url = url+database_name;
@@ -34,7 +35,6 @@ import { Injectable } from '@angular/core';
* return Observable.throw(error.json() || 'Couchbase Lite error');
* })
* }
*
* deleteDatabase(database_name:string) {
* let url = this.getUrl();
* url = url+database_name;
@@ -58,8 +58,6 @@ import { Injectable } from '@angular/core';
* }
*
*
*
*
* ```
*/
@Plugin({

View File

@@ -71,10 +71,10 @@ export class Firebase extends IonicNativePlugin {
/**
* Check permission to receive push notifications
* @return {Promise<any>}
* @return {Promise<{isEnabled: boolean}>}
*/
@Cordova()
hasPermission(): Promise<any> { return; }
hasPermission(): Promise<{isEnabled: boolean}> { return; }
/**
* Set icon badge number. Set to 0 to clear the badge.

View File

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

View File

@@ -443,7 +443,7 @@ export class VisibleRegion implements ILatLngBounds {
* @hidden
* You can listen to these events where appropriate
*/
export const GoogleMapsEvent: { [eventName: string]: string; } = {
export const GoogleMapsEvent = {
MAP_READY: 'map_ready',
MAP_LOADED: 'map_loaded',
MAP_CLICK: 'map_click',
@@ -610,7 +610,7 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = {
pluginRef: 'plugin.google.maps',
plugin: 'cordova-plugin-googlemaps',
repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps',
install: 'ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"',
install: 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"',
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'],
platforms: ['Android', 'iOS']
})
@@ -656,6 +656,21 @@ export class BaseClass {
if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) {
if (args[args.length - 1].type === 'Map') {
args[args.length - 1] = this;
} else if (this instanceof MarkerCluster) {
let overlay: Marker = this.get(args[args.length - 1].getId());
if (!overlay) {
let markerJS: any = args[args.length - 1];
let markerCluster: MarkerCluster = <MarkerCluster>this;
overlay = new Marker(markerCluster.getMap(), markerJS);
this.get('_overlays').push(markerJS.getId());
this.set(markerJS.getId(), overlay);
markerJS.one(markerJS.getId() + '_remove', () => {
let idx = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerJS.getId(), undefined);
});
}
args[args.length - 1] = overlay;
} else {
args[args.length - 1] = this._objectInstance.getMap().get(args[args.length - 1].getId());
}
@@ -677,6 +692,21 @@ export class BaseClass {
if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) {
if (args[args.length - 1].type === 'Map') {
args[args.length - 1] = this;
} else if (this instanceof MarkerCluster) {
let overlay: Marker = this.get(args[args.length - 1].getId());
if (!overlay) {
let markerJS: any = args[args.length - 1];
let markerCluster: MarkerCluster = <MarkerCluster>this;
overlay = new Marker(markerCluster.getMap(), markerJS);
this.get('_overlays').push(markerJS.getId());
this.set(markerJS.getId(), overlay);
markerJS.one(markerJS.getId() + '_remove', () => {
let idx = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerJS.getId(), undefined);
});
}
args[args.length - 1] = overlay;
} else {
args[args.length - 1] = this._objectInstance.getMap().get(args[args.length - 1].getId());
}
@@ -723,6 +753,21 @@ export class BaseClass {
if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) {
if (args[args.length - 1].type === 'Map') {
args[args.length - 1] = this;
} else if (this instanceof MarkerCluster) {
let overlay: Marker = this.get(args[args.length - 1].getId());
if (!overlay) {
let markerJS: any = args[args.length - 1];
let markerCluster: MarkerCluster = <MarkerCluster>this;
overlay = new Marker(markerCluster.getMap(), markerJS);
this.get('_overlays').push(markerJS.getId());
this.set(markerJS.getId(), overlay);
markerJS.one(markerJS.getId() + '_remove', () => {
let idx = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerJS.getId(), undefined);
});
}
args[args.length - 1] = overlay;
} else {
args[args.length - 1] = this._objectInstance.getMap().get(args[args.length - 1].getId());
}
@@ -744,6 +789,21 @@ export class BaseClass {
if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) {
if (args[args.length - 1].type === 'Map') {
args[args.length - 1] = this;
} else if (this instanceof MarkerCluster) {
let overlay: Marker = this.get(args[args.length - 1].getId());
if (!overlay) {
let markerJS: any = args[args.length - 1];
let markerCluster: MarkerCluster = <MarkerCluster>this;
overlay = new Marker(markerCluster.getMap(), markerJS);
this.get('_overlays').push(markerJS.getId());
this.set(markerJS.getId(), overlay);
markerJS.one(markerJS.getId() + '_remove', () => {
let idx = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerJS.getId(), undefined);
});
}
args[args.length - 1] = overlay;
} else {
args[args.length - 1] = this._objectInstance.getMap().get(args[args.length - 1].getId());
}
@@ -1567,9 +1627,15 @@ export class GoogleMap extends BaseClass {
return new Promise<Marker>((resolve, reject) => {
this._objectInstance.addMarker(options, (marker: any) => {
if (marker) {
let markerId: string = marker.getId();
const overlay: Marker = new Marker(this, marker);
this.get('_overlays').push(marker.getId());
this.set(marker.getId(), overlay);
this.get('_overlays').push(markerId);
this.set(markerId, overlay);
marker.one(markerId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerId, undefined);
});
resolve(overlay);
} else {
reject();
@@ -1586,6 +1652,12 @@ export class GoogleMap extends BaseClass {
const overlay = new MarkerCluster(this, markerCluster);
this.get('_overlays').push(markerCluster.getId());
this.set(markerCluster.getId(), overlay);
markerCluster.one('remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(markerCluster.getId(), undefined);
});
markerCluster.set('_overlays', new BaseArrayClass());
resolve(overlay);
} else {
reject();
@@ -1603,9 +1675,15 @@ export class GoogleMap extends BaseClass {
return new Promise<Circle>((resolve, reject) => {
this._objectInstance.addCircle(options, (circle: any) => {
if (circle) {
let circleId: string = circle.getId();
const overlay = new Circle(this, circle);
this.get('_overlays').push(circle.getId());
this.set(circle.getId(), overlay);
this.get('_overlays').push(circleId);
this.set(circleId, overlay);
circle.one(circleId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(circleId, undefined);
});
resolve(overlay);
} else {
reject();
@@ -1623,10 +1701,16 @@ export class GoogleMap extends BaseClass {
return new Promise<Polygon>((resolve, reject) => {
this._objectInstance.addPolygon(options, (polygon: any) => {
if (polygon) {
let polygonId: string = polygon.getId();
const overlay = new Polygon(this, polygon);
this.get('_overlays').push(polygon.getId());
this.set(polygon.getId(), overlay);
resolve(polygon);
this.get('_overlays').push(polygonId);
this.set(polygonId, overlay);
polygon.one(polygonId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(polygonId, undefined);
});
resolve(overlay);
} else {
reject();
}
@@ -1643,9 +1727,15 @@ export class GoogleMap extends BaseClass {
return new Promise<Polyline>((resolve, reject) => {
this._objectInstance.addPolyline(options, (polyline: any) => {
if (polyline) {
let polylineId: string = polyline.getId();
const overlay = new Polyline(this, polyline);
this.get('_overlays').push(polyline.getId());
this.set(polyline.getId(), overlay);
this.get('_overlays').push(polylineId);
this.set(polylineId, overlay);
polyline.one(polylineId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(polylineId, undefined);
});
resolve(overlay);
} else {
reject();
@@ -1662,9 +1752,15 @@ export class GoogleMap extends BaseClass {
return new Promise<TileOverlay>((resolve, reject) => {
this._objectInstance.addTileOverlay(options, (tileOverlay: any) => {
if (tileOverlay) {
let tileOverlayId: string = tileOverlay.getId();
const overlay = new TileOverlay(this, tileOverlay);
this.get('_overlays').push(tileOverlay.getId());
this.set(tileOverlay.getId(), overlay);
this.get('_overlays').push(tileOverlayId);
this.set(tileOverlayId, overlay);
tileOverlay.one(tileOverlayId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(tileOverlayId, undefined);
});
resolve(overlay);
} else {
reject();
@@ -1681,9 +1777,15 @@ export class GoogleMap extends BaseClass {
return new Promise<GroundOverlay>((resolve, reject) => {
this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => {
if (groundOverlay) {
let groundOverlayId: string = groundOverlay.getId();
const overlay = new GroundOverlay(this, groundOverlay);
this.get('_overlays').push(groundOverlay.getId());
this.set(groundOverlay.getId(), overlay);
this.get('_overlays').push(groundOverlayId);
this.set(groundOverlayId, overlay);
groundOverlay.one(groundOverlayId + '_remove', () => {
let idx: number = this.get('_overlays').indexOf(overlay);
this.get('_overlays').removeAt(idx);
this.set(groundOverlayId, undefined);
});
resolve(overlay);
} else {
reject();
@@ -2141,6 +2243,7 @@ export class MarkerCluster extends BaseClass {
@InstanceCheck()
remove(): void {
this._objectInstance.set('_overlays', undefined);
this._objectInstance.getMap().get('_overlays').set(this.getId(), undefined);
this._objectInstance.remove();
this.destroy();

View File

@@ -165,7 +165,7 @@ export interface OSNotificationPayload {
/**
* URL to open when opening the notification.
*/
launchUrl?: string;
launchURL?: string;
/**
* Sound resource to play when the notification is shown.
*/

View File

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

View File

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

View File

@@ -13,7 +13,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
*
* let license; // read regula.license file
* RegulaDocumentReader.scanDocument(license).then((result) => {
* RegulaDocumentReader.initReader(license); // initialize reader
* RegulaDocumentReader.scanDocument().then((result) => {
* // read result
* })
* ```
@@ -23,17 +24,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
plugin: 'cordova-plugin-documentreader',
pluginRef: 'DocumentReader',
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
platforms: ['iOS'],
platforms: ['iOS', 'Android'],
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
})
@Injectable()
export class RegulaDocumentReader extends IonicNativePlugin {
/**
* Run the scanner
* Initialize the scanner
* @param license {any} License data
*/
@Cordova()
initReader(license: any): void {}
/**
* Run the scanner
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
*/
@Cordova()
scanDocument(license: any): Promise<string[]> { return; }
scanDocument(): Promise<string[]> { return; }
}