Compare commits

...

54 Commits

Author SHA1 Message Date
Raman Rasliuk
a2d33963b1 feat(http): use a different plugin source with better features (#1921) 2017-08-26 03:57:23 -04:00
Leonardo Ruhland
332f9aefe5 docs(safariview): usage fix (#1923)
The show method returns a Observable, not a Promise.
2017-08-26 03:55:06 -04:00
Heather Lemieux
4942b88873 docs(google-maps): update docs (#1833)
Since the new googlemaps plugin uses the native code, you need to wait for the platform to be ready before loading the map.
2017-08-26 03:53:57 -04:00
frank10gm
39ec5158a0 fix(google-maps): add missing debug option (#1832)
added debug option to TileOverlayOptions.
2017-08-26 03:51:39 -04:00
Masashi Katsumata
c11aec33a7 feat(google-maps): update plugin and fix a few issues (#1834)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

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

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

* Remove `@CordovaInstance` decorators from getMap()

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

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

* Fix: tslint error

* Fix: tslint error

* No more isAvailable() method.

* Bug fix: description is incorrect

* Bug fix: example code was wrong.

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

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

* Bug fix: HtmlInfoWindow does not work

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

* Bug fix: map.setDiv()

* Bug fix: HtmlInfoWindow does not work

* Bug fix: BaseArrayClass definition is incorrect

* Bug fix: BaseArrayClass constructor is wrong

* Bug fix: Geocoder class does not work

* Bug fix: LatLngBounds constructor is wrong

* update: noNotify option is not declared

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

* Update: clarify acceptable parameters of BaseArrayClass

* Add: AnimateCameraOption.padding is missing

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

* Add `destruct` option to the CordovaOption.

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

* A semicolon is mixing

* update: event names

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

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

* Build for working group

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

* Bug fix: The definition of VisibleRegion interface is incorrect

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

Add: VisibleRegion class

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

* Fix: map.fromLatLngToPoint()

* Ignore the dist directory on the master branch

* Remove the dist folder on the master branch

* fixes and tweaks

* use union types for CameraPosition

fixes issue mentioned on slack by @wf9a5m75

* fix types

* update AnimateCameraOptions interface

* remove AnimateCameraOptions interface

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

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

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

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

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

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

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

* add district

* update NativeGeocoderReverseResult & refactor code

* delete plugins

* delete index.ts
2017-08-23 19:35:51 -04:00
Ibby Hadeed
fe02c84fd9 clean up 2017-08-23 19:34:55 -04:00
Moamen Mostafa
a2cc1870b4 feat(keychain-touch-id): add KeychainTouchId plugin (#1837) 2017-08-23 19:33:12 -04:00
Ibby Hadeed
1c6a3a3bc5 update package-lock 2017-08-23 19:31:23 -04:00
Robert Coie
0c097ba2be fix(sqlite): add optional key parameter to SQLiteDatabaseConfig to support sqlcipher-adapter (#1917) 2017-08-23 19:21:57 -04:00
Animesh Kumar
0dd507ff03 docs(): fix typo (#1914)
corrected `to` to `two` on line number 14
2017-08-23 19:21:25 -04:00
Ibby Hadeed
9ab458bba2 chore(): update changelog 2017-07-21 01:16:05 -04:00
Ibby Hadeed
7e900dae22 4.1.0 2017-07-21 01:15:59 -04:00
Ibby Hadeed
0fa82e5c56 feat(open-native-settings): add Open Native Settings plugin
closes #1821
2017-07-21 01:15:51 -04:00
Ibby Hadeed
4af3d5bcc1 fix(media): add setRate method
closes #1825
2017-07-21 01:07:38 -04:00
Masashi Katsumata
976401a4e9 feat(google-maps): add missing features and fix wrong definitions (#1815)
* Update index.ts

* Update index.ts

* Add missing features, and bug fix of methods

* update: classname must be in pascal case

* remove: duplicated class definition

* export encode and spherical static classes

* Add comma

* Fix Encoding and Spherical

* Add convenience methods

* Fix decorators for Encoding and Spherical

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

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

* Remove `@CordovaInstance` decorators from getMap()

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

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

* Fix: tslint error

* Fix: tslint error

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

* feat(HyperTrack): fix getOrCreateUser()

* docs(HyperTrack): add note about publishable key

* feat(HyperTrack): add requestPermissions

* feat(HyperTrack): add startTracking

* docs(HyperTrack): add usage for calls

* feat(HyperTrack): add stopTracking

* docs(HyperTrack): add stopTracking note

* feat(HyperTrack): add setUserId

* feat(HyperTrack): add getCurrentLocation

* style(HyperTrack): reorder functions

* feat(HyperTrack): add createAndAssignAction

* feat(HyperTrack): add completeAction

* feat(HyperTrack): add completeActionWithLookupId

* feat(HyperTrack): add checkLocationPermission

* docs(HyperTrack): add usage for requestPermissions

* docs(HyperTrack): add android note

* feat(HyperTrack): add checkLocationServices

* feat(HyperTrack): add requestLocationServices

* feat(HyperTrack): add base implementation for HyperTrack

* feat(HyperTrack): fix getOrCreateUser()

* docs(HyperTrack): add note about publishable key

* feat(HyperTrack): add requestPermissions

* feat(HyperTrack): add startTracking

* docs(HyperTrack): add usage for calls

* feat(HyperTrack): add stopTracking

* docs(HyperTrack): add stopTracking note

* feat(HyperTrack): add setUserId

* feat(HyperTrack): add getCurrentLocation

* style(HyperTrack): reorder functions

* feat(HyperTrack): add createAndAssignAction

* feat(HyperTrack): add completeAction

* feat(HyperTrack): add completeActionWithLookupId

* feat(HyperTrack): add checkLocationPermission

* docs(HyperTrack): add usage for requestPermissions

* docs(HyperTrack): add android note

* feat(HyperTrack): add checkLocationServices

* feat(HyperTrack): add requestLocationServices

* docs(HyperTrack): Fix plugin usage

* fix(HyperTrack): helloWorld param and docs

* docs(HyperTrack): document all functions

* docs(HyperTrack): move all usage documentation up

* docs(HyperTrack): fix documentation

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

* Fix some doc typos (#1)

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

* Fix another issue with a missing closing code fence in the same plugin file
2017-07-13 12:41:53 -05:00
Ibby Hadeed
238e2ab26c tests(): add test to verify new way of creating classes 2017-07-12 14:06:06 -04:00
Ibby Hadeed
146c823f2a refactor(): remove unused import 2017-07-11 17:29:17 -04:00
Ibby Hadeed
1b55513bc4 docs(clipboard): update plugin source 2017-07-11 10:43:26 -04:00
Ibby Hadeed
953841681c feat(launch-navigator): update plugin wrapper to support v4
closes #1738
2017-07-11 10:38:22 -04:00
Ibby Hadeed
76a45a3834 refactor(launch-navigator): move constants to the top of the class 2017-07-11 10:29:26 -04:00
Ibby Hadeed
eff9bc376c refactor(action-sheet): add values for ANDROID_THEMES to prevent errors in dev environments 2017-07-11 10:04:10 -04:00
Ibby Hadeed
b9993c24f0 docs(image-picker): add npm package instead of git repo
closes #1787
2017-07-11 09:58:07 -04:00
Ibby Hadeed
9752c865fc docs(): hide AuthenticationContext class 2017-07-11 09:39:09 -04:00
Ibby Hadeed
4c4cf76f7a docs(): hide IAPError class 2017-07-11 09:37:32 -04:00
Ibby Hadeed
70cbcbf1e9 docs(google-maps): add temporary note to notify about 4.x changes 2017-07-11 09:29:12 -04:00
42 changed files with 4490 additions and 1626 deletions

2
.gitignore vendored
View File

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

View File

@@ -1,3 +1,39 @@
<a name="4.1.0"></a>
# [4.1.0](https://github.com/ionic-team/ionic-native/compare/v4.0.1...v4.1.0) (2017-07-21)
### Bug Fixes
* **media:** add setRate method ([4af3d5b](https://github.com/ionic-team/ionic-native/commit/4af3d5b)), closes [#1825](https://github.com/ionic-team/ionic-native/issues/1825)
### Features
* **firebase:** add unregister method ([#1823](https://github.com/ionic-team/ionic-native/issues/1823)) ([6230958](https://github.com/ionic-team/ionic-native/commit/6230958))
* **google-maps:** add missing features and fix wrong definitions ([#1815](https://github.com/ionic-team/ionic-native/issues/1815)) ([976401a](https://github.com/ionic-team/ionic-native/commit/976401a))
* **hyper-track:** add HyperTrack plugin ([#1816](https://github.com/ionic-team/ionic-native/issues/1816)) ([47fa44c](https://github.com/ionic-team/ionic-native/commit/47fa44c))
* **open-native-settings:** add Open Native Settings plugin ([0fa82e5](https://github.com/ionic-team/ionic-native/commit/0fa82e5)), closes [#1821](https://github.com/ionic-team/ionic-native/issues/1821)
<a name="4.0.1"></a>
## [4.0.1](https://github.com/ionic-team/ionic-native/compare/v4.0.0...v4.0.1) (2017-07-15)
### Bug Fixes
* **media:** fix success/error/statusUpdate observables ([7105048](https://github.com/ionic-team/ionic-native/commit/7105048)), closes [#1806](https://github.com/ionic-team/ionic-native/issues/1806)
* **social-sharing:** fix issues caused by omitting optional params ([25c1cf4](https://github.com/ionic-team/ionic-native/commit/25c1cf4)), closes [#1805](https://github.com/ionic-team/ionic-native/issues/1805)
### Features
* **camera:** add enums for camera options ([6061af6](https://github.com/ionic-team/ionic-native/commit/6061af6))
* **launch-navigator:** update plugin wrapper to support v4 ([9538416](https://github.com/ionic-team/ionic-native/commit/9538416)), closes [#1738](https://github.com/ionic-team/ionic-native/issues/1738)
* **media:** add MEDIA_STATUS and MEDIA_ERROR enums ([1decedd](https://github.com/ionic-team/ionic-native/commit/1decedd))
<a name="4.0.0"></a>
# [4.0.0](https://github.com/ionic-team/ionic-native/compare/v3.14.0...v4.0.0) (2017-07-11)

3572
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -186,7 +186,7 @@ docType: "<$ doc.docType $>"
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
<ol class="installation">
<li>Install the Cordova and Ionic Native plugins:<br>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '&lt;').replace('>', '&gt;') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install --save @ionic-native/<$ doc.npmId $>
</code></pre>
</li>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -107,6 +107,13 @@ export class Firebase extends IonicNativePlugin {
@Cordova()
unsubscribe(topic: string): Promise<any> { return; }
/**
* Unregister from firebase, used to stop receiving push notifications.
* Call this when you logout user from your app.
*/
@Cordova()
unregister(): Promise<any> { return; }
/**
* Log an event using Analytics
* @param type {string}

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin, InstanceProperty } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
@@ -8,7 +8,55 @@ import { Observer } from 'rxjs/Observer';
*/
export class MediaObject {
constructor(private _objectInstance: any, public onSuccess: Observable<any>, public onError: Observable<any>, public onStatusUpdate: Observable<any>) {}
/**
* An observable that notifies you on actions success
*/
onSuccess: Observable<any>;
/**
* An observable that notifies you when an error occurs
*/
onError: Observable<MEDIA_ERROR>;
/**
* An observable that notifies you when the file status changes
*/
onStatusUpdate: Observable<MEDIA_STATUS>;
/**
* @hidden
*/
@InstanceProperty
successCallback: Function;
/**
* @hidden
*/
@InstanceProperty
errorCallback: Function;
/**
* @hidden
*/
@InstanceProperty
statusCallback: Function;
constructor(private _objectInstance: any) {
this.onSuccess = new Observable<any>((observer: Observer<any>) => {
this.successCallback = observer.next.bind(observer);
return () => this.successCallback = () => {};
});
this.onError = new Observable<MEDIA_ERROR>((observer: Observer<MEDIA_ERROR>) => {
this.errorCallback = observer.next.bind(observer);
return () => this.errorCallback = () => {};
});
this.onStatusUpdate = new Observable<MEDIA_STATUS>((observer: Observer<MEDIA_STATUS>) => {
this.statusCallback = observer.next.bind(observer);
return () => this.statusCallback = () => {};
});
}
/**
* Get the current amplitude of the current recording.
@@ -66,6 +114,9 @@ export class MediaObject {
@CordovaInstance({ sync: true })
setVolume(volume: number): void { }
@CordovaInstance({ sync: true })
setRate(speedRate: number): void {}
/**
* Starts recording an audio file.
*/
@@ -114,6 +165,21 @@ export interface MediaError {
}
export enum MEDIA_STATUS {
NONE = 0,
STARTING,
RUNNING,
PAUSED,
STOPPED
}
export enum MEDIA_ERROR {
ABORTED = 1,
NETWORK,
DECODE,
SUPPORTED
}
export type MediaErrorCallback = (error: MediaError) => void;
/**
@@ -266,39 +332,17 @@ export class Media extends IonicNativePlugin {
/**
* Open a media file
* @param src {string} A URI containing the audio content.
* @param [onStatusUpdate] {MediaStatusUpdateCallback} A callback function to be invoked when the status of the file changes
* @param [onSuccess] {Function} A callback function to be invoked after the current play, record, or stop action is completed
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
* @return {MediaObject}
*/
create(src: string): MediaObject {
let instance: any,
onSuccess: Function,
onError: Function,
onStatusUpdate: Function;
const onSuccessObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
onSuccess = observer.next.bind(observer);
return () => {};
}),
onErrorObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
onError = observer.next.bind(observer);
return () => {};
}),
onStatusUpdateObservable: Observable<any> = new Observable<any>((observer: Observer<any>) => {
onStatusUpdate = observer.next.bind(observer);
return () => {};
});
let instance: any;
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
// Creates a new media object
instance = new (Media.getPlugin())(src, onSuccess, onError, onStatusUpdate);
instance = new (Media.getPlugin())(src);
}
return new MediaObject(instance, onSuccessObservable, onErrorObservable, onStatusUpdateObservable);
return new MediaObject(instance);
}
}

View File

@@ -106,6 +106,9 @@ export class MSAdal extends IonicNativePlugin {
}
/**
* @hidden
*/
export class AuthenticationContext {
@InstanceProperty
@@ -134,7 +137,7 @@ export class AuthenticationContext {
@CordovaInstance({
otherPromise: true
})
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
/**
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
@@ -149,6 +152,6 @@ export class AuthenticationContext {
@CordovaInstance({
otherPromise: true
})
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId: string): Promise<AuthenticationResult> { return; }
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise<AuthenticationResult> { return; }
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var window: any;
declare const window: any;
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
@@ -188,10 +188,25 @@ export interface AndroidPushOptions {
topics?: string[];
}
export interface BrowserPushOptions {
/**
* Optional. Your GCM API key if you are using VAPID keys.
*/
applicationServerKey?: string;
/**
* URL for the push server you want to use.
* Default: http://push.api.phonegap.com/v1/push Optional.
*/
pushServiceURL?: string;
}
export interface PushOptions {
ios?: IOSPushOptions;
android?: AndroidPushOptions;
windows?: any;
browser?: BrowserPushOptions;
}
export type PushEvent = 'registration' | 'error' | 'notification';
@@ -237,7 +252,10 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* badge: true,
* sound: 'false'
* },
* windows: {}
* windows: {},
* browser: {
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
* }
* };
*
* const pushObject: PushObject = this.push.init(options);
@@ -257,6 +275,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
* NotificationEventAdditionalData
* IOSPushOptions
* AndroidPushOptions
* BrowserPushOptions
* PushOptions
*/
@Plugin({

View File

@@ -38,7 +38,7 @@ export interface SafariViewControllerOptions {
* enterReaderModeIfAvailable: true,
* tintColor: '#ff0000'
* })
* .then((result: any) => {
* .subscribe((result: any) => {
* if(result.event === 'opened') console.log('Opened');
* else if(result.event === 'loaded') console.log('Loaded');
* else if(result.event === 'closed') console.log('Closed');

View File

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

View File

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

View File

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

View File

@@ -20,6 +20,10 @@ export interface SQLiteDatabaseConfig {
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
*/
createFromLocation?: number;
/**
* support encrypted databases with https://github.com/litehelpers/Cordova-sqlcipher-adapter
*/
key?: string;
}
/**

View File

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