mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0bb4cfeff | ||
|
|
445570c241 | ||
|
|
1b161d8c9e | ||
|
|
074d16605d | ||
|
|
4841f31a92 | ||
|
|
0c0456ada6 | ||
|
|
dac013fe7b | ||
|
|
965d742bb6 | ||
|
|
4f85110f75 | ||
|
|
8bd906c1a7 | ||
|
|
46e3a0ecb3 | ||
|
|
6ee645a976 | ||
|
|
3a1a3ceabc | ||
|
|
29de6b394e | ||
|
|
6f625f9222 | ||
|
|
de14b0ea15 | ||
|
|
e55c0c3e15 | ||
|
|
1dbfd70724 | ||
|
|
4059035050 | ||
|
|
b4b3ec0d2a | ||
|
|
d03ff962e3 | ||
|
|
af5d4ad87f | ||
|
|
453374d4e7 | ||
|
|
daa6d4cbb9 | ||
|
|
2996da65c3 | ||
|
|
b5a2ffc6a5 | ||
|
|
2fe37c461c | ||
|
|
be1725d2eb | ||
|
|
a1ce39dfda | ||
|
|
0cb79d1cd1 | ||
|
|
e8f4b08f66 | ||
|
|
cdf9cdef54 | ||
|
|
72ec500ffd | ||
|
|
c23f5e90dc | ||
|
|
0315e63782 | ||
|
|
9a28b24a0b | ||
|
|
5c72340a37 | ||
|
|
360888563f | ||
|
|
b8a513301e | ||
|
|
4f0cd24476 | ||
|
|
00d35c636b | ||
|
|
e150224cda | ||
|
|
fa4721319e | ||
|
|
6229d4932e | ||
|
|
7c20bddd17 | ||
|
|
2b4e318072 | ||
|
|
dd97df19fe | ||
|
|
9eb63a0d74 | ||
|
|
ba20dbe590 | ||
|
|
b8be1de068 | ||
|
|
592feb409e | ||
|
|
4a38c02c14 | ||
|
|
d84b83b42c | ||
|
|
38cea9da27 | ||
|
|
da28af024c | ||
|
|
c69f8203ff | ||
|
|
eee5fd0c17 | ||
|
|
ef960c8aec | ||
|
|
f2f3741819 | ||
|
|
e802571726 | ||
|
|
644e999d1e | ||
|
|
5a14ec01ef | ||
|
|
3a6210873e | ||
|
|
25fab64e3f |
89
CHANGELOG.md
89
CHANGELOG.md
@@ -1,3 +1,92 @@
|
||||
<a name="1.3.7"></a>
|
||||
## [1.3.7](https://github.com/driftyco/ionic-native/compare/v1.3.6...v1.3.7) (2016-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **contacts:** missing name property, types ([#320](https://github.com/driftyco/ionic-native/issues/320)) ([074d166](https://github.com/driftyco/ionic-native/commit/074d166))
|
||||
* **geolocation:** handle errors on watchPosition ([1b161d8](https://github.com/driftyco/ionic-native/commit/1b161d8)), closes [#322](https://github.com/driftyco/ionic-native/issues/322)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **sim:** Add sim plugin ([#317](https://github.com/driftyco/ionic-native/issues/317)) ([4f85110](https://github.com/driftyco/ionic-native/commit/4f85110))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.6"></a>
|
||||
## [1.3.6](https://github.com/driftyco/ionic-native/compare/v1.3.5...v1.3.6) (2016-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** able to pass array of LatLng to GoogleMapsLatLngBounds constructor ([de14b0e](https://github.com/driftyco/ionic-native/commit/de14b0e)), closes [#298](https://github.com/driftyco/ionic-native/issues/298)
|
||||
* **launch-navigator:** fix the navigate function wrapper to match latest plugin API ([6f625f9](https://github.com/driftyco/ionic-native/commit/6f625f9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **camera-preview:** add wrapper for camera-preview ([#301](https://github.com/driftyco/ionic-native/issues/301)) ([3a1a3ce](https://github.com/driftyco/ionic-native/commit/3a1a3ce))
|
||||
* **launch-navigator:** add new methods and constants to match latest plugin API ([29de6b3](https://github.com/driftyco/ionic-native/commit/29de6b3))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.5"></a>
|
||||
## [1.3.5](https://github.com/driftyco/ionic-native/compare/v1.3.4...v1.3.5) (2016-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ibeacon:** minor fixes ([b5a2ffc](https://github.com/driftyco/ionic-native/commit/b5a2ffc))
|
||||
* **safari-view-controller:** fix wrappers ([b4b3ec0](https://github.com/driftyco/ionic-native/commit/b4b3ec0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **googlemaps:** add Geocoder class ([#292](https://github.com/driftyco/ionic-native/issues/292)) ([2996da6](https://github.com/driftyco/ionic-native/commit/2996da6)), closes [#280](https://github.com/driftyco/ionic-native/issues/280)
|
||||
* **media-capture:** add media capture plugin ([#293](https://github.com/driftyco/ionic-native/issues/293)) ([daa6d4c](https://github.com/driftyco/ionic-native/commit/daa6d4c)), closes [#272](https://github.com/driftyco/ionic-native/issues/272)
|
||||
* **nativestorage:** add NativeStorage plugin wrapper ([af5d4ad](https://github.com/driftyco/ionic-native/commit/af5d4ad))
|
||||
* **pin-dialog:** add pin dialog plugin ([#291](https://github.com/driftyco/ionic-native/issues/291)) ([2fe37c4](https://github.com/driftyco/ionic-native/commit/2fe37c4))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.4"></a>
|
||||
## [1.3.4](https://github.com/driftyco/ionic-native/compare/v1.3.3...v1.3.4) (2016-07-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **touchid:** make isAvailable static ([c23f5e9](https://github.com/driftyco/ionic-native/commit/c23f5e9))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* **changelog:** old changelog ([0cb79d1](https://github.com/driftyco/ionic-native/commit/0cb79d1))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.3"></a>
|
||||
## [1.3.3](https://github.com/driftyco/ionic-native/compare/v1.3.2...v1.3.3) (2016-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove unnecessary decorator ([#257](https://github.com/driftyco/ionic-native/issues/257)) ([25fab64](https://github.com/driftyco/ionic-native/commit/25fab64))
|
||||
* **actionsheet:** add missing optional parameter for hide function ([#262](https://github.com/driftyco/ionic-native/issues/262)) ([644e999](https://github.com/driftyco/ionic-native/commit/644e999))
|
||||
* **background-geolocation:** fix pluginref again ([b8a5133](https://github.com/driftyco/ionic-native/commit/b8a5133))
|
||||
* **geolocation:** fix plugin reference ([4f0cd24](https://github.com/driftyco/ionic-native/commit/4f0cd24)), closes [#258](https://github.com/driftyco/ionic-native/issues/258)
|
||||
* **googlemaps:** use correct methods for addGroundOverlay and addKmlOverlay ([#268](https://github.com/driftyco/ionic-native/issues/268)) ([b8be1de](https://github.com/driftyco/ionic-native/commit/b8be1de))
|
||||
* **socialsharing:** all methods return Promises now ([e150224](https://github.com/driftyco/ionic-native/commit/e150224)), closes [#275](https://github.com/driftyco/ionic-native/issues/275)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ibeacon:** add iBeacon plugin support ([#270](https://github.com/driftyco/ionic-native/issues/270)) ([dd97df1](https://github.com/driftyco/ionic-native/commit/dd97df1))
|
||||
* **onesignal:** added wrapper for the Cordova OneSignal Plugin ([#252](https://github.com/driftyco/ionic-native/issues/252)) ([ba20dbe](https://github.com/driftyco/ionic-native/commit/ba20dbe))
|
||||
* **push:** added support for Action Buttons on iOS with categories ([#273](https://github.com/driftyco/ionic-native/issues/273)) ([592feb4](https://github.com/driftyco/ionic-native/commit/592feb4))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.2"></a>
|
||||
## [1.3.2](https://github.com/driftyco/ionic-native/compare/v1.3.1...v1.3.2) (2016-06-27)
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
|
||||
## Feature request?
|
||||
Have a plugin you'd like to see supported? Because Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whichever plugin you'd like to add.
|
||||
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
|
||||
|
||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||
|
||||
## Having an issue?
|
||||
## Have an issue?
|
||||
#### There are no rules, but here are a few things to consider:
|
||||
###### Before you submit an issue:
|
||||
* Do a quick search to see if there are similar issues
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.7",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
|
||||
@@ -5,15 +5,20 @@ module.exports = function removePrivateMembers() {
|
||||
$runAfter: ['tags-parsed'],
|
||||
$runBefore: ['rendering-docs'],
|
||||
$process: function(docs) {
|
||||
docs.forEach(function(doc){
|
||||
docs.forEach(function(doc) {
|
||||
if (doc.members) {
|
||||
doc.members = doc.members.filter(function(member){
|
||||
return !member.tags.tagsByName.get("private");
|
||||
})
|
||||
doc.members = doc.members.filter(function(member) {
|
||||
return !member.tags.tagsByName.get('private');
|
||||
});
|
||||
}
|
||||
})
|
||||
if (doc.statics) {
|
||||
doc.statics = doc.statics.filter(function(staticMethod) {
|
||||
return !staticMethod.tags.tagsByName.get('private');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return docs;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'usage'}
|
||||
];
|
||||
|
||||
11
scripts/docs/templates/common.template.html
vendored
11
scripts/docs/templates/common.template.html
vendored
@@ -104,7 +104,7 @@ docType: "<$ doc.docType $>"
|
||||
|
||||
</h1>
|
||||
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
Improve this doc
|
||||
</a>
|
||||
|
||||
@@ -211,10 +211,12 @@ docType: "<$ doc.docType $>"
|
||||
<@- if method.decorators @>
|
||||
<@ for prop in method.decorators[0].argumentInfo @>
|
||||
<@ if prop.platforms @>
|
||||
<p>
|
||||
<b>Platforms:</b>
|
||||
<@- for platform in prop.platforms @>
|
||||
<code><$ platform $></code>
|
||||
<@ endfor -@>
|
||||
</p>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
@@ -276,6 +278,13 @@ docType: "<$ doc.docType $>"
|
||||
|
||||
<@- endif -@>
|
||||
|
||||
<@ block advanced @>
|
||||
<@- if doc.advanced -@>
|
||||
<h2><a class="anchor" name="advanced" href="#advanced"></a>Advanced</h2>
|
||||
<$ doc.advanced | marked $>
|
||||
<@- endif -@>
|
||||
<@ endblock @>
|
||||
|
||||
<!-- related link -->
|
||||
<@- if doc.see @>
|
||||
|
||||
|
||||
27
src/index.ts
27
src/index.ts
@@ -20,6 +20,7 @@ import {BLE} from './plugins/ble';
|
||||
import {BluetoothSerial} from './plugins/bluetoothserial';
|
||||
import {Calendar} from './plugins/calendar';
|
||||
import {Camera} from './plugins/camera';
|
||||
import {CameraPreview} from './plugins/camera-preview';
|
||||
import {CardIO} from './plugins/card-io';
|
||||
import {Clipboard} from './plugins/clipboard';
|
||||
import {Contacts} from './plugins/contacts';
|
||||
@@ -44,18 +45,24 @@ import {GoogleMap} from './plugins/googlemaps';
|
||||
import {GoogleAnalytics} from './plugins/googleanalytics';
|
||||
import {Hotspot} from './plugins/hotspot';
|
||||
import {Httpd} from './plugins/httpd';
|
||||
import {IBeacon} from './plugins/ibeacon';
|
||||
import {ImagePicker} from './plugins/imagepicker';
|
||||
import {InAppBrowser} from './plugins/inappbrowser';
|
||||
import {Insomnia} from './plugins/insomnia';
|
||||
import {Keyboard} from './plugins/keyboard';
|
||||
import {LaunchNavigator} from './plugins/launchnavigator';
|
||||
import {LocalNotifications} from './plugins/localnotifications';
|
||||
import {MediaCapture} from './plugins/media-capture';
|
||||
import {NativeStorage} from './plugins/nativestorage';
|
||||
import {MediaPlugin} from './plugins/media';
|
||||
import {Network, Connection} from './plugins/network';
|
||||
import {Network} from './plugins/network';
|
||||
import {OneSignal} from './plugins/onesignal';
|
||||
import {PinDialog} from './plugins/pin-dialog';
|
||||
import {Printer} from './plugins/printer';
|
||||
import {Push} from './plugins/push';
|
||||
import {SafariViewController} from './plugins/safari-view-controller';
|
||||
import {Screenshot} from './plugins/screenshot';
|
||||
import {Sim} from './plugins/sim';
|
||||
import {SMS} from './plugins/sms';
|
||||
import {SocialSharing} from './plugins/socialsharing';
|
||||
import {SpinnerDialog} from './plugins/spinnerdialog';
|
||||
@@ -79,13 +86,16 @@ export * from './plugins/datepicker';
|
||||
export * from './plugins/device';
|
||||
export * from './plugins/devicemotion';
|
||||
export * from './plugins/deviceorientation';
|
||||
export * from './plugins/filetransfer';
|
||||
export * from './plugins/googlemaps';
|
||||
export * from './plugins/httpd';
|
||||
export * from './plugins/ibeacon';
|
||||
export * from './plugins/imagepicker';
|
||||
export * from './plugins/inappbrowser';
|
||||
export * from './plugins/launchnavigator';
|
||||
export * from './plugins/localnotifications';
|
||||
export * from './plugins/media';
|
||||
export * from './plugins/media-capture';
|
||||
export * from './plugins/printer';
|
||||
export * from './plugins/push';
|
||||
export * from './plugins/safari-view-controller';
|
||||
@@ -105,8 +115,8 @@ export {
|
||||
Brightness,
|
||||
BLE,
|
||||
BluetoothSerial,
|
||||
CameraPreview,
|
||||
Clipboard,
|
||||
Connection,
|
||||
DBMeter,
|
||||
Deeplinks,
|
||||
DeviceAccounts,
|
||||
@@ -123,9 +133,13 @@ export {
|
||||
Hotspot,
|
||||
Insomnia,
|
||||
Keyboard,
|
||||
NativeStorage,
|
||||
Network,
|
||||
OneSignal,
|
||||
PinDialog,
|
||||
Screenshot,
|
||||
SocialSharing,
|
||||
Sim,
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
@@ -146,6 +160,7 @@ window['IonicNative'] = {
|
||||
AppVersion: AppVersion,
|
||||
Badge: Badge,
|
||||
BackgroundGeolocation: BackgroundGeolocation,
|
||||
BackgroundMode: BackgroundMode,
|
||||
BarcodeScanner: BarcodeScanner,
|
||||
Base64ToGallery: Base64ToGallery,
|
||||
BatteryStatus: BatteryStatus,
|
||||
@@ -154,9 +169,9 @@ window['IonicNative'] = {
|
||||
BluetoothSerial: BluetoothSerial,
|
||||
Calendar: Calendar,
|
||||
Camera: Camera,
|
||||
CameraPreview: CameraPreview,
|
||||
CardIO: CardIO,
|
||||
Clipboard: Clipboard,
|
||||
Connection: Connection,
|
||||
Contacts: Contacts,
|
||||
DatePicker: DatePicker,
|
||||
DBMeter: DBMeter,
|
||||
@@ -178,17 +193,23 @@ window['IonicNative'] = {
|
||||
GoogleAnalytics: GoogleAnalytics,
|
||||
Hotspot: Hotspot,
|
||||
Httpd: Httpd,
|
||||
IBeacon: IBeacon,
|
||||
ImagePicker: ImagePicker,
|
||||
InAppBrowser: InAppBrowser,
|
||||
Keyboard: Keyboard,
|
||||
LaunchNavigator: LaunchNavigator,
|
||||
LocalNotifications: LocalNotifications,
|
||||
MediaCapture: MediaCapture,
|
||||
MediaPlugin: MediaPlugin,
|
||||
NativeStorage: NativeStorage,
|
||||
Network: Network,
|
||||
Printer: Printer,
|
||||
Push: Push,
|
||||
OneSignal: OneSignal,
|
||||
PinDialog: PinDialog,
|
||||
SafariViewController: SafariViewController,
|
||||
Screenshot: Screenshot,
|
||||
Sim: Sim,
|
||||
SMS: SMS,
|
||||
SocialSharing: SocialSharing,
|
||||
SpinnerDialog: SpinnerDialog,
|
||||
|
||||
@@ -7,8 +7,10 @@ declare var window: any;
|
||||
* @usage
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
* ```
|
||||
* import {ThreeDeeTouch, ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch} from 'ionic-native';
|
||||
* import {ThreeDeeTouch} from 'ionic-native';
|
||||
*
|
||||
* // import for type completion on variables
|
||||
* import {ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch} from 'ionic-native';
|
||||
* ...
|
||||
*
|
||||
* ThreeDeeTouch.isAvailable().then(isAvailable => console.log("3D Touch available? " + isAvailable)):
|
||||
@@ -48,6 +50,15 @@ declare var window: any;
|
||||
* }
|
||||
* ];
|
||||
* ThreeDeeTouch.configureQuickActions(actions);
|
||||
*
|
||||
* ThreeDeeTouchForceTouch.onHomeIconPressed().subscribe(
|
||||
* (payload) => {
|
||||
* // returns an object that is the button you presed
|
||||
* console.log(`Pressed the ${payload.title} button`)
|
||||
* console.log(payload.type)
|
||||
*
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -74,6 +85,13 @@ export class ThreeDeeTouch {
|
||||
})
|
||||
static watchForceTouches(): Observable<ThreeDeeTouchForceTouch> {return; }
|
||||
|
||||
/**
|
||||
* setup the 3D-touch actions, takes an array of objects with the following
|
||||
* @param {string} type (optional) A type that can be used `onHomeIconPressed` callback
|
||||
* @param {string} title Title for your action
|
||||
* @param {string} subtitle (optional) A short description for your action
|
||||
* @param {string} iconType (optional) Choose between Prohibit, Contact, Home, MarkLocation, Favorite, Love, Cloud, Invitation, Confirmation, Mail, Message, Date, Time, CapturePhoto, CaptureVideo, Task, TaskCompleted, Alarm, Bookmark, Shuffle, Audio, Update
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
@@ -83,9 +101,6 @@ export class ThreeDeeTouch {
|
||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
@@ -97,6 +112,7 @@ export class ThreeDeeTouch {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -123,4 +139,4 @@ export interface ThreeDeeTouchForceTouch {
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,21 @@ import {Plugin, Cordova} from './plugin';
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* ActionSheet options
|
||||
*
|
||||
* | Option | Type | Description |
|
||||
* |-------------------------------|-----------|----------------------------------------------|
|
||||
* | title |`string` | The title for the actionsheet |
|
||||
* | buttonLabels |`string[]` | the labels for the buttons. Uses the index x |
|
||||
* | androidTheme |`number` | Theme to be used on Android |
|
||||
* | androidEnableCancelButton |`boolean` | Enable a cancel on Android |
|
||||
* | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone |
|
||||
* | addCancelButtonWithLabel |`string` | Add a cancel button with text |
|
||||
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
|
||||
* | position |`number[]` | On an iPad, set the X,Y position |
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-actionsheet',
|
||||
@@ -32,20 +47,8 @@ import {Plugin, Cordova} from './plugin';
|
||||
export class ActionSheet {
|
||||
|
||||
/**
|
||||
* Show the ActionSheet. The ActionSheet's options is an object with the following propterties.
|
||||
*
|
||||
* | Option | Type | Description |
|
||||
* |-------------------------------|-----------|----------------------------------------------|
|
||||
* | title |`string` | The title for the actionsheet |
|
||||
* | buttonLabels |`string[]` | the labels for the buttons. Uses the index x |
|
||||
* | androidTheme |`number` | Theme to be used on Android |
|
||||
* | androidEnableCancelButton |`boolean` | Enable a cancel on Android |
|
||||
* | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone |
|
||||
* | addCancelButtonWithLabel |`string` | Add a cancel button with text |
|
||||
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
|
||||
* | position |`number[]` | On an iPad, set the X,Y position |
|
||||
*
|
||||
* @param {options} Options See table above
|
||||
* Show a native ActionSheet component. See below for options.
|
||||
* @param {options} Options See table below
|
||||
* @returns {Promise} Returns a Promise that resolves with the index of the
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
@@ -63,8 +66,9 @@ export class ActionSheet {
|
||||
|
||||
|
||||
/**
|
||||
* Hide the ActionSheet.
|
||||
* Progamtically hide the native ActionSheet
|
||||
* @returns {Promise} Returns a Promise that resolves when the actionsheet is closed
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(): Promise<any> { return; }
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export class AppAvailability {
|
||||
|
||||
/**
|
||||
* Checks if an app is available on device
|
||||
* @param app Package name on android, or URI scheme on iOS
|
||||
* @param {string} app Package name on android, or URI scheme on iOS
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -20,6 +20,27 @@ declare var window;
|
||||
* AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name=<the Package Family Name of the application>';
|
||||
* AppRate.promptForRating();
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* Rating dialog preferences
|
||||
*
|
||||
* | Option | Type | Default | Description |
|
||||
* |------------------------------|------------|---------|----------------------------------------------------------------------------------------|
|
||||
* | useLanguage | `String` | null | custom BCP 47 language tag |
|
||||
* | displayAppName | `String` | '' | custom application title |
|
||||
* | promptAgainForEachNewVersion | `Boolean` | true | show dialog again when application version will be updated |
|
||||
* | usesUntilPrompt | `Integer` | 3 | count of runs of application before dialog will be displayed |
|
||||
* | openStoreInApp | `Boolean` | false | leave app or no when application page opened in app store (now supported only for iOS) |
|
||||
* | useCustomRateDialog | `Boolean` | false | use custom view for rate dialog |
|
||||
* | callbacks.onButtonClicked | `Function` | null | call back function. called when user clicked on rate-dialog buttons |
|
||||
* | callbacks.onRateDialogShow | `Function` | null | call back function. called when rate-dialog showing |
|
||||
* | storeAppURL.ios | `String` | null | application id in AppStore |
|
||||
* | storeAppURL.android | `String` | null | application URL in GooglePlay |
|
||||
* | storeAppURL.blackberry | `String` | null | application URL in AppWorld |
|
||||
* | storeAppURL.windows8 | `String` | null | application URL in WindowsStore |
|
||||
* | customLocale | `Object` | null | custom locale object |
|
||||
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-apprate',
|
||||
@@ -30,31 +51,14 @@ declare var window;
|
||||
export class AppRate {
|
||||
|
||||
/**
|
||||
* Rating dialog preferences
|
||||
*
|
||||
* | Option | Type | Default | Description |
|
||||
* |------------------------------|------------|---------|----------------------------------------------------------------------------------------|
|
||||
* | useLanguage | `String` | null | custom BCP 47 language tag |
|
||||
* | displayAppName | `String` | '' | custom application title |
|
||||
* | promptAgainForEachNewVersion | `Boolean` | true | show dialog again when application version will be updated |
|
||||
* | usesUntilPrompt | `Integer` | 3 | count of runs of application before dialog will be displayed |
|
||||
* | openStoreInApp | `Boolean` | false | leave app or no when application page opened in app store (now supported only for iOS) |
|
||||
* | useCustomRateDialog | `Boolean` | false | use custom view for rate dialog |
|
||||
* | callbacks.onButtonClicked | `Function` | null | call back function. called when user clicked on rate-dialog buttons |
|
||||
* | callbacks.onRateDialogShow | `Function` | null | call back function. called when rate-dialog showing |
|
||||
* | storeAppURL.ios | `String` | null | application id in AppStore |
|
||||
* | storeAppURL.android | `String` | null | application URL in GooglePlay |
|
||||
* | storeAppURL.blackberry | `String` | null | application URL in AppWorld |
|
||||
* | storeAppURL.windows8 | `String` | null | application URL in WindowsStore |
|
||||
* | customLocale | `Object` | null | custom locale object |
|
||||
* @type {{}}
|
||||
* Configure various settings for the Rating View.
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get preferences() { return window.AppRate.preferences; }
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
*
|
||||
* @param {boolean} immediately Show the rating prompt immediately.
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -177,7 +177,7 @@ export interface Config {
|
||||
* debug: true, // enable this hear sounds for background-geolocation life-cycle.
|
||||
* stopOnTerminate: false, // enable this to clear background location settings when the app terminates
|
||||
* };
|
||||
*
|
||||
*
|
||||
* BackgroundGeolocation.configure(config)
|
||||
* .then((location) => {
|
||||
* console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
|
||||
@@ -202,7 +202,7 @@ export interface Config {
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
||||
pluginRef: 'plugins.backgroundGeoLocation',
|
||||
pluginRef: 'backgroundGeolocation',
|
||||
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
|
||||
platforms: ['iOS', 'Android', 'Windows Phone 8']
|
||||
})
|
||||
|
||||
@@ -8,12 +8,25 @@ import {Plugin, Cordova} from './plugin';
|
||||
*@usage
|
||||
* ```js
|
||||
* import {BackgroundMode} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* BackgroundMode.enable();
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* Configuration options
|
||||
*
|
||||
* | Property | Type | Description |
|
||||
* |----------|-----------|------------------------------------------------------------------------------|
|
||||
* | title | `string` | Title of the background task. Optional |
|
||||
* | ticker | `string` | The text that scrolls itself on the statusbar. Optional |
|
||||
* | text | `string` | Description of the background task. Optional |
|
||||
* | silent | `boolean` | If the plugin will display a notification or not. Default is false. Optional |
|
||||
* | resume | `boolean` | Bring the app into the foreground if the notification is tapped. Optional |
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'de.appplant.cordova.plugin.background-mode',
|
||||
plugin: 'cordova-plugin-background-mode',
|
||||
pluginRef: 'cordova.plugins.backgroundMode',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
@@ -37,11 +50,14 @@ export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {boolean} returns a true of false if the background mode is enabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> {return; }
|
||||
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
* @returns {boolean} returns tru or flase if the background mode is active.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> {return; }
|
||||
@@ -49,6 +65,7 @@ export class BackgroundMode {
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
* Available only for Android platform.
|
||||
* @param {Configure} options List of option to configure. See table below
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
@@ -58,11 +75,13 @@ export class BackgroundMode {
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
* Available only for Android platform.
|
||||
* @param {Configure} options Any options you want to update. See table below.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static update(options?: Configure): void {}
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* Can be used to get notified or run function when the background mode has been activated, deactivated or failed.
|
||||
|
||||
@@ -27,6 +27,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
})
|
||||
export class BarcodeScanner {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static Encode: any = {
|
||||
TEXT_TYPE: 'TEXT_TYPE',
|
||||
EMAIL_TYPE: 'EMAIL_TYPE',
|
||||
|
||||
@@ -23,12 +23,13 @@ export class Base64ToGallery {
|
||||
|
||||
/**
|
||||
* Converts a base64 string to an image file in the device gallery
|
||||
* @param data
|
||||
* @param prefix
|
||||
* @param {string} data The actual base64 string that you want to save
|
||||
* @param {sstring} prefix Prefix the file with a string. Default is 'img_'. Optional.
|
||||
* @returns {Promise} returns a promise that resolves when the image is saved.
|
||||
*/
|
||||
@Cordova()
|
||||
static base64ToGallery(data: string , prefix?: string ): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,24 @@ import {Observable} from 'rxjs/Observable';
|
||||
* @name Bluetooth Serial
|
||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
|
||||
* @usage
|
||||
* ```ts
|
||||
* // Write a string
|
||||
* Bluetooth.write("hello world").then(success, failure);
|
||||
*
|
||||
* // Array of int or bytes
|
||||
* Bluetooth.write([186, 220, 222]).then(success, failure);
|
||||
*
|
||||
* // Typed Array
|
||||
* var data = new Uint8Array(4);
|
||||
* data[0] = 0x41;
|
||||
* data[1] = 0x42;
|
||||
* data[2] = 0x43;
|
||||
* data[3] = 0x44;
|
||||
* Bluetooth.write(data).then(success, failure);
|
||||
*
|
||||
* // Array Buffer
|
||||
* Bluetooth.write(data.buffer).then(success, failure);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
repo: 'https://github.com/don/BluetoothSerial',
|
||||
@@ -16,8 +34,8 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Connect to a Bluetooth device
|
||||
* Returns an Observable. Subscribe to connect, unsubscribe to disconnect.
|
||||
* @param macAddress_or_uuid Identifier of the remote device
|
||||
* @param {string} macAddress_or_uuid Identifier of the remote device
|
||||
* @returns {Observable} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -28,8 +46,8 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Connect insecurely to a Bluetooth device
|
||||
* Returns an Observable. Subscribe to connect, unsubscribe to disconnect.
|
||||
* @param macAddress Identifier of the remote device
|
||||
* @param {string} macAddress Identifier of the remote device
|
||||
* @returns {Observable} Subscribe to connect, unsubscribe to disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
@@ -40,26 +58,8 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
* @param data ArrayBuffer of data
|
||||
* @usage
|
||||
* ```ts
|
||||
* // Write a string
|
||||
* Bluetooth.write("hello world").then(success, failure);
|
||||
*
|
||||
* // Array of int or bytes
|
||||
* Bluetooth.write([186, 220, 222]).then(success, failure);
|
||||
*
|
||||
* // Typed Array
|
||||
* var data = new Uint8Array(4);
|
||||
* data[0] = 0x41;
|
||||
* data[1] = 0x42;
|
||||
* data[2] = 0x43;
|
||||
* data[3] = 0x44;
|
||||
* Bluetooth.write(data).then(success, failure);
|
||||
*
|
||||
* // Array Buffer
|
||||
* Bluetooth.write(data.buffer).then(success, failure);
|
||||
* ```
|
||||
* @param {any} data ArrayBuffer of data
|
||||
* @returns {Promise} returns a promise when data has been written
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -68,6 +68,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Gets the number of bytes of data available
|
||||
* @returns {Promise} returns a promise that contains the available bytes
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -75,6 +76,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
* @returns {Promise} returns a promise with data from the buffer
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -83,7 +85,8 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reads data from the buffer until it reaches a delimiter
|
||||
* @param delimiter
|
||||
* @param {string} delimiter string that you want to search until
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -92,7 +95,8 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @param delimiter
|
||||
* @param {string} delimiter the string you want to watch for
|
||||
* @returns {Observable} returns an observable.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -103,6 +107,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
* @returns {Observable} returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -113,6 +118,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
* @returns {Promise} returns a promise when completed
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -121,6 +127,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -129,6 +136,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -137,6 +145,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -145,6 +154,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -153,6 +163,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -161,6 +172,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -169,20 +181,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
* @usage
|
||||
* ```ts
|
||||
* [{
|
||||
* "class": 276,
|
||||
* "id": "10:BF:48:CB:00:00",
|
||||
* "address": "10:BF:48:CB:00:00",
|
||||
* "name": "Nexus 7"
|
||||
* }, {
|
||||
* "class": 7936,
|
||||
* "id": "00:06:66:4D:00:00",
|
||||
* "address": "00:06:66:4D:00:00",
|
||||
* "name": "RN42"
|
||||
* }]
|
||||
* ```
|
||||
* @returns {Promise} returns a promise
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
@@ -191,6 +190,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
|
||||
* @returns {Observable} Returns an observable
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone'],
|
||||
@@ -201,7 +201,7 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Sets the human readable device name that is broadcasted to other devices
|
||||
* @param newName Desired name of device
|
||||
* @param {string} newName Desired name of device
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
@@ -211,14 +211,11 @@ export class BluetoothSerial {
|
||||
|
||||
/**
|
||||
* Makes the device discoverable by other devices
|
||||
* @param discoverableDuration Desired number of seconds device should be discoverable for
|
||||
* @param {number} discoverableDuration Desired number of seconds device should be discoverable for
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setDiscoverable (discoverableDuration: number): void {}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
129
src/plugins/camera-preview.ts
Normal file
129
src/plugins/camera-preview.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
export interface CameraPreviewOptions {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* 'front' for front camera
|
||||
* 'rear' for rear camera
|
||||
*/
|
||||
camera: string;
|
||||
/** Take photo on tap */
|
||||
tapPhoto: boolean;
|
||||
/** */
|
||||
previewDrag: boolean;
|
||||
/** */
|
||||
toBack: boolean;
|
||||
/** Alpha use when toBack is set to true */
|
||||
alpha: number;
|
||||
}
|
||||
|
||||
export interface CameraPreviewSize {
|
||||
maxWidth: number;
|
||||
maxHeight: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
*
|
||||
* Requires {@link module:driftyco/ionic-native} and the Cordova plugin: `cordova-plugin-camera-preview`. For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/westonganger/cordova-plugin-camera-preview).
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
pluginRef: 'cordova.plugins.camerapreview',
|
||||
repo: 'https://github.com/westonganger/cordova-plugin-camera-preview',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class CameraPreview {
|
||||
|
||||
/**
|
||||
* Starts the camera preview instance.
|
||||
* @param {CameraPreviewOptions} options for the preview
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static startCamera(options: CameraPreviewOptions): void {};
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static stopCamera(): void {};
|
||||
|
||||
/**
|
||||
* Take the picture, the parameter size is optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static takePicture(size: CameraPreviewSize): void {};
|
||||
|
||||
/**
|
||||
* Register a callback function that receives the original picture and the image captured from the preview box.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static setOnPictureTakenHandler(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static switchCamera(): void {};
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static show(): void {};
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide(): void {};
|
||||
|
||||
/**
|
||||
* Set the default mode for the Flash.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static setFlashMode(mode: number): void {};
|
||||
|
||||
/**
|
||||
* Set camera color effect.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static setColorEffect(effect: string): void {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static FlashMode = {
|
||||
OFF: 0,
|
||||
ON: 1,
|
||||
AUTO: 2
|
||||
};
|
||||
|
||||
}
|
||||
@@ -95,7 +95,7 @@ export interface CameraPopoverOptions {
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Camera} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Camera.getPicture(options).then((imageData) => {
|
||||
* // imageData is either a base64 encoded string or a file URI
|
||||
* // If it's base64:
|
||||
@@ -113,8 +113,8 @@ export interface CameraPopoverOptions {
|
||||
export class Camera {
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions} options
|
||||
* @return Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
* @param {CameraOptions} options Options that you want to pass to the camera. Encoding type, quality, etc.
|
||||
* @return {Promise} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -132,6 +132,7 @@ export class Camera {
|
||||
static cleanup() { };
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static DestinationType = {
|
||||
@@ -144,6 +145,7 @@ export class Camera {
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static EncodingType = {
|
||||
@@ -153,6 +155,7 @@ export class Camera {
|
||||
PNG: 1
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static MediaType = {
|
||||
@@ -165,6 +168,7 @@ export class Camera {
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static PictureSourceType = {
|
||||
@@ -177,6 +181,7 @@ export class Camera {
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
|
||||
* @enum {number}
|
||||
*/
|
||||
@@ -189,6 +194,7 @@ export class Camera {
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
*/
|
||||
static Direction = {
|
||||
|
||||
@@ -41,7 +41,7 @@ export class CardIO {
|
||||
|
||||
/**
|
||||
* Scan a credit card with card.io.
|
||||
* @param options
|
||||
* @param {CardIOOptions} options Options for configuring the plugin
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options?: CardIOOptions): Promise<any> {return; }
|
||||
@@ -70,4 +70,4 @@ export interface CardIOOptions {
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* Clipboard.paste().then(
|
||||
* (resolve : string) => {
|
||||
* alert(resolve);
|
||||
* },
|
||||
* alert(resolve);
|
||||
* },
|
||||
* (reject : string) => {
|
||||
* alert("Error: " + reject);
|
||||
* }
|
||||
* );
|
||||
* );
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@@ -37,15 +37,15 @@ export class Clipboard {
|
||||
|
||||
/**
|
||||
* Copies the given text
|
||||
* @param text
|
||||
* @returns {Promise<T>}
|
||||
* @param {string} text Text that gets copied on the system clipboard
|
||||
* @returns {Promise<T>} Returns a promise after the text has been copied
|
||||
*/
|
||||
@Cordova()
|
||||
static copy(text: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Pastes the text stored in clipboard
|
||||
* @returns {Promise<T>}
|
||||
* @returns {Promise<T>} Returns a promise after the text has been pasted
|
||||
*/
|
||||
@Cordova()
|
||||
static paste(): Promise<any> { return; }
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface IContactProperties {
|
||||
/** The name of this Contact, suitable for display to end users. */
|
||||
displayName?: string;
|
||||
/** An object containing all components of a persons name. */
|
||||
name?: ContactName;
|
||||
name?: IContactName;
|
||||
/** A casual name by which to address the contact. */
|
||||
nickname?: string;
|
||||
/** An array of all the contact's phone numbers. */
|
||||
@@ -15,11 +15,11 @@ export interface IContactProperties {
|
||||
/** An array of all the contact's email addresses. */
|
||||
emails?: IContactField[];
|
||||
/** An array of all the contact's addresses. */
|
||||
addresses?: ContactAddress[];
|
||||
addresses?: IContactAddress[];
|
||||
/** An array of all the contact's IM addresses. */
|
||||
ims?: IContactField[];
|
||||
/** An array of all the contact's organizations. */
|
||||
organizations?: ContactOrganization[];
|
||||
organizations?: IContactOrganization[];
|
||||
/** The birthday of the contact. */
|
||||
birthday?: Date;
|
||||
/** A note about the contact. */
|
||||
@@ -31,16 +31,22 @@ export interface IContactProperties {
|
||||
/** An array of web pages associated with the contact. */
|
||||
urls?: IContactField[];
|
||||
}
|
||||
export class Contact {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class Contact implements IContactProperties {
|
||||
private _objectInstance: any;
|
||||
@InstanceProperty get id(): string {return; }
|
||||
@InstanceProperty get displayName(): string {return; }
|
||||
@InstanceProperty get nickname(): ContactName {return; }
|
||||
@InstanceProperty get phoneNumbers(): string {return; }
|
||||
@InstanceProperty get name(): IContactName {return; }
|
||||
@InstanceProperty get nickname(): string {return; }
|
||||
@InstanceProperty get phoneNumbers(): IContactField[] {return; }
|
||||
@InstanceProperty get emails(): IContactField[] {return; }
|
||||
@InstanceProperty get addresses(): ContactAddress[] {return; }
|
||||
@InstanceProperty get addresses(): IContactAddress[] {return; }
|
||||
@InstanceProperty get ims(): IContactField[] {return; }
|
||||
@InstanceProperty get organizations(): ContactOrganization[] {return; }
|
||||
@InstanceProperty get organizations(): IContactOrganization[] {return; }
|
||||
@InstanceProperty get birthday(): Date {return; }
|
||||
@InstanceProperty get note(): string {return; }
|
||||
@InstanceProperty get photos(): IContactField[] {return; }
|
||||
@@ -92,6 +98,10 @@ export interface IContactName {
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactName implements IContactName {
|
||||
private _objectInstance: any;
|
||||
constructor(formatted?: string, familyName?: string, givenName?: string, middleName?: string, honorificPrefix?: string, honorificSuffix?: string) {
|
||||
@@ -114,6 +124,9 @@ export interface IContactField {
|
||||
pref: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactField implements IContactField {
|
||||
private _objectInstance: any;
|
||||
constructor(type?: string, value?: string, pref?: boolean) {
|
||||
@@ -143,6 +156,9 @@ export interface IContactAddress {
|
||||
country?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactAddress implements IContactAddress {
|
||||
private _objectInstance: any;
|
||||
constructor (pref?: boolean,
|
||||
@@ -178,6 +194,9 @@ export interface IContactOrganization {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactOrganization implements IContactOrganization {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
@@ -200,6 +219,9 @@ export interface IContactFindOptions {
|
||||
desiredFields?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class ContactFindOptions implements IContactFindOptions {
|
||||
private _objectInstance: any;
|
||||
constructor () {
|
||||
@@ -210,6 +232,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
@InstanceProperty get desiredFields(): any {return; }
|
||||
@InstanceProperty get hasPhoneNumber(): boolean {return; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Contacts
|
||||
* @description
|
||||
@@ -243,9 +266,6 @@ export class Contacts {
|
||||
}
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
*
|
||||
* Example: Contacts.find(['*'], { filter: 'Max' }) // will search for a displayName of 'Max'
|
||||
*
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
* A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
|
||||
* A contactFields value of "*" searches all contact fields.
|
||||
@@ -269,4 +289,4 @@ export class Contacts {
|
||||
*/
|
||||
@Cordova()
|
||||
static pickContact(): Promise<any> {return; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ export interface DatePickerOptions {
|
||||
* import {DatePicker} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* DatePicker.show({
|
||||
* date: new Date(),
|
||||
* mode: 'date'
|
||||
@@ -97,10 +96,10 @@ export class DatePicker {
|
||||
|
||||
/**
|
||||
* Shows the date and/or time picker dialog(s)
|
||||
* @param options
|
||||
* @param {DatePickerOptions} options Options for the date picker.
|
||||
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: DatePickerOptions): Promise<Date> { return; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Get the current acceleration along the x, y, and z axes.
|
||||
*
|
||||
* @returns {Promise<any>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -80,18 +79,8 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
*
|
||||
* ```ts
|
||||
* // Watch device acceleration
|
||||
* var subscription = DeviceMotion.watchPosition().subscribe(acceleration => {
|
||||
* console.log(acceleration);
|
||||
* });
|
||||
*
|
||||
* // Stop watch
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @param options
|
||||
* @returns {Observable<AccelerationData>}
|
||||
* @param {AccelerometerOptions} options list of options for the accelerometer.
|
||||
* @returns {Observable<AccelerationData>} Observable returns an observable that you can subscribe to
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
|
||||
@@ -83,8 +83,8 @@ export class DeviceOrientation {
|
||||
* Get the device current heading at a regular interval
|
||||
*
|
||||
* Stop the watch by unsubscribing from the observable
|
||||
* @param options
|
||||
* @returns {Observable<CompassHeading>}
|
||||
* @param {CompassOptions} options Options for compass. Frequency and Filter. Optional
|
||||
* @returns {Observable<CompassHeading>} Returns an observable that contains the compass heading
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
|
||||
@@ -40,9 +40,9 @@ export class Dialogs {
|
||||
|
||||
/**
|
||||
* Shows a custom alert or dialog box.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title. (String) (Optional, defaults to Alert)
|
||||
* @param buttonName Button name. (String) (Optional, defaults to OK)
|
||||
* @param {string} message Dialog message.
|
||||
* @param {string} title Dialog title. (Optional, defaults to Alert)
|
||||
* @param {string} buttonName Button name. (Optional, defaults to OK)
|
||||
* @returns {Promise<any>} Returns a blank promise once the user has dismissed the alert.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -57,9 +57,9 @@ export class Dialogs {
|
||||
|
||||
/**
|
||||
* Displays a customizable confirmation dialog box.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title. (String) (Optional, defaults to Confirm)
|
||||
* @param buttonLabels Array of strings specifying button labels. (Array) (Optional, defaults to [OK,Cancel])
|
||||
* @param {string} message Dialog message.
|
||||
* @param {string} title Dialog title. (Optional, defaults to Confirm)
|
||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
|
||||
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing.
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -74,10 +74,10 @@ export class Dialogs {
|
||||
|
||||
/**
|
||||
* Displays a native dialog box that is more customizable than the browser's prompt function.
|
||||
* @param message Dialog message. (String)
|
||||
* @param title Dialog title (String) (Optional, defaults to Prompt)
|
||||
* @param buttonLabels Array of strings specifying button labels (Array) (Optional, defaults to ["OK","Cancel"])
|
||||
* @param defaultText Default textbox input value (String) (Optional, Default: empty string)
|
||||
* @param {string} message Dialog message.
|
||||
* @param {string} title Dialog title. (Optional, defaults to Prompt)
|
||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"])
|
||||
* @param {string} defaultText Default textbox input value. (Optional, Default: empty string)
|
||||
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -94,11 +94,11 @@ export class Dialogs {
|
||||
|
||||
/**
|
||||
* The device plays a beep sound.
|
||||
* @param times The number of times to repeat the beep. (Number)
|
||||
* @param {numbers} times The number of times to repeat the beep.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static beep(times: number): void {}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ export class Facebook {
|
||||
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param appId
|
||||
* @param version
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
*/
|
||||
@Cordova()
|
||||
static browserInit(appId: number, version?: string): Promise<any> {
|
||||
|
||||
@@ -154,8 +154,7 @@ export class Geolocation {
|
||||
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||
return new Observable<Geoposition>(
|
||||
(observer: any) => {
|
||||
let cb = (data: Geoposition) => observer.next(data);
|
||||
let watchId = navigator.geolocation.watchPosition(cb, options);
|
||||
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.error.bind(observer), options);
|
||||
return () => navigator.geolocation.clearWatch(watchId);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -34,9 +34,9 @@ export class Globalization {
|
||||
|
||||
/**
|
||||
* Converts date to string
|
||||
* @param date
|
||||
* @param options
|
||||
* @return {Promise<{value: string}>}
|
||||
* @param {Date} date Date you wish to convert
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -45,9 +45,10 @@ export class Globalization {
|
||||
static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dateString
|
||||
* @param options
|
||||
* Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object.
|
||||
* @param {string} dateString Date as a string to be converted
|
||||
* @param options Options for the converted date. Length, selector.
|
||||
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -57,8 +58,9 @@ export class Globalization {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns a pattern string to format and parse dates according to the client's user preferences.
|
||||
* @param options Object with the format length and selector
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -67,8 +69,9 @@ export class Globalization {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
|
||||
* @param options Object with type (narrow or wide) and item (month or days).
|
||||
* @return {Promise<{value: string}>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -76,20 +79,22 @@ export class Globalization {
|
||||
static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; }
|
||||
|
||||
/**
|
||||
* Check if day light saving is active
|
||||
* @param date
|
||||
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
|
||||
* @param {data} date Date to process
|
||||
* @returns {Promise<dst>} reutrns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; }
|
||||
|
||||
/**
|
||||
* Get first day of week
|
||||
* Returns the first day of the week according to the client's user preferences and calendar.
|
||||
* @returns {Promise<value>} reutrns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static getFirstDayOfWeek(): Promise<{value: string}> {return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns a number formatted as a string according to the client's user preferences.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -100,8 +105,9 @@ export class Globalization {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stringToConvert
|
||||
* @param options
|
||||
* @param {string} stringToConvert String you want to conver to a number
|
||||
* @param options The type of number you want to return. Can be decimal, percent, or currency.
|
||||
* @returns {Promise} Returns a promise with the value.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -110,8 +116,9 @@ export class Globalization {
|
||||
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options
|
||||
* Returns a pattern string to format and parse numbers according to the client's user preferences.
|
||||
* @param options Can be decimal, percent, or currency.
|
||||
* @returns {Promise} returns a promise with the value.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -119,8 +126,9 @@ export class Globalization {
|
||||
static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param currencyCode
|
||||
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
|
||||
* @param {string} currencyCode Currency Code.A
|
||||
* @returns {Promise} returns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; }
|
||||
|
||||
@@ -77,8 +77,7 @@ export class GoogleMap {
|
||||
on(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
let cb = data => observer.next(data);
|
||||
this._objectInstance.on(event, cb);
|
||||
this._objectInstance.on(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.off(event);
|
||||
}
|
||||
);
|
||||
@@ -238,7 +237,7 @@ export class GoogleMap {
|
||||
addGroundOverlay(options: GoogleMapsGroundOverlayOptions): Promise<GoogleMapsGroundOverlay> {
|
||||
return new Promise<GoogleMapsGroundOverlay>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addTileOverlay(options, (groundOverlay: any) => {
|
||||
this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => {
|
||||
if (groundOverlay) resolve(new GoogleMapsGroundOverlay(groundOverlay));
|
||||
else reject();
|
||||
});
|
||||
@@ -249,7 +248,7 @@ export class GoogleMap {
|
||||
addKmlOverlay(options: GoogleMapsKmlOverlayOptions): Promise<GoogleMapsKmlOverlay> {
|
||||
return new Promise<GoogleMapsKmlOverlay>(
|
||||
(resolve, reject) => {
|
||||
this._objectInstance.addTileOverlay(options, (kmlOverlay: any) => {
|
||||
this._objectInstance.addKmlOverlay(options, (kmlOverlay: any) => {
|
||||
if (kmlOverlay) resolve(new GoogleMapsKmlOverlay(kmlOverlay));
|
||||
else reject();
|
||||
});
|
||||
@@ -389,11 +388,8 @@ export class GoogleMapsMarker {
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
let cb = (data: any) => {
|
||||
observer.next(data);
|
||||
};
|
||||
this._objectInstance.addEventListener(event, cb);
|
||||
return () => this._objectInstance.removeEventListener(event, cb);
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -537,9 +533,8 @@ export class GoogleMapsCircle {
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
let cb = data => observer.next(data);
|
||||
this._objectInstance.addEventListener(event, cb);
|
||||
return () => this._objectInstance.removeEventListener(event, cb);
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -629,9 +624,8 @@ export class GoogleMapsPolyline {
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
let cb = data => observer.next(data);
|
||||
this._objectInstance.addEventListener(event, cb);
|
||||
return () => this._objectInstance.removeEventListener(event, cb);
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -721,9 +715,8 @@ export class GoogleMapsPolygon {
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
(observer) => {
|
||||
let cb = data => observer.next(data);
|
||||
this._objectInstance.addEventListener(event, cb);
|
||||
return () => this._objectInstance.removeEventListener(event, cb);
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -951,8 +944,9 @@ export class GoogleMapsKmlOverlay {
|
||||
export class GoogleMapsLatLngBounds {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(public southwest: GoogleMapsLatLng, public northeast: GoogleMapsLatLng) {
|
||||
this._objectInstance = new plugin.google.maps.LatLngBounds([southwest, northeast]);
|
||||
constructor(public southwestOrArrayOfLatLng: GoogleMapsLatLng|GoogleMapsLatLng[], public northeast?: GoogleMapsLatLng) {
|
||||
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
|
||||
this._objectInstance = new plugin.google.maps.LatLngBounds(args);
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
@@ -1005,3 +999,38 @@ export class GoogleMapsLatLng {
|
||||
return this.lat.toFixed(precision) + ',' + this.lng.toFixed(precision);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface GeocoderRequest {
|
||||
address?: string;
|
||||
position?: {lat: number; lng: number};
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface GeocoderResult {
|
||||
position?: {lat: number; lng: number};
|
||||
subThoroughfare?: string;
|
||||
thoroughfare?: string;
|
||||
locality?: string;
|
||||
adminArea?: string;
|
||||
postalCode?: string;
|
||||
country?: string;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export class Geocoder {
|
||||
/**
|
||||
* Converts position to address and vice versa
|
||||
* @param {GeocoderRequest} request Request object with either an address or a position
|
||||
* @returns {Promise<GeocoderResult[]>}
|
||||
*/
|
||||
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
|
||||
return new Promise<GeocoderResult[]>((resolve, reject) => {
|
||||
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({error: 'plugin_not_installed'});
|
||||
else plugin.google.maps.Geocoder.geocode(request, resolve);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
703
src/plugins/ibeacon.ts
Normal file
703
src/plugins/ibeacon.ts
Normal file
@@ -0,0 +1,703 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface Beacon {
|
||||
/**
|
||||
* The physical device's identifier.
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number.
|
||||
*/
|
||||
major: number;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number.
|
||||
*/
|
||||
minor: number;
|
||||
|
||||
/**
|
||||
* The proximity of the beacon relative to the phone.
|
||||
*
|
||||
* Possible options are:
|
||||
* ProximityImmediate
|
||||
* ProximityNear
|
||||
* ProximityFar
|
||||
* ProximityUnknown
|
||||
*/
|
||||
proximity: 'ProximityImmediate' | 'ProximityNear' | 'ProximityFar' | 'ProximityUnknown';
|
||||
|
||||
/**
|
||||
* Transmission Power of the beacon. A constant emitted by the beacon which indicates what's the expected RSSI at a distance of 1 meter to the beacon.
|
||||
*/
|
||||
tx: number;
|
||||
|
||||
/**
|
||||
* Received Signal Strength Indicator. The strength of the beacon's signal when it reaches the device.
|
||||
* RSSI ranges from aprox -26 (a few inches) to -100 (40-50 m distance).
|
||||
*/
|
||||
rssi: number;
|
||||
|
||||
/**
|
||||
* The accuracy of the ranging.
|
||||
*/
|
||||
accuracy: number;
|
||||
|
||||
}
|
||||
export interface BeaconRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
*/
|
||||
identifier: string;
|
||||
|
||||
/**
|
||||
* The the beacon identifier the device will "watch" for. Many beacons can share the same uuid.
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* The beacon's major identifier number. Optional, of nothing is supplied
|
||||
* the plugin will treat it as a wildcard.
|
||||
*/
|
||||
major?: number;
|
||||
|
||||
/**
|
||||
* The beacon's minor identifier number. Optional, of nothing is supplied
|
||||
* the plugin will treat it as a wildcard.
|
||||
*/
|
||||
minor?: number;
|
||||
|
||||
/**
|
||||
* If set to true the device will scan for beacons and determine region state anytime
|
||||
* the device's screen is turned on or off. Useful for debugging.
|
||||
*/
|
||||
notifyEntryStateOnDisplay?: boolean;
|
||||
}
|
||||
export interface CircularRegion {
|
||||
/**
|
||||
* A unique identifier for this region.
|
||||
*/
|
||||
identifier: string;
|
||||
|
||||
/**
|
||||
* The latitude of this region.
|
||||
*/
|
||||
latitude: number;
|
||||
|
||||
/**
|
||||
* The longitude of this region.
|
||||
*/
|
||||
longitude: number;
|
||||
|
||||
/**
|
||||
* The radius of the geofence for this region.
|
||||
*/
|
||||
radius: number;
|
||||
}
|
||||
export type Region = BeaconRegion | CircularRegion;
|
||||
|
||||
export interface PluginResult {
|
||||
|
||||
/**
|
||||
* The name of the delegate function that produced the PluginResult object.
|
||||
*/
|
||||
eventType: string;
|
||||
|
||||
/**
|
||||
* The region that triggered the event.
|
||||
*/
|
||||
region: Region;
|
||||
|
||||
/**
|
||||
* An array of beacon objects
|
||||
*/
|
||||
beacons: Beacon[];
|
||||
|
||||
/**
|
||||
* The status of the location permission for iOS.
|
||||
*/
|
||||
authorizationStatus: string;
|
||||
|
||||
/**
|
||||
* The state of the phone in relation to the region. Inside/outside for example.
|
||||
*/
|
||||
state: 'CLRegionStateInside' | 'CLRegionStateOutside';
|
||||
|
||||
/**
|
||||
* Error message, used only with monitoringDidFailForRegionWithError delegate.
|
||||
*/
|
||||
error: string;
|
||||
}
|
||||
export interface Delegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
* @return Returns a string.
|
||||
*/
|
||||
didChangeAuthorizationStatus(): Observable<string>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the native layer is able to determine the device's state.
|
||||
*
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didDetermineStateForRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone enters a region that it was asked to monitor.
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didEnterRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the phone exits a region that it was asked to monitor.
|
||||
*
|
||||
* If the user has given the app Always-Location permission, this function
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didExitRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* each time that the device ranges beacons. Modern Android and iOS devices range
|
||||
* aproximately once per second.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didRangeBeaconsInRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins monitoring a region.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didStartMonitoringForRegion(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device fails to monitor a region.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
monitoringDidFailForRegionWithError(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins advertising as an iBeacon.
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidStartAdvertising(): Observable<PluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the state of the peripheral manager's state updates.
|
||||
*
|
||||
*
|
||||
* @return {PluginResult} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidUpdateState(): Observable<PluginResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name IBeacon
|
||||
* @description
|
||||
* This plugin provides functions for working with iBeacons.
|
||||
*
|
||||
* The plugin's API closely mimics the one exposed through the [CLLocationManager](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html) introduced in iOS 7.
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import {IBeacon} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Request permission to use location on iOS
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.Delegate();
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
* data => {console.log('didRangeBeaconsInRegion: ', data)},
|
||||
* error => console.error
|
||||
* );
|
||||
* delegate.didStartMonitoringForRegion()
|
||||
* .subscribe(
|
||||
* data => {console.log('didStartMonitoringForRegion: ', data)},
|
||||
* error => console.error
|
||||
* );
|
||||
* delegate.didEnterRegion()
|
||||
* .subscribe(
|
||||
* data => {
|
||||
* console.log('didEnterRegion: ', data);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* let beaconRegion = IBeacon.BeaconRegion('deskBeacon','F7826DA6-ASDF-ASDF-8024-BC5B71E0893E');
|
||||
*
|
||||
* IBeacon.startMonitoringForRegion(beaconRegion)
|
||||
* .then(
|
||||
* () => console.log('Native layer recieved the request to monitoring'),
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-ibeacon',
|
||||
pluginRef: 'cordova.plugins.locationManager',
|
||||
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class IBeacon {
|
||||
|
||||
|
||||
/**
|
||||
* Instances of this class are delegates between the {@link LocationManager} and
|
||||
* the code that consumes the messages generated on in the native layer.
|
||||
*
|
||||
* @returns {Delegate} An instance of the type {@type Delegate}.
|
||||
*/
|
||||
static Delegate(): Delegate {
|
||||
let delegate = new cordova.plugins.locationManager.Delegate();
|
||||
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didChangeAuthorizationStatus = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didDetermineStateForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didEnterRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didEnterRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didExitRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didExitRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didRangeBeaconsInRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.didStartMonitoringForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.monitoringDidFailForRegionWithError = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidStartAdvertising = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidUpdateState = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
cordova.plugins.locationManager.setDelegate(delegate);
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new BeaconRegion
|
||||
*
|
||||
* @param {String} identifier @see {CLRegion}
|
||||
* @param {String} uuid The proximity ID of the beacon being targeted.
|
||||
* This value must not be blank nor invalid as a UUID.
|
||||
* @param {Number} major The major value that you use to identify one or more beacons.
|
||||
* @param {Number} minor The minor value that you use to identify a specific beacon.
|
||||
* @param {BOOL} notifyEntryStateOnDisplay
|
||||
*
|
||||
* @return Returns the BeaconRegion that was created
|
||||
*/
|
||||
static BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
|
||||
return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the Delegate
|
||||
*/
|
||||
@Cordova()
|
||||
static getDelegate(): Delegate { return; }
|
||||
|
||||
/**
|
||||
* @param {Delegate} delegate An instance of a delegate to register with the native layer.
|
||||
*
|
||||
* @return Returns the Delegate
|
||||
*/
|
||||
@Cordova()
|
||||
static setDelegate(delegate: Delegate): Delegate { return; }
|
||||
|
||||
/**
|
||||
* Signals the native layer that the client side is ready to consume messages.
|
||||
* Readiness here means that it has a {Delegate} set by the consumer javascript
|
||||
* code.
|
||||
*
|
||||
* The {LocationManager.setDelegate()} will implicitly call this method as well,
|
||||
* therefore the only case when you have to call this manually is if you don't
|
||||
* wish to specify a {Delegate} of yours.
|
||||
*
|
||||
* The purpose of this signaling mechanism is to make the events work when the
|
||||
* app is being woken up by the Operating System to give it a chance to handle
|
||||
* region monitoring events for example.
|
||||
*
|
||||
* If you don't set a {Delegate} and don't call this method manually, an error
|
||||
* message get emitted in the native runtime and the DOM as well after a certain
|
||||
* period of time.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the request and started to send events.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static onDomDelegateReady(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Determines if bluetooth is switched on, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether bluetooth is active.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static isBluetoothEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Enables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static enableBluetooth(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Disables Bluetooth using the native Layer. (ANDROID ONLY)
|
||||
*
|
||||
* @returns Returns a promise which is resolved when Bluetooth
|
||||
* could be enabled. If not, the promise will be rejected with an error.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static disableBluetooth(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Start monitoring the specified region.
|
||||
*
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* monitored for this application,
|
||||
* it will be removed from monitoring. For circular regions, the region
|
||||
* monitoring service will prioritize
|
||||
* regions by their size, favoring smaller regions over larger regions.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static startMonitoringForRegion(region: BeaconRegion): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for monitoring
|
||||
* with a different location manager object, during this or previous
|
||||
* launches of your application.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static stopMonitoringForRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Request state the for specified region. When result is ready
|
||||
* didDetermineStateForRegion is triggered. This can be any region,
|
||||
* also those which is not currently monitored.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static requestStateForRegion(region: Region): Promise<void> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Start ranging the specified beacon region.
|
||||
*
|
||||
* If a region of the same type with the same identifier is already being
|
||||
* monitored for this application, it will be removed from monitoring.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in rangedRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static startRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging the specified region. It is valid to call
|
||||
* stopMonitoringForRegion: for a region that was registered for ranging
|
||||
* with a different location manager object, during this or previous
|
||||
* launches of your application.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in rangedRegions.
|
||||
*
|
||||
* @param {Region} region An instance of {BeaconRegion} which will be monitored
|
||||
* by the operating system.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static stopRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the
|
||||
* requested authorization status.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getAuthorizationStatus(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* For iOS 8 and above only. The permission model has changed by Apple in iOS 8, making it necessary for apps to
|
||||
* explicitly request permissions via methods like these:
|
||||
* <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestWhenInUseAuthorization">requestWhenInUseAuthorization</a>
|
||||
* <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestAlwaysAuthorization">requestAlwaysAuthorization</a>
|
||||
*
|
||||
* If you are using this plugin on Android devices only, you will never have to use this, nor {@code requestAlwaysAuthorization}
|
||||
* @returns Returns a promise that is resolved when the request dialog is shown.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static requestWhenInUseAuthorization(): Promise<void> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* See the docuemntation of {@code requestWhenInUseAuthorization} for further details.
|
||||
*
|
||||
* @returns Returns a promise which is resolved when the native layer
|
||||
* shows the request dialog.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static requestAlwaysAuthorization(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being monitored by the native layer.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getMonitoredRegions(): Promise<Region[]> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns Returns a promise which is resolved with an {Array}
|
||||
* of {Region} instances that are being ranged by the native layer.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getRangedRegions(): Promise<Region[]> { return; }
|
||||
|
||||
/**
|
||||
* Determines if ranging is available or not, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether ranging is available or not.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static isRangingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Determines if region type is supported or not, according to the native layer.
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be checked
|
||||
* by the operating system.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether the region type is supported or not.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static isMonitoringAvailableForClass(region: Region): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Start advertising the specified region.
|
||||
*
|
||||
* If a region a different identifier is already being advertised for
|
||||
* this application, it will be replaced with the new identifier.
|
||||
*
|
||||
* This call will accept a valid beacon even when no BlueTooth is available,
|
||||
* and will start when BlueTooth is powered on. See {Delegate.}
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be advertised
|
||||
* by the operating system.
|
||||
* @param {Integer} measuredPower: Optional parameter, if left empty, the device will
|
||||
* use it's own default value.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the advertising request.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static startAdvertising(region: Region, measuredPower: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop advertising as a beacon.
|
||||
*
|
||||
* This is done asynchronously and may not be immediately reflected in isAdvertising.
|
||||
*
|
||||
* @return Returns a promise which is resolved as soon as the
|
||||
* native layer acknowledged the dispatch of the request to stop advertising.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static stopAdvertising(region: Region): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Determines if advertising is available or not, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is available or not.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static isAdvertisingAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Determines if advertising is currently active, according to the native layer.
|
||||
* @returns Returns a promise which is resolved with a {Boolean}
|
||||
* indicating whether advertising is active.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static isAdvertising(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Disables debug logging in the native layer. Use this method if you want
|
||||
* to prevent this plugin from writing to the device logs.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static disableDebugLogs(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Enables the posting of debug notifications in the native layer. Use this method if you want
|
||||
* to allow the plugin the posting local notifications.
|
||||
* This can be very helpful when debugging how to apps behave when launched into the background.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to enabled.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static enableDebugNotifications(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Disables the posting of debug notifications in the native layer. Use this method if you want
|
||||
* to prevent the plugin from posting local notifications.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* native layer has set the flag to disabled.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static disableDebugNotifications(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Enables debug logging in the native layer. Use this method if you want
|
||||
* a debug the inner workings of this plugin.
|
||||
*
|
||||
* @returns Returns a promise which is resolved as soon as the
|
||||
* native layer has set the logging level accordingly.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static enableDebugLogs(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Appends the provided [message] to the device logs.
|
||||
* Note: If debug logging is turned off, this won't do anything.
|
||||
*
|
||||
* @param {String} message The message to append to the device logs.
|
||||
*
|
||||
* @returns Returns a promise which is resolved with the log
|
||||
* message received by the native layer for appending. The returned message
|
||||
* is expected to be equivalent to the one provided in the original call.
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static appendToDeviceLog(message: string): Promise<void> { return; }
|
||||
|
||||
}
|
||||
@@ -3,47 +3,58 @@ import {Plugin, Cordova} from './plugin';
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
/**
|
||||
* iOS, Android, Windows
|
||||
* If true, the plugin will NOT attempt to use the geolocation plugin to determine the current device position when the start location parameter is omitted. Defaults to false.
|
||||
* name of the navigation app to use for directions. Specify using launchnavigator.APP constants. If not specified, defaults to User Selection.
|
||||
*/
|
||||
disableAutoGeolocation?: boolean;
|
||||
app?: string;
|
||||
|
||||
/**
|
||||
* nickname to display in app for destination. e.g. "Bob's House".
|
||||
*/
|
||||
destinationName?: string;
|
||||
|
||||
/**
|
||||
* Start point of the navigation
|
||||
*/
|
||||
start?: string|number[];
|
||||
|
||||
/**
|
||||
* nickname to display in app for start . e.g. "My House".
|
||||
*/
|
||||
startName?: string;
|
||||
|
||||
/**
|
||||
* iOS, Android, Windows
|
||||
* Transportation mode for navigation: "driving", "walking" or "transit". Defaults to "driving" if not specified.
|
||||
*/
|
||||
transportMode?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If true, plugin will attempt to launch Google Maps instead of Apple Maps. If Google Maps is not available, it will fall back to Apple Maps.
|
||||
*/
|
||||
preferGoogleMaps?: boolean;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If using Google Maps and the app has a URL scheme, passing this to Google Maps will display a button which returns to the app.
|
||||
*/
|
||||
urlScheme?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If using Google Maps with a URL scheme, this specifies the text of the button in Google Maps which returns to the app. Defaults to "Back" if not specified.
|
||||
*/
|
||||
backButtonText?: string;
|
||||
|
||||
/**
|
||||
* iOS
|
||||
* If true, debug log output will be generated by the plugin. Defaults to false.
|
||||
*/
|
||||
enableDebug?: boolean;
|
||||
|
||||
/**
|
||||
* Android
|
||||
* Navigation mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified.
|
||||
* a key/value map of extra app-specific parameters. For example, to tell Google Maps on Android to display Satellite view in "maps" launch mode: `{"t": "k"}`
|
||||
*/
|
||||
navigationMode?: string;
|
||||
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.
|
||||
*/
|
||||
launchMode?: 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.
|
||||
*/
|
||||
appSelectionDialogHeader?: 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.
|
||||
*/
|
||||
appSelectionCancelButton?: string;
|
||||
|
||||
successCallback?: Function;
|
||||
|
||||
errorCallback?: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,12 +63,17 @@ export interface LaunchNavigatorOptions {
|
||||
* Requires Cordova plugin: uk.co.workingedge.phonegap.plugin.launchnavigator. For more info, please see the [LaunchNavigator plugin docs](https://github.com/dpa99c/phonegap-launch-navigator).
|
||||
*
|
||||
* @usage
|
||||
* Please refer to the plugin's repo for detailed usage. This docs page only explains the Native wrapper.
|
||||
*
|
||||
* ```js
|
||||
* import {LaunchNavigator} from 'ionic-native';
|
||||
* import {LaunchNavigator, LaunchNavigatorOptions} from 'ionic-native';
|
||||
*
|
||||
* let options: LaunchNavigatorOptions = {
|
||||
* start: 'London, ON',
|
||||
* app: LaunchNavigator.APPS.UBER
|
||||
* };
|
||||
*
|
||||
*
|
||||
* LaunchNavigator.navigate("Toronto, ON", "London, ON")
|
||||
* LaunchNavigator.navigate("Toronto, ON", options)
|
||||
* .then(
|
||||
* success => console.log("Launched navigator"),
|
||||
* error => console.log("Error launching navigator", error)
|
||||
@@ -73,19 +89,109 @@ export class LaunchNavigator {
|
||||
|
||||
/**
|
||||
* Launches navigator app
|
||||
* @param destination Location name or coordinates
|
||||
* @param start Location name or coordinates
|
||||
* @param options
|
||||
* @param destination {string|number[]} Location name or coordinates (as string or array)
|
||||
* @param options {LaunchNavigatorOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static navigate(
|
||||
destination: any,
|
||||
start: any = null,
|
||||
destination: string|number[],
|
||||
options?: LaunchNavigatorOptions
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determines if the given app is installed and available on the current device.
|
||||
* @param app {string}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAppAvailable(app: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Returns a list indicating which apps are installed and available on the current device.
|
||||
*/
|
||||
@Cordova()
|
||||
static availableApps(): Promise<string[]> {return; }
|
||||
|
||||
/**
|
||||
* Returns the display name of the specified app.
|
||||
* @param app {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getAppDisplayName(app: string): string {return; }
|
||||
|
||||
/**
|
||||
* Returns list of supported apps on a given platform.
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static getAppsForPlatform(platform: string): string[] {return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of transport mode.
|
||||
* @param app {string} specified as a string, you can use one of the constants, e.g `LaunchNavigator.APP.GOOGLE_MAPS`
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsTransportMode(app: string, platform: string): boolean {return; }
|
||||
|
||||
/**
|
||||
* Returns the list of transport modes supported by an app on a given platform.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static 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}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsLaunchMode(app: string, platform: string): boolean {return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of start location.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static supportsStart(app: string, platform: string): boolean {return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static supportsStartName(app: string, platform: string): boolean {return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static supportsDestName(app: string, platform: string): boolean {return; }
|
||||
|
||||
@Cordova({sync: true})
|
||||
static userSelect(destination: string|number[], options: LaunchNavigatorOptions): void { }
|
||||
|
||||
static 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'
|
||||
};
|
||||
|
||||
static TRANSPORT_MODE: any = {
|
||||
DRIVING: 'driving',
|
||||
WALKING: 'walking',
|
||||
BICYCLING: 'bicycling',
|
||||
TRANSIT: 'transit'
|
||||
};
|
||||
}
|
||||
|
||||
219
src/plugins/media-capture.ts
Normal file
219
src/plugins/media-capture.ts
Normal file
@@ -0,0 +1,219 @@
|
||||
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
import {Observable} from 'rxjs/Rx';
|
||||
declare var navigator: any;
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {MediaCapture} from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
* MediaCapture.captureImage(options)
|
||||
* .then(
|
||||
* (data: MediaFile[]) => console.log(data),
|
||||
* (err: CaptureError) => console.error(err)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-media-capture',
|
||||
pluginRef: 'navigator.device.capture',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media-capture'
|
||||
})
|
||||
export class MediaCapture {
|
||||
/**
|
||||
* The audio recording formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedImageModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedImageModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The recording image sizes and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedAudioModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedAudioModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The recording video resolutions and formats supported by the device.
|
||||
* @returns {ConfigurationData[]}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get supportedVideoModes(): ConfigurationData[] {
|
||||
return <ConfigurationData[]>navigator.device.capture.supportedVideoModes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the audio recorder application and return information about captured audio clip files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureAudio(options?: CaptureAudioOptions): Promise<MediaFile[]|CaptureError> {return; }
|
||||
|
||||
/**
|
||||
* Start the camera application and return information about captured image files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureImage(options?: CaptureImageOptions): Promise<MediaFile[]|CaptureError> {return; }
|
||||
|
||||
/**
|
||||
* Start the video recorder application and return information about captured video clip files.
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static captureVideo(options?: CaptureVideoOptions): Promise<MediaFile[]|CaptureError> {return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is successful
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureresult'
|
||||
})
|
||||
static onPendingCaptureResult(): Observable<MediaFile[]> {return; }
|
||||
|
||||
/**
|
||||
* is fired if the capture call is unsuccessful
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'pendingcaptureerror'
|
||||
})
|
||||
static onPendingCaptureError(): Observable<CaptureError> {return; }
|
||||
|
||||
}
|
||||
/**
|
||||
* Encapsulates properties of a media capture file.
|
||||
*/
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The full path of the file, including the name.
|
||||
*/
|
||||
fullPath: string;
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
lastModifiedDate: Date;
|
||||
/**
|
||||
* The size of the file, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Retrieves the format information of the media file.
|
||||
* @param {Function} successCallback
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
||||
}
|
||||
/**
|
||||
* Encapsulates format information about a media file.
|
||||
*/
|
||||
export interface MediaFileData {
|
||||
/**
|
||||
* The actual format of the audio and video content.
|
||||
*/
|
||||
codecs: string;
|
||||
/**
|
||||
* The average bitrate of the content. The value is zero for images.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The length of the video or sound clip in seconds. The value is zero for images.
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates the error code resulting from a failed media capture operation.
|
||||
*/
|
||||
export interface CaptureError {
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Encapsulates audio capture configuration options.
|
||||
*/
|
||||
export interface CaptureAudioOptions {
|
||||
/**
|
||||
* Maximum number of audio clips. Defaults to 1.
|
||||
* On iOS you can only record one file.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates image capture configuration options.
|
||||
*/
|
||||
export interface CaptureImageOptions {
|
||||
/**
|
||||
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates video capture configuration options.
|
||||
*/
|
||||
export interface CaptureVideoOptions {
|
||||
/**
|
||||
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration per video clip. This will be ignored on BlackBerry.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Quality of the video. This parameter can only be used with Android.
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates a set of media capture parameters that a device supports.
|
||||
*/
|
||||
export interface ConfigurationData {
|
||||
/**
|
||||
* The ASCII-encoded lowercase string representing the media type.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
56
src/plugins/nativestorage.ts
Normal file
56
src/plugins/nativestorage.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* @name Native Storage
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {NativeStorage} from 'ionic-native';
|
||||
*
|
||||
* NativeStorage.setItem('myitem', {property: 'value', anotherProperty: 'anotherValue'})
|
||||
* .then(
|
||||
* () => console.log('Stored item!'),
|
||||
* error => console.error('Error storing item', error)
|
||||
* );
|
||||
*
|
||||
* NativeStorage.getItem('myitem')
|
||||
* .then(
|
||||
* data => console.log(data),
|
||||
* error => console.error(error)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-nativestorage',
|
||||
pluginRef: 'NativeStorage',
|
||||
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'
|
||||
})
|
||||
export class NativeStorage {
|
||||
/**
|
||||
* Stores a value
|
||||
* @param reference
|
||||
* @param value
|
||||
*/
|
||||
@Cordova()
|
||||
static setItem(reference: string, value: any): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Gets a stored item
|
||||
* @param reference
|
||||
*/
|
||||
@Cordova()
|
||||
static getItem(reference: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Removes a single stored item
|
||||
* @param reference
|
||||
*/
|
||||
@Cordova()
|
||||
static remove(reference: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Removes all stored values.
|
||||
*/
|
||||
@Cordova()
|
||||
static clear(): Promise<any> {return; }
|
||||
}
|
||||
@@ -10,7 +10,7 @@ declare var navigator: any;
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Network, Connection} from 'ionic-native';
|
||||
* import {Network} from 'ionic-native';
|
||||
*
|
||||
* // watch network for a disconnect
|
||||
* let disconnectSubscription = Network.onDisconnect().subscribe(() => {
|
||||
@@ -28,8 +28,7 @@ declare var navigator: any;
|
||||
*
// before we determine the connection type. Might need to wait
|
||||
* // prior to doing any api requests as well.
|
||||
* setTimeout(() => {
|
||||
* console.log(Network.connection);
|
||||
* if (Network.connection === Connection.WIFI) {
|
||||
* if (Network.connection === 'wifi') {
|
||||
* console.log('we got a wifi connection, woohoo!');
|
||||
* }
|
||||
* }, 3000);
|
||||
@@ -39,6 +38,8 @@ declare var navigator: any;
|
||||
* connectSubscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @advanced
|
||||
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-network-information',
|
||||
@@ -52,7 +53,7 @@ export class Network {
|
||||
* Return the network connection type
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get connection(): Connection { return navigator.connection.type; }
|
||||
static get connection(): String { return navigator.connection.type; }
|
||||
|
||||
/**
|
||||
* Get notified when the device goes offline
|
||||
@@ -75,14 +76,3 @@ export class Network {
|
||||
static onConnect(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export class Connection {
|
||||
static get UNKNOWN() { return 'unknown'; }
|
||||
static get ETHERNET() { return 'ethernet'; }
|
||||
static get WIFI() { return 'wifi'; }
|
||||
static get CELL_2G() { return '2g'; }
|
||||
static get CELL_3G() { return '3g'; }
|
||||
static get CELL_4G() { return '4g'; }
|
||||
static get CELL() { return 'cellular'; }
|
||||
static get NONE() { return 'none'; }
|
||||
}
|
||||
|
||||
253
src/plugins/onesignal.ts
Normal file
253
src/plugins/onesignal.ts
Normal file
@@ -0,0 +1,253 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
|
||||
* OneSignal is a simple implementation for delivering push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {OneSignal} from 'ionic-native';
|
||||
*
|
||||
* let notificationOpenedCallback(jsonData: any) {
|
||||
* console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));
|
||||
* };
|
||||
* OneSignal.init("b2f7f966-d8cc-11e4-bed1-df8f05be55ba",
|
||||
* {googleProjectNumber: "703322744261"},
|
||||
* notificationOpenedCallback);
|
||||
*
|
||||
* OneSignal.enableInAppAlertNotification(true);
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
/**
|
||||
* Only required method you need to call to setup OneSignal to receive push notifications. Call this from the `deviceready` event.
|
||||
*
|
||||
* @param {appId} Your AppId from your OneSignal app
|
||||
* @param {options} The Google Project Number (which you can get from the Google Developer Potal) and the autoRegister option.
|
||||
* @returns {Promise} Returns a Promise that resolves when remote notification was recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
static init(appId: string,
|
||||
options: {
|
||||
googleProjectNumber: string,
|
||||
autoRegister: boolean
|
||||
}): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only use if you passed false to autoRegister when calling init.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerForPushNotifications(): void { }
|
||||
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {key} Key of your choosing to create or update.
|
||||
* @param {value} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTag(key: string, value: string): void { }
|
||||
|
||||
/**
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {json} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that resolves when tags are recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
static getTags(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
|
||||
*
|
||||
* @param {key} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {keys} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {enable} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {enable} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon devices.
|
||||
*
|
||||
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
|
||||
* If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableNotificationsWhenActive(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
|
||||
* If set to true notifications will be shown as native alert boxes if a notification is received when the user is in your app.
|
||||
* The notificationOpenedCallback is then fired after the alert box is closed.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableInAppAlertNotification(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {enable} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
static postNotification(notificationObj: {
|
||||
app_id: string,
|
||||
contents: any,
|
||||
headings?: any,
|
||||
isIos?: boolean,
|
||||
isAndroid?: boolean,
|
||||
isWP?: boolean,
|
||||
isWP_WNS?: boolean,
|
||||
isAdm?: boolean,
|
||||
isChrome?: boolean,
|
||||
isChromeWeb?: boolean,
|
||||
isSafari?: boolean,
|
||||
isAnyWeb?: boolean,
|
||||
included_segments?: string[],
|
||||
excluded_segments?: string[],
|
||||
include_player_ids?: string[],
|
||||
include_ios_tokens?: string[],
|
||||
include_android_reg_ids?: string[],
|
||||
include_wp_uris?: string[],
|
||||
include_wp_wns_uris?: string[],
|
||||
include_amazon_reg_ids?: string[],
|
||||
include_chrome_reg_ids?: string[],
|
||||
include_chrome_web_reg_ids?: string[],
|
||||
app_ids?: string[];
|
||||
tags?: any[],
|
||||
ios_badgeType?: string,
|
||||
ios_badgeCount?: number,
|
||||
ios_sound?: string,
|
||||
android_sound?: string,
|
||||
adm_sound?: string,
|
||||
wp_sound?: string,
|
||||
wp_wns_sound?: string,
|
||||
data?: any,
|
||||
buttons?: any,
|
||||
small_icon?: string,
|
||||
large_icon?: string,
|
||||
big_picture?: string,
|
||||
adm_small_icon?: string,
|
||||
adm_large_icon?: string,
|
||||
adm_big_picture?: string,
|
||||
chrome_icon?: string,
|
||||
chrome_big_picture?: string,
|
||||
chrome_web_icon?: string,
|
||||
firefox_icon?: string,
|
||||
url?: string,
|
||||
send_after?: string,
|
||||
delayed_option?: string,
|
||||
delivery_time_of_day?: string,
|
||||
android_led_color?: string,
|
||||
android_accent_color?: string,
|
||||
android_visibility?: number,
|
||||
content_available?: boolean,
|
||||
amazon_background_data?: boolean,
|
||||
template_id?: string,
|
||||
android_group?: string,
|
||||
android_group_message?: any,
|
||||
adm_group?: string,
|
||||
adm_group_message?: any,
|
||||
ttl?: number,
|
||||
priority?: number,
|
||||
ios_category?: string
|
||||
}): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static promptLocation(): void { }
|
||||
|
||||
/**
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
|
||||
* The higher the value the more information is shown.
|
||||
*
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setLogLevel(logLevel: {
|
||||
logLevel: number,
|
||||
visualLevel: number
|
||||
}): void { }
|
||||
}
|
||||
37
src/plugins/pin-dialog.ts
Normal file
37
src/plugins/pin-dialog.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* @name Pin Dialog
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import {PinDialog} from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
|
||||
* .then(
|
||||
* (result: any) => {
|
||||
* if(result.buttonIndex == 1) console.log('User clicked OK, value is: ', result.input1);
|
||||
* else if(result.buttonIndex == 2) console.log('User cancelled');
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-pin-dialog',
|
||||
pluginRef: 'plugins.pinDialog',
|
||||
repo: 'https://github.com/Paldom/PinDialog'
|
||||
})
|
||||
export class PinDialog {
|
||||
/**
|
||||
* Show pin dialog
|
||||
* @param {string} message Message to show the user
|
||||
* @param {string} title Title of the dialog
|
||||
* @param {string[]} buttons Buttons to show
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1
|
||||
})
|
||||
static prompt(message: string, title: string, buttons: string[]): Promise<{buttonIndex: number, input1: string}> {return; }
|
||||
}
|
||||
@@ -142,6 +142,7 @@ function callInstance(pluginObj: any, methodName: string, args: any[], opts: any
|
||||
function wrapInstance (pluginObj: any, methodName: string, opts: any = {}) {
|
||||
return (...args) => {
|
||||
if (opts.sync) {
|
||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||
return callInstance(pluginObj, methodName, args, opts);
|
||||
} else if (opts.observable) {
|
||||
return new Observable(observer => {
|
||||
@@ -173,9 +174,8 @@ function wrapInstance (pluginObj: any, methodName: string, opts: any = {}) {
|
||||
*/
|
||||
function wrapEventObservable (event: string): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
let callback = (status: any) => observer.next(status);
|
||||
window.addEventListener(event, callback, false);
|
||||
return () => window.removeEventListener(event, callback, false);
|
||||
window.addEventListener(event, observer.next.bind(observer), false);
|
||||
return () => window.removeEventListener(event, observer.next.bind(observer), false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -190,6 +190,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {}
|
||||
return (...args) => {
|
||||
|
||||
if (opts.sync)
|
||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||
return callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||
|
||||
else if (opts.observable)
|
||||
|
||||
@@ -186,6 +186,29 @@ export interface IOSPushOptions {
|
||||
* **Note**: only usable in conjunction with `senderID`.
|
||||
*/
|
||||
topics?: string[];
|
||||
|
||||
/**
|
||||
* The data required in order to enable Action Buttons for iOS.
|
||||
* Action Buttons on iOS - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#action-buttons-1
|
||||
*/
|
||||
categories?: CategoryArray;
|
||||
}
|
||||
|
||||
export interface CategoryArray {
|
||||
[name: string]: CategoryAction;
|
||||
}
|
||||
|
||||
export interface CategoryAction {
|
||||
yes?: CategoryActionData;
|
||||
no?: CategoryActionData;
|
||||
maybe?: CategoryActionData;
|
||||
}
|
||||
|
||||
export interface CategoryActionData {
|
||||
callback: string;
|
||||
title: string;
|
||||
foreground: boolean;
|
||||
destructive: boolean;
|
||||
}
|
||||
|
||||
export interface AndroidPushOptions {
|
||||
|
||||
@@ -41,7 +41,7 @@ import {Plugin, Cordova} from './plugin';
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-safariviewcontroller',
|
||||
pluginRef: 'SafariViewController',
|
||||
platforms: ['iOS'],
|
||||
platforms: ['iOS', 'Android'],
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
|
||||
})
|
||||
export class SafariViewController {
|
||||
@@ -56,17 +56,13 @@ export class SafariViewController {
|
||||
* Shows Safari View Controller
|
||||
* @param options
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
@Cordova()
|
||||
static show(options?: SafariViewControllerOptions): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Hides Safari View Controller
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
@Cordova()
|
||||
static hide(): void {}
|
||||
|
||||
/**
|
||||
|
||||
35
src/plugins/sim.ts
Normal file
35
src/plugins/sim.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
|
||||
/**
|
||||
* @name Sim
|
||||
* @description
|
||||
* Gets info from the Sim card like the carrier name, mcc, mnc and country code and other system dependent info.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-sim`. For more info, please see the [Cordova Sim docs](https://github.com/pbakondy/cordova-plugin-sim).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Sim} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Sim.getSimInfo().then(
|
||||
* (info) => console.log('Sim info:', info),
|
||||
* (err) => console.log('Unable to get sim info:', err)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-sim',
|
||||
pluginRef: 'plugins.sim',
|
||||
repo: 'https://github.com/pbakondy/cordova-plugin-sim',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
export class Sim {
|
||||
/**
|
||||
* Returns info from the SIM card.
|
||||
* @returns {Promise}
|
||||
*/
|
||||
@Cordova()
|
||||
static getSimInfo(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -28,10 +28,8 @@ export class SocialSharing {
|
||||
* @param file {string|Array<string>} URL(s) to file(s) or image(s), local path(s) to file(s) or image(s), or base64 data of an image. Only the first file/image will be used on Windows Phone.
|
||||
* @param url {string} A URL to share
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static share (message?: string, subject?: string, file?: string|Array<string>, url?: string): void {}
|
||||
@Cordova()
|
||||
static share (message?: string, subject?: string, file?: string|Array<string>, url?: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Shares using the share sheet with additional options and returns a result object or an error message (requires plugin version 5.1.0+)
|
||||
@@ -58,10 +56,9 @@ export class SocialSharing {
|
||||
* @param url
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
static shareViaTwitter (message: string, image?: string, url?: string): void {}
|
||||
static shareViaTwitter (message: string, image?: string, url?: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Shares directly to Facebook
|
||||
|
||||
@@ -27,7 +27,7 @@ export class SpinnerDialog {
|
||||
* Shows the spinner dialog
|
||||
* @param title {string} Spinner title (shows on Android only)
|
||||
* @param message {string} Spinner message
|
||||
* @param cancelCallback {boolean|function} Set to false to set spinner not cancelable. Or provide a function to call when the user cancels the spinner.
|
||||
* @param cancelCallback {boolean|function} Set to true to set spinner not cancelable. Or provide a function to call when the user cancels the spinner.
|
||||
* @param iOSOptions {object} Options for iOS only
|
||||
*/
|
||||
@Cordova({
|
||||
@@ -50,4 +50,4 @@ export interface SpinnerDialogIOSOptions {
|
||||
textColorRed?: number;
|
||||
textColorGreen?: number;
|
||||
textColorBlue?: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export class SQLite {
|
||||
* import { SQLite } from 'ionic-native';
|
||||
*
|
||||
* let db = new SQLite();
|
||||
* db.openDatabse({
|
||||
* db.openDatabase({
|
||||
* name: 'data.db',
|
||||
* location: 'default' // the location field is required
|
||||
* }).then(() => {
|
||||
|
||||
@@ -53,7 +53,7 @@ export class TouchID {
|
||||
* @return {Promise} Returns a Promise that resolves if yes, rejects if no.
|
||||
*/
|
||||
@Cordova()
|
||||
isAvailable(): Promise<any> { return; }
|
||||
static isAvailable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, brings up standard system passcode screen.
|
||||
|
||||
Reference in New Issue
Block a user