Merge branch 'master' into patch-1
This commit is contained in:
commit
22cb2e3f45
8
.github/ISSUE_TEMPLATE.md
vendored
8
.github/ISSUE_TEMPLATE.md
vendored
@ -1,7 +1,7 @@
|
||||
**I'm submitting a ...** (check one with "x")
|
||||
[ ] bug report
|
||||
[ ] feature request
|
||||
<!-- Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/ -->
|
||||
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
|
||||
|
||||
**Current behavior:**
|
||||
<!-- Describe how the bug manifests. -->
|
||||
@ -21,8 +21,8 @@ insert any relevant code here
|
||||
**Other information:**
|
||||
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
|
||||
|
||||
**package.json info:**
|
||||
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):
|
||||
|
||||
```json
|
||||
insert the content here
|
||||
```
|
||||
insert the output from ionic info here
|
||||
```
|
||||
|
164
CHANGELOG.md
164
CHANGELOG.md
@ -1,5 +1,167 @@
|
||||
<a name="4.6.0"></a>
|
||||
# [4.6.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.3...v4.6.0) (2018-03-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **badge:** add correct requestPermission function ([586c7e5](https://github.com/ionic-team/ionic-native/commit/586c7e5))
|
||||
* **call-log:** comments erratum ([4b9cf17](https://github.com/ionic-team/ionic-native/commit/4b9cf17))
|
||||
* **call-log:** update getCallLog signature ([61c0ecf](https://github.com/ionic-team/ionic-native/commit/61c0ecf))
|
||||
* **contacts:** refactor wrong ContactFieldTypes ([f607a03](https://github.com/ionic-team/ionic-native/commit/f607a03))
|
||||
* **facebook:** remove browserInit function ([f718432](https://github.com/ionic-team/ionic-native/commit/f718432))
|
||||
* **firebase-analytics:** add `sync` option for all methods ([42fd1f2](https://github.com/ionic-team/ionic-native/commit/42fd1f2))
|
||||
* **google-maps:** wrong decorators ([e5b9d53](https://github.com/ionic-team/ionic-native/commit/e5b9d53))
|
||||
* **health-kit:** add missing properties to HealthKitOptions ([f8e79ce](https://github.com/ionic-team/ionic-native/commit/f8e79ce))
|
||||
* **index-app-content:** remove onItemPressed function ([270678f](https://github.com/ionic-team/ionic-native/commit/270678f))
|
||||
* **printer:** add correct npm repository ([4bf55d3](https://github.com/ionic-team/ionic-native/commit/4bf55d3))
|
||||
* **pro:** proper callback type and guard for plugin instantiate. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([61293c3](https://github.com/ionic-team/ionic-native/commit/61293c3))
|
||||
* **pro:** Tweak to pro plugin. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([c8ecee0](https://github.com/ionic-team/ionic-native/commit/c8ecee0))
|
||||
* **Pro:** CordovaCheck should sync. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([f419db5](https://github.com/ionic-team/ionic-native/commit/f419db5))
|
||||
* **push:** Android senderID as optional ([1b237aa](https://github.com/ionic-team/ionic-native/commit/1b237aa))
|
||||
* **Radmob-pro:** add offsetTopBar option ([4948640](https://github.com/ionic-team/ionic-native/commit/4948640))
|
||||
* **sqlite:** remove trailing whitespaces ([7547a94](https://github.com/ionic-team/ionic-native/commit/7547a94))
|
||||
* **web-intent:** allow extras ([8dc5ad2](https://github.com/ionic-team/ionic-native/commit/8dc5ad2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **app-rate:** add custom locale interface ([2a18dbc](https://github.com/ionic-team/ionic-native/commit/2a18dbc))
|
||||
* **app-update:** add app update options ([0f325ed](https://github.com/ionic-team/ionic-native/commit/0f325ed))
|
||||
* **appodeal:** add new functions ([247a1a1](https://github.com/ionic-team/ionic-native/commit/247a1a1))
|
||||
* **base64-to-gallery:** add options interface ([11d516f](https://github.com/ionic-team/ionic-native/commit/11d516f))
|
||||
* **ble:** add scan options interface ([e345fed](https://github.com/ionic-team/ionic-native/commit/e345fed))
|
||||
* **calendar:** add getCreateCalendarOptions function ([13765d2](https://github.com/ionic-team/ionic-native/commit/13765d2))
|
||||
* **call-log:** add plugin ([76a644d](https://github.com/ionic-team/ionic-native/commit/76a644d))
|
||||
* **camera-preview:** add onBackButton function ([a345e2c](https://github.com/ionic-team/ionic-native/commit/a345e2c))
|
||||
* **device-accounts:** add android account interface ([d2261b6](https://github.com/ionic-team/ionic-native/commit/d2261b6))
|
||||
* **device-feedback:** add feedback interface ([7cafebd](https://github.com/ionic-team/ionic-native/commit/7cafebd))
|
||||
* **google-analytics:** add missing functions ([ff0008e](https://github.com/ionic-team/ionic-native/commit/ff0008e))
|
||||
* **google-maps:** update to match latest plugin version ([#2320](https://github.com/ionic-team/ionic-native/issues/2320)) ([f11be24](https://github.com/ionic-team/ionic-native/commit/f11be24))
|
||||
* **hot code push:** add cordova-hot-code-push ([e7968da](https://github.com/ionic-team/ionic-native/commit/e7968da))
|
||||
* **hot code push:** add update events ([04bdade](https://github.com/ionic-team/ionic-native/commit/04bdade))
|
||||
* **jins-meme:** enable background mode data collection ([1932f2d](https://github.com/ionic-team/ionic-native/commit/1932f2d))
|
||||
* **local-notifications:** added a new param to specify if the notification will be silent ([6e58192](https://github.com/ionic-team/ionic-native/commit/6e58192))
|
||||
* **one-signal:** add clearOneSignalNotifications function ([fc0338a](https://github.com/ionic-team/ionic-native/commit/fc0338a))
|
||||
* **plugin:** add iOS File Picker ([571df3a](https://github.com/ionic-team/ionic-native/commit/571df3a))
|
||||
* **speechkit:** plugin implementation ([41e5a0f](https://github.com/ionic-team/ionic-native/commit/41e5a0f))
|
||||
* **sqlite:** add selfTest function ([241f073](https://github.com/ionic-team/ionic-native/commit/241f073))
|
||||
* **web-intent:** add startService function ([15bb350](https://github.com/ionic-team/ionic-native/commit/15bb350))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.3"></a>
|
||||
# [5.0.0-beta.3](https://github.com/ionic-team/ionic-native/compare/v4.5.1...v5.0.0-beta.3) (2017-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **push:** fix finish method ([995fd56](https://github.com/ionic-team/ionic-native/commit/995fd56))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **crop:** add targetHeight and targetWidth options ([#2213](https://github.com/ionic-team/ionic-native/issues/2213)) ([9990df8](https://github.com/ionic-team/ionic-native/commit/9990df8))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.1"></a>
|
||||
## [4.5.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.0...v4.5.1) (2017-12-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** fix issue with CordovaFunctionOverride decorator ([6cd97ca](https://github.com/ionic-team/ionic-native/commit/6cd97ca))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.0"></a>
|
||||
# [5.0.0-beta.0](https://github.com/ionic-team/ionic-native/compare/v4.5.0...v5.0.0-beta.0) (2017-12-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **alipay:** add 'string' as an alternative type for 'pay()' input parameter; ([#2172](https://github.com/ionic-team/ionic-native/issues/2172)) ([d43fe72](https://github.com/ionic-team/ionic-native/commit/d43fe72))
|
||||
* **app-rate:** add simpleMode ([#2155](https://github.com/ionic-team/ionic-native/issues/2155)) ([9844274](https://github.com/ionic-team/ionic-native/commit/9844274))
|
||||
* **app-rate:** change openStoreInApp to inAppReview ([#2097](https://github.com/ionic-team/ionic-native/issues/2097)) ([d95ae68](https://github.com/ionic-team/ionic-native/commit/d95ae68))
|
||||
* **camera-preview:** add missing `tapToFocus` camera option ([#2046](https://github.com/ionic-team/ionic-native/issues/2046)) ([b9b781d](https://github.com/ionic-team/ionic-native/commit/b9b781d))
|
||||
* **deeplinks:** add options parameter([#1601](https://github.com/ionic-team/ionic-native/issues/1601)) ([#2141](https://github.com/ionic-team/ionic-native/issues/2141)) ([bb2291c](https://github.com/ionic-team/ionic-native/commit/bb2291c))
|
||||
* **ftp:** return observable (not promise) for upload and download method ([#2174](https://github.com/ionic-team/ionic-native/issues/2174)) ([5159367](https://github.com/ionic-team/ionic-native/commit/5159367))
|
||||
* **indexappcontent:** Return observable for onItemPressed ([#2006](https://github.com/ionic-team/ionic-native/issues/2006)) ([9a52110](https://github.com/ionic-team/ionic-native/commit/9a52110))
|
||||
* **mobile-accessibility:** change signature references to the correct names ([#2139](https://github.com/ionic-team/ionic-native/issues/2139)) ([b2c873c](https://github.com/ionic-team/ionic-native/commit/b2c873c))
|
||||
* **ms-adal:** add userInfo in the AuthenticationResult ([#2160](https://github.com/ionic-team/ionic-native/issues/2160)) ([c038c63](https://github.com/ionic-team/ionic-native/commit/c038c63))
|
||||
* **music-controls:** various fixes ([#2094](https://github.com/ionic-team/ionic-native/issues/2094)) ([afca876](https://github.com/ionic-team/ionic-native/commit/afca876))
|
||||
* **push:** add senderID to AndroidPushOptions ([#2060](https://github.com/ionic-team/ionic-native/issues/2060)) ([4694c42](https://github.com/ionic-team/ionic-native/commit/4694c42))
|
||||
* **web-intent:** fix false negative of plugin installation ([#2062](https://github.com/ionic-team/ionic-native/issues/2062)) ([ae94c71](https://github.com/ionic-team/ionic-native/commit/ae94c71))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android exoplayer:** add cordova-plugin-exoplayer ([#2180](https://github.com/ionic-team/ionic-native/issues/2180)) ([d06fa48](https://github.com/ionic-team/ionic-native/commit/d06fa48))
|
||||
* **android-fingerprint:** add getSigningCertificateFingerprint() method ([#2076](https://github.com/ionic-team/ionic-native/issues/2076)) ([bd5bcdc](https://github.com/ionic-team/ionic-native/commit/bd5bcdc))
|
||||
* **apple-pay:** add cordova-plugin-applepay ([#2081](https://github.com/ionic-team/ionic-native/issues/2081)) ([784f948](https://github.com/ionic-team/ionic-native/commit/784f948))
|
||||
* **apple-pay:** update for version 3 of the Apple Pay plugin. ([#2177](https://github.com/ionic-team/ionic-native/issues/2177)) ([bf41506](https://github.com/ionic-team/ionic-native/commit/bf41506))
|
||||
* **ble:** support startStateNotifications & stopStateNotifications ([#2085](https://github.com/ionic-team/ionic-native/issues/2085)) ([2a4bcee](https://github.com/ionic-team/ionic-native/commit/2a4bcee))
|
||||
* **braintree:** add support for cordova-plugin-braintree to [@ionic-native](https://github.com/ionic-native) ([#2073](https://github.com/ionic-team/ionic-native/issues/2073)) ([091ac7a](https://github.com/ionic-team/ionic-native/commit/091ac7a))
|
||||
* **call-number:** add isCallSupported method ([#2051](https://github.com/ionic-team/ionic-native/issues/2051)) ([6053296](https://github.com/ionic-team/ionic-native/commit/6053296))
|
||||
* **dns:** add cordova-plugin-dns plugin ([#2083](https://github.com/ionic-team/ionic-native/issues/2083)) ([212bd63](https://github.com/ionic-team/ionic-native/commit/212bd63))
|
||||
* **firebase:** add new Firebase phone verification methods ([#2157](https://github.com/ionic-team/ionic-native/issues/2157)) ([86181af](https://github.com/ionic-team/ionic-native/commit/86181af))
|
||||
* **GooglePlayGamesServices:** add plugin ([#1904](https://github.com/ionic-team/ionic-native/issues/1904)) ([03f5789](https://github.com/ionic-team/ionic-native/commit/03f5789))
|
||||
* **network-interface:** add plugin support ([#2063](https://github.com/ionic-team/ionic-native/issues/2063)) ([86b2a2c](https://github.com/ionic-team/ionic-native/commit/86b2a2c))
|
||||
* **nfc:** add interfaces and missing references to UriHelper and TextHelper ([#2104](https://github.com/ionic-team/ionic-native/issues/2104)) ([8b78644](https://github.com/ionic-team/ionic-native/commit/8b78644))
|
||||
* **nfc:** add support for iOS ([#2050](https://github.com/ionic-team/ionic-native/issues/2050)) ([9f72592](https://github.com/ionic-team/ionic-native/commit/9f72592))
|
||||
* **push:** add support for version 2.1.0 ([#2064](https://github.com/ionic-team/ionic-native/issues/2064)) ([c1ce5da](https://github.com/ionic-team/ionic-native/commit/c1ce5da))
|
||||
* **zeroconf:** add reInit() method ([#2144](https://github.com/ionic-team/ionic-native/issues/2144)) ([7255795](https://github.com/ionic-team/ionic-native/commit/7255795))
|
||||
|
||||
|
||||
|
||||
<a name="4.4.2"></a>
|
||||
## [4.4.2](https://github.com/ionic-team/ionic-native/compare/v4.4.1...v4.4.2) (2017-11-15)
|
||||
|
||||
|
||||
|
||||
<a name="4.4.1"></a>
|
||||
## [4.4.1](https://github.com/ionic-team/ionic-native/compare/v4.4.0...v4.4.1) (2017-11-13)
|
||||
|
||||
|
||||
|
||||
<a name="4.4.0"></a>
|
||||
# [4.4.0](https://github.com/ionic-team/ionic-native/compare/v4.3.3...v4.4.0) (2017-11-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-maps:** accept own properties for `addMarker()` and others ([#2093](https://github.com/ionic-team/ionic-native/issues/2093)) ([196be02](https://github.com/ionic-team/ionic-native/commit/196be02))
|
||||
* **http:** add support for new methods ([#2054](https://github.com/ionic-team/ionic-native/issues/2054)) ([d96d3ee](https://github.com/ionic-team/ionic-native/commit/d96d3ee))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.3"></a>
|
||||
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.3) (2017-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** HtmlInfoWindow should extend BaseClass [#2034](https://github.com/ionic-team/ionic-native/issues/2034) ([#2035](https://github.com/ionic-team/ionic-native/issues/2035)) ([ce6e412](https://github.com/ionic-team/ionic-native/commit/ce6e412))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.1...4.3.2) (2017-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** remove type from GoogleMapsEvent constant ([4639bf9](https://github.com/ionic-team/ionic-native/commit/4639bf9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pro:** support corova-plugin-ionic v2.0.0 ([975f08b](https://github.com/ionic-team/ionic-native/commit/975f08b))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.1"></a>
|
||||
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.2) (2017-10-06)
|
||||
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...4.3.1) (2017-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
11
CODE_OF_CONDUCT.md
Normal file
11
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of the Ionic project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
|
||||
|
||||
Communication through any of Ionic's channels (GitHub, Slack, Forum, IRC, mailing lists, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ionic project to do the same.
|
||||
|
||||
If any member of the community violates this code of conduct, the maintainers of the Ionic project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
|
||||
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [hi@ionicframework.com](mailto:hi@ionicframework.com).
|
@ -210,3 +210,12 @@ someMethod(): Promise<any> {
|
||||
// anything here will only run if the plugin is available
|
||||
}
|
||||
```
|
||||
|
||||
#### CordovaFunctionOverride
|
||||
Wrap a stub function in a call to a Cordova plugin, checking if both Cordova and the required plugin are installed.
|
||||
|
||||
Example:
|
||||
```ts
|
||||
@CordovaFunctionOverride()
|
||||
someMethod(): Observable<any> { return; }
|
||||
```
|
12256
package-lock.json
generated
12256
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "4.3.1",
|
||||
"version": "4.6.0",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "4.1.3",
|
||||
"@angular/compiler-cli": "4.1.3",
|
||||
"@angular/core": "4.1.3",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.5.51",
|
||||
"@types/node": "^7.0.27",
|
||||
"@types/jasmine": "^2.6.3",
|
||||
"@types/node": "^8.0.50",
|
||||
"canonical-path": "0.0.2",
|
||||
"child-process-promise": "2.2.1",
|
||||
"conventional-changelog-cli": "1.3.1",
|
||||
"cpr": "2.0.2",
|
||||
"conventional-changelog-cli": "1.3.4",
|
||||
"cpr": "2.0.0",
|
||||
"cz-conventional-changelog": "2.0.0",
|
||||
"decamelize": "1.2.0",
|
||||
"dgeni": "0.4.7",
|
||||
@ -39,12 +39,12 @@
|
||||
"q": "1.5.0",
|
||||
"queue": "4.2.1",
|
||||
"rimraf": "2.6.1",
|
||||
"rxjs": "5.4.0",
|
||||
"rxjs": "5.5.2",
|
||||
"semver": "5.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"typescript": "2.3.3",
|
||||
"zone.js": "0.8.12"
|
||||
"typescript": "~2.4.2",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run test:watch",
|
||||
|
@ -1,9 +1,23 @@
|
||||
import { Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
/**
|
||||
* This is a template for new plugin wrappers
|
||||
*
|
||||
* TODO:
|
||||
* - Add/Change information below
|
||||
* - Document usage (importing, executing main functionality)
|
||||
* - Remove any imports that you are not using
|
||||
* - Add this file to /src/index.ts (follow style of other plugins)
|
||||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added
|
||||
* - Remove this note
|
||||
*
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name {{ Plugin_Name }}
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@ -15,16 +29,33 @@ import { Injectable } from '@angular/core';
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.{{ pluginName }}.functionName('Hello', 123)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: '{{ PluginName }}',
|
||||
plugin: '',
|
||||
pluginRef: '',
|
||||
repo: '',
|
||||
platforms: []
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
installVariables: [], // OPTIONAL the plugin requires variables
|
||||
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class {{ PluginName }} extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
* @param arg1 {string} Some param to configure something
|
||||
* @param arg2 {number} Another param to configure something
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
functionName(arg1: string, arg2: number): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,8 +40,9 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
platforms: [], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
installVariables: [], // OPTIONAL the plugin requires variables
|
||||
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class {{ PluginName }} extends IonicNativePlugin {
|
||||
|
@ -105,17 +105,6 @@ export interface CordovaCheckOptions {
|
||||
observable?: boolean;
|
||||
}
|
||||
|
||||
export interface CordovaFiniteObservableOptions extends CordovaOptions {
|
||||
/**
|
||||
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
|
||||
*/
|
||||
resultFinalPredicate?: (result: any) => boolean;
|
||||
/**
|
||||
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
|
||||
*/
|
||||
resultTransform?: (result: any) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@ -167,7 +156,6 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
@ -323,39 +311,3 @@ export function CordovaFunctionOverride(opts: any = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
|
||||
*
|
||||
*/
|
||||
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
|
||||
if (opts.observable === false) {
|
||||
throw new Error('CordovaFiniteObservable decorator can only be used on methods that returns observable. Please provide correct option.');
|
||||
}
|
||||
opts.observable = true;
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
let wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
|
||||
return new Observable<any>((observer) => {
|
||||
let wrappedSubscription = wrappedObservable.subscribe({
|
||||
next: (x) => {
|
||||
observer.next(opts.resultTransform ? opts.resultTransform(x) : x);
|
||||
if (opts.resultFinalPredicate && opts.resultFinalPredicate(x)) {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
error: (err) => { observer.error(err); },
|
||||
complete: () => { observer.complete(); }
|
||||
});
|
||||
return () => {
|
||||
wrappedSubscription.unsubscribe();
|
||||
};
|
||||
});
|
||||
},
|
||||
enumerable: true
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ export function wrapEventObservable(event: string, element: any = window): Obser
|
||||
export function overrideFunction(pluginObj: any, methodName: string, args: any[], opts: any = {}): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
|
||||
const availabilityCheck = checkAvailability(pluginObj, methodName);
|
||||
const availabilityCheck = checkAvailability(pluginObj, null, pluginObj.constructor.getPluginName());
|
||||
|
||||
if (availabilityCheck === true) {
|
||||
const pluginInstance = getPlugin(pluginObj.constructor.getPluginRef());
|
||||
|
@ -21,7 +21,7 @@ export interface ActionSheetOptions {
|
||||
/**
|
||||
* Theme to be used on Android
|
||||
*/
|
||||
androidTheme?: number;
|
||||
androidTheme?: 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
/**
|
||||
* Enable a cancel on Android
|
||||
@ -46,7 +46,7 @@ export interface ActionSheetOptions {
|
||||
/**
|
||||
* On an iPad, set the X,Y position
|
||||
*/
|
||||
position?: number[];
|
||||
position?: [number, number];
|
||||
|
||||
/**
|
||||
* Choose if destructive button will be the last
|
||||
@ -123,7 +123,7 @@ export class ActionSheet extends IonicNativePlugin {
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
@Cordova()
|
||||
show(options?: ActionSheetOptions): Promise<any> { return; }
|
||||
show(options?: ActionSheetOptions): Promise<number> { return; }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1,11 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
|
||||
export type AdSize =
|
||||
| 'SMART_BANNER'
|
||||
| 'BANNER'
|
||||
| 'MEDIUM_RECTANGLE'
|
||||
| 'FULL_BANNER'
|
||||
| 'LEADERBOARD'
|
||||
| 'SKYSCRAPER'
|
||||
| 'CUSTOM';
|
||||
|
||||
export interface AdMobOptions {
|
||||
|
||||
/**
|
||||
* Banner ad ID
|
||||
*/
|
||||
@ -71,10 +77,13 @@ export interface AdMobOptions {
|
||||
*/
|
||||
license?: any;
|
||||
|
||||
/**
|
||||
* Set offset
|
||||
*/
|
||||
offsetTopBar?: boolean;
|
||||
}
|
||||
|
||||
export interface AdExtras {
|
||||
|
||||
color_bg: string;
|
||||
|
||||
color_bg_top: string;
|
||||
@ -86,7 +95,6 @@ export interface AdExtras {
|
||||
color_text: string;
|
||||
|
||||
color_url: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,7 +142,6 @@ export interface AdExtras {
|
||||
})
|
||||
@Injectable()
|
||||
export class AdMobPro extends IonicNativePlugin {
|
||||
|
||||
AD_POSITION: {
|
||||
NO_CHANGE: number;
|
||||
TOP_LEFT: number;
|
||||
@ -167,7 +174,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the banner is created
|
||||
*/
|
||||
@Cordova()
|
||||
createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the banner, remove it from screen.
|
||||
@ -175,7 +184,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
removeBanner(): void { }
|
||||
removeBanner(): void {}
|
||||
|
||||
/**
|
||||
* Show banner at position
|
||||
@ -184,7 +193,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
showBanner(position: number): void { }
|
||||
showBanner(position: number): void {}
|
||||
|
||||
/**
|
||||
* Show banner at custom position
|
||||
@ -194,7 +203,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
showBannerAtXY(x: number, y: number): void { }
|
||||
showBannerAtXY(x: number, y: number): void {}
|
||||
|
||||
/**
|
||||
* Hide the banner, remove it from screen, but can show it later
|
||||
@ -202,7 +211,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
hideBanner(): void { }
|
||||
hideBanner(): void {}
|
||||
|
||||
/**
|
||||
* Prepare interstitial banner
|
||||
@ -210,7 +219,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when interstitial is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show interstitial ad when it's ready
|
||||
@ -218,7 +229,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
showInterstitial(): void { }
|
||||
showInterstitial(): void {}
|
||||
|
||||
/**
|
||||
* Prepare a reward video ad
|
||||
@ -226,7 +237,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the ad is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a reward video ad
|
||||
@ -234,7 +247,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
showRewardVideoAd(): void { }
|
||||
showRewardVideoAd(): void {}
|
||||
|
||||
/**
|
||||
* Sets the values for configuration and targeting
|
||||
@ -242,14 +255,18 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the options have been set
|
||||
*/
|
||||
@Cordova()
|
||||
setOptions(options: AdMobOptions): Promise<any> { return; }
|
||||
setOptions(options: AdMobOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user ad settings
|
||||
* @returns {Promise<any>} Returns a promise that resolves with the ad settings
|
||||
*/
|
||||
@Cordova()
|
||||
getAdSettings(): Promise<any> { return; }
|
||||
getAdSettings(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when failed to receive Ad
|
||||
@ -260,7 +277,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
event: 'onAdFailLoad',
|
||||
element: document
|
||||
})
|
||||
onAdFailLoad(): Observable<any> { return; }
|
||||
onAdFailLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when Ad received
|
||||
@ -271,7 +290,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
event: 'onAdLoaded',
|
||||
element: document
|
||||
})
|
||||
onAdLoaded(): Observable<any> { return; }
|
||||
onAdLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when Ad will be showed on screen
|
||||
@ -282,7 +303,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
event: 'onAdPresent',
|
||||
element: document
|
||||
})
|
||||
onAdPresent(): Observable<any> { return; }
|
||||
onAdPresent(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when user click the Ad, and will jump out of your App
|
||||
@ -293,7 +316,9 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
event: 'onAdLeaveApp',
|
||||
element: document
|
||||
})
|
||||
onAdLeaveApp(): Observable<any> { return; }
|
||||
onAdLeaveApp(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when dismiss the Ad and back to your App
|
||||
@ -304,6 +329,7 @@ export class AdMobPro extends IonicNativePlugin {
|
||||
event: 'onAdDismiss',
|
||||
element: document
|
||||
})
|
||||
onAdDismiss(): Observable<any> { return; }
|
||||
|
||||
onAdDismiss(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -101,17 +101,17 @@ export interface AlipayOrder {
|
||||
plugin: 'cordova-alipay-base',
|
||||
pluginRef: 'Alipay.Base',
|
||||
repo: 'https://github.com/xueron/cordova-alipay-base',
|
||||
install: 'ionic cordova plugin add cordova-alipay-base --variable APP_ID=your_app_id',
|
||||
installVariables: ['APP_ID'],
|
||||
install: 'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id',
|
||||
installVariables: ['ALI_PID'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Alipay extends IonicNativePlugin {
|
||||
/**
|
||||
* Open Alipay to perform App pay
|
||||
* @param order { AlipayOrder } alipay options
|
||||
* @param order { AlipayOrder | string } alipay options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
pay(order: AlipayOrder): Promise<any> { return; }
|
||||
pay(order: AlipayOrder | string): Promise<any> { return; }
|
||||
}
|
||||
|
273
src/@ionic-native/plugins/android-exoplayer/index.ts
Normal file
273
src/@ionic-native/plugins/android-exoplayer/index.ts
Normal file
@ -0,0 +1,273 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AndroidExoPlayerAspectRatio = 'FILL_SCREEN' | 'FIT_SCREEN';
|
||||
|
||||
export interface AndroidExoPlayerParams {
|
||||
/**
|
||||
* Url of the video to play.
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Set the user agent. Default is `ExoPlayerPlugin`
|
||||
*/
|
||||
userAgent?: string;
|
||||
|
||||
/**
|
||||
* Set the player aspect ratio.
|
||||
*/
|
||||
aspectRatio?: AndroidExoPlayerAspectRatio;
|
||||
|
||||
/**
|
||||
* Hide controls after this many milliseconds, default is `5000`.
|
||||
*/
|
||||
hideTimeout?: number;
|
||||
|
||||
/**
|
||||
* When set to false stream will not automatically start.
|
||||
*/
|
||||
autoPlay?: boolean;
|
||||
|
||||
/**
|
||||
* Start playback at this many milliseconds into video, default is `0`.
|
||||
*/
|
||||
seekTo?: number;
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds to use when skipping forward, default is `1000`.
|
||||
*/
|
||||
forwardTime?: number;
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds to use when skipping backward, default is `1000`.
|
||||
*/
|
||||
rewindTime?: number;
|
||||
|
||||
/**
|
||||
* Only play audio in the backgroud, default is `false`.
|
||||
* If you pass in `audioOnly: true`, make sure to manually close the player on some event (like escape button) since the plugin won't be detecting keypresses when playing audio in the background.
|
||||
*/
|
||||
audioOnly?: true;
|
||||
|
||||
/**
|
||||
* Optional subtitle url to display over the video.
|
||||
* We currently support .srt and .vtt subtitle formats. Subtitles are not supported on all stream types, as ExoPlayer has requirement that both video and subtitle "must have the same number of periods, and must not have any dynamic windows", which means for simple mp4s it should work, but on more complex HLS/Dash setups it might not.
|
||||
*/
|
||||
subtitleUrl?: string;
|
||||
|
||||
/**
|
||||
* okhttp connect timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
connectTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp read timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
readTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp write timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
writeTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp socket ping interval in milliseconds (default is `0` or disabled)
|
||||
*/
|
||||
pingInterval?: number;
|
||||
|
||||
/**
|
||||
* Number of times datasource will retry the stream before giving up (default is `3`)
|
||||
*/
|
||||
retryCount?: number;
|
||||
|
||||
/**
|
||||
* If this object is not present controller will not be visible.
|
||||
*/
|
||||
controller?: AndroidExoPlayerControllerConfig;
|
||||
}
|
||||
|
||||
export interface AndroidExoplayerState {
|
||||
[s: string]: string;
|
||||
}
|
||||
|
||||
export interface AndroidExoPlayerControllerConfig {
|
||||
/**
|
||||
* Image in the controller.
|
||||
*/
|
||||
streamImage: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
streamTitle: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
streamDescription: string;
|
||||
|
||||
/**
|
||||
* Hide entire progress bar.
|
||||
*/
|
||||
hideProgress?: true;
|
||||
|
||||
/**
|
||||
* If progress bar is visible hide current position from it
|
||||
*/
|
||||
hidePosition: false;
|
||||
|
||||
/**
|
||||
* If progress bar is visible Hide stream duration from it
|
||||
*/
|
||||
hideDuration: false;
|
||||
|
||||
/**
|
||||
* Override the player control button icons.
|
||||
*/
|
||||
controlIcons?: {
|
||||
/**
|
||||
* Rewind button icon.
|
||||
*/
|
||||
exo_rew: string;
|
||||
|
||||
/**
|
||||
* Play button icon.
|
||||
*/
|
||||
exo_play: string;
|
||||
|
||||
/**
|
||||
* Payse button icon.
|
||||
*/
|
||||
exo_pause: string;
|
||||
|
||||
/**
|
||||
* Fast forward button icon.
|
||||
*/
|
||||
exo_ffwd: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Android ExoPlayer
|
||||
* @description
|
||||
* Cordova media player plugin using Google's ExoPlayer framework.
|
||||
*
|
||||
* https://github.com/google/ExoPlayer
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AndroidExoPlayer } from '@ionic-native/android-exoplayer';
|
||||
*
|
||||
* constructor(private androidExoPlayer: AndroidExoPlayer) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.androidExoPlayer.show({url: 'http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube'});
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AndroidExoPlayerParams
|
||||
* AndroidExoplayerState
|
||||
* AndroidExoPlayerControllerConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidExoPlayer',
|
||||
plugin: 'cordova-plugin-exoplayer',
|
||||
pluginRef: 'ExoPlayer',
|
||||
repo: 'https://github.com/frontyard/cordova-plugin-exoplayer',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidExoplayer extends IonicNativePlugin {
|
||||
/**
|
||||
* Show the player.
|
||||
* @param parameters {AndroidExoPlayerParams} Parameters
|
||||
* @return {Observable<AndroidExoplayerState>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'close',
|
||||
clearWithArgs: false,
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
show(parameters: AndroidExoPlayerParams): Observable<AndroidExoplayerState> { return; }
|
||||
|
||||
/**
|
||||
* Switch stream without disposing of the player.
|
||||
* @param url {string} The url of the new stream.
|
||||
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
setStream(url: string, controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Will pause if playing and play if paused
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
playPause(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop playing.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Jump to a particular position.
|
||||
* @param milliseconds {number} Position in stream in milliseconds
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
seekTo(milliseconds: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Jump to a particular time relative to the current position.
|
||||
* @param milliseconds {number} Time in milliseconds
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
seekBy(milliseconds: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Get the current player state.
|
||||
* @return {Promise<AndroidExoplayerState>}
|
||||
*/
|
||||
@Cordova()
|
||||
getState(): Promise<AndroidExoplayerState> { return; }
|
||||
|
||||
/**
|
||||
* Show the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
showController(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Hide the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
hideController(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Update the controller configuration.
|
||||
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
setController(controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Close and dispose of player, call before destroy.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
close(): Promise<void> { return; }
|
||||
}
|
@ -14,8 +14,6 @@ export enum AndroidSystemUiFlags {
|
||||
HideNavigation = 2,
|
||||
/** View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. SYSTEM_UI_FLAG_FULLSCREEN */
|
||||
Fullscreen = 4,
|
||||
/** Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds. SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR */
|
||||
LightNavigationBar = 16,
|
||||
/** When using other layout flags, we would like a stable view of the content insets given to fitSystemWindows(Rect). SYSTEM_UI_FLAG_LAYOUT_STABLE */
|
||||
LayoutStable = 256,
|
||||
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_HIDE_NAVIGATION, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION */
|
||||
@ -45,8 +43,8 @@ export enum AndroidSystemUiFlags {
|
||||
* ...
|
||||
*
|
||||
* this.androidFullScreen.isImmersiveModeSupported()
|
||||
* .then(() => this.androidFullScreen.immersiveMode())
|
||||
* .catch((error: any) => console.log(error));
|
||||
* .then(() => console.log('Immersive mode supported'))
|
||||
* .catch(err => console.log(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
@ -18,13 +18,15 @@ import { Injectable } from '@angular/core';
|
||||
* ...
|
||||
*
|
||||
* this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
|
||||
* success => console.log('Permission granted'),
|
||||
* result => console.log('Has permission?',result.hasPermission),
|
||||
* err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
|
||||
* );
|
||||
*
|
||||
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* Android 26 and above: due to Android 26's changes to permissions handling (permissions are requested at time of use rather than at runtime,) if your app does not include any functions (eg. other Ionic Native plugins) that utilize a particular permission, then `requestPermission()` and `requestPermissions()` will resolve immediately with no prompt shown to the user. Thus, you must include a function utilizing the feature you would like to use before requesting permission for it.
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidPermissions',
|
||||
|
@ -27,8 +27,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* this.appAvailability.check(app)
|
||||
* .then(
|
||||
* (yes: string) => console.log(app + ' is available'),
|
||||
* (no: string) => console.log(app + ' is NOT available')
|
||||
* (yes: boolean) => console.log(app + ' is available'),
|
||||
* (no: boolean) => console.log(app + ' is NOT available')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface AppRatePreferences {
|
||||
|
||||
/**
|
||||
* Custom BCP 47 language tag
|
||||
*/
|
||||
@ -23,10 +22,15 @@ export interface AppRatePreferences {
|
||||
*/
|
||||
usesUntilPrompt?: number;
|
||||
|
||||
/**
|
||||
* Simple Mode to display the rate dialog directly and bypass negative feedback filtering flow
|
||||
*/
|
||||
simpleMode?: boolean;
|
||||
|
||||
/**
|
||||
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
|
||||
*/
|
||||
openStoreInApp?: boolean;
|
||||
inAppReview?: boolean;
|
||||
|
||||
/**
|
||||
* use custom view for rate dialog. Defaults to `false`
|
||||
@ -36,7 +40,7 @@ export interface AppRatePreferences {
|
||||
/**
|
||||
* Custom locale object
|
||||
*/
|
||||
customLocale?: any;
|
||||
customLocale?: AppRateCustomLocale;
|
||||
|
||||
/**
|
||||
* Callbacks for events
|
||||
@ -47,11 +51,38 @@ export interface AppRatePreferences {
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppURL?: AppUrls;
|
||||
}
|
||||
|
||||
export interface AppRateCustomLocale {
|
||||
/** Title */
|
||||
title?: string;
|
||||
|
||||
/** Message */
|
||||
message?: string;
|
||||
|
||||
/** Cancel button label */
|
||||
cancelButtonLabel?: string;
|
||||
|
||||
/** Later button label */
|
||||
laterButtonLabel?: string;
|
||||
|
||||
/** Rate button label */
|
||||
rateButtonLabel?: string;
|
||||
|
||||
/** Yes button label */
|
||||
yesButtonLabel?: string;
|
||||
|
||||
/** No button label */
|
||||
noButtonLabel?: string;
|
||||
|
||||
/** App rate promt title */
|
||||
appRatePromptTitle?: string;
|
||||
|
||||
/** Feedback prompt title */
|
||||
feedbackPromptTitle?: string;
|
||||
}
|
||||
|
||||
export interface AppRateCallbacks {
|
||||
|
||||
/**
|
||||
* call back function. called when user clicked on rate-dialog buttons
|
||||
*/
|
||||
@ -65,11 +96,9 @@ export interface AppRateCallbacks {
|
||||
* call back function. called when user clicked on negative feedback
|
||||
*/
|
||||
handleNegativeFeedback?: Function;
|
||||
|
||||
}
|
||||
|
||||
export interface AppUrls {
|
||||
|
||||
/**
|
||||
* application id in AppStore
|
||||
*/
|
||||
@ -94,7 +123,6 @@ export interface AppUrls {
|
||||
* application URL in WindowsStore
|
||||
*/
|
||||
windows8?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,6 +165,7 @@ export interface AppUrls {
|
||||
* AppRatePreferences
|
||||
* AppUrls
|
||||
* AppRateCallbacks
|
||||
* AppRateCustomLocal
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
@ -148,25 +177,22 @@ export interface AppUrls {
|
||||
})
|
||||
@Injectable()
|
||||
export class AppRate extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Configure various settings for the Rating View.
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
preferences: AppRatePreferences;
|
||||
@CordovaProperty preferences: AppRatePreferences;
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
* @param {boolean} immediately Show the rating prompt immediately.
|
||||
*/
|
||||
@Cordova()
|
||||
promptForRating(immediately: boolean): void { };
|
||||
promptForRating(immediately: boolean): void {}
|
||||
|
||||
/**
|
||||
* Immediately send the user to the app store rating page
|
||||
*/
|
||||
@Cordova()
|
||||
navigateToAppStore(): void { };
|
||||
|
||||
navigateToAppStore(): void {}
|
||||
}
|
||||
|
@ -1,5 +1,11 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface AppUpdateOptions {
|
||||
authType: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name App Update
|
||||
@ -24,13 +30,15 @@ import { Injectable } from '@angular/core';
|
||||
*
|
||||
* constructor(private appUpdate: AppUpdate) {
|
||||
*
|
||||
* const updateUrl = 'http://your-remote-api.com/update.xml';
|
||||
* this.appUpdate.checkAppUpdate(updateUrl);
|
||||
* const updateUrl = 'https://your-remote-api.com/update.xml';
|
||||
* this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') });
|
||||
*
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The plugin will compare the app version and update it automatically if the API has a newer version to install.
|
||||
* @interfaces
|
||||
* AppUpdateOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppUpdate',
|
||||
@ -49,5 +57,7 @@ export class AppUpdate extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
checkAppUpdate(updateUrl: string): Promise<any> { return; }
|
||||
checkAppUpdate(updateUrl: string, options?: AppUpdateOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -38,30 +38,30 @@ export class AppVersion extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAppName(): Promise<any> { return; }
|
||||
getAppName(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns the package name of the app
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getPackageName(): Promise<any> { return; }
|
||||
getPackageName(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns the build identifier of the app
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getVersionCode(): Promise<any> { return; }
|
||||
getVersionCode(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns the version of the app
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getVersionNumber(): Promise<any> { return; }
|
||||
getVersionNumber(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
327
src/@ionic-native/plugins/apple-pay/index.ts
Normal file
327
src/@ionic-native/plugins/apple-pay/index.ts
Normal file
@ -0,0 +1,327 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {
|
||||
Plugin,
|
||||
Cordova,
|
||||
IonicNativePlugin
|
||||
} from '@ionic-native/core';
|
||||
|
||||
export type IMakePayments = 'This device can make payments and has a supported card' | 'This device cannot make payments.' | 'This device can make payments but has no supported cards';
|
||||
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
|
||||
export type IBillingRequirement = 'none' | 'all' | 'postcode' | 'name' | 'email' | 'phone';
|
||||
export type ITransactionStatus = 'success' | 'failure' | 'invalid-billing-address' | 'invalid-shipping-address' | 'invalid-shipping-contact' | 'require-pin' | 'incorrect-pin' | 'locked-pin';
|
||||
export type ICompleteTransaction = 'Payment status applied.';
|
||||
export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?';
|
||||
|
||||
export interface IPaymentResponse {
|
||||
billingNameFirst?: string;
|
||||
billingNameMiddle?: string;
|
||||
billingNameLast?: string;
|
||||
billingEmailAddress?: string;
|
||||
billingSupplementarySubLocality?: string;
|
||||
billingAddressStreet?: string;
|
||||
billingAddressCity?: string;
|
||||
billingAddressState?: string;
|
||||
billingPostalCode?: string;
|
||||
billingCountry?: string;
|
||||
billingISOCountryCode?: string;
|
||||
|
||||
shippingNameFirst?: string;
|
||||
shippingNameMiddle?: string;
|
||||
shippingNameLast?: string;
|
||||
shippingEmailAddress?: string;
|
||||
shippingPhoneNumber?: string;
|
||||
shippingSupplementarySubLocality?: string;
|
||||
shippingAddressStreet?: string;
|
||||
shippingAddressCity?: string;
|
||||
shippingAddressState?: string;
|
||||
shippingPostalCode?: string;
|
||||
shippingCountry?: string;
|
||||
shippingISOCountryCode?: string;
|
||||
|
||||
paymentData: string;
|
||||
transactionIdentifier: string;
|
||||
paymentMethodDisplayName?: string;
|
||||
paymentMethodNetwork?: string;
|
||||
paymentMethodTypeCard?: string;
|
||||
}
|
||||
|
||||
export interface IOrderItem {
|
||||
label: string;
|
||||
amount: number;
|
||||
}
|
||||
export interface IShippingMethod {
|
||||
identifier: string;
|
||||
label: string;
|
||||
detail: string;
|
||||
amount: number;
|
||||
}
|
||||
export interface IOrderItemsAndShippingMethods {
|
||||
items: IOrderItem[];
|
||||
shippingMethods?: IShippingMethod[];
|
||||
}
|
||||
|
||||
export interface IOrder extends IOrderItemsAndShippingMethods {
|
||||
merchantIdentifier: string;
|
||||
currencyCode: string;
|
||||
countryCode: string;
|
||||
billingAddressRequirement?: IBillingRequirement | IBillingRequirement[];
|
||||
shippingAddressRequirement?: IBillingRequirement | IBillingRequirement[];
|
||||
shippingType?: IShippingType;
|
||||
}
|
||||
|
||||
export interface ISelectedShippingContact {
|
||||
shippingAddressCity: string;
|
||||
shippingAddressState: string;
|
||||
shippingPostalCode: string;
|
||||
shippingISOCountryCode: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Apple Pay
|
||||
* @description
|
||||
* A dependency free Cordova plugin to provide Apple Pay functionality.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ApplePay } from '@ionic-native/apple-pay';
|
||||
*
|
||||
*
|
||||
* constructor(private applePay: ApplePay) { }
|
||||
*
|
||||
* ...
|
||||
* async applePay() {
|
||||
* // This block is optional -- only if you need to update order items/shipping
|
||||
* // methods in response to shipping method selections
|
||||
* this.applePay.startListeningForShippingContactSelection()
|
||||
* .subscribe(async selection => {
|
||||
* try {
|
||||
* await this.applePay.updateItemsAndShippingMethods({
|
||||
* items: getFromSelection(selection),
|
||||
* shippingMethods: getFromSelection(selection),
|
||||
* });
|
||||
* }
|
||||
* catch {
|
||||
* // handle update items error
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* try {
|
||||
* const applePayTransaction = await this.applePay.makePaymentRequest({
|
||||
* items,
|
||||
* shippingMethods,
|
||||
* merchantIdentifier,
|
||||
* currencyCode,
|
||||
* countryCode,
|
||||
* billingAddressRequirement: ['name', 'email', 'phone'],
|
||||
* shippingAddressRequirement: 'none',
|
||||
* shippingType: 'shipping'
|
||||
* });
|
||||
*
|
||||
* const transactionStatus = await completeTransactionWithMerchant(applePayTransaction);
|
||||
* await this.applePay.completeLastTransaction(transactionStatus);
|
||||
* } catch {
|
||||
* // handle payment request error
|
||||
* // Can also handle stop complete transaction but these should normally not occur
|
||||
* }
|
||||
*
|
||||
* // only if you started listening before
|
||||
* await this.applePay.stopListeningForShippingContactSelection();
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ApplePay',
|
||||
plugin: 'cordova-plugin-applepay',
|
||||
pluginRef: 'ApplePay',
|
||||
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class ApplePay extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Detects if the current device supports Apple Pay and has any capable cards registered.
|
||||
* @return {Promise<IMakePayments>} Returns a promise
|
||||
*
|
||||
* @usage
|
||||
* try {
|
||||
* const message = await this.applePay.canMakePayments();
|
||||
* // Apple Pay is enabled and a supported card is setup. Expect:
|
||||
* // 'This device can make payments and has a supported card'
|
||||
* } catch (message) {
|
||||
* // There is an issue, examine the message to see the details, will be:
|
||||
* // 'This device cannot make payments.''
|
||||
* // 'This device can make payments but has no supported cards'
|
||||
* }
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
canMakePayments(): Promise<IMakePayments> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts listening for shipping contact selection changes
|
||||
* Any time the user selects shipping contact, this callback will fire.
|
||||
* You *must* call `updateItemsAndShippingMethods` in response or else the
|
||||
* user will not be able to process payment.
|
||||
* @return {Observable<ISelectedShippingContact>} emits with shipping contact information on
|
||||
* shipping contact selection changes
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopListeningForShippingContactSelection'
|
||||
})
|
||||
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops listening for shipping contact selection changes
|
||||
* @return {Promise} whether stop listening was successful. This should
|
||||
* really only fail if this is called without starting listening
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
stopListeningForShippingContactSelection(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the list of pay sheet items and shipping methods in response to
|
||||
* a shipping contact selection event. This *must* be called in response to
|
||||
* any shipping contact selection event or else the user will not be able
|
||||
* to complete a transaction on the pay sheet. Do not call without
|
||||
* subscribing to shipping contact selection events first
|
||||
* @returns {Promise}
|
||||
*
|
||||
* @param {Object} including `items` and `shippingMethods` properties.
|
||||
*
|
||||
* @usage
|
||||
* this.applePay.startListeningForShippingContactSelection().pluck('shippingAddressState').subscribe(shippingAddressState => {
|
||||
* let shippingMethods;
|
||||
* if ('AK' === shippingAddressState) {
|
||||
* shippingMethods = [{
|
||||
* identifier: 'Alaska',
|
||||
* label: 'Alaska',
|
||||
* detail: 'For shipping to Alaska',
|
||||
* amount: 9.99
|
||||
* },];
|
||||
* } else {
|
||||
* shippingMethods = [{
|
||||
* identifier: 'Continental',
|
||||
* label: 'Continental',
|
||||
* detail: 'For shipping Continentally',
|
||||
* amount: 5.99
|
||||
* }];
|
||||
* }
|
||||
* this.paySheetItems.shippingCost = {
|
||||
* label: 'Shipping Cost',
|
||||
* amount: shippingMethod[0].amount
|
||||
* };
|
||||
* this.applePay.updateItemsAndShippingMethods(this.paySheetItems, shippingMethods);
|
||||
* });
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a payment with Apple Pay
|
||||
* @return {Promise<IPaymentResponse>} Returns a promise that resolves when something happens
|
||||
*
|
||||
* @param order {IOrder}
|
||||
*
|
||||
* @usage
|
||||
* try {
|
||||
* const paymentResponse = this.applePay.makePaymentRequest({
|
||||
* items: [
|
||||
* {
|
||||
* label: '3 x Basket Items',
|
||||
* amount: 49.99
|
||||
* },
|
||||
* {
|
||||
* label: 'Next Day Delivery',
|
||||
* amount: 3.99
|
||||
* },
|
||||
* {
|
||||
* label: 'My Fashion Company',
|
||||
* amount: 53.98
|
||||
* }
|
||||
* ],
|
||||
* shippingMethods: [
|
||||
* {
|
||||
* identifier: 'NextDay',
|
||||
* label: 'NextDay',
|
||||
* detail: 'Arrives tomorrow by 5pm.',
|
||||
* amount: 3.99
|
||||
* },
|
||||
* {
|
||||
* identifier: 'Standard',
|
||||
* label: 'Standard',
|
||||
* detail: 'Arrive by Friday.',
|
||||
* amount: 4.99
|
||||
* },
|
||||
* {
|
||||
* identifier: 'SaturdayDelivery',
|
||||
* label: 'Saturday',
|
||||
* detail: 'Arrive by 5pm this Saturday.',
|
||||
* amount: 6.99
|
||||
* }
|
||||
* ],
|
||||
* merchantIdentifier: 'merchant.apple.test',
|
||||
* currencyCode: 'GBP',
|
||||
* countryCode: 'GB',
|
||||
* billingAddressRequirement: 'none',
|
||||
* shippingAddressRequirement: 'none',
|
||||
* shippingType: 'shipping',
|
||||
* });
|
||||
*
|
||||
* // The user has authorized the payment.
|
||||
*
|
||||
* // Handle the token, asynchronously, i.e. pass to your merchant bank to
|
||||
* // action the payment, then once finished, depending on the outcome:
|
||||
*
|
||||
* // Here is an example implementation:
|
||||
*
|
||||
* const captureStatus = await MyPaymentProvider.authorizeApplePayToken(paymentResponse.paymentData);
|
||||
* await this.applePay.completeLastTransaction('success');
|
||||
* }
|
||||
* catch (err) {
|
||||
* if (isPaymentAuthError(err)) {
|
||||
* this.completeLastTransaction('failure');
|
||||
* }
|
||||
* else {
|
||||
* // Failed to open pay sheet or user canceled payment
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
makePaymentRequest(order: IOrder): Promise<IPaymentResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Once the makePaymentRequest has been resolved successfully, the device will be waiting for a completion event.
|
||||
* This means, that the application must proceed with the token authorisation and return a success, failure,
|
||||
* or other validation error. Once this has been passed back, the Apple Pay sheet will be dismissed via an animation.
|
||||
* @return {Promise<ICompleteTransaction>} Returns a promise that resolves after confirmation of payment authorization completion
|
||||
*
|
||||
* @param complete {ITransactionStatus}
|
||||
*
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
|
||||
return;
|
||||
}
|
||||
}
|
@ -46,14 +46,16 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
initialize(appKey: string, adType: number): void { };
|
||||
initialize(appKey: string, adType: number): void {}
|
||||
|
||||
/**
|
||||
* check if SDK has been initialized
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isInitialized(): Promise<any> { return; };
|
||||
isInitialized(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* show ad of specified type
|
||||
@ -61,7 +63,9 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
show(adType: number): Promise<any> { return; };
|
||||
show(adType: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* show ad of specified type with placement options
|
||||
@ -70,24 +74,26 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
showWithPlacement(
|
||||
adType: number,
|
||||
placement: any
|
||||
): Promise<any> { return; };
|
||||
showWithPlacement(adType: number, placement: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* hide ad of specified type
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
hide(adType: number): void { };
|
||||
hide(adType: number): void {}
|
||||
|
||||
/**
|
||||
* confirm use of ads of specified type
|
||||
* @param {number} adType
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
confirm(adType: number): void { };
|
||||
canShow(adType: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if ad of specified type has been loaded
|
||||
@ -95,7 +101,9 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isLoaded(adType: number): Promise<any> { return; };
|
||||
isLoaded(adType: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if ad of specified
|
||||
@ -103,7 +111,9 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isPrecache(adType: number): Promise<any> { return; };
|
||||
isPrecache(adType: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -111,75 +121,77 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param autoCache
|
||||
*/
|
||||
@Cordova()
|
||||
setAutoCache(adType: number, autoCache: any): void { };
|
||||
setAutoCache(adType: number, autoCache: any): void {}
|
||||
|
||||
/**
|
||||
* forcefully cache an ad by type
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
cache(adType: number): void { };
|
||||
cache(adType: number): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {boolean} set
|
||||
*/
|
||||
@Cordova()
|
||||
setOnLoadedTriggerBoth(set: boolean): void { };
|
||||
setTriggerOnLoadedOnPrecache(set: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable or disable Smart Banners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
setSmartBanners(enabled: boolean): void { };
|
||||
setSmartBanners(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable or disable banner backgrounds
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
setBannerBackground(enabled: boolean): void { };
|
||||
setBannerBackground(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable or disable banner animations
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
setBannerAnimation(enabled: boolean): void { };
|
||||
setBannerAnimation(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
@Cordova()
|
||||
set728x90Banners(value: any): void { };
|
||||
set728x90Banners(value: any): void {}
|
||||
|
||||
/**
|
||||
* enable or disable logging
|
||||
* @param {boolean} logging
|
||||
*/
|
||||
@Cordova()
|
||||
setLogging(logging: boolean): void { };
|
||||
setLogLevel(logging: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable or disable testing mode
|
||||
* @param {boolean} testing
|
||||
*/
|
||||
@Cordova()
|
||||
setTesting(testing: boolean): void { };
|
||||
setTesting(testing: boolean): void {}
|
||||
|
||||
/**
|
||||
* reset device ID
|
||||
*/
|
||||
@Cordova()
|
||||
resetUUID(): void { };
|
||||
resetUUID(): void {}
|
||||
|
||||
/**
|
||||
* get version of Appdeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
getVersion(): Promise<any> { return; };
|
||||
getVersion(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -187,7 +199,7 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
disableNetwork(network?: string, adType?: number): void { };
|
||||
disableNetwork(network?: string, adType?: number): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -195,54 +207,54 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {number} adType
|
||||
*/
|
||||
@Cordova()
|
||||
disableNetworkType(network?: string, adType?: number): void { };
|
||||
disableNetworkType(network?: string, adType?: number): void {}
|
||||
|
||||
/**
|
||||
* disable Location permissions for Appodeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
disableLocationPermissionCheck(): void { };
|
||||
disableLocationPermissionCheck(): void {}
|
||||
|
||||
/**
|
||||
* disable Storage permissions for Appodeal SDK
|
||||
*/
|
||||
@Cordova()
|
||||
disableWriteExternalStoragePermissionCheck(): void { };
|
||||
disableWriteExternalStoragePermissionCheck(): void {}
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
enableInterstitialCallbacks(enabled: boolean): void { };
|
||||
enableInterstitialCallbacks(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
enableSkippableVideoCallbacks(enabled: boolean): void { };
|
||||
enableSkippableVideoCallbacks(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
enableNonSkippableVideoCallbacks(enabled: boolean): void { };
|
||||
enableNonSkippableVideoCallbacks(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
enableBannerCallbacks(enabled: boolean): void { };
|
||||
enableBannerCallbacks(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
* enable event listeners
|
||||
* @param {boolean} enabled
|
||||
*/
|
||||
@Cordova()
|
||||
enableRewardedVideoCallbacks(enabled: boolean): void { };
|
||||
enableRewardedVideoCallbacks(enabled: boolean): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -250,7 +262,7 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {boolean} value
|
||||
*/
|
||||
@Cordova()
|
||||
setCustomBooleanRule(name: string, value: boolean): void { };
|
||||
setCustomBooleanRule(name: string, value: boolean): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -258,7 +270,7 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
setCustomIntegerRule(name: string, value: number): void { };
|
||||
setCustomIntegerRule(name: string, value: number): void {}
|
||||
|
||||
/**
|
||||
* set rule with float value
|
||||
@ -266,7 +278,7 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {number} value
|
||||
*/
|
||||
@Cordova()
|
||||
setCustomDoubleRule(name: string, value: number): void { };
|
||||
setCustomDoubleRule(name: string, value: number): void {}
|
||||
|
||||
/**
|
||||
* set rule with string value
|
||||
@ -274,243 +286,321 @@ export class Appodeal extends IonicNativePlugin {
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
setCustomStringRule(name: string, value: string): void { };
|
||||
setCustomStringRule(name: string, value: string): void {}
|
||||
|
||||
/**
|
||||
* set ID preference in Appodeal for current user
|
||||
* @param id
|
||||
*/
|
||||
@Cordova()
|
||||
setUserId(id: any): void { };
|
||||
setUserId(id: any): void {}
|
||||
|
||||
/**
|
||||
* set Email preference in Appodeal for current user
|
||||
* @param email
|
||||
*/
|
||||
@Cordova()
|
||||
setEmail(email: any): void { };
|
||||
setEmail(email: any): void {}
|
||||
|
||||
/**
|
||||
* set Birthday preference in Appodeal for current user
|
||||
* @param birthday
|
||||
*/
|
||||
@Cordova()
|
||||
setBirthday(birthday: any): void { };
|
||||
setBirthday(birthday: any): void {}
|
||||
|
||||
/**
|
||||
* et Age preference in Appodeal for current user
|
||||
* @param age
|
||||
*/
|
||||
@Cordova()
|
||||
setAge(age: any): void { };
|
||||
setAge(age: any): void {}
|
||||
|
||||
/**
|
||||
* set Gender preference in Appodeal for current user
|
||||
* @param gender
|
||||
*/
|
||||
@Cordova()
|
||||
setGender(gender: any): void { };
|
||||
setGender(gender: any): void {}
|
||||
|
||||
/**
|
||||
* set Occupation preference in Appodeal for current user
|
||||
* @param occupation
|
||||
*/
|
||||
@Cordova()
|
||||
setOccupation(occupation: any): void { };
|
||||
setOccupation(occupation: any): void {}
|
||||
|
||||
/**
|
||||
* set Relation preference in Appodeal for current user
|
||||
* @param relation
|
||||
*/
|
||||
@Cordova()
|
||||
setRelation(relation: any): void { };
|
||||
setRelation(relation: any): void {}
|
||||
|
||||
/**
|
||||
* set Smoking preference in Appodeal for current user
|
||||
* @param smoking
|
||||
*/
|
||||
@Cordova()
|
||||
setSmoking(smoking: any): void { };
|
||||
setSmoking(smoking: any): void {}
|
||||
|
||||
/**
|
||||
* set Alcohol preference in Appodeal for current user
|
||||
* @param alcohol
|
||||
*/
|
||||
@Cordova()
|
||||
setAlcohol(alcohol: any): void { };
|
||||
setAlcohol(alcohol: any): void {}
|
||||
|
||||
/**
|
||||
* set Interests preference in Appodeal for current user
|
||||
* @param interests
|
||||
*/
|
||||
@Cordova()
|
||||
setInterests(interests: any): void { };
|
||||
setInterests(interests: any): void {}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialLoaded',
|
||||
element: document
|
||||
})
|
||||
onInterstitialLoaded(): Observable<any> { return; }
|
||||
onInterstitialLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialFailedToLoad',
|
||||
element: document
|
||||
})
|
||||
onInterstitialFailedToLoad(): Observable<any> { return; }
|
||||
onInterstitialFailedToLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialShown',
|
||||
element: document
|
||||
})
|
||||
onInterstitialShown(): Observable<any> { return; }
|
||||
onInterstitialShown(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialClicked',
|
||||
element: document
|
||||
})
|
||||
onInterstitialClicked(): Observable<any> { return; }
|
||||
onInterstitialClicked(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialClosed',
|
||||
element: document
|
||||
})
|
||||
onInterstitialClosed(): Observable<any> { return; }
|
||||
onInterstitialClosed(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onSkippableVideoLoaded',
|
||||
element: document
|
||||
})
|
||||
onSkippableVideoLoaded(): Observable<any> { return; }
|
||||
onSkippableVideoLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onSkippableVideoFailedToLoad',
|
||||
element: document
|
||||
})
|
||||
onSkippableVideoFailedToLoad(): Observable<any> { return; }
|
||||
onSkippableVideoFailedToLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onSkippableVideoShown',
|
||||
element: document
|
||||
})
|
||||
onSkippableVideoShown(): Observable<any> { return; }
|
||||
onSkippableVideoShown(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onSkippableVideoFinished',
|
||||
element: document
|
||||
})
|
||||
onSkippableVideoFinished(): Observable<any> { return; }
|
||||
onSkippableVideoFinished(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onSkippableVideoClosed',
|
||||
element: document
|
||||
})
|
||||
onSkippableVideoClosed(): Observable<any> { return; }
|
||||
onSkippableVideoClosed(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onRewardedVideoLoaded',
|
||||
element: document
|
||||
})
|
||||
onRewardedVideoLoaded(): Observable<any> { return; }
|
||||
onRewardedVideoLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onRewardedVideoFailedToLoad',
|
||||
element: document
|
||||
})
|
||||
onRewardedVideoFailedToLoad(): Observable<any> { return; }
|
||||
onRewardedVideoFailedToLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onRewardedVideoShown',
|
||||
element: document
|
||||
})
|
||||
onRewardedVideoShown(): Observable<any> { return; }
|
||||
onRewardedVideoShown(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onRewardedVideoFinished',
|
||||
element: document
|
||||
})
|
||||
onRewardedVideoFinished(): Observable<any> { return; }
|
||||
onRewardedVideoFinished(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onRewardedVideoClosed',
|
||||
element: document
|
||||
})
|
||||
onRewardedVideoClosed(): Observable<any> { return; }
|
||||
onRewardedVideoClosed(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onNonSkippableVideoLoaded',
|
||||
element: document
|
||||
})
|
||||
onNonSkippableVideoLoaded(): Observable<any> { return; }
|
||||
onNonSkippableVideoLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onNonSkippableVideoFailedToLoad',
|
||||
element: document
|
||||
})
|
||||
onNonSkippableVideoFailedToLoad(): Observable<any> { return; }
|
||||
onNonSkippableVideoFailedToLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onNonSkippableVideoShown',
|
||||
element: document
|
||||
})
|
||||
onNonSkippableVideoShown(): Observable<any> { return; }
|
||||
onNonSkippableVideoShown(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onNonSkippableVideoFinished',
|
||||
element: document
|
||||
})
|
||||
onNonSkippableVideoFinished(): Observable<any> { return; }
|
||||
onNonSkippableVideoFinished(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onNonSkippableVideoClosed',
|
||||
element: document
|
||||
})
|
||||
onNonSkippableVideoClosed(): Observable<any> { return; }
|
||||
onNonSkippableVideoClosed(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerClicked',
|
||||
element: document
|
||||
})
|
||||
onBannerClicked(): Observable<any> { return; }
|
||||
onBannerClicked(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerFailedToLoad',
|
||||
element: document
|
||||
})
|
||||
onBannerFailedToLoad(): Observable<any> { return; }
|
||||
onBannerFailedToLoad(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerLoaded',
|
||||
element: document
|
||||
})
|
||||
onBannerLoaded(): Observable<any> { return; }
|
||||
onBannerLoaded(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerShown',
|
||||
element: document
|
||||
})
|
||||
onBannerShown(): Observable<any> { return; }
|
||||
onBannerShown(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
getRewardParametersForPlacement(placement: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
getRewardParameters(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
canShowWithPlacement(adType: string, placement: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
showTestScreen(value: any): void {}
|
||||
|
||||
@Cordova()
|
||||
muteVideosIfCallsMuted(value: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
setChildDirectedTreatment(value: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2,48 +2,52 @@ import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface BackgroundModeConfiguration {
|
||||
|
||||
/**
|
||||
* Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* Set the background color of the notification circle
|
||||
*/
|
||||
color?: string;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin won't come to foreground when tapped.
|
||||
* By default the app will come to foreground when tapping on the notification. If false, plugin won't come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
/**
|
||||
* When set to false makes the notifications visible on lockscreen (Android 5.0+)
|
||||
*/
|
||||
hidden?: boolean;
|
||||
|
||||
/** Big text */
|
||||
bigText?: boolean;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
ticker?: string;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,7 +78,6 @@ export interface BackgroundModeConfiguration {
|
||||
})
|
||||
@Injectable()
|
||||
export class BackgroundMode extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Enable the background mode.
|
||||
* Once called, prevents the app from being paused while in background.
|
||||
@ -82,14 +85,16 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
enable(): void { }
|
||||
enable(): void {}
|
||||
|
||||
/**
|
||||
* Disable the background mode.
|
||||
* Once the background mode has been disabled, the app will be paused when in background.
|
||||
*/
|
||||
@Cordova()
|
||||
disable(): Promise<any> { return; }
|
||||
disable(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
@ -98,7 +103,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
isEnabled(): boolean { return; }
|
||||
isEnabled(): boolean {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
@ -107,7 +114,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
isActive(): boolean { return; }
|
||||
isActive(): boolean {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
@ -117,7 +126,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
setDefaults(options?: BackgroundModeConfiguration): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
@ -140,7 +151,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
clearFunction: 'un',
|
||||
clearWithArgs: true
|
||||
})
|
||||
on(event: string): Observable<any> { return; }
|
||||
on(event: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Android allows to programmatically move from foreground to background.
|
||||
@ -149,7 +162,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
moveToBackground(): void { }
|
||||
moveToBackground(): void {}
|
||||
|
||||
/**
|
||||
* Enable GPS-tracking in background (Android).
|
||||
@ -158,7 +171,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
disableWebViewOptimizations (): void { }
|
||||
disableWebViewOptimizations(): void {}
|
||||
|
||||
/**
|
||||
* Android allows to programmatically move from background to foreground.
|
||||
@ -167,7 +180,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
moveToForeground(): void { }
|
||||
moveToForeground(): void {}
|
||||
|
||||
/**
|
||||
* Override the back button on Android to go to background instead of closing the app.
|
||||
@ -176,7 +189,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
overrideBackButton(): void { }
|
||||
overrideBackButton(): void {}
|
||||
|
||||
/**
|
||||
* Exclude the app from the recent task list. Works on Android 5.0+.
|
||||
@ -185,7 +198,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
excludeFromTaskList(): void { }
|
||||
excludeFromTaskList(): void {}
|
||||
|
||||
/**
|
||||
* The method works async instead of isActive() or isEnabled().
|
||||
@ -193,7 +206,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
isScreenOff(): Promise<boolean> { return; }
|
||||
isScreenOff(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn screen on
|
||||
@ -202,7 +217,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
wakeUp(): void { }
|
||||
wakeUp(): void {}
|
||||
|
||||
/**
|
||||
* Turn screen on and show app even locked
|
||||
@ -211,6 +226,5 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
unlock(): void { }
|
||||
|
||||
unlock(): void {}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
* @name Badge
|
||||
* @description
|
||||
@ -31,13 +30,14 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class Badge extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Clear the badge of the app icon.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
clear(): Promise<boolean> { return; }
|
||||
clear(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the badge of the app icon.
|
||||
@ -45,14 +45,18 @@ export class Badge extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
set(badgeNumber: number): Promise<any> { return; }
|
||||
set(badgeNumber: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the badge of the app icon.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
get(): Promise<any> { return; }
|
||||
get(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase the badge number.
|
||||
@ -60,7 +64,9 @@ export class Badge extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
increase(increaseBy: number): Promise<any> { return; }
|
||||
increase(increaseBy: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrease the badge number.
|
||||
@ -68,20 +74,34 @@ export class Badge extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
decrease(decreaseBy: number): Promise<any> { return; }
|
||||
decrease(decreaseBy: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check support to show badges.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
isSupported(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the app has permission to show badges.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<any> { return; }
|
||||
hasPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register permission to set badge notifications
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
registerPermission(): Promise<any> { return; }
|
||||
|
||||
requestPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface BarcodeScannerOptions {
|
||||
|
||||
/**
|
||||
* Prefer front camera. Supported on iOS and Android.
|
||||
*/
|
||||
@ -52,11 +51,26 @@ export interface BarcodeScannerOptions {
|
||||
* Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only.
|
||||
*/
|
||||
resultDisplayDuration?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface BarcodeScanResult {
|
||||
format: 'QR_CODE' | 'DATA_MATRIX' | 'UPC_E' | 'UPC_A' | 'EAN_8' | 'EAN_13' | 'CODE_128' | 'CODE_39' | 'CODE_93' | 'CODABAR' | 'ITF' | 'RSS14' | 'RSS_EXPANDED' | 'PDF417' | 'AZTEC' | 'MSI';
|
||||
format:
|
||||
| 'QR_CODE'
|
||||
| 'DATA_MATRIX'
|
||||
| 'UPC_E'
|
||||
| 'UPC_A'
|
||||
| 'EAN_8'
|
||||
| 'EAN_13'
|
||||
| 'CODE_128'
|
||||
| 'CODE_39'
|
||||
| 'CODE_93'
|
||||
| 'CODABAR'
|
||||
| 'ITF'
|
||||
| 'RSS14'
|
||||
| 'RSS_EXPANDED'
|
||||
| 'PDF417'
|
||||
| 'AZTEC'
|
||||
| 'MSI';
|
||||
cancelled: boolean;
|
||||
text: string;
|
||||
}
|
||||
@ -77,10 +91,10 @@ export interface BarcodeScanResult {
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.barcodeScanner.scan().then((barcodeData) => {
|
||||
* // Success! Barcode data is here
|
||||
* }, (err) => {
|
||||
* // An error occurred
|
||||
* this.barcodeScanner.scan().then(barcodeData => {
|
||||
* console.log('Barcode data', barcodeData);
|
||||
* }).catch(err => {
|
||||
* console.log('Error', err);
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
@ -96,7 +110,6 @@ export interface BarcodeScanResult {
|
||||
})
|
||||
@Injectable()
|
||||
export class BarcodeScanner extends IonicNativePlugin {
|
||||
|
||||
Encode: {
|
||||
TEXT_TYPE: string;
|
||||
EMAIL_TYPE: string;
|
||||
@ -117,7 +130,9 @@ export class BarcodeScanner extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
scan(options?: BarcodeScannerOptions): Promise<BarcodeScanResult> { return; }
|
||||
scan(options?: BarcodeScannerOptions): Promise<BarcodeScanResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes data into a barcode.
|
||||
@ -127,6 +142,7 @@ export class BarcodeScanner extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
encode(type: string, data: any): Promise<any> { return; }
|
||||
|
||||
encode(type: string, data: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface Base64ToGalleryOptions {
|
||||
/** Saved file name prefix */
|
||||
prefix: string;
|
||||
/**
|
||||
* On Android runs Media Scanner after file creation.
|
||||
* On iOS if true the file will be added to camera roll, otherwise will be saved to a library folder.
|
||||
*/
|
||||
mediaScanner: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Base64 To Gallery
|
||||
@ -19,6 +29,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* err => console.log('Error saving image to gallery ', err)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* Base64ToGalleryOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Base64ToGallery',
|
||||
@ -29,19 +41,20 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class Base64ToGallery extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Converts a base64 string to an image file in the device gallery
|
||||
* @param {string} data The actual base64 string that you want to save
|
||||
* @param {any} [options] An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
|
||||
* @param {any} [options] An object with properties
|
||||
* @returns {Promise<any>} returns a promise that resolves when the image is saved.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
base64ToGallery(data: string, options?: { prefix?: string; mediaScanner?: boolean }): Promise<any> {
|
||||
base64ToGallery(
|
||||
data: string,
|
||||
options?: Base64ToGalleryOptions
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface BatteryStatusResponse {
|
||||
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
@ -13,7 +12,6 @@ export interface BatteryStatusResponse {
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,11 +29,9 @@ export interface BatteryStatusResponse {
|
||||
*
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = this.batteryStatus.onChange().subscribe(
|
||||
* (status: BatteryStatusResponse) => {
|
||||
* const subscription = this.batteryStatus.onChange().subscribe(status => {
|
||||
* console.log(status.level, status.isPlugged);
|
||||
* }
|
||||
* );
|
||||
* });
|
||||
*
|
||||
* // stop watch
|
||||
* subscription.unsubscribe();
|
||||
@ -49,11 +45,10 @@ export interface BatteryStatusResponse {
|
||||
plugin: 'cordova-plugin-battery-status',
|
||||
pluginRef: 'navigator.battery',
|
||||
repo: 'https://github.com/apache/cordova-plugin-battery-status',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows']
|
||||
platforms: ['iOS', 'Android', 'Windows', 'Browser']
|
||||
})
|
||||
@Injectable()
|
||||
export class BatteryStatus extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Watch the change in battery level
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
@ -62,7 +57,9 @@ export class BatteryStatus extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
onChange(): Observable<BatteryStatusResponse> { return; }
|
||||
onChange(): Observable<BatteryStatusResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
@ -72,7 +69,9 @@ export class BatteryStatus extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
onLow(): Observable<BatteryStatusResponse> { return; }
|
||||
onLow(): Observable<BatteryStatusResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
@ -82,6 +81,7 @@ export class BatteryStatus extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
onCritical(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
onCritical(): Observable<BatteryStatusResponse> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface BLEScanOptions {
|
||||
/** true if duplicate devices should be reported, false (default) if devices should only be reported once. */
|
||||
reportDuplicates?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name BLE
|
||||
* @description
|
||||
@ -167,6 +172,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* UUIDs are always strings and not numbers. Some 16-bit UUIDs, such as '2220' look like integers, but they're not. (The integer 2220 is 0x8AC in hex.) This isn't a problem with 128 bit UUIDs since they look like strings 82b9e6e1-593a-456f-be9b-9215160ebcac. All 16-bit UUIDs should also be passed to methods as strings.
|
||||
*
|
||||
* @interfaces
|
||||
* BLEScanOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BLE',
|
||||
@ -177,7 +184,6 @@ import { Observable } from 'rxjs/Observable';
|
||||
})
|
||||
@Injectable()
|
||||
export class BLE extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
@ -194,7 +200,9 @@ export class BLE extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
scan(services: string[], seconds: number): Observable<any> { return; }
|
||||
scan(services: string[], seconds: number): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals until `stopScan` is called.
|
||||
@ -217,7 +225,9 @@ export class BLE extends IonicNativePlugin {
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: false
|
||||
})
|
||||
startScan(services: string[]): Observable<any> { return; }
|
||||
startScan(services: string[]): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scans for BLE devices. This function operates similarly to the `startScan` function, but allows you to specify extra options (like allowing duplicate device reports).
|
||||
@ -230,7 +240,12 @@ export class BLE extends IonicNativePlugin {
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: false
|
||||
})
|
||||
startScanWithOptions(services: string[], options: { reportDuplicates?: boolean } | any): Observable<any> { return; }
|
||||
startScanWithOptions(
|
||||
services: string[],
|
||||
options: BLEScanOptions
|
||||
): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
@ -247,7 +262,9 @@ export class BLE extends IonicNativePlugin {
|
||||
* @return returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
stopScan(): Promise<any> { return; }
|
||||
stopScan(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to a peripheral.
|
||||
@ -268,7 +285,9 @@ export class BLE extends IonicNativePlugin {
|
||||
clearFunction: 'disconnect',
|
||||
clearWithArgs: true
|
||||
})
|
||||
connect(deviceId: string): Observable<any> { return; }
|
||||
connect(deviceId: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
@ -282,7 +301,9 @@ export class BLE extends IonicNativePlugin {
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
disconnect(deviceId: string): Promise<any> { return; }
|
||||
disconnect(deviceId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the value of a characteristic.
|
||||
@ -297,7 +318,9 @@ export class BLE extends IonicNativePlugin {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; };
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
@ -333,7 +356,9 @@ export class BLE extends IonicNativePlugin {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
@ -350,7 +375,9 @@ export class BLE extends IonicNativePlugin {
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
@ -376,7 +403,9 @@ export class BLE extends IonicNativePlugin {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Observable<any> { return; }
|
||||
): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
@ -391,7 +420,9 @@ export class BLE extends IonicNativePlugin {
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report the connection status.
|
||||
@ -407,7 +438,9 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
isConnected(deviceId: string): Promise<any> { return; }
|
||||
isConnected(deviceId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
@ -415,7 +448,40 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<void>} Returns a Promise that resolves if Bluetooth is enabled, and rejects if disabled.
|
||||
*/
|
||||
@Cordova()
|
||||
isEnabled(): Promise<void> { return; }
|
||||
isEnabled(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register to be notified when Bluetooth state changes on the device.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startStateNotifications().subscribe(state => {
|
||||
* console.log("Bluetooth is " + state);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @return Returns an Observable that notifies when the Bluetooth is enabled or disabled on the device.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopStateNotifications',
|
||||
clearWithArgs: false
|
||||
})
|
||||
startStateNotifications(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop state notifications.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stopStateNotifications(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
@ -423,7 +489,9 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
showBluetoothSettings(): Promise<any> { return; }
|
||||
showBluetoothSettings(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
@ -431,7 +499,9 @@ export class BLE extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
enable(): Promise<any> { return; }
|
||||
enable(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the RSSI value on the device connection.
|
||||
@ -441,7 +511,7 @@ export class BLE extends IonicNativePlugin {
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readRSSI(
|
||||
deviceId: string,
|
||||
): Promise<any> { return; }
|
||||
readRSSI(deviceId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
114
src/@ionic-native/plugins/blinkup/index.ts
Normal file
114
src/@ionic-native/plugins/blinkup/index.ts
Normal file
@ -0,0 +1,114 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* Interface of a blink up options.
|
||||
*/
|
||||
export interface BlinkUpOptions {
|
||||
apiKey: string;
|
||||
developmentPlanId?: string;
|
||||
isInDevelopment?: boolean;
|
||||
timeoutMs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface of a blink up wifi options.
|
||||
*/
|
||||
export interface BlinkUpWifiOptions {
|
||||
apiKey: string;
|
||||
timeoutMs?: number;
|
||||
ssid: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface of a blink up wps options.
|
||||
*/
|
||||
export interface BlinkUpWPSOptions {
|
||||
apiKey: string;
|
||||
timeoutMs?: number;
|
||||
wpsPin: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name BlinkUp
|
||||
* @description
|
||||
* Electric Imp BlinkUp ionic plugin.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { BlinkUp } from '@ionic-native/blinkup';
|
||||
*
|
||||
* const options = <BlinkUpWifiOptions>{
|
||||
* apiKey: 'API_KEY',
|
||||
* timeoutMs: 60000,
|
||||
* ssid: 'MY_SSID',
|
||||
* password: 'MY_PASSWORD'
|
||||
* }
|
||||
* BlinkUp.flashWifiBlinkUp(options).subscribe(
|
||||
* (result) => console.log('Done'),
|
||||
* (error) => console.log(error)
|
||||
* )
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BlinkUp',
|
||||
plugin: 'cordova-plugin-blinkup',
|
||||
pluginRef: 'blinkup',
|
||||
repo: 'https://github.com/SensorShare/cordova-plugin-blinkup',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class BlinkUp extends IonicNativePlugin {
|
||||
/**
|
||||
* startBlinkUp - starts the blinkup process
|
||||
* @param {module:blinkup.BlinkUpOptions} options BlinkUp Options
|
||||
* @return {Observable<any>} Returns an Observable
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true
|
||||
})
|
||||
startBlinkUp(options: BlinkUpOptions): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* flashWifiBlinkUp - invokes the flash wifi process
|
||||
* @param {module:blinkup.BlinkUpWifiOptions} options BlinkUp Wifi Options
|
||||
* @return {Observable<any>} Returns an Observable
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true
|
||||
})
|
||||
flashWifiBlinkUp(options: BlinkUpWifiOptions): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* flashWPSBlinkUp - invokes the flash wps process
|
||||
* @param {module:blinkup.BlinkUpWPSOptions} options BlinkUp WPS Options
|
||||
* @return {Observable<any>} Returns an Observable
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true
|
||||
})
|
||||
flashWPSBlinkUp(options: BlinkUpWPSOptions): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* abortBlinkUp - abort blinkup process
|
||||
* @return {Observable<any>} Returns an Observable
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
abortBlinkUp(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* clearBlinkUpData - clear wifi data
|
||||
* @return {Observable<any>} Returns an Observable
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
clearBlinkUpData(): Observable<any> { return; }
|
||||
}
|
250
src/@ionic-native/plugins/braintree/index.ts
Normal file
250
src/@ionic-native/plugins/braintree/index.ts
Normal file
@ -0,0 +1,250 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* Options for the setupApplePay method.
|
||||
*/
|
||||
export interface ApplePayOptions {
|
||||
/**
|
||||
* Apple Merchant ID - can be obtained from the Apple Developer Portal.
|
||||
*/
|
||||
merchantId: string;
|
||||
|
||||
/**
|
||||
* The currency in which to receive payment.
|
||||
* This is a 3 letter currency code (ISO-4217) - e.g. "GBP", "USD", "MXN", etc.
|
||||
*/
|
||||
currency: string;
|
||||
|
||||
/**
|
||||
* The locale in which payment is accepted.
|
||||
* This is a 2 letter country code (ISO-3166-1) - e.g. "GB", "US", "MX"
|
||||
*/
|
||||
country: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for the presentDropInPaymentUI method.
|
||||
*/
|
||||
export interface PaymentUIOptions {
|
||||
/**
|
||||
* The amount of the transaction to show in the drop-in UI on the
|
||||
* summary row as well as the call-to-action button, as a string.
|
||||
* If not provided, this value will default to "0.00", e.g. free.
|
||||
* Unless you are simply capturing authorizations, you probably
|
||||
* want to fill this value in!
|
||||
*/
|
||||
amount?: string;
|
||||
|
||||
/**
|
||||
* The description of the transaction to show in the drop-in UI on the summary row.
|
||||
* Defaults to empty string.
|
||||
*/
|
||||
primaryDescription?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Successful callback result for the presentDropInPaymentUI method.
|
||||
*/
|
||||
export interface PaymentUIResult {
|
||||
/**
|
||||
* Indicates if the user used the cancel button to close the dialog without
|
||||
* completing the payment.
|
||||
*/
|
||||
userCancelled: boolean;
|
||||
|
||||
/**
|
||||
* The nonce returned for the payment transaction (if a payment was completed).
|
||||
*/
|
||||
nonce: string;
|
||||
|
||||
/**
|
||||
* The payment type (if a payment was completed) (credit card, check, paypal, etc).
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* A description of the payment method (if a payment was completed).
|
||||
*/
|
||||
localizedDescription: string;
|
||||
|
||||
/**
|
||||
* Information about the credit card used to complete a payment (if a credit card was used).
|
||||
*/
|
||||
card: {
|
||||
/**
|
||||
* The last two digits of the credit card used.
|
||||
*/
|
||||
lastTwo: string;
|
||||
|
||||
/**
|
||||
* An enumerated value used to indicate the type of credit card used.
|
||||
*
|
||||
* Can be one of the following values:
|
||||
*
|
||||
* BTCardNetworkUnknown
|
||||
* BTCardNetworkAMEX
|
||||
* BTCardNetworkDinersClub
|
||||
* BTCardNetworkDiscover
|
||||
* BTCardNetworkMasterCard
|
||||
* BTCardNetworkVisa
|
||||
* BTCardNetworkJCB
|
||||
* BTCardNetworkLaser
|
||||
* BTCardNetworkMaestro
|
||||
* BTCardNetworkUnionPay
|
||||
* BTCardNetworkSolo
|
||||
* BTCardNetworkSwitch
|
||||
* BTCardNetworkUKMaestro
|
||||
*/
|
||||
network: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the PayPal account used to complete a payment (if a PayPal account was used).
|
||||
*/
|
||||
payPalAccount: {
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
phone: string;
|
||||
billingAddress: string;
|
||||
shippingAddress: string;
|
||||
clientMetadataId: string;
|
||||
payerId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the Apple Pay card used to complete a payment (if Apple Pay was used).
|
||||
*/
|
||||
applePaycard: {
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about 3D Secure card used to complete a payment (if 3D Secure was used).
|
||||
*/
|
||||
threeDSecureCard: {
|
||||
liabilityShifted: boolean;
|
||||
liabilityShiftPossible: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about Venmo account used to complete a payment (if a Venmo account was used).
|
||||
*/
|
||||
venmoAccount: {
|
||||
username: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Braintree
|
||||
* @description
|
||||
* This plugin enables the use of the Braintree Drop-In Payments UI in your Ionic applications on Android and iOS, using the native Drop-In UI for each platform (not the Javascript SDK).
|
||||
*
|
||||
* Ionic Native utilizes [a maintaned fork](https://github.com/taracque/cordova-plugin-braintree) of the original `cordova-plugin-braintree`
|
||||
*
|
||||
* For information on how to use Apple Pay with this plugin, please refer to the [plugin documentation](https://github.com/Taracque/cordova-plugin-braintree#apple-pay-ios-only)
|
||||
*
|
||||
* **NOTE**: This is not a complete payments solution. All of the Braintree client-side UIs simply generate a payment nonce that must then be processed by your server to complete the payment.
|
||||
* See the [Braintree Node server documentation](https://developers.braintreepayments.com/start/hello-server/node) for details and a [sample Express server](https://github.com/braintree/braintree_express_example) that implements the required functionality.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Braintree, ApplePayOptions, PaymentUIOptions } from '@ionic-native/braintree';
|
||||
*
|
||||
* constructor(private braintree: Braintree) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Your Braintree `Tokenization Key` from the Braintree dashboard.
|
||||
* // Alternatively you can also generate this token server-side
|
||||
* // using a client ID in order to allow users to use stored payment methods.
|
||||
* // See the [Braintree Client Token documentation](https://developers.braintreepayments.com/reference/request/client-token/generate/node#customer_id) for details.
|
||||
* const BRAINTREE_TOKEN = '<YOUR_BRAINTREE_TOKEN>';
|
||||
*
|
||||
* // NOTE: Do not provide this unless you have configured your Apple Developer account
|
||||
* // as well as your Braintree merchant account, otherwise the Braintree module will fail.
|
||||
* const appleOptions: ApplePayOptions = {
|
||||
* merchantId: '<YOUR MERCHANT ID>',
|
||||
* currency: 'USD',
|
||||
* country: 'US'
|
||||
* };
|
||||
*
|
||||
* const paymentOptions: PaymentUIOptions = {
|
||||
* amount: '14.99',
|
||||
* primaryDescription: 'Your product or service (per /item, /month, /week, etc)',
|
||||
* };
|
||||
*
|
||||
* this.braintree.initialize(BRAINTREE_TOKEN)
|
||||
* .then(() => this.braintree.setupApplePay(appleOptions))
|
||||
* .then(() => this.braintree.presentDropInPaymentUI(paymentOptions))
|
||||
* .then((result: PaymentUIResult) => {
|
||||
* if (result.userCancelled) {
|
||||
* console.log("User cancelled payment dialog.");
|
||||
* } else {
|
||||
* console.log("User successfully completed payment!");
|
||||
* console.log("Payment Nonce: " + result.nonce);
|
||||
* console.log("Payment Result.", result);
|
||||
* }
|
||||
* })
|
||||
* .catch((error: string) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ApplePayOptions
|
||||
* PaymentUIOptions
|
||||
* PaymentUIResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Braintree',
|
||||
plugin: 'cordova-plugin-braintree',
|
||||
pluginRef: 'BraintreePlugin',
|
||||
repo: 'https://github.com/taracque/cordova-plugin-braintree',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic cordova plugin add https://github.com/taracque/cordova-plugin-braintree',
|
||||
installVariables: [],
|
||||
})
|
||||
@Injectable()
|
||||
export class Braintree extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Used to initialize the Braintree client. This function must be called before other methods can be used.
|
||||
* As the initialize code is async, be sure you call all Braintree related methods after the initialize promise has resolved.
|
||||
*
|
||||
* @param token {string} The client token or tokenization key to use with the Braintree client.
|
||||
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
initialize(token: string): Promise<undefined | string> { return; }
|
||||
|
||||
/**
|
||||
* Used to configure Apple Pay on iOS.
|
||||
* In order for Apple Pay payments to appear on the Drop-In Payments UI, you must initialize the Apple Pay framework before using the Drop-In Payments UI.
|
||||
*
|
||||
* Do not turn on Apple Pay in Braintree if you don't have Apple Pay entitlements - the Braintree module will reject the attempt to set up Apple Pay.
|
||||
* Please refer to the [Braintree Merchant Documentation](https://developers.braintreepayments.com/guides/apple-pay/configuration/ios/v4#apple-pay-certificate-request-and-provisioning) to set up a Merchant Account.
|
||||
*
|
||||
* Calling this function on Android is a `noop` so you can call it without having to check which cordova platform you are on! :D
|
||||
*
|
||||
* @param options {ApplePayOptions} The options used to configure Apple Pay.
|
||||
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
setupApplePay(options: ApplePayOptions): Promise<undefined | string> { return; }
|
||||
|
||||
/**
|
||||
* Shows Braintree's Drop-In Payments UI.
|
||||
* Apple Pay is only shown in the Drop In UI if you have previously called `setupApplePay`.
|
||||
*
|
||||
* @param options {PaymentUIOptions} An optional argument used to configure the payment UI; see type definition for parameters. If not provided, the UI will show "0.00" as the price and an empty description.
|
||||
* @return {Promise<PaymentUIResult | string>} Returns a promise that resolves with a PaymentUIResult object on successful payment (or the user cancels), or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
presentDropInPaymentUI(options?: PaymentUIOptions): Promise<PaymentUIResult | string> { return; }
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Brightness
|
||||
@ -17,7 +16,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let brightnessValue: number = 0.8;
|
||||
* let brightnessValue = 0.8;
|
||||
* this.brightness.setBrightness(brightnessValue);
|
||||
* ```
|
||||
*
|
||||
@ -31,15 +30,16 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class Brightness extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Sets the brightness of the display.
|
||||
*
|
||||
* @param {value} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||
* @param value {number} Floating number between 0 and 1 in which case 1 means 100% brightness and 0 means 0% brightness.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if setting brightness was successful.
|
||||
*/
|
||||
@Cordova()
|
||||
setBrightness(value: number): Promise<any> { return; }
|
||||
setBrightness(value: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the current brightness of the device display.
|
||||
@ -48,12 +48,13 @@ export class Brightness extends IonicNativePlugin {
|
||||
* brightness value of the device display (floating number between 0 and 1).
|
||||
*/
|
||||
@Cordova()
|
||||
getBrightness(): Promise<any> { return; }
|
||||
getBrightness(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the screen on. Prevents the device from setting the screen to sleep.
|
||||
*/
|
||||
@Cordova()
|
||||
setKeepScreenOn(value: boolean): void { }
|
||||
|
||||
setKeepScreenOn(value: boolean): void {}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: 'cordova-plugin-broadcaster',
|
||||
pluginRef: 'broadcaster',
|
||||
repo: 'https://github.com/bsorrentino/cordova-broadcaster',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
@Injectable()
|
||||
export class Broadcaster extends IonicNativePlugin {
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CalendarOptions {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@ -47,7 +46,14 @@ export interface CalendarOptions {
|
||||
* URL
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface NameOrOptions {
|
||||
/** Calendar name */
|
||||
calendarName?: string;
|
||||
|
||||
/** Calendar color as a HEX string */
|
||||
calendarColor?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,6 +78,7 @@ export interface CalendarOptions {
|
||||
* ```
|
||||
* @interfaces
|
||||
* CalendarOptions
|
||||
* NameOrOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Calendar',
|
||||
@ -82,7 +89,6 @@ export interface CalendarOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class Calendar extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function checks if we have permission to read/write from/to the calendar.
|
||||
* The promise will resolve with `true` when:
|
||||
@ -95,51 +101,65 @@ export class Calendar extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasReadWritePermission(): Promise<boolean> { return; }
|
||||
hasReadWritePermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we have read permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasReadPermission(): Promise<boolean> { return; }
|
||||
hasReadPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we have write permission
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasWritePermission(): Promise<boolean> { return; }
|
||||
hasWritePermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request write permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestWritePermission(): Promise<any> { return; }
|
||||
requestWritePermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request read permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestReadPermission(): Promise<any> { return; }
|
||||
requestReadPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests read/write permissions
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestReadWritePermission(): Promise<any> { return; }
|
||||
requestReadWritePermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @param {string | CalendarOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
createCalendar(nameOrOptions: string | any): Promise<any> { return; }
|
||||
createCalendar(nameOrOptions: string | CalendarOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
@ -147,7 +167,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
deleteCalendar(name: string): Promise<any> { return; }
|
||||
deleteCalendar(name: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default calendar options.
|
||||
@ -157,7 +179,21 @@ export class Calendar extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
getCalendarOptions(): CalendarOptions { return; }
|
||||
getCalendarOptions(): CalendarOptions {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns options for a custom calender with sepcific colord
|
||||
*
|
||||
* @return {NameOrOptions} Returns an object with the default options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
getCreateCalendarOptions(): NameOrOptions {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Silently create an event.
|
||||
@ -175,7 +211,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Silently create an event with additional options.
|
||||
@ -196,7 +234,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interactively create an event.
|
||||
@ -215,7 +255,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interactively create an event with additional options.
|
||||
@ -236,7 +278,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find an event.
|
||||
@ -255,7 +299,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find an event with additional options.
|
||||
@ -275,7 +321,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
options?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a list of events within the specified date range. (Android only)
|
||||
@ -287,14 +335,18 @@ export class Calendar extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
|
||||
listEventsInRange(startDate: Date, endDate: Date): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all calendars.
|
||||
* @returns {Promise<any>} A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
listCalendars(): Promise<any> { return; }
|
||||
listCalendars(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
@ -303,7 +355,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
|
||||
findAllEventsInNamedCalendar(calendarName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify an event. (iOS only)
|
||||
@ -334,7 +388,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify an event with additional options. (iOS only)
|
||||
@ -369,7 +425,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
newEndDate?: Date,
|
||||
filterOptions?: CalendarOptions,
|
||||
newOptions?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an event.
|
||||
@ -388,7 +446,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
notes?: string,
|
||||
startDate?: Date,
|
||||
endDate?: Date
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an event from the specified Calendar. (iOS only)
|
||||
@ -411,7 +471,9 @@ export class Calendar extends IonicNativePlugin {
|
||||
startDate?: Date,
|
||||
endDate?: Date,
|
||||
calendarName?: string
|
||||
): Promise<any> { return; }
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the calendar at the specified date.
|
||||
@ -419,6 +481,7 @@ export class Calendar extends IonicNativePlugin {
|
||||
* @return {Promise<any>} Promise returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
openCalendar(date: Date): Promise<any> { return; }
|
||||
|
||||
openCalendar(date: Date): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
67
src/@ionic-native/plugins/call-log/index.ts
Normal file
67
src/@ionic-native/plugins/call-log/index.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CallLogObject {
|
||||
name: string;
|
||||
value: string|Array<string>;
|
||||
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like';
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Call Log
|
||||
* @description
|
||||
* This plugin access the call history on a device and that can be filtered
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CallLog } from '@ionic-native/call-log';
|
||||
*
|
||||
*
|
||||
* constructor(private callLog: CallLog) { }
|
||||
*
|
||||
* ````
|
||||
* @interfaces
|
||||
* CallLogObject
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CallLog',
|
||||
plugin: 'cordova-plugin-calllog',
|
||||
pluginRef: 'plugins.callLog',
|
||||
repo: 'https://github.com/creacore-team/cordova-plugin-calllog',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class CallLog extends IonicNativePlugin {
|
||||
/**
|
||||
* This function return the call logs
|
||||
* @param filters {CallLogObject[]} array of object to filter the query
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getCallLog(filters: CallLogObject[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
hasReadPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
requestReadPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Call Number
|
||||
* @description
|
||||
@ -16,8 +17,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
*
|
||||
* this.callNumber.callNumber("18001010101", true)
|
||||
* .then(() => console.log('Launched dialer!'))
|
||||
* .catch(() => console.log('Error launching dialer'));
|
||||
* .then(res => console.log('Launched dialer!', res))
|
||||
* .catch(err => console.log('Error launching dialer', err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@ -30,7 +31,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class CallNumber extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Calls a phone number
|
||||
* @param numberToCall {string} The phone number to call as a string
|
||||
@ -44,4 +44,14 @@ export class CallNumber extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if call feature is available
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
isCallSupported(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CameraPreviewDimensions {
|
||||
/** The width of the camera preview, default to window.screen.width */
|
||||
@ -36,6 +36,9 @@ export interface CameraPreviewOptions {
|
||||
|
||||
/** Alpha channel of the preview box, float, [0,1], default 1 */
|
||||
alpha?: number;
|
||||
|
||||
/** Tap to set specific focus point. Note, this assumes the camera is full-screen. default false */
|
||||
tapToFocus?: boolean;
|
||||
}
|
||||
|
||||
export interface CameraPreviewPictureOptions {
|
||||
@ -128,12 +131,12 @@ export interface CameraPreviewPictureOptions {
|
||||
pluginName: 'CameraPreview',
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
pluginRef: 'CameraPreview',
|
||||
repo: 'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
|
||||
repo:
|
||||
'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CameraPreview extends IonicNativePlugin {
|
||||
|
||||
FOCUS_MODE = {
|
||||
FIXED: 'fixed',
|
||||
AUTO: 'auto',
|
||||
@ -186,35 +189,45 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
startCamera(options: CameraPreviewOptions): Promise<any> { return; }
|
||||
startCamera(options: CameraPreviewOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance. (iOS & Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stopCamera(): Promise<any> { return; }
|
||||
stopCamera(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
switchCamera(): Promise<any> { return; }
|
||||
switchCamera(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
hide(): Promise<any> { return; }
|
||||
hide(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
show(): Promise<any> { return; }
|
||||
show(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take the picture (base64)
|
||||
@ -225,7 +238,9 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
takePicture(options?: CameraPreviewPictureOptions): Promise<any> { return; }
|
||||
takePicture(options?: CameraPreviewPictureOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -238,7 +253,9 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setColorEffect(effect: string): Promise<any> { return; }
|
||||
setColorEffect(effect: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the zoom (Android)
|
||||
@ -249,21 +266,27 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setZoom(zoom?: number): Promise<any> { return; }
|
||||
setZoom(zoom?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum zoom (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getMaxZoom(): Promise<any> { return; }
|
||||
getMaxZoom(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current zoom (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getZoom(): Promise<any> { return; }
|
||||
getZoom(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the preview Size
|
||||
@ -274,14 +297,18 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
||||
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get focus mode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getFocusMode(): Promise<any> { return; }
|
||||
getFocusMode(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the focus mode
|
||||
@ -292,21 +319,27 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setFocusMode(focusMode?: string): Promise<any> { return; }
|
||||
setFocusMode(focusMode?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get supported focus modes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSupportedFocusModes(): Promise<any> { return; }
|
||||
getSupportedFocusModes(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current flash mode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getFlashMode(): Promise<any> { return; }
|
||||
getFlashMode(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the flashmode
|
||||
@ -317,35 +350,45 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setFlashMode(flashMode?: string): Promise<any> { return; }
|
||||
setFlashMode(flashMode?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get supported flash modes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSupportedFlashModes(): Promise<any> { return; }
|
||||
getSupportedFlashModes(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get supported picture sizes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSupportedPictureSizes(): Promise<any> { return; }
|
||||
getSupportedPictureSizes(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get exposure mode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureMode(): Promise<any> { return; }
|
||||
getExposureMode(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get exposure modes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureModes(): Promise<any> { return; }
|
||||
getExposureModes(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set exposure mode
|
||||
@ -356,14 +399,18 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setExposureMode(lock?: string): Promise<any> { return; }
|
||||
setExposureMode(lock?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get exposure compensation (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureCompensation(): Promise<any> { return; }
|
||||
getExposureCompensation(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set exposure compensation (Android)
|
||||
@ -374,14 +421,18 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
|
||||
setExposureCompensation(exposureCompensation?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get exposure compensation range (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureCompensationRange(): Promise<any> { return; }
|
||||
getExposureCompensationRange(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set specific focus point. Note, this assumes the camera is full-screen.
|
||||
@ -390,6 +441,16 @@ export class CameraPreview extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
tapToFocus(xPoint: number, yPoint: number): Promise<any> { return; }
|
||||
tapToFocus(xPoint: number, yPoint: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a listener for the back event for the preview
|
||||
* @return {Promise<any>} if backbutton pressed
|
||||
*/
|
||||
@Cordova()
|
||||
onBackButton(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ export enum Direction {
|
||||
plugin: 'cordova-plugin-camera',
|
||||
pluginRef: 'navigator.camera',
|
||||
repo: 'https://github.com/apache/cordova-plugin-camera',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone 8']
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Camera extends IonicNativePlugin {
|
||||
|
@ -400,7 +400,7 @@ export interface DownloadProgress {
|
||||
* @description
|
||||
* CodePush plugin for Cordova by Microsoft that supports iOS and Android.
|
||||
*
|
||||
* For more info, please see https://github.com/ksachdeva/ionic2-code-push-example
|
||||
* For more info, please see https://github.com/Dellos7/example-cordova-code-push-plugin
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
declare const window: any,
|
||||
navigator: any;
|
||||
|
||||
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'familyName' | 'formatted' | 'givenName' | 'honorificPrefix' | 'honorificSuffix' | 'id' | 'ims' | 'locality' | 'middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
||||
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'name.familyName' | 'name.formatted' | 'name.givenName' | 'name.honorificPrefix' | 'name.honorificSuffix' | 'id' | 'ims' | 'locality' | 'name.middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
||||
|
||||
export interface IContactProperties {
|
||||
|
||||
@ -294,9 +293,8 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
pluginRef: 'navigator.contacts',
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone 8']
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Contacts extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,6 @@ import { Injectable } from '@angular/core';
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
*
|
||||
* getAllDbs() {
|
||||
* let url = this.getUrl();
|
||||
* url = url+'_all_dbs';
|
||||
@ -56,6 +55,59 @@ import { Injectable } from '@angular/core';
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
* // DOCUMENTS //
|
||||
* getAllDocuments(database_name:string){
|
||||
* let url = this.getUrl();
|
||||
* // include_docs=true will include a doc inside response, it is false by default
|
||||
* url = url + database_name + '/_all_docs?include_docs=true';
|
||||
* return this._http
|
||||
* .get(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* createDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name;
|
||||
* return this._http
|
||||
* .post(url,document)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* let document = {
|
||||
* _id:'You can either specify the document ID (must be string) else couchbase generates one for your doc',
|
||||
* data:{name:'sandman',age:25,city:pune}
|
||||
* }
|
||||
* createDocument('justbe', document);
|
||||
* // successful response
|
||||
* { "id": "string","rev": "string","ok": true }
|
||||
* updateDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name + '/' + document._id;
|
||||
* return this._http
|
||||
* .put(url,document)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* // for updation of document your document must contain most recent rev(revision) id.
|
||||
* // for each updation of document new rev id is get generated
|
||||
* // successful response
|
||||
* { "id": "string","rev": "string(new revision id)","ok": true }
|
||||
* deleteDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name + '/' + document._id +'?rev='+doc._rev;
|
||||
* return this._http
|
||||
* .delete(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
*
|
||||
*
|
||||
* ```
|
||||
|
@ -1,6 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface CropOptions {
|
||||
quality?: number;
|
||||
targetHeight?: number;
|
||||
targetWidth?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Crop
|
||||
* @description Crops images
|
||||
@ -18,6 +24,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* error => console.error('Error cropping image', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CropOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Crop',
|
||||
@ -28,7 +36,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class Crop extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Crops an image
|
||||
* @param pathToImage
|
||||
@ -38,6 +45,7 @@ export class Crop extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
crop(pathToImage: string, options?: { quality: number }): Promise<string> { return; }
|
||||
|
||||
crop(pathToImage: string, options?: CropOptions): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
@ -21,13 +21,13 @@ export interface DatePickerOptions {
|
||||
|
||||
/**
|
||||
* Maximum date
|
||||
* Default?: empty String
|
||||
* Default: empty String
|
||||
*/
|
||||
maxDate?: Date | string | number;
|
||||
|
||||
/**
|
||||
* Label for the dialog title. If empty, uses android default (Set date/Set time).
|
||||
* Default?: empty String
|
||||
* Default: empty String
|
||||
*/
|
||||
titleText?: string;
|
||||
|
||||
@ -116,7 +116,6 @@ export interface DatePickerOptions {
|
||||
* Force locale for datePicker.
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,7 +154,6 @@ export interface DatePickerOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class DatePicker extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@ -176,5 +174,4 @@ export class DatePicker extends IonicNativePlugin {
|
||||
show(options: DatePickerOptions): Promise<Date> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
@ -21,7 +21,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* // Check if we are listening
|
||||
* this.dbMeter.isListening().then(
|
||||
* (isListening: boolean) => console.log(isListening)
|
||||
* isListening => console.log(isListening)
|
||||
* );
|
||||
*
|
||||
* // Stop listening
|
||||
@ -43,7 +43,6 @@ import { Observable } from 'rxjs/Observable';
|
||||
})
|
||||
@Injectable()
|
||||
export class DBMeter extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Starts listening
|
||||
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||
@ -52,27 +51,34 @@ export class DBMeter extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'stop'
|
||||
})
|
||||
start(): Observable<any> { return; }
|
||||
start(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops listening
|
||||
* @hidden
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<any> { return; }
|
||||
stop(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the DB Meter is listening
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||
*/
|
||||
@Cordova()
|
||||
isListening(): Promise<boolean> { return; }
|
||||
isListening(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the DB Meter instance
|
||||
* @returns {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||
*/
|
||||
@Cordova()
|
||||
delete(): Promise<any> { return; }
|
||||
|
||||
delete(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,13 @@ export interface DeeplinkMatch {
|
||||
|
||||
}
|
||||
|
||||
export interface DeeplinkOptions {
|
||||
/**
|
||||
* Set the matched route as root page using `navCtrl.setRoot()` method.
|
||||
*/
|
||||
root: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Deeplinks
|
||||
* @description This plugin handles deeplinks on iOS and Android for both custom URL scheme links
|
||||
@ -117,12 +124,14 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
*
|
||||
* @param {Object} paths
|
||||
*
|
||||
* @param {DeeplinkOptions} options
|
||||
*
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch> { return; }
|
||||
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface AndroidAccount {
|
||||
/** Account creator */
|
||||
CREATOR: AndroidAccount;
|
||||
|
||||
/** Account name */
|
||||
name: string;
|
||||
|
||||
/** Account type */
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Device Accounts
|
||||
@ -19,6 +30,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* .catch(error => console.error(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* AndroidAccount
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceAccounts',
|
||||
@ -29,33 +42,39 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class DeviceAccounts extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Gets all accounts registered on the Android Device
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<AndroidAccount[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
get(): Promise<any> { return; }
|
||||
get(): Promise<AndroidAccount[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all accounts registered on Android device for requested type
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<AndroidAccount[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
getByType(type: string): Promise<any> { return; }
|
||||
getByType(type: string): Promise<AndroidAccount[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all emails registered on Android device (accounts with 'com.google' type)
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
getEmails(): Promise<any> { return; }
|
||||
getEmails(): Promise<string[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first email registered on Android device
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getEmail(): Promise<any> { return; }
|
||||
|
||||
getEmail(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface DeviceFeedbackEnabled {
|
||||
/** Haptic Feedback */
|
||||
haptic: boolean;
|
||||
|
||||
/** Acoustic Feedback */
|
||||
acoustic: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Device Feedback
|
||||
* @description
|
||||
@ -19,8 +28,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* this.deviceFeedback.haptic(0);
|
||||
*
|
||||
* this.deviceFeedback.isFeedbackEnabled()
|
||||
* .then((feedback) => {
|
||||
* this.deviceFeedback.isFeedbackEnabled().then(feedback => {
|
||||
* console.log(feedback);
|
||||
* // {
|
||||
* // acoustic: true,
|
||||
@ -29,6 +37,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @innterfaces
|
||||
* DeviceFeedbackEnabled
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceFeedback',
|
||||
@ -39,25 +49,25 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class DeviceFeedback extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
acoustic(): void { }
|
||||
acoustic(): void {}
|
||||
|
||||
/**
|
||||
* Provide vibrate feedback to user, nevertheless respect user's tactile feedback setting as native feedback do.
|
||||
* @param type {Number} Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
|
||||
* @param type {number} Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
haptic(type: number): void { }
|
||||
haptic(type: number): void {}
|
||||
|
||||
/**
|
||||
* Check if haptic and acoustic feedback is enabled by user settings.
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<DeviceFeedbackEnabled>}
|
||||
*/
|
||||
@Cordova()
|
||||
isFeedbackEnabled(): Promise<{ haptic: boolean; acoustic: boolean; }> { return; }
|
||||
|
||||
isFeedbackEnabled(): Promise<DeviceFeedbackEnabled> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export interface DeviceOrientationCompassHeading {
|
||||
/**
|
||||
* The time at which this heading was determined. (DOMTimeStamp)
|
||||
*/
|
||||
timestamp: any;
|
||||
timestamp: number;
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ declare const window: any;
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device',
|
||||
repo: 'https://github.com/apache/cordova-plugin-device',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Android', 'Browser', 'iOS', 'macOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Device extends IonicNativePlugin {
|
||||
|
@ -125,6 +125,16 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
POWERING_OFF: string;
|
||||
};
|
||||
|
||||
@CordovaProperty
|
||||
motionStatus: {
|
||||
NOT_REQUESTED: string;
|
||||
GRANTED: string;
|
||||
DENIED: string;
|
||||
RESTRICTED: string;
|
||||
NOT_AVAILABLE: string;
|
||||
NOT_DETERMINED: string;
|
||||
UNKNOWN: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if app is able to access device location.
|
||||
@ -162,7 +172,7 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
/**
|
||||
* Displays the device location settings to allow user to enable location services/change location mode.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10', 'iOS'] })
|
||||
switchToLocationSettings(): void { }
|
||||
|
||||
/**
|
||||
@ -609,7 +619,26 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
})
|
||||
registerNFCStateChangeHandler(handler: Function): void { }
|
||||
|
||||
/**
|
||||
* Checks if the device data roaming setting is enabled.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isDataRoamingEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device setting for ADB(debug) is switched on.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isADBModeEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device is rooted.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isDeviceRooted(): Promise<boolean> { return; }
|
||||
|
||||
// IOS ONLY
|
||||
|
||||
@ -640,7 +669,7 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
* Checks if remote (push) notifications are enabled.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
@Cordova({ platforms: ['iOS', 'Android'] })
|
||||
isRemoteNotificationsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
@ -650,6 +679,14 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isRegisteredForRemoteNotifications(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the authorization status for the application to use Remote Notifications.
|
||||
* Note: Works on iOS 10+ only (iOS 9 and below will invoke the error callback).
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
getRemoteNotificationsAuthorizationStatus(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Indicates the current setting of notification types for the app in the Settings app.
|
||||
* Note: on iOS 8+, if "Allow Notifications" switch is OFF, all types will be returned as disabled.
|
||||
@ -720,13 +757,23 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
isMotionRequestOutcomeAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests and checks motion authorization for the application: there is no way to independently request only or check only, so both must be done in one operation.
|
||||
* Requests motion tracking authorization for the application.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestandcheckmotionauthorization)
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestmotionauthorization)
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
requestAndCheckMotionAuthorization(): Promise<any> { return; }
|
||||
requestMotionAuthorization(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Checks motion authorization status for the application.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#getmotionauthorizationstatus)
|
||||
*
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
getMotionAuthorizationStatus(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ export interface DialogsPromptCallback {
|
||||
plugin: 'cordova-plugin-dialogs',
|
||||
pluginRef: 'navigator.notification',
|
||||
repo: 'https://github.com/apache/cordova-plugin-dialogs',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Dialogs extends IonicNativePlugin {
|
||||
|
40
src/@ionic-native/plugins/dns/index.ts
Normal file
40
src/@ionic-native/plugins/dns/index.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name DNS
|
||||
* @description A plugin for Apache Cordova that enables applications to manually resolve hostnames into an underlying network address. This is mostly useful for determining whether there is a problem with the device's DNS server configuration.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { DNS } from '@ionic-native/dns';
|
||||
*
|
||||
*
|
||||
* constructor(private dns: DNS) { }
|
||||
*
|
||||
* ...
|
||||
* this.dns.resolve(hostname)
|
||||
* .then(
|
||||
* address => console.log('Resolved ' + hostname + ' to ' + address),
|
||||
* error => console.log('Failed to resolve ' + hostname + ': ' + error)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DNS',
|
||||
plugin: 'cordova-plugin-dns',
|
||||
pluginRef: 'cordova.plugins.dns',
|
||||
repo: 'https://bitbucket.org/zegeba/cordova-plugin-dns',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class DNS extends IonicNativePlugin {
|
||||
/**
|
||||
* Resolve hostnames into an underlying network address.
|
||||
* @param hostname
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the resolution.
|
||||
*/
|
||||
@Cordova()
|
||||
resolve(hostname: string): Promise<string> { return; }
|
||||
}
|
45
src/@ionic-native/plugins/document-picker/index.ts
Normal file
45
src/@ionic-native/plugins/document-picker/index.ts
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
* @name iOS DocumentPicker
|
||||
* @description
|
||||
*
|
||||
* Opens the file picker on iOS for the user to select a file, returns a file URI.
|
||||
* Allows the user to upload files from icloud
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { IOSDocumentPicker } from '@ionic-native/document-picker';
|
||||
*
|
||||
* constructor(private docPicker: IOSDocumentPicker) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.docPicker.getFile('all')
|
||||
* .then(uri => console.log(uri))
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IOSDocumentPicker',
|
||||
plugin: 'cordova-plugin-documentpicker.DocumentPicker',
|
||||
pluginRef: 'DocumentPicker',
|
||||
repo: 'https://github.com/iampossible/Cordova-DocPicker',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class DocumentPicker extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Open a file
|
||||
* @param {string} filters files between 'image', 'pdf' or 'all'
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getFile(options?: string): Promise<string> { return; }
|
||||
|
||||
}
|
@ -156,17 +156,6 @@ export class Facebook extends IonicNativePlugin {
|
||||
EVENT_PARAM_VALUE_NO: '0'
|
||||
};
|
||||
|
||||
/**
|
||||
* Browser wrapper
|
||||
* @param {number} appId Your Facebook AppID from their dashboard
|
||||
* @param {string} version The version of API you may want to use. Optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
browserInit(appId: number, version?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
*
|
||||
|
@ -31,25 +31,25 @@ export interface NotificationData {
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* fcm.subscribeToTopic('marketing');
|
||||
* this.fcm.subscribeToTopic('marketing');
|
||||
*
|
||||
* fcm.getToken().then(token=>{
|
||||
* this.fcm.getToken().then(token => {
|
||||
* backend.registerToken(token);
|
||||
* })
|
||||
* });
|
||||
*
|
||||
* fcm.onNotification().subscribe(data=>{
|
||||
* this.fcm.onNotification().subscribe(data => {
|
||||
* if(data.wasTapped){
|
||||
* console.log("Received in background");
|
||||
* } else {
|
||||
* console.log("Received in foreground");
|
||||
* };
|
||||
* })
|
||||
* });
|
||||
*
|
||||
* fcm.onTokenRefresh().subscribe(token=>{
|
||||
* this.fcm.onTokenRefresh().subscribe(token => {
|
||||
* backend.registerToken(token);
|
||||
* })
|
||||
* });
|
||||
*
|
||||
* fcm.unsubscribeFromTopic('marketing');
|
||||
* this.fcm.unsubscribeFromTopic('marketing');
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
|
41
src/@ionic-native/plugins/file-picker/index.ts
Normal file
41
src/@ionic-native/plugins/file-picker/index.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name iOS File Picker
|
||||
* @description
|
||||
*
|
||||
* Opens the file picker on iOS for the user to select a file, returns a file URI.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { IOSFilePicker } from '@ionic-native/file-picker';
|
||||
*
|
||||
* constructor(private filePicker: IOSFilePicker) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.filePicker.pickFile()
|
||||
* .then(uri => console.log(uri))
|
||||
* .catch(err => console.log('Error', err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'iOS File Picker',
|
||||
plugin: 'cordova-plugin-filepicker',
|
||||
pluginRef: 'filePicker',
|
||||
repo: 'https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class IOSFilePicker extends IonicNativePlugin {
|
||||
/**
|
||||
* Open a file
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
pickFile(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
@ -112,6 +112,10 @@ export interface FileTransferError {
|
||||
* @description
|
||||
* This plugin allows you to upload and download files.
|
||||
*
|
||||
* @deprecated
|
||||
* This plugin has been deprecated in favor of XHR2
|
||||
* https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';
|
||||
|
@ -620,7 +620,7 @@ declare const window: Window;
|
||||
plugin: 'cordova-plugin-file',
|
||||
pluginRef: 'cordova.file',
|
||||
repo: 'https://github.com/apache/cordova-plugin-file',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Android', 'Browser', 'iOS', 'macOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class File extends IonicNativePlugin {
|
||||
@ -1000,7 +1000,7 @@ export class File extends IonicNativePlugin {
|
||||
*
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
|
||||
* @param {string} fileName path relative to base path
|
||||
* @param {string | Blob} text content or blob to write
|
||||
* @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
|
||||
* @param {IWriteOptions} options replace file if set to true. See WriteOptions for more information.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to updated file entry or rejects with an error.
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
* @param params {any} Some param to configure something
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({ sync: true })
|
||||
logEvent(name: string, params: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
* @param id {string} The user ID
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({ sync: true })
|
||||
setUserId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -62,7 +62,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
* @param value {string} The property value
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({ sync: true })
|
||||
setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
* @param enabled {boolean}
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({ sync: true })
|
||||
setEnabled(enabled: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -79,7 +79,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
* @param name {string} The name of the screen
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({ sync: true })
|
||||
setCurrentScreen(name: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,22 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface DynamicLinksOptions {
|
||||
title: string;
|
||||
message: string;
|
||||
deepLink?: string;
|
||||
callToActionText?: string;
|
||||
export interface IDynamicLink {
|
||||
matchType: 'Weak' | 'Strong';
|
||||
deepLink: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Dynamic Links
|
||||
* @description
|
||||
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
|
||||
* Cordova plugin for Firebase Dynamic Links
|
||||
*
|
||||
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
|
||||
* Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
|
||||
* Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.
|
||||
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||
*
|
||||
* Preferences:
|
||||
@ -41,17 +38,6 @@ export interface DynamicLinksOptions {
|
||||
* constructor(private firebaseDynamicLinks: FirebaseDynamicLinks) { }
|
||||
*
|
||||
* ...
|
||||
* // The deepLink and callToActionText properties are optional
|
||||
* const options: DynamicLinksOptions = {
|
||||
* title: 'My Title';
|
||||
* message: 'My message';
|
||||
* deepLink: 'http://example.com/';
|
||||
* callToActionText: 'Message on button';
|
||||
* }
|
||||
*
|
||||
* this.firebaseDynamicLinks.sendInvitation(options)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.firebaseDynamicLinks.onDynamicLink()
|
||||
* .then((res: any) => console.log(res)) //Handle the logic here after opening the app with the Dynamic link
|
||||
@ -75,17 +61,12 @@ export class FirebaseDynamicLinks extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Registers callback that is triggered on each dynamic link click.
|
||||
* @return {Promise<any>} Returns a promise
|
||||
* @return {Observable<IDynamicLink>} Returns an observable
|
||||
*/
|
||||
@Cordova()
|
||||
onDynamicLink(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Display invitation dialog.
|
||||
* @param options {DynamicLinksOptions} Some param to configure something
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
sendInvitation(options: DynamicLinksOptions): Promise<any> { return; }
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
})
|
||||
onDynamicLink(): Observable<IDynamicLink> { return; }
|
||||
|
||||
}
|
||||
|
@ -30,17 +30,18 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: 'cordova-plugin-firebase',
|
||||
pluginRef: 'FirebasePlugin',
|
||||
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class Firebase extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the device token
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getToken(): Promise<any> { return; }
|
||||
getToken(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when a token is refreshed
|
||||
@ -49,7 +50,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
onTokenRefresh(): Observable<any> { return; }
|
||||
onTokenRefresh(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when the user opens a notification
|
||||
@ -58,7 +61,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
onNotificationOpen(): Observable<any> { return; }
|
||||
onNotificationOpen(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permission to receive push notifications
|
||||
@ -67,14 +72,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
grantPermission(): Promise<any> { return; }
|
||||
grantPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission to receive push notifications
|
||||
* @return {Promise<{isEnabled: boolean}>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{isEnabled: boolean}> { return; }
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
@ -82,14 +91,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setBadgeNumber(badgeNumber: number): Promise<any> { return; }
|
||||
setBadgeNumber(badgeNumber: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get icon badge number
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getBadgeNumber(): Promise<any> { return; }
|
||||
getBadgeNumber(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to a topic
|
||||
@ -97,7 +110,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
subscribe(topic: string): Promise<any> { return; }
|
||||
subscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from a topic
|
||||
@ -105,14 +120,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
unsubscribe(topic: string): Promise<any> { return; }
|
||||
unsubscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister from firebase, used to stop receiving push notifications.
|
||||
* Call this when you logout user from your app.
|
||||
*/
|
||||
@Cordova()
|
||||
unregister(): Promise<any> { return; }
|
||||
unregister(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
@ -121,7 +140,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logEvent(type: string, data: any): Promise<any> { return; }
|
||||
logEvent(type: string, data: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an Error using FirebaseCrash
|
||||
@ -129,7 +150,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logError(message: string): Promise<any> { return; }
|
||||
logError(message: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the current screen in Analytics
|
||||
@ -137,7 +160,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setScreenName(name: string): Promise<any> { return; }
|
||||
setScreenName(name: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a user id for use in Analytics
|
||||
@ -145,7 +170,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setUserId(userId: string): Promise<any> { return; }
|
||||
setUserId(userId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a user property for use in Analytics
|
||||
@ -154,22 +181,31 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||
setUserProperty(name: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app
|
||||
* @param cacheExpirationSeconds {number}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
fetch(cacheExpirationSeconds?: number): Promise<any> { return; }
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
fetch(cacheExpirationSeconds?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the Remote Config fetched config
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
activateFetched(): Promise<any> { return; }
|
||||
activateFetched(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config value
|
||||
@ -177,8 +213,13 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @param [namespace] {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getValue(key: string, namespace?: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
getValue(key: string, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config byte array
|
||||
@ -189,7 +230,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
getByteArray(key: string, namespace?: string): Promise<any> { return; }
|
||||
getByteArray(key: string, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current state of the FirebaseRemoteConfig singleton object
|
||||
@ -198,7 +241,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
getInfo(): Promise<any> { return; }
|
||||
getInfo(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the settings for the FirebaseRemoteConfig object's operations
|
||||
@ -208,7 +253,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
setConfigSettings(settings: any): Promise<any> { return; }
|
||||
setConfigSettings(settings: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set defaults in the Remote Config
|
||||
@ -219,6 +266,44 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
setDefaults(defaults: any, namespace?: string): Promise<any> { return; }
|
||||
setDefaults(defaults: any, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param phoneNumber {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
getVerificationID(phoneNumber: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param phoneNumber {string} the phone number, including '+' and country code
|
||||
* @param timeoutDuration {number} the timeout in sec - no more SMS will be sent to this number until this timeout expires
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
verifyPhoneNumber(phoneNumber: string, timeoutDuration: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the user to enable/disable analytics collection
|
||||
* @param enabled {booleab} value to set collection
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ export class FlurryAnalyticsObject {
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from 'ionic-native/flurry-analytics';
|
||||
* import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from '@ionic-native/flurry-analytics';
|
||||
*
|
||||
* constructor(private flurryAnalytics: FlurryAnalytics) { }
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name FTP
|
||||
@ -95,24 +96,28 @@ export class FTP extends IonicNativePlugin {
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
upload(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
upload(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Download one remote file on the ftp server to local path.
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
download(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
download(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancel all requests. Always success.
|
||||
|
@ -117,6 +117,14 @@ export interface GeolocationOptions {
|
||||
*
|
||||
* This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation.
|
||||
*
|
||||
* For iOS you have to add this configuration to your configuration.xml file
|
||||
* ```xml
|
||||
* <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
|
||||
* <string>We want your location! Best regards NSA</string>
|
||||
* </edit-config>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
@ -155,7 +163,7 @@ export interface GeolocationOptions {
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
|
||||
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Geolocation extends IonicNativePlugin {
|
||||
|
@ -1,9 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface GlobalizationOptions {
|
||||
formatLength: string;
|
||||
selector: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Globalization
|
||||
* @description
|
||||
* This plugin obtains information and performs operations specific to the user's locale, language, and timezone.
|
||||
*
|
||||
* @deprecated
|
||||
* With the [ECMA Internationalization API](https://www.ecma-international.org/ecma-402/1.0/) now supported on iOS, Android and Windows devices, this plugin is not required any more.
|
||||
* Migrating from this plugin to the [ECMA Internationalization API](https://www.ecma-international.org/ecma-402/1.0/) is explained in this [Cordova blog post](https://cordova.apache.org/news/2017/11/20/migrate-from-cordova-globalization-plugin.html).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Globalization } from '@ionic-native/globalization';
|
||||
@ -20,30 +31,35 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* GlobalizationOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Globalization',
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
pluginRef: 'navigator.globalization',
|
||||
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Globalization extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
getPreferredLanguage(): Promise<{ value: string }> { return; }
|
||||
getPreferredLanguage(): Promise<{ value: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
|
||||
* @returns {Promise<{value: string}>}
|
||||
*/
|
||||
@Cordova()
|
||||
getLocaleName(): Promise<{ value: string }> { return; }
|
||||
getLocaleName(): Promise<{ value: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts date to string
|
||||
@ -55,7 +71,12 @@ export class Globalization extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
dateToString(date: Date, options: { formatLength: string, selector: string }): Promise<{ value: string }> { return; }
|
||||
dateToString(
|
||||
date: Date,
|
||||
options: GlobalizationOptions
|
||||
): Promise<{ value: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@ -67,17 +88,40 @@ export class Globalization extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
stringToDate(dateString: string, options: { formatLength: string, selector: string }): Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }> { return; }
|
||||
stringToDate(
|
||||
dateString: string,
|
||||
options: GlobalizationOptions
|
||||
): Promise<{
|
||||
year: number;
|
||||
month: number;
|
||||
day: number;
|
||||
hour: number;
|
||||
minute: number;
|
||||
second: number;
|
||||
millisecond: number;
|
||||
}> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @returns {Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }>} Returns a promise.
|
||||
* @returns {Promise<{ pattern: string, timezone: string, utc_offset: number, dst_offset: number }>} Returns a promise.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getDatePattern(options: { formatLength: string, selector: string }): Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }> { return; }
|
||||
getDatePattern(
|
||||
options: GlobalizationOptions
|
||||
): Promise<{
|
||||
pattern: string;
|
||||
timezone: string;
|
||||
iana_timezone: string;
|
||||
utc_offset: number;
|
||||
dst_offset: number;
|
||||
}> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
|
||||
@ -87,7 +131,12 @@ export class Globalization extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getDateNames(options: { type: string, item: string }): Promise<{ value: Array<string> }> { return; }
|
||||
getDateNames(options: {
|
||||
type: string;
|
||||
item: string;
|
||||
}): Promise<{ value: Array<string> }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
|
||||
@ -95,14 +144,18 @@ export class Globalization extends IonicNativePlugin {
|
||||
* @returns {Promise<{dst: string}>} reutrns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
isDayLightSavingsTime(date: Date): Promise<{ dst: string }> { return; }
|
||||
isDayLightSavingsTime(date: Date): Promise<{ dst: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first day of the week according to the client's user preferences and calendar.
|
||||
* @returns {Promise<{value: string}>} returns a promise with the value
|
||||
*/
|
||||
@Cordova()
|
||||
getFirstDayOfWeek(): Promise<{ value: string }> { return; }
|
||||
getFirstDayOfWeek(): Promise<{ value: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a number formatted as a string according to the client's user preferences.
|
||||
@ -113,7 +166,12 @@ export class Globalization extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
numberToString(numberToConvert: number, options: { type: string }): Promise<{ value: string }> { return; }
|
||||
numberToString(
|
||||
numberToConvert: number,
|
||||
options: { type: string }
|
||||
): Promise<{ value: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -125,7 +183,12 @@ export class Globalization extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
stringToNumber(stringToConvert: string, options: { type: string }): Promise<{ value: number | string }> { return; }
|
||||
stringToNumber(
|
||||
stringToConvert: string,
|
||||
options: { type: string }
|
||||
): Promise<{ value: number | string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a pattern string to format and parse numbers according to the client's user preferences.
|
||||
@ -135,7 +198,20 @@ export class Globalization extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getNumberPattern(options: { type: string }): Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }> { return; }
|
||||
getNumberPattern(options: {
|
||||
type: string;
|
||||
}): Promise<{
|
||||
pattern: string;
|
||||
symbol: string;
|
||||
fraction: number;
|
||||
rounding: number;
|
||||
positive: string;
|
||||
negative: string;
|
||||
decimal: string;
|
||||
grouping: string;
|
||||
}> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
|
||||
@ -143,6 +219,16 @@ export class Globalization extends IonicNativePlugin {
|
||||
* @returns {Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }>}
|
||||
*/
|
||||
@Cordova()
|
||||
getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> { return; }
|
||||
|
||||
getCurrencyPattern(
|
||||
currencyCode: string
|
||||
): Promise<{
|
||||
pattern: string;
|
||||
code: string;
|
||||
fraction: number;
|
||||
rounding: number;
|
||||
decimal: number;
|
||||
grouping: string;
|
||||
}> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class GoogleAnalytics extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
@ -50,7 +49,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
startTrackerWithId(id: string, interval?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more
|
||||
@ -58,7 +59,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAllowIDFACollection(allow: boolean): Promise<any> { return; }
|
||||
setAllowIDFACollection(allow: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
@ -67,7 +70,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setUserId(id: string): Promise<any> { return; }
|
||||
setUserId(id: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a anonymize Ip address
|
||||
@ -75,15 +80,40 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAnonymizeIp(anonymize: boolean): Promise<any> { return; }
|
||||
setAnonymizeIp(anonymize: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the app version
|
||||
* Set the app version
|
||||
* @param appVersion {string} App version
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setAppVersion(appVersion: string): Promise<any> { return; }
|
||||
setAppVersion(appVersion: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a variable
|
||||
* @param key {string} Variable
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getVar(key: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a variable
|
||||
* @param key {string} Variable
|
||||
* @param value {string} Parameter
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setVar(key: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set OptOut
|
||||
@ -91,14 +121,18 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setOptOut(optout: boolean): Promise<any> { return; }
|
||||
setOptOut(optout: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
debugMode(): Promise<any> { return; }
|
||||
debugMode(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track custom metric
|
||||
@ -110,7 +144,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
trackMetric(key: number, value?: number): Promise<any> { return; }
|
||||
trackMetric(key: number, value?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
@ -125,7 +161,13 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
successIndex: 3,
|
||||
errorIndex: 4
|
||||
})
|
||||
trackView(title: string, campaignUrl?: string, newSession?: boolean): Promise<any> { return; }
|
||||
trackView(
|
||||
title: string,
|
||||
campaignUrl?: string,
|
||||
newSession?: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
@ -135,7 +177,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
addCustomDimension(key: number, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track an event
|
||||
@ -151,7 +195,15 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
successIndex: 5,
|
||||
errorIndex: 6
|
||||
})
|
||||
trackEvent(category: string, action: string, label?: string, value?: number, newSession?: boolean): Promise<any> { return; }
|
||||
trackEvent(
|
||||
category: string,
|
||||
action: string,
|
||||
label?: string,
|
||||
value?: number,
|
||||
newSession?: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
@ -160,7 +212,9 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
trackException(description: string, fatal: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track User Timing (App Speed)
|
||||
@ -171,7 +225,14 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
trackTiming(
|
||||
category: string,
|
||||
intervalInMilliseconds: number,
|
||||
variable: string,
|
||||
label: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Transaction (Ecommerce)
|
||||
@ -185,7 +246,16 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
addTransaction(
|
||||
id: string,
|
||||
affiliation: string,
|
||||
revenue: number,
|
||||
tax: number,
|
||||
shipping: number,
|
||||
currencyCode: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Transaction Item (Ecommerce)
|
||||
@ -200,7 +270,17 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
addTransactionItem(
|
||||
id: string,
|
||||
name: string,
|
||||
sku: string,
|
||||
category: string,
|
||||
price: number,
|
||||
quantity: number,
|
||||
currencyCode: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
@ -208,6 +288,19 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually dispatch any data
|
||||
* @returns {Promise<any>}
|
||||
* @platform
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
dispatch(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
264
src/@ionic-native/plugins/google-play-games-services/index.ts
Normal file
264
src/@ionic-native/plugins/google-play-games-services/index.ts
Normal file
@ -0,0 +1,264 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface ScoreData {
|
||||
|
||||
/**
|
||||
* The score to submit.
|
||||
*/
|
||||
score: number;
|
||||
|
||||
/**
|
||||
* The leaderboard ID from Google Play Developer console.
|
||||
*/
|
||||
leaderboardId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LeaderboardData {
|
||||
|
||||
/**
|
||||
* The leaderboard ID from Goole Play Developer console.
|
||||
*/
|
||||
leaderboardId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface AchievementData {
|
||||
|
||||
/**
|
||||
* The achievement ID from Google Play Developer console.
|
||||
*/
|
||||
achievementId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface IncrementableAchievementData extends AchievementData {
|
||||
|
||||
/**
|
||||
* The amount to increment the achievement by.
|
||||
*/
|
||||
numSteps: number;
|
||||
|
||||
}
|
||||
|
||||
export interface SignedInResponse {
|
||||
|
||||
/**
|
||||
* True or false is the use is signed in.
|
||||
*/
|
||||
isSignedIn: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface Player {
|
||||
|
||||
/**
|
||||
* The players display name.
|
||||
*/
|
||||
displayName: string;
|
||||
|
||||
/**
|
||||
* The ID given to the player by Play Games Services.
|
||||
*/
|
||||
playerId: string;
|
||||
|
||||
/**
|
||||
* The title of the player based on their gameplay activity. Not
|
||||
* all players have this and it may change over time.
|
||||
*/
|
||||
title: string|null;
|
||||
|
||||
/**
|
||||
* Retrieves the URI for loading this player's icon-size profile image.
|
||||
* Returns null if the player has no profile image.
|
||||
*/
|
||||
iconImageUrl: string;
|
||||
|
||||
/**
|
||||
* Retrieves the URI for loading this player's hi-res profile image. Returns
|
||||
* null if the player has no profile image.
|
||||
*/
|
||||
hiResIconImageUrl: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Google Play Games Services
|
||||
* @description
|
||||
* A Cordova plugin that let's you interact with Google Play Games Services.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GooglePlayGamesServices } from '@ionic-native/google-play-games-services';
|
||||
*
|
||||
*
|
||||
* constructor(private googlePlayGamesServices: GooglePlayGamesServices) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Authenticate with Play Games Services
|
||||
* this.googlePlayGamesServices.auth()
|
||||
* .then(() => console.log('Logged in to Play Games Services'))
|
||||
* .catch(e) => console.log('Error logging in Play Games Services', e);
|
||||
*
|
||||
* // Sign out of Play Games Services.
|
||||
* this.googlePlayGamesServices.signOut()
|
||||
* .then(() => console.log('Logged out of Play Games Services'))
|
||||
* .catch(e => console.log('Error logging out of Play Games Services', e);
|
||||
*
|
||||
* // Check auth status.
|
||||
* this.googlePlayGamesServices.isSignedIn()
|
||||
* .then((signedIn: SignedInResponse) => {
|
||||
* if (signedIn.isSignedIn) {
|
||||
* hideLoginButton();
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // Fetch currently authenticated user's data.
|
||||
* this.googlePlayGamesServices.showPlayer().then((data: Player) => {
|
||||
* console.log('Player data', data);
|
||||
* });
|
||||
*
|
||||
* // Submit a score.
|
||||
* this.googlePlayGamesServices.submitScore({
|
||||
* score: 100,
|
||||
* leaderboardId: 'SomeLeaderboardId'
|
||||
* });
|
||||
*
|
||||
* // Show the native leaderboards window.
|
||||
* this.googlePlayGamesServices.showAllLeaderboards()
|
||||
* .then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
* // Show a signle native leaderboard window.
|
||||
* this.googlePlayGamesServices.showLeaderboard({
|
||||
* leaderboardId: 'SomeLeaderBoardId'
|
||||
* }).then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
* // Unlock an achievement.
|
||||
* this.googlePlayGamesServices.unlockAchievement({
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement unlocked'));
|
||||
*
|
||||
* // Incremement an achievement.
|
||||
* this.googlePlayGamesServices.incrementAchievement({
|
||||
* step: 1,
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement incremented'));
|
||||
*
|
||||
* // Show the native achievements window.
|
||||
* this.googlePlayGamesServices.showAchivements()
|
||||
* .then(() => console.log('The achievements window is visible.'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'GooglePlayGamesServices',
|
||||
plugin: 'cordova-plugin-play-games-service',
|
||||
pluginRef: 'plugins.playGamesServices',
|
||||
repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
|
||||
platforms: ['Android'],
|
||||
install: 'ionic cordova plugin add cordova-plugin-play-games-services --variable APP_ID="YOUR_APP_ID',
|
||||
})
|
||||
@Injectable()
|
||||
export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Initialise native Play Games Service login procedure.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the player
|
||||
* is authenticated with Play Games Services.
|
||||
*/
|
||||
@Cordova()
|
||||
auth(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Sign out of Google Play Games Services.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolve when the player
|
||||
* successfully signs out.
|
||||
*/
|
||||
@Cordova()
|
||||
signOut(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if the user is signed in.
|
||||
*
|
||||
* @return {Promise<SignedInResponse>} Returns a promise that resolves with
|
||||
* the signed in response.
|
||||
*/
|
||||
@Cordova()
|
||||
isSignedIn(): Promise<SignedInResponse> { return; }
|
||||
|
||||
/**
|
||||
* Show the currently authenticated player.
|
||||
*
|
||||
* @return {Promise<Player>} Returns a promise that resolves when Play
|
||||
* Games Services returns the authenticated player.
|
||||
*/
|
||||
@Cordova()
|
||||
showPlayer(): Promise<Player> { return; }
|
||||
|
||||
/**
|
||||
* Submit a score to a leaderboard. You should ensure that you have a
|
||||
* successful return from auth() before submitting a score.
|
||||
*
|
||||
* @param data {ScoreData} The score data you want to submit.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* score is submitted.
|
||||
*/
|
||||
@Cordova()
|
||||
submitScore(data: ScoreData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controller to show all the
|
||||
* leaderboards.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboards window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showAllLeaderboards(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controll to show the
|
||||
* specified leaderboard.
|
||||
*
|
||||
* @param data {LeaderboardData} The leaderboard you want to show.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboard window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showLeaderboard(data: LeaderboardData): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Unlock an achievement.
|
||||
*
|
||||
* @param data {AchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is unlocked.
|
||||
*/
|
||||
@Cordova()
|
||||
unlockAchievement(data: AchievementData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Increment an achievement.
|
||||
*
|
||||
* @param data {IncrementableAchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is incremented.
|
||||
*/
|
||||
@Cordova()
|
||||
incrementAchievement(data: IncrementableAchievementData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Lauches the native Play Games achievements view controller to show
|
||||
* achievements.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showAchievements(): Promise<any> { return; }
|
||||
|
||||
}
|
@ -63,4 +63,11 @@ export class GooglePlus extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
disconnect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will retrieve the Android signing certificate fingerprint which is required in the Google Developer Console.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSigningCertificateFingerprint(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export interface HealthKitOptions {
|
||||
* HKWorkoutActivityType constant
|
||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||
*/
|
||||
activityType?: string; //
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||
@ -18,6 +18,12 @@ export interface HealthKitOptions {
|
||||
*/
|
||||
amount?: number;
|
||||
|
||||
/**
|
||||
* specifies if the data returned by querySampleType() should be sorted by
|
||||
* end date in ascending order, default is false
|
||||
*/
|
||||
ascending?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -63,6 +69,11 @@ export interface HealthKitOptions {
|
||||
*/
|
||||
extraData?: any;
|
||||
|
||||
/**
|
||||
* limits the maximum number of records returned by querySampleType()
|
||||
*/
|
||||
limit?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
270
src/@ionic-native/plugins/hot-code-push/index.ts
Normal file
270
src/@ionic-native/plugins/hot-code-push/index.ts
Normal file
@ -0,0 +1,270 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin, CordovaCheck } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var chcp: any;
|
||||
|
||||
export interface HotCodePushVersion {
|
||||
/**
|
||||
* Application's version name. This version is visible to the user on the stores.
|
||||
*/
|
||||
appVersion: string;
|
||||
/**
|
||||
* Application's build version number.
|
||||
*/
|
||||
buildVersion: string;
|
||||
/**
|
||||
* Version of the web content, that is displayed to the user. Basically, value of the release property from chcp.json file in your local www folder.
|
||||
*/
|
||||
currentWebVersion: string;
|
||||
/**
|
||||
* Previous web content version. This is a version of our backup. Can be empty, if there were no updates installed.
|
||||
*/
|
||||
previousWebVersion: string;
|
||||
/**
|
||||
* Version number of the web content, that was loaded by the plugin and ready to be installed. Basically, value of the release property from chcp.json file on your server. Can be empty, if no update is waiting for installation.
|
||||
*/
|
||||
readyToInstallWebVersion: string;
|
||||
}
|
||||
|
||||
export interface HotCodePushUpdate {
|
||||
/**
|
||||
* Current version installed.
|
||||
*/
|
||||
currentVersion: string;
|
||||
/**
|
||||
* Available version to replace the current one.
|
||||
*/
|
||||
readyToInstallVersion: string;
|
||||
}
|
||||
|
||||
export interface HotCodePushRequestOptions {
|
||||
/**
|
||||
* Url of the chcp.json config on the server. Plugin will use this one instead of <config-file url=""> from the config.xml.
|
||||
*/
|
||||
'config-file'?: string;
|
||||
/**
|
||||
* Additional HTTP headers, that will be added to all requests in update download process, including loading configs and new/changed files.
|
||||
*/
|
||||
'request-headers'?: {[key: string]: any};
|
||||
}
|
||||
|
||||
/**
|
||||
* For description on error codes, please visit https://github.com/nordnet/cordova-hot-code-push/wiki/Error-codes
|
||||
*/
|
||||
export enum ErrorCode {
|
||||
NOTHING_TO_INSTALL = 1,
|
||||
NOTHING_TO_UPDATE = 2,
|
||||
FAILED_TO_DOWNLOAD_APPLICATION_CONFIG = -1,
|
||||
APPLICATION_BUILD_VERSION_TOO_LOW = -2,
|
||||
FAILED_TO_DOWNLOAD_CONTENT_MANIFEST = -3,
|
||||
FAILED_TO_DOWNLOAD_UPDATE_FILES = -4,
|
||||
FAILED_TO_MOVE_LOADED_FILES_TO_INSTALLATION_FOLDER = -5,
|
||||
UPDATE_IS_INVALID = -6,
|
||||
FAILED_TO_COPY_FILES_FROM_PREVIOUS_RELEASE = -7,
|
||||
FAILED_TO_COPY_NEW_CONTENT_FILES = -8,
|
||||
LOCAL_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND = -9,
|
||||
LOCAL_VERSION_OF_MANIFEST_NOT_FOUND = -10,
|
||||
LOADED_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND = -11,
|
||||
LOADED_VERSION_OF_MANIFEST_NOT_FOUND = -12,
|
||||
FAILED_TO_INSTALL_ASSETS_ON_EXTERNAL_STORAGE = -13,
|
||||
CANT_INSTALL_WHILE_DOWNLOAD_IN_PROGRESS = -14,
|
||||
CANT_DOWNLOAD_UPDATE_WHILE_INSTALLATION_IN_PROGRESS = -15,
|
||||
INSTALLATION_ALREADY_IN_PROGRESS = -16,
|
||||
DOWNLOAD_ALREADY_IN_PROGRESS = -17,
|
||||
ASSETS_FOLDER_IS_NOT_YET_INSTALLED = -18,
|
||||
NEW_APPLICATION_CONFIG_IS_INVALID = -19
|
||||
}
|
||||
|
||||
export interface HotCodePushError {
|
||||
code: ErrorCode;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface HotCodePushEventData {
|
||||
details?: {
|
||||
error?: HotCodePushError;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Hot Code Push
|
||||
* @description
|
||||
* HotCodePush plugin for Cordova that supports iOS and Android. This plugin allows you to keep your html, css and js files synced with your server.
|
||||
*
|
||||
* For more info, please see the detailed wiki https://github.com/nordnet/cordova-hot-code-push/wiki
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { HotCodePush } from '@ionic-native/hot-code-push';
|
||||
*
|
||||
* constructor(private hotCodePush: HotCodePush) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* hotCodePush.fetchUpdate(options).then(data => { console.log('Update available'); });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HotCodePush',
|
||||
plugin: 'cordova-hot-code-push',
|
||||
pluginRef: 'chcp',
|
||||
repo: 'https://github.com/nordnet/cordova-hot-code-push',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class HotCodePush extends IonicNativePlugin {
|
||||
/**
|
||||
* Show dialog with the request to update application through the Store (App Store or Google Play).
|
||||
* @param message {string} Message to show in the dialog
|
||||
* @returns {Promise<any>} Resolves when the user is redirected to the store, rejects if the user declines.
|
||||
*/
|
||||
@Cordova()
|
||||
requestApplicationUpdate(message: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Download updates from the server-side.
|
||||
* @param options {HotCodePushRequestOptions} Additional options to the request. If not set - preferences from config.xml are used.
|
||||
* @returns {Promise<any>} Resolves if there is an update available, rejects otherwise.
|
||||
*/
|
||||
@CordovaCheck()
|
||||
fetchUpdate(options?: HotCodePushRequestOptions): Promise<any> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
HotCodePush.getPlugin().fetchUpdate((error: HotCodePushError, data: any) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(data);
|
||||
}
|
||||
}, options);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Install update if there is anything to install.
|
||||
* @returns {Promise<any>} Resolves when the update is installed.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
installUpdate(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if update was loaded and ready to be installed.
|
||||
* @returns {Promise<HotCodePushUpdate>} Resolves if an update is ready, rejects if there is no update.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
isUpdateAvailableForInstallation(): Promise<HotCodePushUpdate> { return; }
|
||||
|
||||
/**
|
||||
* Gets information about the app's versions.
|
||||
* @returns {Promise<HotCodePushVersion>} Resolves with the information about the versions.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
getVersionInfo(): Promise<HotCodePushVersion> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when new release was successfully loaded and ready to be installed.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_updateIsReadyToInstall'
|
||||
})
|
||||
onUpdateIsReadyToInstall(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when plugin couldn't load update from the server. Error details are attached to the event.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_updateLoadFailed'
|
||||
})
|
||||
onUpdateLoadFailed(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when we successfully loaded application config from the server, but there is nothing new is available.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_nothingToUpdate'
|
||||
})
|
||||
onNothingToUpdate(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when an update is about to be installed.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_beforeInstall'
|
||||
})
|
||||
onBeforeInstall(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when update was successfully installed.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_updateInstalled'
|
||||
})
|
||||
onUpdateInstalled(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when update installation failed. Error details are attached to the event.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_updateInstallFailed'
|
||||
})
|
||||
onUpdateInstallFailed(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when there is nothing to install. Probably, nothing was loaded before that.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_nothingToInstall'
|
||||
})
|
||||
onNothingToInstall(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when plugin is about to start installing bundle content on the external storage.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_beforeAssetsInstalledOnExternalStorage'
|
||||
})
|
||||
onBeforeAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when plugin successfully copied web project files from bundle on the external storage. Most likely you will use it for debug purpose only. Or even never.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_assetsInstalledOnExternalStorage'
|
||||
})
|
||||
onAssetsInstalledOnExternalStorage(): Observable<HotCodePushEventData> { return; }
|
||||
|
||||
/**
|
||||
* Event sent when plugin couldn't copy files from bundle on the external storage. If this happens - plugin won't work. Can occur when there is not enough free space on the device.
|
||||
* @returns {Observable<HotCodePushEventData>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'chcp_assetsInstallationError'
|
||||
})
|
||||
onAssetsInstallationError(): Observable<HotCodePushEventData> { return; }
|
||||
}
|
@ -1,19 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The headers of the response
|
||||
*/
|
||||
headers: any;
|
||||
/**
|
||||
* The URL of the response. This property will be the final URL obtained after any redirects.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* Error response from the server. This property usually exists when a promise returned by a request method rejects.
|
||||
*/
|
||||
@ -33,7 +37,7 @@ export interface HTTPResponse {
|
||||
* ```typescript
|
||||
* import { HTTP } from '@ionic-native/http';
|
||||
*
|
||||
* constructor(private http: HTTP) { }
|
||||
* constructor(private http: HTTP) {}
|
||||
*
|
||||
* ...
|
||||
*
|
||||
@ -66,7 +70,6 @@ export interface HTTPResponse {
|
||||
})
|
||||
@Injectable()
|
||||
export class HTTP extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This returns an object representing a basic HTTP Authorization header of the form.
|
||||
* @param username {string} Username
|
||||
@ -74,7 +77,12 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBasicAuthHeader(username: string, password: string): { Authorization: string; } { return; }
|
||||
getBasicAuthHeader(
|
||||
username: string,
|
||||
password: string
|
||||
): { Authorization: string } {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets up all future requests to use Basic HTTP authentication with the given username and password.
|
||||
@ -82,55 +90,101 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param password {string} Password
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
useBasicAuth(username: string, password: string): void { }
|
||||
useBasicAuth(username: string, password: string): void {}
|
||||
|
||||
/**
|
||||
* Set a header for all future requests. Takes a header and a value.
|
||||
* Get all headers defined for a given hostname.
|
||||
* @param host {string} The hostname
|
||||
* @returns {string} return all headers defined for the hostname
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getHeaders(host: string): string {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a header for all future requests. Takes a hostname, a header and a value.
|
||||
* @param host {string} The hostname to be used for scoping this header
|
||||
* @param header {string} The name of the header
|
||||
* @param value {string} The value of the header
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setHeader(header: string, value: string): void { }
|
||||
setHeader(host: string, header: string, value: string): void {}
|
||||
|
||||
/**
|
||||
* Get the name of the data serializer which will be used for all future POST and PUT requests.
|
||||
* @returns {string} returns the name of the configured data serializer
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getDataSerializer(): string {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
|
||||
* @param serializer {string} The name of the serializer. Can be urlencoded or json
|
||||
* @param serializer {string} The name of the serializer. Can be urlencoded, utf8 or json
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setDataSerializer(serializer: string): void { }
|
||||
setDataSerializer(serializer: string): void {}
|
||||
|
||||
/**
|
||||
* Clear all cookies
|
||||
* Add a custom cookie.
|
||||
* @param url {string} Scope of the cookie
|
||||
* @param cookie {string} RFC compliant cookie string
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
clearCookies(): void { }
|
||||
setCookie(url: string, cookie: string): void {}
|
||||
|
||||
/**
|
||||
* Remove cookies
|
||||
* Clear all cookies.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
clearCookies(): void {}
|
||||
|
||||
/**
|
||||
* Remove cookies for given URL.
|
||||
* @param url {string}
|
||||
* @param cb
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
removeCookies(url: string, cb: () => void): void { }
|
||||
removeCookies(url: string, cb: () => void): void {}
|
||||
|
||||
/**
|
||||
* Set request timeout
|
||||
* Resolve cookie string for given URL.
|
||||
* @param url {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getCookieString(url: string): string { return; }
|
||||
|
||||
/**
|
||||
* Get global request timeout value in seconds.
|
||||
* @returns {number} returns the global request timeout value
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getRequestTimeout(): number {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set global request timeout value in seconds.
|
||||
* @param timeout {number} The timeout in seconds. Default 60
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setRequestTimeout(timeout: number): void { }
|
||||
setRequestTimeout(timeout: number): void {}
|
||||
|
||||
/**
|
||||
* Enable or disable SSL Pinning. This defaults to false.
|
||||
*
|
||||
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this stackoverflow answer. You want to convert it to a DER encoded certificate with a .cer extension.
|
||||
* To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project's platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this [stackoverflow answer](https://stackoverflow.com/questions/16583428/how-to-convert-an-ssl-certificate-in-linux/16583429#16583429). You want to convert it to a DER encoded certificate with a .cer extension.
|
||||
*
|
||||
* As an alternative, you can store your .cer files in the www/certificates folder.
|
||||
* @param enable {boolean} Set to true to enable
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
enableSSLPinning(enable: boolean): Promise<void> { return; }
|
||||
enableSSLPinning(enable: boolean): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept all SSL certificates. Or disabled accepting all certificates. Defaults to false.
|
||||
@ -138,15 +192,17 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
acceptAllCerts(accept: boolean): Promise<void> { return; }
|
||||
acceptAllCerts(accept: boolean): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not to validate the domain name in the certificate. This defaults to true.
|
||||
* @param validate {boolean} Set to true to validate
|
||||
* Disable following redirects automatically.
|
||||
* @param disable {boolean} Set to true to disable following redirects automatically
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
validateDomainName(validate: boolean): Promise<void> { return; }
|
||||
disableRedirect(disable: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Make a POST request
|
||||
@ -156,7 +212,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
post(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a GET request
|
||||
@ -166,7 +224,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a PUT request
|
||||
@ -176,7 +236,21 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
put(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a PATCH request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
patch(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a DELETE request
|
||||
@ -186,7 +260,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a HEAD request
|
||||
@ -196,7 +272,9 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -208,7 +286,15 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<HTTPResponse> { return; }
|
||||
uploadFile(
|
||||
url: string,
|
||||
body: any,
|
||||
headers: any,
|
||||
filePath: string,
|
||||
name: string
|
||||
): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -219,5 +305,12 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> { return; }
|
||||
downloadFile(
|
||||
url: string,
|
||||
body: any,
|
||||
headers: any,
|
||||
filePath: string
|
||||
): Promise<HTTPResponse> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -248,12 +248,12 @@ export interface IBeaconDelegate {
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didRangeBeaconsInRegion: ', data),
|
||||
* error => console.error();
|
||||
* error => console.error()
|
||||
* );
|
||||
* delegate.didStartMonitoringForRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didStartMonitoringForRegion: ', data),
|
||||
* error => console.error();
|
||||
* error => console.error()
|
||||
* );
|
||||
* delegate.didEnterRegion()
|
||||
* .subscribe(
|
||||
|
@ -31,8 +31,7 @@ export interface ImageResizerOptions {
|
||||
quality?: number;
|
||||
|
||||
/**
|
||||
* A custom name for the file. Default name is a timestamp
|
||||
* (Android and Windows only)
|
||||
* A custom name for the file. Default name is a timestamp. You have to set this value on iOS
|
||||
*/
|
||||
fileName?: string;
|
||||
}
|
||||
|
@ -24,6 +24,10 @@ export interface InAppBrowserOptions {
|
||||
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
|
||||
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
|
||||
shouldPauseOnSuspend?: 'yes' | 'no';
|
||||
/** (Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties */
|
||||
footer?: 'yes' | 'no';
|
||||
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb) , and it will change the footer color from default. Only has effect if user has footer set to yes */
|
||||
footercolor?: string;
|
||||
/** (iOS Only) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
|
||||
closebuttoncaption?: string;
|
||||
/** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */
|
||||
@ -166,7 +170,12 @@ export class InAppBrowserObject {
|
||||
* const browser = this.iab.create('https://ionicframework.com/');
|
||||
*
|
||||
* browser.executeScript(...);
|
||||
*
|
||||
* browser.insertCSS(...);
|
||||
* browser.on('loadstop').subscribe(event => {
|
||||
* browser.insertCSS({ code: "body{color: red;" });
|
||||
* });
|
||||
*
|
||||
* browser.close();
|
||||
*
|
||||
* ```
|
||||
@ -181,7 +190,7 @@ export class InAppBrowserObject {
|
||||
plugin: 'cordova-plugin-inappbrowser',
|
||||
pluginRef: 'cordova.InAppBrowser',
|
||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
|
||||
platforms: ['AmazonFire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['AmazonFire OS', 'Android', 'Browser', 'iOS', 'macOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class InAppBrowser extends IonicNativePlugin {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface IndexItem {
|
||||
domain: string;
|
||||
@ -71,7 +71,6 @@ export interface IndexItem {
|
||||
})
|
||||
@Injectable()
|
||||
export class IndexAppContent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* The option to index app content might not be available at all due to device limitations or user settings.
|
||||
* Therefore it's highly recommended to check upfront if indexing is possible.
|
||||
@ -92,17 +91,6 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If user taps on a search result in spotlight then the app will be launched.
|
||||
* You can register a Javascript handler to get informed when this happens.
|
||||
* @param {IndexItem} Clicked Item
|
||||
* @return {Promise<any>} Returns promise
|
||||
*/
|
||||
@Cordova()
|
||||
onItemPressed(payload: IndexItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all items stored for a given array of domains
|
||||
* @param {Array<string>} Array of domains to clear
|
||||
@ -132,5 +120,4 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
setIndexingInterval(intervalMinutes: number) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ export class Intercom extends IonicNativePlugin {
|
||||
* @param secureHash {string}
|
||||
* @param secureData {any}
|
||||
* @return {Promise<any>} Returns a promise
|
||||
* @deprecated Use setUserHash instead as of Intercom Cordova 4.0.0 and higher https://github.com/intercom/intercom-cordova/blob/master/CHANGELOG.md#400-2017-08-29
|
||||
*/
|
||||
@Cordova()
|
||||
setSecureMode(secureHash: string, secureData: any): Promise<any> { return; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Is Debug
|
||||
@ -16,8 +16,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* ...
|
||||
*
|
||||
* this.isDebug.getIsDebug()
|
||||
* .then((isDebug: boolean) => console.log('Is debug:', isDebug))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* .then(isDebug => console.log('Is debug:', isDebug))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@ -30,7 +30,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class IsDebug extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Determine if an app was installed via xcode / eclipse / the ionic CLI etc
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with true if the app was installed via xcode / eclipse / the ionic CLI etc. It will resolve to false if the app was downloaded from the app / play store by the end user.
|
||||
@ -39,5 +38,4 @@ export class IsDebug extends IonicNativePlugin {
|
||||
getIsDebug(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,10 +31,10 @@ declare const cordova: any;
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Jins Meme',
|
||||
plugin: 'JinsMemeSDK-Plugin-Cordova',
|
||||
pluginRef: 'cordova.plugins.JinsMemePlugin',
|
||||
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova',
|
||||
pluginName: 'JINS MEME',
|
||||
plugin: 'cordova-plugin-jins-meme',
|
||||
pluginRef: 'JinsMemePlugin',
|
||||
repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
@ -77,7 +77,7 @@ export class JinsMeme extends IonicNativePlugin {
|
||||
connect(target: string): Observable<any> {
|
||||
return new Observable<any>((observer: any) => {
|
||||
let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
|
||||
return () => console.log(data);
|
||||
return data;
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
@ -5,9 +5,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* @name Launch Review
|
||||
* @description
|
||||
*
|
||||
* This launches the native store app in order for the user to leave a review.
|
||||
* On Android, the plugin opens the the app's storepage in the Play Store where the user can leave a review by pressing the stars to give a rating.
|
||||
* On iOS, the plugin opens the app's storepage in the App Store and focuses the Review tab, where the user can leave a review by pressing "Write a review".
|
||||
* Assists in leaving user reviews/ratings in the App Stores.
|
||||
* - Launches the platform's App Store page for the current app in order for the user to leave a review.
|
||||
* - On iOS (10.3 and above) invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@ -17,9 +17,13 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* const appId: string = 'yourAppId';
|
||||
* this.launchReview.launch(appId)
|
||||
* this.launchReview.launch()
|
||||
* .then(() => console.log('Successfully launched store app');
|
||||
*
|
||||
* if(this.launchReview.isRatingSupported()){
|
||||
* this.launchReview.rating()
|
||||
* .then(() => console.log('Successfully launched rating dialog');
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@ -33,10 +37,34 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
export class LaunchReview extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Launch store app using given app ID
|
||||
* Launches App Store on current platform in order to leave a review for given app.
|
||||
* @param appId {string} - (optional) the platform-specific app ID to use to open the page in the store app.
|
||||
* If not specified, the plugin will use the app ID for the app in which the plugin is contained.
|
||||
* On Android this is the full package name of the app. For example, for Google Maps: `com.google.android.apps.maps`
|
||||
* On iOS this is the Apple ID of the app. For example, for Google Maps: `585027354`
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
launch(appId: string): Promise<void> { return; }
|
||||
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
|
||||
launch(appId?: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.
|
||||
* Requires iOS 10.3 and above: Calling this on any platform/version other than iOS 10.3+ will result in the error callback.
|
||||
* Success callback will be called up to 3 times:
|
||||
* - First: after `LaunchReview.rating()` is called and the request to show the dialog is successful. Will be passed the value `requested`.
|
||||
* - Second: if and when the Rating dialog is actually displayed. Will be passed the value `shown`.
|
||||
* - Third: if and when the Rating dialog is dismissed. Will be passed the value `dismissed`.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
rating(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if the current platform/version supports in-app ratings dialog, i.e. calling LaunchReview.rating().
|
||||
* Will return true if current platform is iOS 10.3 or above.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
|
||||
isRatingSupported(): boolean { return; }
|
||||
|
||||
}
|
||||
|
442
src/@ionic-native/plugins/local-notifications/index.ts
Normal file → Executable file
442
src/@ionic-native/plugins/local-notifications/index.ts
Normal file → Executable file
@ -1,5 +1,195 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export enum ELocalNotificationTriggerUnit {
|
||||
SECOND = 'second',
|
||||
MINUTE = 'minute',
|
||||
HOUR = 'hour',
|
||||
DAY = 'day',
|
||||
WEEK = 'week',
|
||||
MONTH = 'month',
|
||||
QUARTER = 'quarter',
|
||||
YEAR = 'year',
|
||||
WEEKDAY = 'weekday',
|
||||
WEEKDAY_ORDINAL = 'weekdayOrdinal',
|
||||
WEEK_OF_MONTH = 'weekOfMonth'
|
||||
}
|
||||
|
||||
export interface ILocalNotificationTrigger {
|
||||
|
||||
/** ***** FIX ***** */
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: Date;
|
||||
|
||||
/** ***** TIMESPAN ***** */
|
||||
|
||||
/**
|
||||
* Amount of units
|
||||
*/
|
||||
in?: number;
|
||||
|
||||
/**
|
||||
* Unit
|
||||
*/
|
||||
unit?: ELocalNotificationTriggerUnit;
|
||||
|
||||
/** ***** REPEAT/MATCH ***** */
|
||||
|
||||
/**
|
||||
* Amount of units
|
||||
*/
|
||||
count?: number;
|
||||
|
||||
/**
|
||||
* The unit
|
||||
*/
|
||||
every?: ELocalNotificationTriggerUnit;
|
||||
|
||||
/**
|
||||
* The end of the repeating notification
|
||||
*/
|
||||
before?: Date;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Only for "repeat"
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
firstAt?: Date;
|
||||
|
||||
/**
|
||||
* Only for "match"
|
||||
*/
|
||||
after?: Date;
|
||||
|
||||
/** ***** LOCATION ***** */
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Center of the location
|
||||
* Latitude and Longitude values
|
||||
*/
|
||||
center?: number[];
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Radius in meters
|
||||
*/
|
||||
radius?: number;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Trigger on entry of the location
|
||||
*/
|
||||
notifyOnEntry?: boolean;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Trigger on exit of the location
|
||||
*/
|
||||
notifyOnExit?: boolean;
|
||||
|
||||
/**
|
||||
* IOS ONLY
|
||||
* Trigger only once?
|
||||
*/
|
||||
single?: boolean;
|
||||
}
|
||||
|
||||
export enum ILocalNotificationActionType {
|
||||
INPUT = 'input',
|
||||
BUTTON = 'button'
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification action
|
||||
*
|
||||
* @see https://github.com/katzer/cordova-plugin-local-notifications#actions
|
||||
*/
|
||||
export interface ILocalNotificationAction {
|
||||
/**
|
||||
* The id of the action is used as the event name in the listener function
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* The title of the notification message
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specifies whether the action causes the app to launch in the foreground
|
||||
*/
|
||||
launch?: boolean;
|
||||
|
||||
/**
|
||||
* If the value is 'decline' the action is displayed with special highlighting to indicate that it performs a destructive task
|
||||
*/
|
||||
ui?: string;
|
||||
|
||||
/**
|
||||
* Specifies whether the action requires that the user’s device be unlocked.
|
||||
* When the user selects an action with this option, the system prompts
|
||||
* the user to unlock the device
|
||||
*/
|
||||
needsAuth?: boolean;
|
||||
|
||||
/**
|
||||
* The resource path of the action icon
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* The type of the action. If omitted 'button' is used.
|
||||
*/
|
||||
type?: ILocalNotificationActionType;
|
||||
}
|
||||
|
||||
export interface ILocalNotificationProgressBar {
|
||||
/**
|
||||
* Is the progress bar enabled?
|
||||
*/
|
||||
enabled?: boolean;
|
||||
|
||||
/**
|
||||
* The current value
|
||||
*/
|
||||
value?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* The maximum value (default is 100)
|
||||
*/
|
||||
maxValue?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Show an indeterminate progress bar
|
||||
*/
|
||||
indeterminate?: boolean;
|
||||
|
||||
/**
|
||||
* WINDOWS ONLY
|
||||
* Gets or sets an optional string to be displayed instead of the
|
||||
* default percentage string. If this isn't provided, something
|
||||
* like "70%" will be displayed.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* WINDOWS ONLY
|
||||
* Sets the status (required), which is displayed underneath the progress bar
|
||||
* on the left.
|
||||
* This string should reflect the status of the operation,
|
||||
* like "Downloading..." or "Installing..."
|
||||
*/
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface ILocalNotification {
|
||||
|
||||
@ -19,20 +209,7 @@ export interface ILocalNotification {
|
||||
* Second row of the notification
|
||||
* Default: Empty string
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||
* Default: 0 (which means that the system triggers the local notification once)
|
||||
*/
|
||||
every?: string;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: any;
|
||||
firstAt?: any;
|
||||
text?: string | string[];
|
||||
|
||||
/**
|
||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||
@ -73,27 +250,153 @@ export interface ILocalNotification {
|
||||
*/
|
||||
color?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Use the default notification vibrate.
|
||||
*/
|
||||
vibrate?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Ongoing notifications differ from regular notifications in the following ways:
|
||||
* - They are sorted above the regular notifications in the notification panel
|
||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||
* Default: false
|
||||
* Define the blinking of the LED on the device.
|
||||
* If set to true, the LED will blink in the default color with
|
||||
* timings for on and off set to 1000 ms.
|
||||
* If set to a string, the LED will blink in this ARGB value with
|
||||
* timings for on and off set to 1000 ms.
|
||||
* If set to an array, the value of the key 0 will be used as the color,
|
||||
* the value of the key 1 will be used as the 'on' timing, the value of
|
||||
* the key 2 will be used as the 'off' timing
|
||||
*/
|
||||
ongoing?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* ARGB value that you would like the LED on the device to blink
|
||||
* Default: FFFFFF
|
||||
*/
|
||||
led?: string;
|
||||
led?: {color: string, on: number, off: number} | any[] | boolean | string;
|
||||
|
||||
/**
|
||||
* Notification priority.
|
||||
* Integers between -2 and 2, whereas -2 is minimum and 2 is maximum priority
|
||||
*/
|
||||
priority?: number;
|
||||
|
||||
/**
|
||||
* Is a silent notification
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* Specifies whether the a click on the notification causes the app
|
||||
* to launch in the foreground
|
||||
*/
|
||||
launch?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Wakeup the device. (default is true)
|
||||
*/
|
||||
wakeup?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Specifies a duration in milliseconds after which this notification should be canceled, if it is not already canceled.
|
||||
*/
|
||||
timeoutAfter?: number | false;
|
||||
|
||||
/**
|
||||
* Actions id or actions
|
||||
*/
|
||||
actions?: string | ILocalNotificationAction[];
|
||||
|
||||
/**
|
||||
* When to trigger the notification
|
||||
*/
|
||||
trigger?: ILocalNotificationTrigger;
|
||||
|
||||
/**
|
||||
* A list of image attachments
|
||||
*/
|
||||
attachments?: string[];
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If and how the notification shall show the when date.
|
||||
* Possbile values:
|
||||
* boolean: true equals 'clock', false disable a watch/counter
|
||||
* 'clock': Show the when date in the content view
|
||||
* 'chronometer': Show a stopwatch
|
||||
*
|
||||
*/
|
||||
clock?: boolean | string;
|
||||
|
||||
/**
|
||||
* Shows a progress bar
|
||||
* Setting a boolean is a shortcut for {enabled: true/false} respectively
|
||||
*/
|
||||
progressBar?: ILocalNotificationProgressBar | boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If multiple notifications have the same group your app can present
|
||||
* them as a single group.
|
||||
*/
|
||||
group?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If set to 'true' this notification could use 'summary' to summarize
|
||||
* the contents of the whole group
|
||||
*/
|
||||
groupSummary?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Summary of the whole notification group. Should be used in conjuntion
|
||||
* with 'groupSummary' set to true
|
||||
*/
|
||||
summary?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Sets the number of items this notification represents.
|
||||
*/
|
||||
number?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Set whether this is an "ongoing" notification.
|
||||
* Ongoing notifications cannot be dismissed by the user,
|
||||
* so your application or service must take care of canceling them.
|
||||
*/
|
||||
sticky?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Make this notification automatically dismissed when the user touches it.
|
||||
*/
|
||||
autoClear?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* If set to true the notification will be show in its entirety on all lockscreens.
|
||||
* If set to false it will not be revealed on a secure lockscreen.
|
||||
*/
|
||||
lockscreen?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Set the default notification options that will be used.
|
||||
* The value should be one or more of the following fields combined with
|
||||
* bitwise-or: DEFAULT_SOUND, DEFAULT_VIBRATE, DEFAULT_LIGHTS.
|
||||
*/
|
||||
defaults?: number;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Specifies the channel the notification should be delivered on.
|
||||
*/
|
||||
channel?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Set the token for the media session
|
||||
*/
|
||||
mediaSession?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,7 +440,7 @@ export interface ILocalNotification {
|
||||
* // Schedule delayed notification
|
||||
* this.localNotifications.schedule({
|
||||
* text: 'Delayed ILocalNotification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* trigger: {at: new Date(new Date().getTime() + 3600)},
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
@ -147,7 +450,7 @@ export interface ILocalNotification {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
plugin: 'cordova-plugin-local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
@ -185,10 +488,7 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
* Clears all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications have cleared
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
@Cordova()
|
||||
clearAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -203,10 +503,7 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
* Cancels all notifications
|
||||
* @returns {Promise<any>} Returns a promise when all notifications are canceled
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
@Cordova()
|
||||
cancelAll(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@ -238,7 +535,7 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
* @returns {Promise<Array<number>>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAllIds(): Promise<Array<number>> { return; }
|
||||
getIds(): Promise<Array<number>> { return; }
|
||||
|
||||
/**
|
||||
* Get the ids of triggered notifications
|
||||
@ -300,11 +597,11 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
* Request permission to show notifications if not already granted.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
registerPermission(): Promise<boolean> { return; }
|
||||
requestPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Informs if the app has the permission to show notifications.
|
||||
@ -313,26 +610,75 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
hasPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Adds a group of actions
|
||||
* @param groupId The id of the action group
|
||||
* @param actions The actions of this group
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
addActions(groupId: any, actions: Array<ILocalNotificationAction>): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Removes a group of actions
|
||||
* @param groupId The id of the action group
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
removeActions(groupId: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if a group of actions is defined
|
||||
* @param groupId The id of the action group
|
||||
* @returns {Promise<boolean>} Whether the group is defined
|
||||
*/
|
||||
@Cordova()
|
||||
hasActions(groupId: any): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Gets the (platform specific) default settings.
|
||||
* @returns {Promise<any>} An object with all default settings
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
getDefaults(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Overwrites the (platform specific) default settings.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
setDefaults(defaults: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets a callback for a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
* @param eventName {string} The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions
|
||||
* @return {Observable}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
observable: true,
|
||||
clearFunction: 'un',
|
||||
clearWithArgs: true
|
||||
})
|
||||
on(eventName: string, callback: any): void { }
|
||||
on(eventName: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Removes a callback of a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
* Not an official interface, however its possible to manually fire events.
|
||||
** @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions
|
||||
* @param args Optional arguments
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
un(eventName: string, callback: any): void { }
|
||||
|
||||
fireEvent(eventName: string, args: any): void { }
|
||||
|
||||
/**
|
||||
* Fire queued events once the device is ready and all listeners are registered.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
fireQueuedEvents(): Promise<any> { return; }
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ export interface ConfigurationData {
|
||||
plugin: 'cordova-plugin-media-capture',
|
||||
pluginRef: 'navigator.device.capture',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media-capture',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class MediaCapture extends IonicNativePlugin {
|
||||
|
@ -284,7 +284,7 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
||||
repo: 'https://github.com/apache/cordova-plugin-media',
|
||||
plugin: 'cordova-plugin-media',
|
||||
pluginRef: 'Media',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Media extends IonicNativePlugin {
|
||||
|
@ -72,6 +72,13 @@ export class Mixpanel extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
init(token: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSuperProperties(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param superProperties {any}
|
||||
@ -80,6 +87,22 @@ export class Mixpanel extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
registerSuperProperties(superProperties: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param superProperties {any}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
registerSuperPropertiesOnce(superProperties: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param superPropertyName {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
unregisterSuperProperty(superPropertyName: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
|
@ -63,14 +63,14 @@ export class MobileAccessibility extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isVoiceOverRunningCallback(): Promise<boolean> { return; }
|
||||
isVoiceOverRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* An Android/Amazon Fire OS-specific proxy for the MobileAccessibility.isScreenReaderRunning method.
|
||||
* @returns {Promise<boolean>} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
|
||||
*/
|
||||
@Cordova({ platforms: ['Amazon Fire OS', 'Android'] })
|
||||
isTalkBackRunningCallback(): Promise<boolean> { return; }
|
||||
isTalkBackRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* On Android, this method returns true if ChromeVox is active and properly initialized with access to the text to speech API in the WebView.
|
||||
@ -85,98 +85,98 @@ export class MobileAccessibility extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isBoldTextEnabledCallback(): Promise<boolean> { return; }
|
||||
isBoldTextEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova()
|
||||
isClosedCaptioningEnabledCallback(): Promise<boolean> { return; }
|
||||
isClosedCaptioningEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isDarkerSystemColorsEnabledCallback(): Promise<boolean> { return; }
|
||||
isDarkerSystemColorsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isGrayscaleEnabledCallback(): Promise<boolean> { return; }
|
||||
isGrayscaleEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isGuidedAccessEnabledCallback(): Promise<boolean> { return; }
|
||||
isGuidedAccessEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isInvertColorsEnabledCallback(): Promise<boolean> { return; }
|
||||
isInvertColorsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isMonoAudioEnabledCallback(): Promise<boolean> { return; }
|
||||
isMonoAudioEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isReduceMotionEnabledCallback(): Promise<boolean> { return; }
|
||||
isReduceMotionEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isReduceTransparencyEnabledCallback(): Promise<boolean> { return; }
|
||||
isReduceTransparencyEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSpeakScreenEnabledCallback(): Promise<boolean> { return; }
|
||||
isSpeakScreenEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSpeakSelectionEnabledCallback(): Promise<boolean> { return; }
|
||||
isSpeakSelectionEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSwitchControlRunningCallback(): Promise<boolean> { return; }
|
||||
isSwitchControlRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['Amazon Fire OS', 'Android'] })
|
||||
isTouchExplorationEnabledCallback(): Promise<boolean> { return; }
|
||||
isTouchExplorationEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* * @returns {Promise<number>} Returns the result
|
||||
*/
|
||||
@Cordova()
|
||||
getTextZoomCallback(): Promise<number> { return; }
|
||||
getTextZoom(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* @param textZoom {number} A percentage value by which text in the WebView should be scaled.
|
||||
|
@ -11,6 +11,7 @@ export interface AuthenticationResult {
|
||||
status: string;
|
||||
statusCode: number;
|
||||
tenantId: string;
|
||||
userInfo: UserInfo;
|
||||
|
||||
/**
|
||||
* Creates authorization header for web requests.
|
||||
|
@ -1,24 +1,31 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasSkipForward: boolean;
|
||||
hasSkipBackward: boolean;
|
||||
skipForwardInterval: number;
|
||||
skipBackwardInterval: number;
|
||||
hasClose: boolean;
|
||||
album: string;
|
||||
duration: number;
|
||||
elapsed: number;
|
||||
ticker: string;
|
||||
track?: string;
|
||||
artist?: string;
|
||||
cover?: string;
|
||||
isPlaying?: boolean;
|
||||
dismissable?: boolean;
|
||||
hasPrev?: boolean;
|
||||
hasNext?: boolean;
|
||||
hasSkipForward?: boolean;
|
||||
hasSkipBackward?: boolean;
|
||||
skipForwardInterval?: number;
|
||||
skipBackwardInterval?: number;
|
||||
hasScrubbing?: boolean;
|
||||
hasClose?: boolean;
|
||||
album?: string;
|
||||
duration?: number;
|
||||
elapsed?: number;
|
||||
ticker?: string;
|
||||
playIcon?: string;
|
||||
pauseIcon?: string;
|
||||
prevIcon?: string;
|
||||
nextIcon?: string;
|
||||
closeIcon?: string;
|
||||
notificationIcon?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,17 +58,26 @@ export interface MusicControlsOptions {
|
||||
* hasClose : true, // show close button, optional, default: false
|
||||
*
|
||||
* // iOS only, optional
|
||||
* album : 'Absolution' // optional, default: ''
|
||||
* album : 'Absolution', // optional, default: ''
|
||||
* duration : 60, // optional, default: 0
|
||||
* elapsed : 10, // optional, default: 0
|
||||
* hasSkipForward : true, // show skip forward button, optional, default: false
|
||||
* hasSkipBackward : true, // show skip backward button, optional, default: false
|
||||
* skipForwardInterval: 15, // display number for skip forward, optional, default: 0
|
||||
* skipBackwardInterval: 15, // display number for skip backward, optional, default: 0
|
||||
* hasScrubbing: false, // enable scrubbing from control center and lockscreen progress bar, optional
|
||||
*
|
||||
* // Android only, optional
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
|
||||
* ticker : 'Now playing "Time is Running Out"',
|
||||
* // All icons default to their built-in android equivalents
|
||||
* // The supplied drawable name, e.g. 'media_play', is the name of a drawable found under android/res/drawable* folders
|
||||
* playIcon: 'media_play',
|
||||
* pauseIcon: 'media_pause',
|
||||
* prevIcon: 'media_prev',
|
||||
* nextIcon: 'media_next',
|
||||
* closeIcon: 'media_close',
|
||||
* notificationIcon: 'notification'
|
||||
* });
|
||||
*
|
||||
* this.musicControls.subscribe().subscribe(action => {
|
||||
@ -91,7 +107,7 @@ export interface MusicControlsOptions {
|
||||
* break;
|
||||
* case 'music-controls-seek-to':
|
||||
* const seekToInSeconds = JSON.parse(action).position;
|
||||
* MusicControls.updateElapsed({
|
||||
* this.musicControls.updateElapsed({
|
||||
* elapsed: seekToInSeconds,
|
||||
* isPlaying: true
|
||||
* });
|
||||
@ -138,21 +154,24 @@ export interface MusicControlsOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class MusicControls extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Create the media controls
|
||||
* @param options {MusicControlsOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
create(options: MusicControlsOptions): Promise<any> { return; }
|
||||
create(options: MusicControlsOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the media controller
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
destroy(): Promise<any> { return; }
|
||||
destroy(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to the events of the media controller
|
||||
@ -161,20 +180,22 @@ export class MusicControls extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
subscribe(): Observable<any> { return; }
|
||||
subscribe(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start listening for events, this enables the Observable from the subscribe method
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
listen(): void { }
|
||||
listen(): void {}
|
||||
|
||||
/**
|
||||
* Toggle play/pause:
|
||||
* @param isPlaying {boolean}
|
||||
*/
|
||||
@Cordova()
|
||||
updateIsPlaying(isPlaying: boolean): void { }
|
||||
updateIsPlaying(isPlaying: boolean): void {}
|
||||
|
||||
/**
|
||||
* Update elapsed time, optionally toggle play/pause:
|
||||
@ -183,12 +204,12 @@ export class MusicControls extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
updateElapsed(args: { elapsed: string; isPlaying: boolean; }): void { }
|
||||
updateElapsed(args: { elapsed: string; isPlaying: boolean }): void {}
|
||||
|
||||
/**
|
||||
* Toggle dismissable:
|
||||
* @param dismissable {boolean}
|
||||
*/
|
||||
@Cordova()
|
||||
updateDismissable(dismissable: boolean): void { }
|
||||
updateDismissable(dismissable: boolean): void {}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* ...
|
||||
*
|
||||
* let autoHide: boolean = true;
|
||||
* this.navigationBar.hide(autoHide);
|
||||
* this.navigationBar.setUp(autoHide);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
58
src/@ionic-native/plugins/network-interface/index.ts
Normal file
58
src/@ionic-native/plugins/network-interface/index.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Network Interface
|
||||
* @description
|
||||
* Network interface information plugin for Cordova/PhoneGap that supports Android, Blackberry 10, Browser, iOS, and Windows Phone 8.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NetworkInterface } from '@ionic-native/network-interface';
|
||||
*
|
||||
*
|
||||
* constructor(private networkInterface: NetworkInterface) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.networkInterface.getWiFiIPAddress(function (ip) { alert(ip); });
|
||||
* this.networkInterface.getCarrierIPAddress(function (ip) { alert(ip); });
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NetworkInterface',
|
||||
plugin: 'cordova-plugin-networkinterface',
|
||||
pluginRef: 'networkinterface',
|
||||
repo: 'https://github.com/salbahra/cordova-plugin-networkinterface',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Windows', 'Windows Phone'],
|
||||
})
|
||||
@Injectable()
|
||||
export class NetworkInterface extends IonicNativePlugin {
|
||||
|
||||
@Cordova()
|
||||
getIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the WiFi IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
*/
|
||||
@Cordova()
|
||||
getWiFiIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wireless carrier IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
*/
|
||||
@Cordova()
|
||||
getCarrierIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
@ -53,7 +53,7 @@ declare const navigator: any;
|
||||
plugin: 'cordova-plugin-network-information',
|
||||
pluginRef: 'navigator.connection',
|
||||
repo: 'https://github.com/apache/cordova-plugin-network-information',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class Network extends IonicNativePlugin {
|
||||
|
@ -1,7 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin, CordovaProperty } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
declare let window: any;
|
||||
|
||||
export interface NdefEvent {
|
||||
tag: NdefTag;
|
||||
}
|
||||
|
||||
export interface NdefRecord {
|
||||
id: any[];
|
||||
payload: number[];
|
||||
tnf: number;
|
||||
type: number[];
|
||||
}
|
||||
|
||||
export interface NdefTag {
|
||||
canMakeReadOnly: boolean;
|
||||
id: number[];
|
||||
isWriteable: boolean;
|
||||
maxSize: number;
|
||||
ndefMessage: NdefRecord[];
|
||||
techTypes: string[];
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name NFC
|
||||
* @description
|
||||
@ -49,6 +71,21 @@ declare let window: any;
|
||||
*/
|
||||
@Injectable()
|
||||
export class NFC extends IonicNativePlugin {
|
||||
/**
|
||||
* Starts the NFCNDEFReaderSession allowing iOS to scan NFC tags.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'invalidateSession',
|
||||
clearWithArgs: true
|
||||
})
|
||||
beginSession(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for any NDEF tag.
|
||||
* @param onSuccess
|
||||
@ -62,7 +99,7 @@ export class NFC extends IonicNativePlugin {
|
||||
clearFunction: 'removeNdefListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
addNdefListener(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
|
||||
addNdefListener(onSuccess?: Function, onFailure?: Function): Observable<NdefEvent> { return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
@ -218,15 +255,120 @@ export class NFC extends IonicNativePlugin {
|
||||
@Injectable()
|
||||
export class Ndef extends IonicNativePlugin {
|
||||
|
||||
@Cordova({ sync: true })
|
||||
uriRecord(uri: string): any { return; }
|
||||
@CordovaProperty
|
||||
TNF_EMPTY: number;
|
||||
@CordovaProperty
|
||||
TNF_WELL_KNOWN: number;
|
||||
@CordovaProperty
|
||||
TNF_MIME_MEDIA: number;
|
||||
@CordovaProperty
|
||||
TNF_ABSOLUTE_URI: number;
|
||||
@CordovaProperty
|
||||
TNF_EXTERNAL_TYPE: number;
|
||||
@CordovaProperty
|
||||
TNF_UNKNOWN: number;
|
||||
@CordovaProperty
|
||||
TNF_UNCHANGED: number;
|
||||
@CordovaProperty
|
||||
TNF_RESERVED: number;
|
||||
|
||||
@CordovaProperty
|
||||
RTD_TEXT: number[];
|
||||
@CordovaProperty
|
||||
RTD_URI: number[];
|
||||
@CordovaProperty
|
||||
RTD_SMART_POSTER: number[];
|
||||
@CordovaProperty
|
||||
RTD_ALTERNATIVE_CARRIER: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_CARRIER: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_REQUEST: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_SELECT: number[];
|
||||
|
||||
@Cordova({ sync: true })
|
||||
textRecord(text: string): any { return; }
|
||||
record(tnf: number, type: number[] | string, id: number[] | string, payload: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
mimeMediaRecord(mimeType: string, payload: string): any { return; }
|
||||
textRecord(text: string, languageCode: string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
androidApplicationRecord(packageName: string): any { return; }
|
||||
uriRecord(uri: string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
absoluteUriRecord(uri: string, payload: number[] | string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
mimeMediaRecord(mimeType: string, payload: string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
smartPoster(ndefRecords: any[], id?: number[] | string ): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
emptyRecord(): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
androidApplicationRecord(packageName: string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
encodeMessage(ndefRecords: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
decodeMessage(bytes: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
docodeTnf(tnf_byte: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
encodeTnf(mb: any, me: any, cf: any, sr: any, il: any, tnf: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
tnfToString(tnf: any): string { return; }
|
||||
|
||||
@CordovaProperty
|
||||
textHelper: TextHelper;
|
||||
|
||||
@CordovaProperty
|
||||
uriHelper: UriHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NFC',
|
||||
plugin: 'phonegap-nfc',
|
||||
pluginRef: 'util'
|
||||
})
|
||||
@Injectable()
|
||||
export class NfcUtil extends IonicNativePlugin {
|
||||
|
||||
@Cordova({ sync: true })
|
||||
toHex(i: number): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
toPrintable(i: number): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
bytesToString(i: number[]): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
stringToBytes(s: string): number[] { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
bytesToHexString(bytes: number[]): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
isType(record: NdefRecord, tnf: number, type: number[]|string): boolean { return; }
|
||||
}
|
||||
|
||||
export class TextHelper extends IonicNativePlugin {
|
||||
decodePayload(data: number[]): string { return; }
|
||||
encodePayload(text: string, lang: string): number[] { return; }
|
||||
}
|
||||
|
||||
export class UriHelper extends IonicNativePlugin {
|
||||
decodePayload(data: number[]): string { return; }
|
||||
encodePayload(uri: string): number[] { return; }
|
||||
}
|
||||
|
@ -301,18 +301,29 @@ export enum OSActionType {
|
||||
* 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).
|
||||
* Please view the official [OneSignal Ionic SDK Installation](https://documentation.onesignal.com/docs/ionic-sdk-setup) guide
|
||||
* for more information.
|
||||
*
|
||||
* #### Icons
|
||||
* If you want to use generated icons with command `ionic cordova resources`:
|
||||
*
|
||||
* 1. Add a file to your `hooks` directory inside the `after_prepare` folder called `030_copy_android_notification_icons.js`
|
||||
* 1. Add a file to your `hooks` directory called `copy_android_notification_icons.js`
|
||||
*
|
||||
* 2. Put the following code in it:
|
||||
* 2. Configure the hook in your config.xml
|
||||
* ```
|
||||
* <platform name="android">
|
||||
* <hook type="after_prepare" src="hooks/copy_android_notification_icons.js" />
|
||||
* </platform>
|
||||
* ```
|
||||
*
|
||||
* 3. Put the following code in it:
|
||||
*
|
||||
* ```
|
||||
* #!/usr/bin/env node
|
||||
*
|
||||
|
||||
* var fs = require('fs');
|
||||
* var path = require('path');
|
||||
|
||||
* var filestocopy = [{
|
||||
* "resources/android/icon/drawable-hdpi-icon.png":
|
||||
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
|
||||
@ -329,19 +340,18 @@ export enum OSActionType {
|
||||
* "resources/android/icon/drawable-xxxhdpi-icon.png":
|
||||
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
|
||||
* } ];
|
||||
*
|
||||
* var fs = require('fs');
|
||||
* var path = require('path');
|
||||
*
|
||||
|
||||
* module.exports = function(context) {
|
||||
|
||||
* // no need to configure below
|
||||
* var rootdir = process.argv[2];
|
||||
*
|
||||
* var rootdir = context.opts.projectRoot;
|
||||
|
||||
* filestocopy.forEach(function(obj) {
|
||||
* Object.keys(obj).forEach(function(key) {
|
||||
* var val = obj[key];
|
||||
* var srcfile = path.join(rootdir, key);
|
||||
* var destfile = path.join(rootdir, val);
|
||||
* //console.log("copying "+srcfile+" to "+destfile);
|
||||
* console.log("copying "+srcfile+" to "+destfile);
|
||||
* var destdir = path.dirname(destfile);
|
||||
* if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {
|
||||
* fs.createReadStream(srcfile).pipe(
|
||||
@ -349,6 +359,8 @@ export enum OSActionType {
|
||||
* }
|
||||
* });
|
||||
* });
|
||||
|
||||
* };
|
||||
* ```
|
||||
*
|
||||
* 3. From the root of your project make the file executable:
|
||||
@ -396,14 +408,13 @@ export enum OSActionType {
|
||||
})
|
||||
@Injectable()
|
||||
export class OneSignal extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* constants to use in inFocusDisplaying()
|
||||
*/
|
||||
OSInFocusDisplayOption = {
|
||||
None: 0,
|
||||
InAppAlert : 1,
|
||||
Notification : 2
|
||||
InAppAlert: 1,
|
||||
Notification: 2
|
||||
};
|
||||
|
||||
/**
|
||||
@ -414,7 +425,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
startInit(appId: string, googleProjectNumber?: string): any { return; }
|
||||
startInit(appId: string, googleProjectNumber?: string): any {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is received, whether it was displayed or not.
|
||||
@ -424,7 +437,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
handleNotificationReceived(): Observable<OSNotification> { return; }
|
||||
handleNotificationReceived(): Observable<OSNotification> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
|
||||
@ -436,7 +451,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; }
|
||||
handleNotificationOpened(): Observable<OSNotificationOpenedResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* **iOS** - Settings for iOS apps
|
||||
@ -456,7 +473,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
iOSSettings(settings: {
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
}): any { return; }
|
||||
}): any {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called after `startInit` to complete initialization of OneSignal.
|
||||
@ -464,7 +483,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
endInit(): any { return; }
|
||||
endInit(): any {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
|
||||
@ -473,7 +494,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
promptForPushNotificationsWithUserResponse(): Promise<boolean> { return; }
|
||||
promptForPushNotificationsWithUserResponse(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
@ -483,7 +506,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
|
||||
*/
|
||||
@Cordova()
|
||||
getTags(): Promise<any> { return; }
|
||||
getTags(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
@ -496,8 +521,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
|
||||
*/
|
||||
@Cordova()
|
||||
getIds(): Promise<{userId: string; pushToken: string}> { return; }
|
||||
|
||||
getIds(): Promise<{ userId: string; pushToken: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@ -507,7 +533,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendTag(key: string, value: string): void { }
|
||||
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.
|
||||
@ -516,7 +542,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendTags(json: any): void { }
|
||||
sendTags(json: any): void {}
|
||||
|
||||
/**
|
||||
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
|
||||
@ -524,7 +550,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {string} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
deleteTag(key: string): void { }
|
||||
deleteTag(key: string): void {}
|
||||
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
@ -532,14 +558,14 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {Array<string>} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
deleteTags(keys: string[]): void { }
|
||||
deleteTags(keys: string[]): void {}
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
registerForPushNotifications(): void { }
|
||||
registerForPushNotifications(): void {}
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
@ -551,7 +577,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
enableVibrate(enable: boolean): void { }
|
||||
enableVibrate(enable: boolean): void {}
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
@ -563,7 +589,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
enableSound(enable: boolean): void { }
|
||||
enableSound(enable: boolean): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -573,7 +599,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
inFocusDisplaying(displayOption: OSDisplayType): any { return; }
|
||||
inFocusDisplaying(displayOption: OSDisplayType): any {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
@ -582,7 +610,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setSubscription(enable: boolean): void { }
|
||||
setSubscription(enable: boolean): void {}
|
||||
|
||||
/**
|
||||
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
|
||||
@ -590,7 +618,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {Promise<OSPermissionSubscriptionState>}
|
||||
*/
|
||||
@Cordova()
|
||||
getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> { return; }
|
||||
getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -598,7 +628,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
postNotification(notificationObj: OSNotification): Promise<any> { return; }
|
||||
postNotification(notificationObj: OSNotification): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a single OneSignal notification based on its Android notification integer id. Use instead of NotificationManager.cancel(id); otherwise the notification will be restored when your app is restarted.
|
||||
@ -611,14 +643,14 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
promptLocation(): void { }
|
||||
promptLocation(): void {}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param email {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
syncHashedEmail(email: string): void { }
|
||||
syncHashedEmail(email: string): void {}
|
||||
|
||||
/**
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
@ -629,10 +661,7 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setLogLevel(logLevel: {
|
||||
logLevel: number,
|
||||
visualLevel: number
|
||||
}): void { }
|
||||
setLogLevel(logLevel: { logLevel: number; visualLevel: number }): void {}
|
||||
|
||||
/**
|
||||
* The passed in function will be fired when a notification permission setting changes.
|
||||
@ -645,7 +674,9 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
addPermissionObserver(): Observable<any> { return; }
|
||||
addPermissionObserver(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The passed in function will be fired when a notification subscription property changes.
|
||||
@ -659,6 +690,13 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
addSubscriptionObserver(): Observable<any> { return; }
|
||||
addSubscriptionObserver(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all OneSignla notifications
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
clearOneSignalNotifications(): void {}
|
||||
}
|
||||
|
74
src/@ionic-native/plugins/openalpr/index.ts
Normal file
74
src/@ionic-native/plugins/openalpr/index.ts
Normal file
@ -0,0 +1,74 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface OpenALPROptions {
|
||||
/** Country used for scanning the license plate */
|
||||
country?: string;
|
||||
|
||||
/** Amount of results returned */
|
||||
amount?: number;
|
||||
}
|
||||
|
||||
export interface OpenALPRResult {
|
||||
/** LicensePlate */
|
||||
number: string;
|
||||
/** Probability */
|
||||
confidence: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OpenALPR
|
||||
* @description
|
||||
* This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { OpenALPR, OpenALPROptions, OpenALPRResult } from '@ionic-native/openalpr';
|
||||
*
|
||||
*
|
||||
* constructor(private openALPR: OpenALPR) { }
|
||||
*
|
||||
* const scanOptions: OpenALPROptions = {
|
||||
* country: this.openALPR.Country.EU,
|
||||
* amount: 3
|
||||
* }
|
||||
*
|
||||
* // To get imageData, you can use the @ionic-native/camera module for example. It works with DestinationType.FILE_URI and DATA_URL
|
||||
*
|
||||
* this.openALPR.scan(imageData, scanOptions)
|
||||
* .then((res: [OpenALPRResult]) => console.log(res))
|
||||
* .catch((error: Error) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OpenALPR',
|
||||
plugin: 'cordova-plugin-openalpr',
|
||||
pluginRef: 'cordova.plugins.OpenALPR',
|
||||
repo: 'https://github.com/iMicknl/cordova-plugin-openalpr',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class OpenALPR extends IonicNativePlugin {
|
||||
Country = {
|
||||
AU: 'au',
|
||||
BR: 'br',
|
||||
BR2: 'br2',
|
||||
EU: 'eu',
|
||||
IN: 'in',
|
||||
KR2: 'kr2',
|
||||
US: 'us',
|
||||
VN2: 'vn2'
|
||||
};
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
* @param imageData {any} Base64 encoding of the image data or the image file URI
|
||||
* @param options {OpenALPROptions} Options to pass to the OpenALPR scanner
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
scan(imageData: any, options?: OpenALPROptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
@ -61,7 +61,7 @@ export interface LocalNotificationOptions {
|
||||
* import { PhonegapLocalNotification } from '@ionic-native/phonegap-local-notification';
|
||||
*
|
||||
*
|
||||
* constructor(private localNotification: PhonegapLocalNotifications) { }
|
||||
* constructor(private localNotification: PhonegapLocalNotification) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
|
@ -1,7 +1,54 @@
|
||||
import { Plugin, Cordova, CordovaFiniteObservable, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin, CordovaOptions, wrap } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface CordovaFiniteObservableOptions extends CordovaOptions {
|
||||
/**
|
||||
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
|
||||
*/
|
||||
resultFinalPredicate?: string;
|
||||
/**
|
||||
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
|
||||
*/
|
||||
resultTransform?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*
|
||||
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
|
||||
*/
|
||||
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
|
||||
opts.observable = true;
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
|
||||
return new Observable<any>((observer: Observer<any>) => {
|
||||
const wrappedSubscription = wrappedObservable.subscribe({
|
||||
next: (x: any) => {
|
||||
observer.next(opts.resultTransform ? x[opts.resultTransform] : x);
|
||||
if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
error: (err: any) => { observer.error(err); },
|
||||
complete: () => { observer.complete(); }
|
||||
});
|
||||
return () => {
|
||||
wrappedSubscription.unsubscribe();
|
||||
};
|
||||
});
|
||||
},
|
||||
enumerable: true
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Photo Library
|
||||
* @description
|
||||
@ -58,8 +105,8 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaFiniteObservable({
|
||||
callbackOrder: 'reverse',
|
||||
resultFinalPredicate: (result: { isLastChunk: boolean }) => { return result.isLastChunk; },
|
||||
resultTransform: (result: { library: LibraryItem[] }) => { return result.library; },
|
||||
resultFinalPredicate: 'isLastChunk',
|
||||
resultTransform: 'library'
|
||||
})
|
||||
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
|
||||
|
||||
@ -69,7 +116,7 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
|
||||
|
||||
@ -78,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getAlbums(): Promise<AlbumItem[]> { return; }
|
||||
|
||||
|
@ -67,7 +67,7 @@ export interface PrintOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Printer',
|
||||
plugin: 'de.appplant.cordova.plugin.printer',
|
||||
plugin: 'cordova-plugin-printer',
|
||||
pluginRef: 'cordova.plugins.printer',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-printer',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Information about the currently running app
|
||||
@ -21,6 +22,15 @@ export interface DeployInfo {
|
||||
binary_version: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object for manually configuring deploy
|
||||
*/
|
||||
export interface DeployConfig {
|
||||
appId?: string;
|
||||
host?: string;
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@ -30,68 +40,61 @@ export class ProDeploy {
|
||||
|
||||
/**
|
||||
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @param host An Ionic Pro live update API
|
||||
* @param config A valid Deploy config object
|
||||
*/
|
||||
@CordovaInstance()
|
||||
init(appId: string, host: string): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
debug(): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
clearDebug(): Promise<any> { return; }
|
||||
init(config: DeployConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check a channel for an available update
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @param channelName An Ionic Pro channel name
|
||||
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
check(appId: string, channelName: string): Promise<any> { return; }
|
||||
check(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Download an available version
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
download(appId: string): Promise<any> { return; }
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
download(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Unzip the latest downloaded version
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
extract(appId: string): Promise<any> { return; }
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
extract(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Reload app with the deployed version
|
||||
* @param appId An Ionic Pro app ID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
redirect(appId: string): Promise<any> { return; }
|
||||
redirect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get info about the version running on the device
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @return {Promise<DeployInfo>} Information about the current version running on the app.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
info(appId: string): Promise<DeployInfo> { return; }
|
||||
info(): Promise<DeployInfo> { return; }
|
||||
|
||||
/**
|
||||
* List versions stored on the device
|
||||
* @param appId An Ionic Pro app ID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getVersions(appId: string): Promise<any> { return; }
|
||||
getVersions(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a version stored on the device by UUID
|
||||
* @param appId An Ionic Pro app ID
|
||||
* @param version A version UUID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
deleteVersion(appId: string, version: string): Promise<any> { return; }
|
||||
deleteVersion(version: string): Promise<any> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,10 +130,20 @@ export class ProDeploy {
|
||||
})
|
||||
@Injectable()
|
||||
export class Pro extends IonicNativePlugin {
|
||||
_deploy: ProDeploy;
|
||||
|
||||
/**
|
||||
* Ionic Pro Deploy .js API.
|
||||
*/
|
||||
deploy: ProDeploy = new ProDeploy(Pro.getPlugin().deploy);
|
||||
@CordovaCheck({ sync: true })
|
||||
deploy(): ProDeploy {
|
||||
if (this._deploy) {
|
||||
return this._deploy;
|
||||
} else {
|
||||
this._deploy = new ProDeploy(Pro.getPlugin().deploy);
|
||||
return this._deploy;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
|
@ -131,6 +131,11 @@ export interface CategoryActionData {
|
||||
}
|
||||
|
||||
export interface AndroidPushOptions {
|
||||
/**
|
||||
* Maps to the project number in the Google Developer Console.
|
||||
*/
|
||||
senderID?: string;
|
||||
|
||||
/**
|
||||
* The name of a drawable resource to use as the small-icon. The name should
|
||||
* not include the extension.
|
||||
@ -208,7 +213,16 @@ export interface PushOptions {
|
||||
browser?: BrowserPushOptions;
|
||||
}
|
||||
|
||||
export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
export type Priority = 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
export interface Channel {
|
||||
id: string;
|
||||
description: string;
|
||||
importance: Priority;
|
||||
sound?: string;
|
||||
}
|
||||
|
||||
export type PushEvent = string;
|
||||
|
||||
/**
|
||||
* @name Push
|
||||
@ -240,6 +254,20 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
*
|
||||
* });
|
||||
*
|
||||
* // Create a channel (Android O and above). You'll need to provide the id, description and importance properties.
|
||||
* this.push.createChannel({
|
||||
* id: "testchannel1",
|
||||
* description: "My first test channel",
|
||||
* // The importance property goes from 1 = Lowest, 2 = Low, 3 = Normal, 4 = High and 5 = Highest.
|
||||
* importance: 3
|
||||
* }).then(() => console.log('Channel created'));
|
||||
*
|
||||
* // Delete a channel (Android O and above)
|
||||
* this.push.deleteChannel('testchannel1').then(() => console.log('Channel deleted'));
|
||||
*
|
||||
* // Return a list of currently configured channels
|
||||
* this.push.listChannels().then((channels) => console.log('List of channels', channels))
|
||||
*
|
||||
* // to initialize push notifications
|
||||
*
|
||||
* const options: PushOptions = {
|
||||
@ -257,6 +285,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
*
|
||||
* const pushObject: PushObject = this.push.init(options);
|
||||
*
|
||||
*
|
||||
* pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));
|
||||
*
|
||||
* pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
|
||||
@ -302,6 +331,31 @@ export class Push extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
|
||||
|
||||
/**
|
||||
* Create a new notification channel for Android O and above.
|
||||
* @param channel {Channel}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
createChannel(channel?: Channel): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a notification channel for Android O and above.
|
||||
* @param id {string}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
deleteChannel(id?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns a list of currently configured channels.
|
||||
* @return {Promise<Channel[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
listChannels(): Promise<Channel[]> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -365,9 +419,12 @@ export class PushObject {
|
||||
* iOS only
|
||||
* Tells the OS that you are done processing a background push notification.
|
||||
* successHandler gets called when background push processing is successfully completed.
|
||||
* @param [id]
|
||||
*/
|
||||
@CordovaInstance()
|
||||
finish(): Promise<any> { return; }
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
finish(id?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Tells the OS to clear all notifications from the Notification Center
|
||||
|
@ -55,7 +55,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: 'cordova-plugin-screen-orientation',
|
||||
pluginRef: 'screen.orientation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-screen-orientation',
|
||||
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class ScreenOrientation extends IonicNativePlugin {
|
||||
|
@ -29,7 +29,7 @@ export interface SmsOptionsAndroid {
|
||||
* @name SMS
|
||||
* @description
|
||||
*
|
||||
* Requires Cordova plugin: cordova-plugin-sms. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin).
|
||||
* Requires Cordova plugin: cordova-sms-plugin. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
53
src/@ionic-native/plugins/speechkit/index.ts
Normal file
53
src/@ionic-native/plugins/speechkit/index.ts
Normal file
@ -0,0 +1,53 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name SpeechKit
|
||||
* @description
|
||||
* Implementation of Nuance SpeechKit SDK on Ionic
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SpeechKit } from '@ionic-native/speechkit';
|
||||
*
|
||||
* constructor(private speechkit: SpeechKit) { }
|
||||
*
|
||||
*
|
||||
* this.speechkit.tts('Text to be read out loud', 'ENG-GBR').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SpeechKit',
|
||||
plugin: 'cordova-plugin-nuance-speechkit',
|
||||
pluginRef: 'plugins.speechkit',
|
||||
repo: 'https://github.com/Shmarkus/cordova-plugin-nuance-speechkit',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SpeechKit extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Speak text out loud in given language
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
tts(
|
||||
text: string,
|
||||
language: string
|
||||
): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Try to recognize what the user said
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
asr(
|
||||
language: string
|
||||
): Promise<string> { return; }
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user