mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d70ec025d | ||
|
|
8d4406ae82 | ||
|
|
ca922761b6 | ||
|
|
3bb669b6ba | ||
|
|
6cd97ca0ee | ||
|
|
0a12dc0792 | ||
|
|
2093c5cb29 | ||
|
|
d43fe72f7b | ||
|
|
c038c6331c | ||
|
|
212bd63191 | ||
|
|
4694c422aa | ||
|
|
38bbf01e8c | ||
|
|
b9b781ddee | ||
|
|
6053296998 | ||
|
|
9f72592fcc | ||
|
|
7c2a761078 | ||
|
|
9a5211001f | ||
|
|
03f578909b | ||
|
|
acd1a80e4d | ||
|
|
bf41506324 | ||
|
|
47dd7e90ed | ||
|
|
afca8761d7 | ||
|
|
5159367db8 | ||
|
|
d06fa48866 | ||
|
|
8f00e44d21 | ||
|
|
9e6f178378 | ||
|
|
997c96b97f | ||
|
|
ae94c710af | ||
|
|
86b2a2ca73 | ||
|
|
c1ce5dac18 | ||
|
|
091ac7a68c | ||
|
|
bd5bcdc9b7 | ||
|
|
dc707fd80c | ||
|
|
3e933bbaff | ||
|
|
86181afc27 | ||
|
|
784f948a5b | ||
|
|
2a4bcee6a0 | ||
|
|
d95ae68c9c | ||
|
|
8b78644680 | ||
|
|
5d48cfd419 | ||
|
|
b2c873cc99 | ||
|
|
bb2291cd16 | ||
|
|
7255795ae5 | ||
|
|
c9b49ccc39 | ||
|
|
9844274213 | ||
|
|
154a4bcacb | ||
|
|
10a96fcdd6 | ||
|
|
7ab522edec | ||
|
|
50d7762b8a | ||
|
|
0a8146b76c | ||
|
|
2d60db9d3b | ||
|
|
3378d7a398 | ||
|
|
61defd480c | ||
|
|
4e28295486 | ||
|
|
dee32c921c | ||
|
|
2475c57e00 | ||
|
|
79b522f832 | ||
|
|
ccb2e55435 | ||
|
|
f09c9cfe9a | ||
|
|
d96d3eef07 | ||
|
|
95daca166b | ||
|
|
196be026ea | ||
|
|
1fa7c91105 | ||
|
|
ba105be55f | ||
|
|
92d26eab94 | ||
|
|
ce6e412788 | ||
|
|
7243ed3960 | ||
|
|
264670211d | ||
|
|
847147a5fa | ||
|
|
4639bf9a94 | ||
|
|
abb77e3e08 | ||
|
|
975f08b7b5 | ||
|
|
773722b767 | ||
|
|
447aa56e3c | ||
|
|
8d22798278 | ||
|
|
30297fb81d | ||
|
|
ac777fca40 | ||
|
|
43b70a12b5 | ||
|
|
ef28078815 | ||
|
|
e304ce0e53 | ||
|
|
9e5f03f15d | ||
|
|
465d5519d0 | ||
|
|
d683b9e5df | ||
|
|
2b2476e873 | ||
|
|
196adc8b2f | ||
|
|
363b41e075 | ||
|
|
2179699622 | ||
|
|
e65406cc2f | ||
|
|
ddb6d43ffa | ||
|
|
30ed33a046 | ||
|
|
3d0a12d40d | ||
|
|
6ca5beaf0b | ||
|
|
247efa656a |
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
|
||||
```
|
||||
|
||||
123
CHANGELOG.md
123
CHANGELOG.md
@@ -1,3 +1,122 @@
|
||||
<a name="4.5.1"></a>
|
||||
## [4.5.1](https://github.com/ionic-team/ionic-native/compare/v4.5.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="4.5.0"></a>
|
||||
# [4.5.0](https://github.com/ionic-team/ionic-native/compare/v4.4.2...v4.5.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/v4.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.2...v4.3.2) (2017-10-18)
|
||||
|
||||
|
||||
|
||||
<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.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...4.3.1) (2017-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
|
||||
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
|
||||
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
|
||||
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.0"></a>
|
||||
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
|
||||
|
||||
@@ -1789,13 +1908,13 @@ The whole implementation has changed now. You must update your code.
|
||||
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
|
||||
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
|
||||
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
|
||||
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
||||
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
||||
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
|
||||
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))
|
||||
|
||||
@@ -209,4 +209,13 @@ Example:
|
||||
someMethod(): Promise<any> {
|
||||
// anything here will only run if the plugin is available
|
||||
}
|
||||
```
|
||||
|
||||
#### CordovaFunctionOverride
|
||||
Wrap a stub function in a call to a Cordova plugin, checking if both Cordova and the required plugin are installed.
|
||||
|
||||
Example:
|
||||
```ts
|
||||
@CordovaFunctionOverride()
|
||||
someMethod(): Observable<any> { return; }
|
||||
```
|
||||
7075
package-lock.json
generated
Normal file
7075
package-lock.json
generated
Normal file
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.0",
|
||||
"version": "4.5.1",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "4.1.3",
|
||||
"@angular/compiler-cli": "4.1.3",
|
||||
"@angular/core": "4.1.3",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.5.51",
|
||||
"@types/node": "^7.0.27",
|
||||
"@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",
|
||||
|
||||
@@ -41,7 +41,7 @@ module.exports = currentVersion => {
|
||||
docTypes: ['class'],
|
||||
getOutputPath: doc => doc.originalModule.replace(config.pluginDir + '/', '')
|
||||
.replace('/plugins', '')
|
||||
.replace('/index', '/README.md')
|
||||
.replace(/\/index$/, '/README.md')
|
||||
}];
|
||||
|
||||
})
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
@@ -23,10 +23,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`
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -417,6 +417,33 @@ export class BLE extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
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).
|
||||
*
|
||||
@@ -441,7 +468,7 @@ export class BLE extends IonicNativePlugin {
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static readRSSI(
|
||||
readRSSI(
|
||||
deviceId: string,
|
||||
): Promise<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; }
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -24,6 +24,7 @@ import { Injectable } from '@angular/core';
|
||||
* getUrl() {
|
||||
* return this.url;
|
||||
* }
|
||||
* // DATABASES //
|
||||
* createDatabase(database_name:string) {
|
||||
* let url = this.getUrl();
|
||||
* url = url+database_name;
|
||||
@@ -34,7 +35,6 @@ import { Injectable } from '@angular/core';
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
*
|
||||
* deleteDatabase(database_name:string) {
|
||||
* let url = this.getUrl();
|
||||
* url = url+database_name;
|
||||
@@ -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,8 +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');
|
||||
* }) .
|
||||
* }
|
||||
*
|
||||
*
|
||||
* ```
|
||||
|
||||
@@ -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
|
||||
@@ -116,6 +123,8 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
*
|
||||
* @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.
|
||||
@@ -123,6 +132,6 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch> { return; }
|
||||
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
|
||||
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; }
|
||||
}
|
||||
@@ -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<any>}
|
||||
*/
|
||||
* Check permission to receive push notifications
|
||||
* @return {Promise<{isEnabled: boolean}>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<any> { return; }
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
@@ -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,7 +181,9 @@ 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
|
||||
@@ -165,14 +194,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
fetch(cacheExpirationSeconds?: number): Promise<any> { return; }
|
||||
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
|
||||
@@ -184,7 +217,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
getValue(key: string, namespace?: string): Promise<any> { return; }
|
||||
getValue(key: string, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config byte array
|
||||
@@ -197,7 +232,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
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
|
||||
@@ -206,7 +243,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
|
||||
@@ -216,7 +255,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
|
||||
@@ -229,6 +270,34 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -153,6 +153,8 @@ export interface GeolocationOptions {
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation',
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
|
||||
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
|
||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
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-service --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; }
|
||||
|
||||
}
|
||||
|
||||
@@ -113,6 +113,13 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova({ sync: true })
|
||||
removeCookies(url: string, cb: () => void): void { }
|
||||
|
||||
/**
|
||||
* Disable following redirects automatically
|
||||
* @param disable {boolean} Set to true to disable following redirects automatically
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
disableRedirect(disable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Set request timeout
|
||||
* @param timeout {number} The timeout in seconds. Default 60
|
||||
@@ -140,14 +147,6 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
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
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
validateDomainName(validate: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Make a POST request
|
||||
* @param url {string} The url to send the request to
|
||||
@@ -178,6 +177,16 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
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
|
||||
* @param url {string} The url to send the request to
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IndexItem {
|
||||
domain: string;
|
||||
@@ -95,11 +96,10 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
/**
|
||||
* 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
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@Cordova()
|
||||
onItemPressed(payload: IndexItem) {
|
||||
@CordovaFunctionOverride()
|
||||
onItemPressed(): Observable<any> {
|
||||
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 ES',
|
||||
plugin: 'cordova-plugin-jins-meme-es',
|
||||
pluginRef: 'com.jins_jp.meme.plugin',
|
||||
repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme-es',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
|
||||
@@ -147,7 +147,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']
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -3,22 +3,23 @@ import { Plugin, Cordova, IonicNativePlugin } 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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,16 +52,17 @@ 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
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
* });
|
||||
*
|
||||
@@ -91,7 +93,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
|
||||
* });
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export interface OSNotificationPayload {
|
||||
/**
|
||||
* URL to open when opening the notification.
|
||||
*/
|
||||
launchUrl?: string;
|
||||
launchURL?: string;
|
||||
/**
|
||||
* Sound resource to play when the notification is shown.
|
||||
*/
|
||||
@@ -301,7 +301,8 @@ 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`:
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface PhotoViewerOptions {
|
||||
/**
|
||||
* Set to false to disable the share button (Android only). Default: true
|
||||
*/
|
||||
share?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Photo Viewer
|
||||
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
|
||||
@@ -29,8 +37,8 @@ export class PhotoViewer extends IonicNativePlugin {
|
||||
* Shows an image in full screen
|
||||
* @param url {string} URL or path to image
|
||||
* @param title {string}
|
||||
* @param options {any}
|
||||
* @param options {PhotoViewerOptions}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
show(url: string, title?: string, options?: {share?: boolean}): void { }
|
||||
show(url: string, title?: string, options?: PhotoViewerOptions): void { }
|
||||
}
|
||||
|
||||
173
src/@ionic-native/plugins/pro/index.ts
Normal file
173
src/@ionic-native/plugins/pro/index.ts
Normal file
@@ -0,0 +1,173 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Information about the currently running app
|
||||
*/
|
||||
export interface AppInfo {
|
||||
platform: string;
|
||||
platformVersion: string;
|
||||
version: string;
|
||||
bundleName: string;
|
||||
bundleVersion: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the current live update
|
||||
*/
|
||||
export interface DeployInfo {
|
||||
deploy_uuid: string;
|
||||
channel: string;
|
||||
binary_version: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object for manually configuring deploy
|
||||
*/
|
||||
export interface DeployConfig {
|
||||
appId?: string;
|
||||
host?: string;
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class ProDeploy {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
|
||||
* @param config A valid Deploy config object
|
||||
*/
|
||||
@CordovaInstance()
|
||||
init(config: DeployConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check a channel for an available update
|
||||
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
check(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Download an available version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
download(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Unzip the latest downloaded version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
extract(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Reload app with the deployed version
|
||||
*/
|
||||
@CordovaInstance()
|
||||
redirect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get info about the version running on the device
|
||||
* @return {Promise<DeployInfo>} Information about the current version running on the app.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
info(): Promise<DeployInfo> { return; }
|
||||
|
||||
/**
|
||||
* List versions stored on the device
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getVersions(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a version stored on the device by UUID
|
||||
* @param version A version UUID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
deleteVersion(version: string): Promise<any> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Pro
|
||||
* @description
|
||||
* This plugin enables Ionic Pro services like live updates and error monitoring
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Pro, AppInfo, DeployInfo } from '@ionic-native/pro';
|
||||
*
|
||||
*
|
||||
* constructor(private pro: Pro) { }
|
||||
*
|
||||
* // Get app info
|
||||
* this.pro.getAppInfo().then((res: AppInfo) => {
|
||||
* console.log(res)
|
||||
* })
|
||||
*
|
||||
* // Get live update info
|
||||
* this.pro.deploy.info().then((res: DeployInfo) => {
|
||||
* console.log(res)
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Pro',
|
||||
plugin: 'cordova-plugin-ionic',
|
||||
pluginRef: 'IonicCordova',
|
||||
repo: 'https://github.com/ionic-team/cordova-plugin-ionic',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
|
||||
})
|
||||
@Injectable()
|
||||
export class Pro extends IonicNativePlugin {
|
||||
/**
|
||||
* Ionic Pro Deploy .js API.
|
||||
*/
|
||||
deploy: ProDeploy = new ProDeploy(Pro.getPlugin().deploy);
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
enableCrashLogging(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
checkForPendingCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
loadPendingCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
forceCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get information about the currently running app
|
||||
* @return {Promise<any>} Returns a promise that resolves with current app info
|
||||
*/
|
||||
@Cordova()
|
||||
getAppInfo(): Promise<AppInfo> { return; }
|
||||
}
|
||||
|
||||
@@ -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,15 @@ 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;
|
||||
}
|
||||
|
||||
export type PushEvent = string;
|
||||
|
||||
/**
|
||||
* @name Push
|
||||
@@ -240,6 +253,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 +284,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 +330,27 @@ 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()
|
||||
createChannel(channel: Channel): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a notification channel for Android O and above.
|
||||
* @param id
|
||||
*/
|
||||
@Cordova()
|
||||
deleteChannel(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns a list of currently configured channels.
|
||||
* @return {Promise<Channel[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
listChannels(): Promise<Channel[]> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,9 +414,10 @@ 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; }
|
||||
finish(id?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Tells the OS to clear all notifications from the Notification Center
|
||||
|
||||
@@ -13,7 +13,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
|
||||
*
|
||||
* let license; // read regula.license file
|
||||
* RegulaDocumentReader.scanDocument(license).then((result) => {
|
||||
* RegulaDocumentReader.initReader(license); // initialize reader
|
||||
* RegulaDocumentReader.scanDocument().then((result) => {
|
||||
* // read result
|
||||
* })
|
||||
* ```
|
||||
@@ -23,17 +24,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
plugin: 'cordova-plugin-documentreader',
|
||||
pluginRef: 'DocumentReader',
|
||||
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
|
||||
platforms: ['iOS'],
|
||||
platforms: ['iOS', 'Android'],
|
||||
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
|
||||
})
|
||||
@Injectable()
|
||||
export class RegulaDocumentReader extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Run the scanner
|
||||
* Initialize the scanner
|
||||
* @param license {any} License data
|
||||
*/
|
||||
@Cordova()
|
||||
initReader(license: any): void {}
|
||||
|
||||
/**
|
||||
* Run the scanner
|
||||
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
|
||||
*/
|
||||
@Cordova()
|
||||
scanDocument(license: any): Promise<string[]> { return; }
|
||||
scanDocument(): Promise<string[]> { return; }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Injectable } from '@angular/core';
|
||||
/**
|
||||
* @name Taptic Engine
|
||||
* @description
|
||||
* An Ionic plugin to use Taptic Engine API on iPHone 7, 7 Plus or newer.
|
||||
* An Ionic plugin to use Taptic Engine API on iPhone 7, 7 Plus or newer.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaFunctionOverride, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window: any;
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
|
||||
/**
|
||||
@@ -165,16 +162,8 @@ export class ThreeDeeTouch extends IonicNativePlugin {
|
||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch) {
|
||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
} else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
@CordovaFunctionOverride()
|
||||
onHomeIconPressed(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
|
||||
@@ -29,7 +29,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
@Plugin({
|
||||
pluginName: 'WebIntent',
|
||||
plugin: 'com-darryncampbell-cordova-plugin-intent',
|
||||
pluginRef: 'intentShim',
|
||||
pluginRef: 'plugins.intentShim',
|
||||
repo: 'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
|
||||
platforms: ['Android']
|
||||
})
|
||||
|
||||
@@ -124,4 +124,11 @@ export class Zeroconf extends IonicNativePlugin {
|
||||
*/
|
||||
@Cordova()
|
||||
close(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Re-initializes the plugin to clean service & browser state.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
reInit(): Promise<void> { return; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user