forked from github/awesome-cordova-plugins
Compare commits
153 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4639bf9a94 | ||
|
|
abb77e3e08 | ||
|
|
975f08b7b5 | ||
|
|
773722b767 | ||
|
|
447aa56e3c | ||
|
|
8d22798278 | ||
|
|
30297fb81d | ||
|
|
ac777fca40 | ||
|
|
43b70a12b5 | ||
|
|
ef28078815 | ||
|
|
e304ce0e53 | ||
|
|
9e5f03f15d | ||
|
|
465d5519d0 | ||
|
|
d683b9e5df | ||
|
|
2b2476e873 | ||
|
|
196adc8b2f | ||
|
|
363b41e075 | ||
|
|
2179699622 | ||
|
|
e65406cc2f | ||
|
|
ddb6d43ffa | ||
|
|
30ed33a046 | ||
|
|
3d0a12d40d | ||
|
|
6ca5beaf0b | ||
|
|
536a906366 | ||
|
|
7fcafaae81 | ||
|
|
1a7a0e7cc0 | ||
|
|
34bf136703 | ||
|
|
bb798340c5 | ||
|
|
1b04ebb5e2 | ||
|
|
a150d4d522 | ||
|
|
4246d47a6c | ||
|
|
024099a772 | ||
|
|
fff99694ba | ||
|
|
429529a5ee | ||
|
|
e2419a26b2 | ||
|
|
10eb3eeeeb | ||
|
|
533cc4efc9 | ||
|
|
6b433b5373 | ||
|
|
e684db479e | ||
|
|
81c576c28e | ||
|
|
e2f3702d0b | ||
|
|
806766e33e | ||
|
|
432c0e901d | ||
|
|
fb70a24c61 | ||
|
|
202c680643 | ||
|
|
7b94d4fccf | ||
|
|
5b15bb9f46 | ||
|
|
c3930c814a | ||
|
|
57af5c5e73 | ||
|
|
29604d6d3d | ||
|
|
76effe98f8 | ||
|
|
0783520723 | ||
|
|
ef898efcc6 | ||
|
|
fdd12b58b3 | ||
|
|
80047907ea | ||
|
|
3a1034eab0 | ||
|
|
c8586927c3 | ||
|
|
f22c603c30 | ||
|
|
957396b5e5 | ||
|
|
d891c3eea0 | ||
|
|
37aa9a82fe | ||
|
|
392b11bd05 | ||
|
|
d4fe051d56 | ||
|
|
a2d33963b1 | ||
|
|
332f9aefe5 | ||
|
|
4942b88873 | ||
|
|
39ec5158a0 | ||
|
|
c11aec33a7 | ||
|
|
21045ea535 | ||
|
|
955c450483 | ||
|
|
00c0707dad | ||
|
|
79f88d6a02 | ||
|
|
ce5966bf10 | ||
|
|
fb8dbe5fc0 | ||
|
|
cde87e2113 | ||
|
|
262e18f409 | ||
|
|
39ef066875 | ||
|
|
35d317f7f3 | ||
|
|
5505e5f064 | ||
|
|
e6b0250d97 | ||
|
|
aa4c3b3787 | ||
|
|
57bbcdebfb | ||
|
|
85825c7b91 | ||
|
|
1acade4883 | ||
|
|
7c1b409542 | ||
|
|
fe02c84fd9 | ||
|
|
a2cc1870b4 | ||
|
|
1c6a3a3bc5 | ||
|
|
0c097ba2be | ||
|
|
0dd507ff03 | ||
|
|
4e0673c8e9 | ||
|
|
0cecf4e43f | ||
|
|
9ab458bba2 | ||
|
|
7e900dae22 | ||
|
|
0fa82e5c56 | ||
|
|
4af3d5bcc1 | ||
|
|
976401a4e9 | ||
|
|
6230958585 | ||
|
|
47fa44c932 | ||
|
|
f1dd8d61f5 | ||
|
|
3d387798b6 | ||
|
|
380eb88a39 | ||
|
|
6e2c998dad | ||
|
|
7105048b89 | ||
|
|
6061af6238 | ||
|
|
1decedd899 | ||
|
|
b5fe6631fe | ||
|
|
25c1cf4058 | ||
|
|
b265b5bd0c | ||
|
|
247efa656a | ||
|
|
238e2ab26c | ||
|
|
146c823f2a | ||
|
|
1b55513bc4 | ||
|
|
953841681c | ||
|
|
76a45a3834 | ||
|
|
eff9bc376c | ||
|
|
b9993c24f0 | ||
|
|
9752c865fc | ||
|
|
4c4cf76f7a | ||
|
|
70cbcbf1e9 | ||
|
|
2caf0684ef | ||
|
|
aa4b2cd2ae | ||
|
|
c56aa7e3ae | ||
|
|
3f8f97f015 | ||
|
|
1f3b97cef2 | ||
|
|
927bd1a9ba | ||
|
|
c43a51e2bb | ||
|
|
1a9a843cde | ||
|
|
2e543291ef | ||
|
|
ad9556ca03 | ||
|
|
cbdde57681 | ||
|
|
d8bac2f0ab | ||
|
|
12a83831c8 | ||
|
|
cdb99a74cc | ||
|
|
dd12be6722 | ||
|
|
cf0c740269 | ||
|
|
bde2b38668 | ||
|
|
b35dab2634 | ||
|
|
ff793d649b | ||
|
|
e8faf22357 | ||
|
|
a6f9714422 | ||
|
|
71349655c0 | ||
|
|
f1a036d8b0 | ||
|
|
7bbd25c1a2 | ||
|
|
01ae8e11fc | ||
|
|
aff653de2e | ||
|
|
0867cfff3f | ||
|
|
d395b42788 | ||
|
|
bc6bf6671e | ||
|
|
9f1a0f9585 | ||
|
|
3c54a1c7f5 | ||
|
|
06e666d6a0 | ||
|
|
73d0d57bbc |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,5 +3,5 @@ node_modules/
|
||||
.idea
|
||||
.tmp
|
||||
aot/
|
||||
dist/
|
||||
scripts/ionic-native-bower
|
||||
dist/
|
||||
|
||||
161
CHANGELOG.md
161
CHANGELOG.md
@@ -1,3 +1,160 @@
|
||||
<a name="4.3.1"></a>
|
||||
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.2) (2017-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
|
||||
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
|
||||
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
|
||||
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.0"></a>
|
||||
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
|
||||
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
|
||||
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
|
||||
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
|
||||
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
|
||||
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
|
||||
* **stripe:** fix stripe create card token ([#2002](https://github.com/ionic-team/ionic-native/issues/2002)) ([5b15bb9](https://github.com/ionic-team/ionic-native/commit/5b15bb9))
|
||||
* **zeroconf:** extend the ZeroconfResult.action definition ([#1985](https://github.com/ionic-team/ionic-native/issues/1985)) ([e2f3702](https://github.com/ionic-team/ionic-native/commit/e2f3702))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-full-screen:** add support for setSystemUiVisiblity ([#1942](https://github.com/ionic-team/ionic-native/issues/1942)) ([4246d47](https://github.com/ionic-team/ionic-native/commit/4246d47))
|
||||
* **document-reader:** add cordova-plugin-documentreader ([#1996](https://github.com/ionic-team/ionic-native/issues/1996)) ([7b94d4f](https://github.com/ionic-team/ionic-native/commit/7b94d4f))
|
||||
* **extended-device-information:** add Extended Device Info plugin ([#1980](https://github.com/ionic-team/ionic-native/issues/1980)) ([806766e](https://github.com/ionic-team/ionic-native/commit/806766e))
|
||||
* **music-controls:** add support for next/prev track and skip forward/backward in control center ([#1927](https://github.com/ionic-team/ionic-native/issues/1927)) ([fff9969](https://github.com/ionic-team/ionic-native/commit/fff9969))
|
||||
* **push:** update PushOptions interfaces to match new version ([#1908](https://github.com/ionic-team/ionic-native/issues/1908)) ([34bf136](https://github.com/ionic-team/ionic-native/commit/34bf136))
|
||||
* **qr-scanner:** added destroy method ([#1916](https://github.com/ionic-team/ionic-native/issues/1916)) ([#1971](https://github.com/ionic-team/ionic-native/issues/1971)) ([10eb3ee](https://github.com/ionic-team/ionic-native/commit/10eb3ee))
|
||||
* **uid:** add UID plugin ([#1946](https://github.com/ionic-team/ionic-native/issues/1946)) ([e2419a2](https://github.com/ionic-team/ionic-native/commit/e2419a2))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **push:** this wrapper will work only with `phonegap-plugin-push@2.0.0`
|
||||
|
||||
|
||||
|
||||
<a name="4.2.0"></a>
|
||||
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **fingerprint-aio:** add missing FingerprintOptions properties ([#1845](https://github.com/ionic-team/ionic-native/issues/1845)) ([85825c7](https://github.com/ionic-team/ionic-native/commit/85825c7))
|
||||
* **geofence:** remove duplicate onTransitionReceived method ([00c0707](https://github.com/ionic-team/ionic-native/commit/00c0707))
|
||||
* **google-maps:** add missing debug option ([#1832](https://github.com/ionic-team/ionic-native/issues/1832)) ([39ec515](https://github.com/ionic-team/ionic-native/commit/39ec515))
|
||||
* **ms-adal:** make userId optional ([#1894](https://github.com/ionic-team/ionic-native/issues/1894)) ([21045ea](https://github.com/ionic-team/ionic-native/commit/21045ea))
|
||||
* **native-geocoder:** update NativeGeocoderReverse result ([#1840](https://github.com/ionic-team/ionic-native/issues/1840)) ([7c1b409](https://github.com/ionic-team/ionic-native/commit/7c1b409))
|
||||
* **native-spinner:** update pluginRef ([#1859](https://github.com/ionic-team/ionic-native/issues/1859)) ([262e18f](https://github.com/ionic-team/ionic-native/commit/262e18f))
|
||||
* **serial:** add missing options for the open method ([#1844](https://github.com/ionic-team/ionic-native/issues/1844)) ([1acade4](https://github.com/ionic-team/ionic-native/commit/1acade4))
|
||||
* **sqlite:** add optional key parameter to SQLiteDatabaseConfig to support sqlcipher-adapter ([#1917](https://github.com/ionic-team/ionic-native/issues/1917)) ([0c097ba](https://github.com/ionic-team/ionic-native/commit/0c097ba))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-maps:** update plugin and fix a few issues ([#1834](https://github.com/ionic-team/ionic-native/issues/1834)) ([c11aec3](https://github.com/ionic-team/ionic-native/commit/c11aec3))
|
||||
* **http:** use a different plugin source with better features ([#1921](https://github.com/ionic-team/ionic-native/issues/1921)) ([a2d3396](https://github.com/ionic-team/ionic-native/commit/a2d3396))
|
||||
* **keychain-touch-id:** add KeychainTouchId plugin ([#1837](https://github.com/ionic-team/ionic-native/issues/1837)) ([a2cc187](https://github.com/ionic-team/ionic-native/commit/a2cc187))
|
||||
* **local-notifications:** add `un` method to unsubscribe from events ([#1871](https://github.com/ionic-team/ionic-native/issues/1871)) ([ce5966b](https://github.com/ionic-team/ionic-native/commit/ce5966b))
|
||||
* **paypal:** add payeeEmail for third party merchants ([#1864](https://github.com/ionic-team/ionic-native/issues/1864)) ([cde87e2](https://github.com/ionic-team/ionic-native/commit/cde87e2))
|
||||
* **push:** add Browser Push notification support ([#1848](https://github.com/ionic-team/ionic-native/issues/1848)) ([aa4c3b3](https://github.com/ionic-team/ionic-native/commit/aa4c3b3))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
# [4.1.0](https://github.com/ionic-team/ionic-native/compare/v4.0.1...v4.1.0) (2017-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **media:** add setRate method ([4af3d5b](https://github.com/ionic-team/ionic-native/commit/4af3d5b)), closes [#1825](https://github.com/ionic-team/ionic-native/issues/1825)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **firebase:** add unregister method ([#1823](https://github.com/ionic-team/ionic-native/issues/1823)) ([6230958](https://github.com/ionic-team/ionic-native/commit/6230958))
|
||||
* **google-maps:** add missing features and fix wrong definitions ([#1815](https://github.com/ionic-team/ionic-native/issues/1815)) ([976401a](https://github.com/ionic-team/ionic-native/commit/976401a))
|
||||
* **hyper-track:** add HyperTrack plugin ([#1816](https://github.com/ionic-team/ionic-native/issues/1816)) ([47fa44c](https://github.com/ionic-team/ionic-native/commit/47fa44c))
|
||||
* **open-native-settings:** add Open Native Settings plugin ([0fa82e5](https://github.com/ionic-team/ionic-native/commit/0fa82e5)), closes [#1821](https://github.com/ionic-team/ionic-native/issues/1821)
|
||||
|
||||
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
## [4.0.1](https://github.com/ionic-team/ionic-native/compare/v4.0.0...v4.0.1) (2017-07-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **media:** fix success/error/statusUpdate observables ([7105048](https://github.com/ionic-team/ionic-native/commit/7105048)), closes [#1806](https://github.com/ionic-team/ionic-native/issues/1806)
|
||||
* **social-sharing:** fix issues caused by omitting optional params ([25c1cf4](https://github.com/ionic-team/ionic-native/commit/25c1cf4)), closes [#1805](https://github.com/ionic-team/ionic-native/issues/1805)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **camera:** add enums for camera options ([6061af6](https://github.com/ionic-team/ionic-native/commit/6061af6))
|
||||
* **launch-navigator:** update plugin wrapper to support v4 ([9538416](https://github.com/ionic-team/ionic-native/commit/9538416)), closes [#1738](https://github.com/ionic-team/ionic-native/issues/1738)
|
||||
* **media:** add MEDIA_STATUS and MEDIA_ERROR enums ([1decedd](https://github.com/ionic-team/ionic-native/commit/1decedd))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/ionic-team/ionic-native/compare/v3.14.0...v4.0.0) (2017-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** fix parameter types in the trackMetric method ([#1780](https://github.com/ionic-team/ionic-native/issues/1780)) ([7bbd25c](https://github.com/ionic-team/ionic-native/commit/7bbd25c))
|
||||
* **media:** wrap plugin callbacks with Observables ([0867cff](https://github.com/ionic-team/ionic-native/commit/0867cff)), closes [#1591](https://github.com/ionic-team/ionic-native/issues/1591)
|
||||
* **safari-view-controller:** show should return an Observable ([a6f9714](https://github.com/ionic-team/ionic-native/commit/a6f9714)), closes [#1619](https://github.com/ionic-team/ionic-native/issues/1619)
|
||||
* **sqlite:** fix param type for `sqlBatch` method ([e8faf22](https://github.com/ionic-team/ionic-native/commit/e8faf22)), closes [#1596](https://github.com/ionic-team/ionic-native/issues/1596)
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **admob-pro:** rename plugin from AdMob to AdMobPro ([#1770](https://github.com/ionic-team/ionic-native/issues/1770)) ([bc6bf66](https://github.com/ionic-team/ionic-native/commit/bc6bf66))
|
||||
* **media:** rename main class to Media ([#1769](https://github.com/ionic-team/ionic-native/issues/1769)) ([9f1a0f9](https://github.com/ionic-team/ionic-native/commit/9f1a0f9))
|
||||
* **rename plugin to FileTransfer to match original plugin:** ([#1768](https://github.com/ionic-team/ionic-native/issues/1768)) ([3c54a1c](https://github.com/ionic-team/ionic-native/commit/3c54a1c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **email-composer:** update plugin to latest version and use original plugin ([#1771](https://github.com/ionic-team/ionic-native/issues/1771)) ([d395b42](https://github.com/ionic-team/ionic-native/commit/d395b42))
|
||||
* **google-maps:** add GoogleMapOptions interface ([aff653d](https://github.com/ionic-team/ionic-native/commit/aff653d))
|
||||
* **google-maps:** update wrapper to support v2 of the plugin ([#1759](https://github.com/ionic-team/ionic-native/issues/1759)) ([06e666d](https://github.com/ionic-team/ionic-native/commit/06e666d))
|
||||
* **ms-adal:** add Azure Active Directory Authentication plugin ([cf0c740](https://github.com/ionic-team/ionic-native/commit/cf0c740)), closes [#372](https://github.com/ionic-team/ionic-native/issues/372)
|
||||
* **onesignal:** add new methods ([b35dab2](https://github.com/ionic-team/ionic-native/commit/b35dab2)), closes [#1677](https://github.com/ionic-team/ionic-native/issues/1677)
|
||||
* **qr-scanner:** add QRScanner plugin ([bde2b38](https://github.com/ionic-team/ionic-native/commit/bde2b38)), closes [#715](https://github.com/ionic-team/ionic-native/issues/715)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **safari-view-controller:** `show` method now returns an Observable
|
||||
* **media:** the plugin's `create` method no longer takes callback functions. You must use the
|
||||
observables provided by the `MediaObject` instance. Refer to the updated documentation for more
|
||||
information.
|
||||
* **admob-pro:** `@ionic-native/admob` is now `@ionic-native/admob-pro`. Also, class name is changed
|
||||
from `AdMob` to `AdMobPro`.
|
||||
* **media:** `MediaObject` class is now `Media`
|
||||
* **rename plugin to FileTransfer to match original plugin:** Package name is now `@ionic-native/file-transfer`. `Transfer` class has been
|
||||
renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `FileTransferObject`.
|
||||
|
||||
|
||||
|
||||
<a name="3.14.0"></a>
|
||||
# [3.14.0](https://github.com/ionic-team/ionic-native/compare/v3.13.1...v3.14.0) (2017-07-07)
|
||||
|
||||
@@ -1641,13 +1798,13 @@ The whole implementation has changed now. You must update your code.
|
||||
* **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40))
|
||||
* **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8))
|
||||
* **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39))
|
||||
* datepicker plugin, pluginref, and [@Cordova](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f))
|
||||
* **plugin:** add sync option to [@Cordova](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
|
||||
* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9))
|
||||
* add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f))
|
||||
* add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521))
|
||||
|
||||
@@ -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; }
|
||||
```
|
||||
22
README.md
22
README.md
@@ -52,38 +52,28 @@ import { NgZone } from '@angular/core';
|
||||
@Component({ ... })
|
||||
export class MyComponent {
|
||||
|
||||
constructor(private geolocation: Geolocation, private platform: Platform, private ngZone: NgZone) {
|
||||
constructor(private geolocation: Geolocation, private platform: Platform) {
|
||||
|
||||
platform.ready().then(() => {
|
||||
|
||||
// get position
|
||||
geolocation.getCurrentPosition().then(pos => {
|
||||
|
||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||
|
||||
});
|
||||
|
||||
|
||||
// watch position
|
||||
const watch = geolocation.watchPosition().subscribe(pos => {
|
||||
|
||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||
|
||||
// Currently, observables from Ionic Native plugins
|
||||
// need to run inside of zone to trigger change detection
|
||||
ngZone.run(() => {
|
||||
this.position = pos;
|
||||
})
|
||||
|
||||
this.position = pos;
|
||||
});
|
||||
|
||||
// to stop watching
|
||||
watch.unsubscribe();
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@@ -171,9 +161,9 @@ Spent way too long diagnosing an issue only to realize a plugin wasn't firing or
|
||||
## Plugin Missing?
|
||||
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
||||
|
||||
## Ionic V1/Angular 1 support
|
||||
## Ionic v1 (AngularJS, Angular 1.x) support
|
||||
|
||||
For Ionic V1/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
|
||||
For Ionic v1 (AngularJS, Angular 1.x) support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/v2.x/README.md) for usage information.
|
||||
|
||||
# Credits
|
||||
|
||||
|
||||
8991
package-lock.json
generated
8991
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "3.14.0",
|
||||
"version": "4.3.1",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "4.1.3",
|
||||
"@angular/compiler-cli": "4.1.3",
|
||||
"@angular/core": "4.1.3",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.5.51",
|
||||
"@types/node": "^7.0.27",
|
||||
@@ -39,12 +39,12 @@
|
||||
"q": "1.5.0",
|
||||
"queue": "4.2.1",
|
||||
"rimraf": "2.6.1",
|
||||
"rxjs": "5.4.0",
|
||||
"rxjs": "5.4.3",
|
||||
"semver": "5.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"typescript": "2.3.3",
|
||||
"zone.js": "0.8.12"
|
||||
"typescript": "2.3.4",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run test:watch",
|
||||
|
||||
@@ -19,7 +19,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
|
||||
// dependency versions
|
||||
const ANGULAR_VERSION = '*',
|
||||
RXJS_VERSION = '^5.0.1',
|
||||
MIN_CORE_VERSION = '^3.6.0',
|
||||
MIN_CORE_VERSION = '^4.2.0',
|
||||
IONIC_NATIVE_VERSION = require(path.resolve(ROOT, 'package.json')).version;
|
||||
|
||||
// package dependencies
|
||||
|
||||
@@ -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')
|
||||
}];
|
||||
|
||||
})
|
||||
|
||||
@@ -22,8 +22,24 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
doc.URL = doc.outputPath.replace('docs//', 'docs/')
|
||||
.replace('/index.md', '')
|
||||
.replace('content/', '');
|
||||
// add trailing slash to plugin pages
|
||||
if(!doc.URL.endsWith("/") && !doc.URL.endsWith(".html")) {
|
||||
doc.URL = doc.URL+'/';
|
||||
}
|
||||
});
|
||||
|
||||
const betaDocs = [];
|
||||
|
||||
docs = docs.filter(doc => {
|
||||
if (doc.beta === true) {
|
||||
betaDocs.push(doc);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
docs = docs.concat(betaDocs);
|
||||
|
||||
// add side menu
|
||||
docs.push({
|
||||
docType: 'nativeMenu',
|
||||
|
||||
@@ -6,5 +6,6 @@ module.exports = [
|
||||
{'name': 'usage'},
|
||||
{'name': 'hidden'}, // hide from docs
|
||||
{'name': 'classes'}, // related classes
|
||||
{'name': 'interfaces'} // related interfaces
|
||||
{'name': 'interfaces'}, // related interfaces
|
||||
{'name': 'paid', transforms: (doc, tag, value) => typeof value !== 'undefined'} // paid plugin, set value to true
|
||||
];
|
||||
|
||||
11
scripts/docs/templates/common.template.html
vendored
11
scripts/docs/templates/common.template.html
vendored
@@ -147,6 +147,9 @@ docType: "<$ doc.docType $>"
|
||||
<@- if doc.beta == true -@>
|
||||
<span class="beta" title="beta">β</span>
|
||||
<@- endif -@>
|
||||
<@- if doc.paid == true -@>
|
||||
<span class="paid" title="paid">Paid</span>
|
||||
<@- endif -@>
|
||||
</h1>
|
||||
|
||||
<a class="improve-v2-docs" href="http://github.com/ionic-team/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
@@ -163,6 +166,12 @@ docType: "<$ doc.docType $>"
|
||||
href="<$ prop.repo $>/issues">plugin repo</a>.
|
||||
</p>
|
||||
<@ endif @>
|
||||
<@ if doc.paid == true @>
|
||||
<p class="paid-notice">
|
||||
This plugin might require a paid license, or might take a share of your app's earnings.
|
||||
Check the <a target="_blank" rel="nofollow" href="<$ prop.repo $>">plugin's repo</a> for more information.
|
||||
</p>
|
||||
<@ endif @>
|
||||
|
||||
<# --- Plugin description --- #>
|
||||
<$ doc.description | marked $>
|
||||
@@ -177,7 +186,7 @@ docType: "<$ doc.docType $>"
|
||||
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
|
||||
<ol class="installation">
|
||||
<li>Install the Cordova and Ionic Native plugins:<br>
|
||||
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
|
||||
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '<').replace('>', '>') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
|
||||
$ npm install --save @ionic-native/<$ doc.npmId $>
|
||||
</code></pre>
|
||||
</li>
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
<li class="capitalize {% if page.id == 'mocking' %}active{% endif %}">
|
||||
<a href="/docs/native/browser.html">Browser Usage</a>
|
||||
</li>
|
||||
<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
|
||||
<@- for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">β</span></a>
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $><@ if doc.paid == true @> <span class="paid">Paid</span><@ endif @><@ if doc.beta == true @> <span class="beta">β</span><@ endif @></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'core-js';
|
||||
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
|
||||
import { IonicNativePlugin } from './ionic-native-plugin';
|
||||
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const window: any;
|
||||
|
||||
@@ -47,6 +48,17 @@ class TestPlugin extends IonicNativePlugin {
|
||||
return new TestObject(TestPlugin.getPlugin().create());
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
destruct: true
|
||||
})
|
||||
destructPromise(): Promise<any> { return; }
|
||||
|
||||
@Cordova({
|
||||
destruct: true,
|
||||
observable: true
|
||||
})
|
||||
destructObservable(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
function definePlugin() {
|
||||
@@ -59,7 +71,9 @@ function definePlugin() {
|
||||
this.ping = (success: Function, error: Function) => success('pong');
|
||||
this.name = 'John Smith';
|
||||
return this;
|
||||
}
|
||||
},
|
||||
destructPromise: (success: Function) => success('hello', 'world'),
|
||||
destructObservable: (success: Function) => success('hello', 'world')
|
||||
};
|
||||
}
|
||||
|
||||
@@ -177,6 +191,30 @@ describe('Regular Decorators', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('CordovaOptions', () => {
|
||||
|
||||
describe('destruct', () => {
|
||||
|
||||
it('should destruct values returned by a Promise', (done) => {
|
||||
plugin.destructPromise()
|
||||
.then((args: any[]) => {
|
||||
expect(args).toEqual(['hello', 'world']);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should destruct values returned by an Observable', (done) => {
|
||||
plugin.destructObservable()
|
||||
.subscribe((args: any[]) => {
|
||||
expect(args).toEqual(['hello', 'world']);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Instance Decorators', () => {
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface PluginConfig {
|
||||
}
|
||||
|
||||
export interface CordovaOptions {
|
||||
destruct?: boolean;
|
||||
/**
|
||||
* Set to true if the wrapped method is a sync function
|
||||
*/
|
||||
@@ -252,7 +253,7 @@ export function Cordova(opts: CordovaOptions = {}) {
|
||||
*
|
||||
* Wrap an instance method
|
||||
*/
|
||||
export function CordovaInstance(opts: any = {}) {
|
||||
export function CordovaInstance(opts: CordovaOptions = {}) {
|
||||
return (target: Object, methodName: string) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
|
||||
69
src/@ionic-native/core/ionic-native-plugin.spec.ts
Normal file
69
src/@ionic-native/core/ionic-native-plugin.spec.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
// This is to verify that new (FileTransfer.getPlugin)() works
|
||||
|
||||
import { Plugin, CordovaInstance } from './decorators';
|
||||
import { checkAvailability } from './plugin';
|
||||
import { IonicNativePlugin } from './ionic-native-plugin';
|
||||
|
||||
class FT {
|
||||
hello(): string {
|
||||
return 'world';
|
||||
}
|
||||
}
|
||||
|
||||
(window as any).FileTransfer = () => new FT();
|
||||
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-file-transfer',
|
||||
pluginRef: 'FileTransfer',
|
||||
repo: '',
|
||||
pluginName: 'FileTransfer'
|
||||
})
|
||||
export class FileTransfer extends IonicNativePlugin {
|
||||
create(): FileTransferObject {
|
||||
let instance: any;
|
||||
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
|
||||
instance = new (FileTransfer.getPlugin())();
|
||||
}
|
||||
return new FileTransferObject(instance);
|
||||
}
|
||||
}
|
||||
|
||||
export class FileTransferObject {
|
||||
|
||||
constructor(public _objectInstance: any) {
|
||||
console.info('Creating a new FileTransferObject with instance: ', _objectInstance);
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
hello(): string { return; }
|
||||
|
||||
}
|
||||
|
||||
describe('Mock FileTransfer Plugin', () => {
|
||||
|
||||
let plugin: FileTransfer,
|
||||
instance: FileTransferObject;
|
||||
|
||||
beforeAll(() => {
|
||||
plugin = new FileTransfer();
|
||||
instance = plugin.create();
|
||||
});
|
||||
|
||||
it('should create a new FileTransfer plugin instance', () => {
|
||||
expect(plugin instanceof FileTransfer).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should create new FileTransferObject instance', () => {
|
||||
expect(instance instanceof FileTransferObject).toBeTruthy();
|
||||
});
|
||||
|
||||
it('FileTransferObject instance should have _objectInstance property', () => {
|
||||
expect(instance._objectInstance).toBeDefined();
|
||||
});
|
||||
|
||||
it('FileTransferObject.hello should return world', () => {
|
||||
console.info('instance hello is', instance.hello());
|
||||
expect(instance.hello()).toEqual('world');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -136,7 +136,11 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||
let pluginResult: any, rej: Function;
|
||||
const p = getPromise((resolve: Function, reject: Function) => {
|
||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
||||
if (opts.destruct) {
|
||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||
} else {
|
||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
||||
}
|
||||
rej = reject;
|
||||
});
|
||||
// Angular throws an error on unhandled rejection, but in this case we have already printed
|
||||
@@ -166,7 +170,14 @@ function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts:
|
||||
|
||||
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||
return new Observable(observer => {
|
||||
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
let pluginResult;
|
||||
|
||||
if (opts.destruct) {
|
||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
|
||||
} else {
|
||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
}
|
||||
|
||||
if (pluginResult && pluginResult.error) {
|
||||
observer.error(pluginResult.error);
|
||||
observer.complete();
|
||||
@@ -266,7 +277,14 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
||||
} else if (opts.observable) {
|
||||
|
||||
return new Observable(observer => {
|
||||
let pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
|
||||
let pluginResult;
|
||||
|
||||
if (opts.destruct) {
|
||||
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
|
||||
} else {
|
||||
pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
}
|
||||
|
||||
if (pluginResult && pluginResult.error) {
|
||||
observer.error(pluginResult.error);
|
||||
@@ -287,9 +305,13 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
||||
});
|
||||
|
||||
} else if (opts.otherPromise) {
|
||||
|
||||
return getPromise((resolve: Function, reject: Function) => {
|
||||
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||
let result;
|
||||
if (opts.destruct) {
|
||||
result = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||
} else {
|
||||
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||
}
|
||||
if (result && !!result.then) {
|
||||
result.then(resolve, reject);
|
||||
} else {
|
||||
@@ -298,8 +320,24 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
||||
});
|
||||
|
||||
} else {
|
||||
let pluginResult: any, rej: Function;
|
||||
const p = getPromise((resolve: Function, reject: Function) => {
|
||||
if (opts.destruct) {
|
||||
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
|
||||
} else {
|
||||
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||
}
|
||||
rej = reject;
|
||||
});
|
||||
// Angular throws an error on unhandled rejection, but in this case we have already printed
|
||||
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
|
||||
// to error
|
||||
if (pluginResult && pluginResult.error) {
|
||||
p.catch(() => { });
|
||||
typeof rej === 'function' && rej(pluginResult.error);
|
||||
}
|
||||
return p;
|
||||
|
||||
return getPromise((resolve: Function, reject: Function) => callInstance(pluginObj, methodName, args, opts, resolve, reject));
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface ActionSheetOptions {
|
||||
|
||||
@@ -99,13 +99,21 @@ export interface ActionSheetOptions {
|
||||
@Injectable()
|
||||
export class ActionSheet extends IonicNativePlugin {
|
||||
|
||||
@CordovaProperty
|
||||
/**
|
||||
* Convenience property to select an Android theme value
|
||||
*/
|
||||
ANDROID_THEMES: {
|
||||
THEME_TRADITIONAL: number;
|
||||
THEME_HOLO_DARK: number;
|
||||
THEME_HOLO_LIGHT: number;
|
||||
THEME_DEVICE_DEFAULT_DARK: number;
|
||||
THEME_DEVICE_DEFAULT_LIGHT: number;
|
||||
} = {
|
||||
THEME_TRADITIONAL: 1,
|
||||
THEME_HOLO_DARK: 2,
|
||||
THEME_HOLO_LIGHT: 3,
|
||||
THEME_DEVICE_DEFAULT_DARK: 4,
|
||||
THEME_DEVICE_DEFAULT_LIGHT: 5
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface AdMobOptions {
|
||||
overlap?: boolean;
|
||||
|
||||
/**
|
||||
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
|
||||
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMobPro.AD_POSITION` property to select other values.
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
@@ -90,17 +90,18 @@ export interface AdExtras {
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdMob
|
||||
* @paid
|
||||
* @name AdMob Pro
|
||||
* @description
|
||||
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* Plugin for Google Ads, including AdMob / DFP (DoubleClick for publisher) and mediations to other Ad networks.
|
||||
*
|
||||
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMob Free](../admob-free).
|
||||
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMobPro Free](../admob-free).
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AdMob } from '@ionic-native/admob';
|
||||
* import { AdMobPro } from '@ionic-native/admob-pro';
|
||||
* import { Platform } from 'ionic-angular';
|
||||
*
|
||||
* constructor(private admob: AdMob, private platform: Platform ) { }
|
||||
* constructor(private admob: AdMobPro, private platform: Platform ) { }
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* this.admob.onAdDismiss()
|
||||
@@ -125,14 +126,14 @@ export interface AdExtras {
|
||||
* AdExtras
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMob',
|
||||
pluginName: 'AdMob Pro',
|
||||
plugin: 'cordova-plugin-admobpro',
|
||||
pluginRef: 'AdMob',
|
||||
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
@Injectable()
|
||||
export class AdMob extends IonicNativePlugin {
|
||||
export class AdMobPro extends IonicNativePlugin {
|
||||
|
||||
AD_POSITION: {
|
||||
NO_CHANGE: number;
|
||||
@@ -178,7 +179,7 @@ export class AdMob extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Show banner at position
|
||||
* @param position {number} Position. Use `AdMob.AD_POSITION` to set values.
|
||||
* @param position {number} Position. Use `AdMobPro.AD_POSITION` to set values.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -1,6 +1,35 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* Bit flag values for setSystemUiVisibility()
|
||||
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
|
||||
*/
|
||||
export enum AndroidSystemUiFlags {
|
||||
/** View has requested the system UI (status bar) to be visible (the default). SYSTEM_UI_FLAG_VISIBLE */
|
||||
Visible = 0,
|
||||
/** View has requested the system UI to enter an unobtrusive "low profile" mode. SYSTEM_UI_FLAG_LOW_PROFILE */
|
||||
LowProfile = 1,
|
||||
/** View has requested that the system navigation be temporarily hidden. SYSTEM_UI_FLAG_HIDE_NAVIGATION */
|
||||
HideNavigation = 2,
|
||||
/** View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. SYSTEM_UI_FLAG_FULLSCREEN */
|
||||
Fullscreen = 4,
|
||||
/** Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds. SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR */
|
||||
LightNavigationBar = 16,
|
||||
/** When using other layout flags, we would like a stable view of the content insets given to fitSystemWindows(Rect). SYSTEM_UI_FLAG_LAYOUT_STABLE */
|
||||
LayoutStable = 256,
|
||||
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_HIDE_NAVIGATION, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION */
|
||||
LayoutHideNavigation = 512,
|
||||
/** View would like its window to be laid out as if it has requested SYSTEM_UI_FLAG_FULLSCREEN, even if it currently hasn't. SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN */
|
||||
LayoutFullscreen = 1024,
|
||||
/** View would like to remain interactive when hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE */
|
||||
Immersive = 2048,
|
||||
/** View would like to remain interactive when hiding the status bar with SYSTEM_UI_FLAG_FULLSCREEN and/or hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION. SYSTEM_UI_FLAG_IMMERSIVE_STICKY */
|
||||
ImmersiveSticky = 4096,
|
||||
/** Requests the status bar to draw in a mode that is compatible with light status bar backgrounds. SYSTEM_UI_FLAG_LIGHT_STATUS_BAR */
|
||||
LightStatusBar = 8192
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Android Full Screen
|
||||
* @description
|
||||
@@ -92,4 +121,13 @@ export class AndroidFullScreen extends IonicNativePlugin {
|
||||
*/
|
||||
@Cordova()
|
||||
immersiveMode(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Manually set the the system UI to a custom mode. This mirrors the Android method of the same name. (Android 4.4+ only).
|
||||
* @see https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
|
||||
* @param {AndroidSystemUiFlags} visibility Bitwise-OR of flags in AndroidSystemUiFlags
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
setSystemUiVisibility(visibility: AndroidSystemUiFlags): Promise<void> { return; }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
|
||||
*
|
||||
* this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
|
||||
* success => console.log('Permission granted'),
|
||||
* err => this.androidPermissions.requestPermissions(this.androidPermissions.PERMISSION.CAMERA)
|
||||
* err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
|
||||
* );
|
||||
*
|
||||
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
|
||||
|
||||
@@ -264,7 +264,7 @@ export interface BackgroundGeolocationConfig {
|
||||
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
|
||||
*
|
||||
* ```typescript
|
||||
* import { BackgroundGeolocation, BackgroundGeolocationConfig } from '@ionic-native/background-geolocation';
|
||||
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
|
||||
*
|
||||
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
|
||||
*
|
||||
|
||||
@@ -19,14 +19,14 @@ export interface BackgroundModeConfiguration {
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
* This will look for <icon name>.png in platforms/android/res/drawable|mipmap
|
||||
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
color?: string;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin won't come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface BackgroundModeConfiguration {
|
||||
* @name Background Mode
|
||||
* @description
|
||||
* Cordova plugin to prevent the app from going to sleep while in background.
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
|
||||
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, visit: https://github.com/katzer/cordova-plugin-background-mode
|
||||
*@usage
|
||||
* ```typescript
|
||||
* import { BackgroundMode } from '@ionic-native/background-mode';
|
||||
@@ -179,7 +179,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
overrideBackButton(): void { }
|
||||
|
||||
/**
|
||||
* Exclude the app from the recent task list works on Android 5.0+.
|
||||
* Exclude the app from the recent task list. Works on Android 5.0+.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
|
||||
@@ -441,7 +441,7 @@ export class BLE extends IonicNativePlugin {
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static readRSSI(
|
||||
readRSSI(
|
||||
deviceId: string,
|
||||
): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Bluetooth Serial
|
||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
|
||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino (not Android to Android or iOS to iOS).
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
|
||||
|
||||
@@ -85,6 +85,42 @@ export interface CameraPopoverOptions {
|
||||
arrowDir: number;
|
||||
}
|
||||
|
||||
export enum DestinationType {
|
||||
DATA_URL = 0,
|
||||
FILE_URL,
|
||||
NATIVE_URI
|
||||
}
|
||||
|
||||
export enum EncodingType {
|
||||
JPEG = 0,
|
||||
PNG
|
||||
}
|
||||
|
||||
export enum MediaType {
|
||||
PICTURE = 0,
|
||||
VIDEO,
|
||||
ALLMEDIA
|
||||
}
|
||||
|
||||
export enum PictureSourceType {
|
||||
PHOTOLIBRARY = 0,
|
||||
CAMERA,
|
||||
SAVEDPHOTOALBUM
|
||||
}
|
||||
|
||||
export enum PopoverArrowDirection {
|
||||
ARROW_UP = 1,
|
||||
ARROW_DOWN,
|
||||
ARROW_LEFT,
|
||||
ARROW_RIGHT,
|
||||
ARROW_ANY
|
||||
}
|
||||
|
||||
export enum Direction {
|
||||
BACK = 0,
|
||||
FRONT
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Camera
|
||||
* @description
|
||||
|
||||
@@ -133,6 +133,11 @@ export interface CardIOResponse {
|
||||
* @name Card IO
|
||||
* @description
|
||||
* @usage
|
||||
* Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element.
|
||||
* ```xml
|
||||
*<key>NSCameraUsageDescription</key>
|
||||
*<string>To scan credit cards.</string>
|
||||
*```
|
||||
* ```typescript
|
||||
* import { CardIO } from '@ionic-native/card-io';
|
||||
*
|
||||
@@ -147,7 +152,7 @@ export interface CardIOResponse {
|
||||
* if(res){
|
||||
* let options = {
|
||||
* requireExpiry: true,
|
||||
* requireCCV: false,
|
||||
* requireCVV: false,
|
||||
* requirePostalCode: false
|
||||
* };
|
||||
* CardIO.scan(options);
|
||||
|
||||
@@ -29,10 +29,10 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Clipboard',
|
||||
plugin: 'danielsogl-cordova-plugin-clipboard',
|
||||
plugin: 'cordova-clipboard',
|
||||
pluginRef: 'cordova.plugins.clipboard',
|
||||
repo: 'https://github.com/danielsogl/cordova-plugin-clipboard',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||
repo: 'https://github.com/ihadeed/cordova-clipboard',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
@Injectable()
|
||||
export class Clipboard extends IonicNativePlugin {
|
||||
|
||||
@@ -10,14 +10,53 @@ import { Injectable } from '@angular/core';
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CouchbaseLite } from '@ionic-native/couchbase-lite';
|
||||
*
|
||||
* constructor(private couchbase: CouchbaseLite) {
|
||||
*
|
||||
* couchbase.getURL()
|
||||
* .then(url => console.log(url))
|
||||
* .catch(error => console.error(error));
|
||||
*
|
||||
* import { Http } from '@angular/http';
|
||||
* import { Observable } from 'rxjs/Observable'
|
||||
* constructor(private couchbase: CouchbaseLite, private platform:Platform,private _http:Http) {
|
||||
* this.initMethod();
|
||||
* }
|
||||
* url:string;
|
||||
* initMethod() {
|
||||
* this.couchbase.getURL().then((url)=> {
|
||||
* this.url = url;
|
||||
* })
|
||||
* }
|
||||
* getUrl() {
|
||||
* return this.url;
|
||||
* }
|
||||
* // DATABASES //
|
||||
* createDatabase(database_name:string) {
|
||||
* let url = this.getUrl();
|
||||
* url = url+database_name;
|
||||
* return this._http
|
||||
* .put(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
* deleteDatabase(database_name:string) {
|
||||
* let url = this.getUrl();
|
||||
* url = url+database_name;
|
||||
* return this._http
|
||||
* .delete(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
*
|
||||
* getAllDbs() {
|
||||
* let url = this.getUrl();
|
||||
* url = url+'_all_dbs';
|
||||
* return this._http
|
||||
* .get(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* })
|
||||
* }
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -1,28 +1,46 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
interface Cordova {
|
||||
plugins: CordovaPlugins & { email: any };
|
||||
}
|
||||
|
||||
declare const cordova: Cordova;
|
||||
|
||||
export interface EmailComposerOptions {
|
||||
|
||||
/**
|
||||
* App to send the email with
|
||||
*/
|
||||
app?: string;
|
||||
|
||||
/**
|
||||
* Email address(es) for To field
|
||||
*/
|
||||
to?: string | Array<string>;
|
||||
|
||||
/**
|
||||
* Email address(es) for CC field
|
||||
*/
|
||||
cc?: string | Array<string>;
|
||||
|
||||
/**
|
||||
* Email address(es) for BCC field
|
||||
*/
|
||||
bcc?: string | Array<string>;
|
||||
|
||||
attachments?: Array<any>;
|
||||
/**
|
||||
* File paths or base64 data streams
|
||||
*/
|
||||
attachments?: string[];
|
||||
|
||||
/**
|
||||
* Subject of the email
|
||||
*/
|
||||
subject?: string;
|
||||
|
||||
/**
|
||||
* Email body (for HTML, set isHtml to true)
|
||||
*/
|
||||
body?: string;
|
||||
|
||||
/**
|
||||
* Indicates if the body is HTML or plain text
|
||||
*/
|
||||
isHtml?: boolean;
|
||||
|
||||
}
|
||||
@@ -67,16 +85,27 @@ export interface EmailComposerOptions {
|
||||
*
|
||||
* // Send a text message using default options
|
||||
* this.emailComposer.open(email);
|
||||
* ```
|
||||
*
|
||||
* You can also assign aliases to email apps
|
||||
* ```ts
|
||||
* // add alias
|
||||
* this.email.addAlias('gmail', 'com.google.android.gm');
|
||||
*
|
||||
* // then use alias when sending email
|
||||
* this.email.open({
|
||||
* app: 'gmail',
|
||||
* ...
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* EmailComposerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'EmailComposer',
|
||||
plugin: 'cordova-plugin-email',
|
||||
plugin: 'cordova-plugin-email-composer',
|
||||
pluginRef: 'cordova.plugins.email',
|
||||
repo: 'https://github.com/hypery2k/cordova-email-plugin',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-email-composer',
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
@@ -92,7 +121,7 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
isAvailable(app?: string): Promise<any> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
if (app) {
|
||||
cordova.plugins.email.isAvailable(app, (isAvailable: boolean) => {
|
||||
EmailComposer.getPlugin().isAvailable(app, (isAvailable: boolean) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
@@ -100,7 +129,7 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cordova.plugins.email.isAvailable((isAvailable: boolean) => {
|
||||
EmailComposer.getPlugin().isAvailable((isAvailable: boolean) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
@@ -111,6 +140,26 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
requestPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the app has a permission to access email accounts information
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 2
|
||||
})
|
||||
hasPermission(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Adds a new mail app alias.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Extended Device Information
|
||||
* @description
|
||||
* Retrieves additional device information that is not provided by other plugins
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information';
|
||||
*
|
||||
*
|
||||
* constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ExtendedDeviceInformation',
|
||||
plugin: 'cordova-plugin-extended-device-information',
|
||||
pluginRef: 'extended-device-information',
|
||||
repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class ExtendedDeviceInformation extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the device's memory size
|
||||
*/
|
||||
@CordovaProperty
|
||||
memory: number;
|
||||
|
||||
/**
|
||||
* Get the device's CPU mhz
|
||||
*/
|
||||
@CordovaProperty
|
||||
cpumhz: string;
|
||||
|
||||
/**
|
||||
* Get the total storage
|
||||
*/
|
||||
@CordovaProperty
|
||||
totalstorage: string;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaInstance, Plugin, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
declare const FileTransfer: any;
|
||||
|
||||
export interface FileUploadOptions {
|
||||
|
||||
/**
|
||||
@@ -109,21 +107,21 @@ export interface FileTransferError {
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Transfer
|
||||
* @name File Transfer
|
||||
*
|
||||
* @description
|
||||
* This plugin allows you to upload and download files.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Transfer, FileUploadOptions, TransferObject } from '@ionic-native/transfer';
|
||||
* import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';
|
||||
* import { File } from '@ionic-native/file';
|
||||
*
|
||||
* constructor(private transfer: Transfer, private file: File) { }
|
||||
* constructor(private transfer: FileTransfer, private file: File) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* const fileTransfer: TransferObject = this.transfer.create();
|
||||
* const fileTransfer: FileTransferObject = this.transfer.create();
|
||||
*
|
||||
* // Upload a file:
|
||||
* fileTransfer.upload(..).then(..).catch(..);
|
||||
@@ -170,7 +168,7 @@ export interface FileTransferError {
|
||||
* FileUploadResult
|
||||
* FileTransferError
|
||||
* @classes
|
||||
* TransferObject
|
||||
* FileTransferObject
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileTransfer',
|
||||
@@ -180,7 +178,7 @@ export interface FileTransferError {
|
||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class Transfer extends IonicNativePlugin {
|
||||
export class FileTransfer extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Error code rejected from upload with FileTransferError
|
||||
@@ -202,10 +200,10 @@ export class Transfer extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Creates a new FileTransfer object
|
||||
* @return {TransferObject}
|
||||
* @return {FileTransferObject}
|
||||
*/
|
||||
create(): TransferObject {
|
||||
return new TransferObject();
|
||||
create(): FileTransferObject {
|
||||
return new FileTransferObject();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -217,12 +215,12 @@ export class Transfer extends IonicNativePlugin {
|
||||
plugin: 'cordova-plugin-file-transfer',
|
||||
pluginName: 'FileTransfer'
|
||||
})
|
||||
export class TransferObject {
|
||||
export class FileTransferObject {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor() {
|
||||
if (checkAvailability('FileTransfer', null, 'FileTransfer') === true) {
|
||||
this._objectInstance = new FileTransfer();
|
||||
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
|
||||
this._objectInstance = new (FileTransfer.getPlugin())();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,9 +237,7 @@ export class TransferObject {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
|
||||
return;
|
||||
}
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> { return; }
|
||||
|
||||
/**
|
||||
* Downloads a file from server.
|
||||
@@ -256,9 +252,7 @@ export class TransferObject {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
download(source: string, target: string, trustAllHosts?: boolean, options?: { [s: string]: any; }): Promise<any> {
|
||||
return;
|
||||
}
|
||||
download(source: string, target: string, trustAllHosts?: boolean, options?: { [s: string]: any; }): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Registers a listener that gets called whenever a new chunk of data is transferred.
|
||||
@@ -276,5 +270,5 @@ export class TransferObject {
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
})
|
||||
abort(): void { }
|
||||
abort(): void {}
|
||||
}
|
||||
@@ -17,6 +17,16 @@ export interface FingerprintOptions {
|
||||
* Disable 'use backup' option. Only for android (optional)
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
|
||||
/**
|
||||
* Title of fallback button. Only for iOS
|
||||
*/
|
||||
localizedFallbackTitle?: string;
|
||||
|
||||
/**
|
||||
* Description in authentication dialogue. Only for iOS
|
||||
*/
|
||||
localizedReason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +46,9 @@ export interface FingerprintOptions {
|
||||
* this.faio.show({
|
||||
* clientId: 'Fingerprint-Demo',
|
||||
* clientSecret: 'password', //Only necessary for Android
|
||||
* disableBackup:true //Only for Android(optional)
|
||||
* disableBackup:true, //Only for Android(optional)
|
||||
* localizedFallbackTitle: 'Use Pin', //Only for iOS
|
||||
* localizedReason: 'Please authenticate' //Only for iOS
|
||||
* })
|
||||
* .then((result: any) => console.log(result))
|
||||
* .catch((error: any) => console.log(error));
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* @description
|
||||
* Cordova plugin for Firebase Analytics
|
||||
*
|
||||
* Go yo firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||
*
|
||||
* NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
|
||||
*
|
||||
@@ -49,7 +49,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
|
||||
/**
|
||||
* Sets the user ID property.
|
||||
* This feature must be used in accordance with Google's Privacy Policy.
|
||||
* @param id {string} THe user ID
|
||||
* @param id {string} The user ID
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -15,7 +15,8 @@ export interface DynamicLinksOptions {
|
||||
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
|
||||
*
|
||||
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
|
||||
*
|
||||
* Variable REVERSED_CLIENT_ID can be found in your GoogleService-Info.plist under the same key name.
|
||||
* Variable PHOTO_LIBRARY_USAGE_DESCRIPTION specifies required value for NSPhotoLibraryUsageDescription on iOS.
|
||||
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||
*
|
||||
* Preferences:
|
||||
|
||||
@@ -71,10 +71,10 @@ export class Firebase extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check permission to receive push notifications
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<{isEnabled: boolean}>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<any> { return; }
|
||||
hasPermission(): Promise<{isEnabled: boolean}> { return; }
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
@@ -107,6 +107,13 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
unsubscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Unregister from firebase, used to stop receiving push notifications.
|
||||
* Call this when you logout user from your app.
|
||||
*/
|
||||
@Cordova()
|
||||
unregister(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
* @param type {string}
|
||||
|
||||
@@ -85,7 +85,7 @@ declare const window: any;
|
||||
@Injectable()
|
||||
export class Geofence extends IonicNativePlugin {
|
||||
|
||||
public TransitionType = {
|
||||
TransitionType = {
|
||||
ENTER: 1,
|
||||
EXIT: 2,
|
||||
BOTH: 3
|
||||
@@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onTrasitionReceived(): Observable<any> { return; };
|
||||
onTransitionReceived(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||
@@ -139,20 +139,6 @@ export class Geofence extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
getWatched(): Promise<string> { return; };
|
||||
|
||||
/**
|
||||
* Called when a geofence is crossed in the direction specified by `TransitType`.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
onTransitionReceived(): Observable<any> {
|
||||
|
||||
return new Observable<any>((observer) => {
|
||||
window && window.geofence && (window.geofence.onTransitionReceived = observer.next.bind(observer));
|
||||
return () => window.geofence.onTransitionReceived = () => { };
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||
*
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -102,7 +102,7 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Track custom metric
|
||||
* @param key {string}
|
||||
* @param key {number}
|
||||
* @param value {any}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ export class GoogleAnalytics extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
trackMetric(key: string, value?: any): Promise<any> { return; }
|
||||
trackMetric(key: number, value?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,9 +59,9 @@ export interface HTTPResponse {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HTTP',
|
||||
plugin: 'cordova-plugin-http',
|
||||
pluginRef: 'cordovaHTTP',
|
||||
repo: 'https://github.com/wymsee/cordova-HTTP',
|
||||
plugin: 'cordova-plugin-advanced-http',
|
||||
pluginRef: 'cordova.plugin.http',
|
||||
repo: 'https://github.com/silkimen/cordova-plugin-advanced-http',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
@@ -92,6 +92,34 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova({ sync: true })
|
||||
setHeader(header: string, value: string): void { }
|
||||
|
||||
/**
|
||||
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
|
||||
* @param serializer {string} The name of the serializer. Can be urlencoded or json
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setDataSerializer(serializer: string): void { }
|
||||
|
||||
/**
|
||||
* Clear all cookies
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
clearCookies(): void { }
|
||||
|
||||
/**
|
||||
* Remove cookies
|
||||
* @param url {string}
|
||||
* @param cb
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
removeCookies(url: string, cb: () => void): void { }
|
||||
|
||||
/**
|
||||
* Set request timeout
|
||||
* @param timeout {number} The timeout in seconds. Default 60
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setRequestTimeout(timeout: number): void { }
|
||||
|
||||
/**
|
||||
* Enable or disable SSL Pinning. This defaults to false.
|
||||
*
|
||||
@@ -131,7 +159,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* Make a GET request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
@@ -140,6 +168,36 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
* Make a PUT request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
* Make a DELETE request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
* Make a HEAD request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param url {string} The url to send the request to
|
||||
|
||||
180
src/@ionic-native/plugins/hyper-track/index.ts
Normal file
180
src/@ionic-native/plugins/hyper-track/index.ts
Normal file
@@ -0,0 +1,180 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name HyperTrack
|
||||
* @description
|
||||
* HyperTrack cordova plugin wrapper for Ionic Native. Location-based services provider.
|
||||
* Make sure to include your publishable key at config.xml (see [HyperTrack Cordova Setup](https://docs.hypertrack.com/sdks/cordova/setup.html#step-2-configure-the-sdk)).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { HyperTrack } from '@ionic-native/hyper-track';
|
||||
*
|
||||
* constructor(private hyperTrack: HyperTrack) { }
|
||||
*
|
||||
* // Check if app has location permissions enabled
|
||||
* this.hyperTrack.checkLocationPermission().then(response => {
|
||||
* // response (String) can be "true" or "false"
|
||||
* if (response != "true") {
|
||||
* // Ask for permissions
|
||||
* this.hyperTrack.requestPermissions().then(response => {}, error => {});
|
||||
* }
|
||||
* }, error => {});
|
||||
*
|
||||
* // Check if app has location services enabled
|
||||
* this.hyperTrack.checkLocationServices().then(response => {
|
||||
* // response (String) can be "true" or "false"
|
||||
* if (response != "true") {
|
||||
* // Request services to be enabled
|
||||
* this.hyperTrack.requestLocationServices().then(response => {}, error => {});
|
||||
* }
|
||||
* }, error => {});
|
||||
*
|
||||
* // First set the current user. This can be done via getOrCreateUser() or setUserId()
|
||||
* this.hyperTrack.setUserId("xxx").then(user => {
|
||||
* // user (String) is a String representation of a User's JSON
|
||||
*
|
||||
* this.hyperTrack.startTracking().then(userId => {}, trackingError => {});
|
||||
*
|
||||
* this.hyperTrack.createAndAssignAction('visit', 'lookupId','address', 20.12, -100.3).then(action => {
|
||||
* // Handle action. It's a String representation of the Action's JSON. For example:
|
||||
* // '{"eta":"Jul 17, 2017 12:50:03 PM","assigned_at":"Jul 17, 2017 12:34:38 PM",,"distance":"0.0",...}'
|
||||
* }, error => {});
|
||||
*
|
||||
* // You can complete an action with completeAction() or completeActionWithLookupId()
|
||||
* this.hyperTrack.completeAction('action-id').then(response => {
|
||||
* // Handle response (String). Should be "OK".
|
||||
* }, error => {});
|
||||
*
|
||||
* this.hyperTrack.getCurrentLocation().then(location => {
|
||||
* // Handle location. It's a String representation of a Location's JSON.For example:
|
||||
* // '{"mAccuracy":22.601,,"mLatitude":23.123456, "mLongitude":-100.1234567, ...}'
|
||||
* }, error => {});
|
||||
*
|
||||
* this.hyperTrack.stopTracking().then(success => {
|
||||
* // Handle success (String). Should be "OK".
|
||||
* }, error => {});
|
||||
*
|
||||
* }, error => {});*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'HyperTrack',
|
||||
plugin: 'cordova-plugin-hypertrack',
|
||||
pluginRef: 'cordova.plugins.HyperTrack',
|
||||
repo: 'https://github.com/hypertrack/hypertrack-cordova',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class HyperTrack extends IonicNativePlugin {
|
||||
/**
|
||||
* Returns given text. For testing purposes.
|
||||
* @param {String} text Given text to print
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result text (which is the same as the given text) if successful, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
helloWorld(text: String): Promise<String> { return; }
|
||||
|
||||
/**
|
||||
* Create a new user to identify the current device or get a user from a lookup id.
|
||||
* @param {String} name User's name
|
||||
* @param {String} phone User's phone
|
||||
* @param {String} photo User's photo as URL or a Base64 converted string
|
||||
* @param {String} lookupId User's lookupId, which is used to check if a new user is to be created (in this case you could set it to an internal reference for the user that you can use later to identify it), or if one with an existing lookupId is to be used.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the User's JSON, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
getOrCreateUser(name: String, phone: String, photo: String, lookupId: String): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set UserId for the SDK created using HyperTrack APIs. This is useful if you already have a user previously created.
|
||||
* @param {String} userId User's ID
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred. An "OK" response doesn't necessarily mean that the userId was found. It just means that it was set correctly.
|
||||
*/
|
||||
@Cordova()
|
||||
setUserId(userId: String): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable the SDK and start tracking. This will fail if there is no user set.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the userId (String) of the User being tracked if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
|
||||
*/
|
||||
@Cordova()
|
||||
startTracking(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Create and assign an action to the current user using specified parameters
|
||||
* @param {String} type The action type. Can be one from "pickup", "delivery", "dropoff", "visit", "stopover" or "task"
|
||||
* @param {String} lookupId The Action's desired lookupId
|
||||
* @param {String} expectedPlaceAddress The address of the Action
|
||||
* @param {Number} expectedPlaceLatitude The latitude of the Action
|
||||
* @param {Number} expectedPlaceLongitude The longitude of the Action
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Action's JSON, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
createAndAssignAction(type: String, lookupId: String, expectedPlaceAddress: String, expectedPlaceLatitude: Number, expectedPlaceLongitude: Number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Complete an action from the SDK by its ID
|
||||
* @param {String} actionId ID of the Action that will be marked as completed
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
completeAction(actionId: String): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Complete an action from the SDK using Action's lookupId as parameter
|
||||
* @param {String} lookupId Lookup ID of the Action that will be marked as completed
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
completeActionWithLookupId(lookupId: String): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Disable the SDK and stop tracking.
|
||||
* Needs user setting (via getOrCreateUser() or setUserId()) first.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the an "OK" string if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
|
||||
*/
|
||||
@Cordova()
|
||||
stopTracking(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get user's current location from the SDK
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Location's JSON, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
getCurrentLocation(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if Location permission has been granted to the app (for Android).
|
||||
* Returns "true" or "false" in success method accordingly.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location permission was granted, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
checkLocationPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request user to grant Location access to the app (for Anrdoid).
|
||||
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location access was given to the app, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
requestPermissions(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if Location services are enabled on the device (for Android).
|
||||
* Returns "true" or "false" in success method accordingly.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location services are enabled, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
checkLocationServices(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request user to enable Location services on the device.
|
||||
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location services were enabled, or it gets rejected if an error ocurred.
|
||||
*/
|
||||
@Cordova()
|
||||
requestLocationServices(): Promise<any> { return; }
|
||||
}
|
||||
@@ -57,10 +57,10 @@ export interface ImagePickerOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ImagePicker',
|
||||
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker.git',
|
||||
plugin: 'cordova-plugin-telerik-imagepicker',
|
||||
pluginRef: 'window.imagePicker',
|
||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||
install: 'ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
|
||||
install: 'ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
|
||||
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
|
||||
@@ -42,11 +42,6 @@ export interface ImageResizerOptions {
|
||||
* @description
|
||||
* Cordova Plugin For Image Resize
|
||||
*
|
||||
* Requires plugin `info.protonet.imageresizer` - use the Ionic CLI and type in the following command:
|
||||
* `ionic cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git`
|
||||
*
|
||||
* For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ImageResizer, ImageResizerOptions } from '@ionic-native/image-resizer';
|
||||
@@ -74,9 +69,9 @@ export interface ImageResizerOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ImageResizer',
|
||||
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
|
||||
plugin: 'info.protonet.imageresizer',
|
||||
pluginRef: 'ImageResizer',
|
||||
repo: 'https://github.com/protonet/cordova-plugin-image-resizer',
|
||||
repo: 'https://github.com/JoschkaSchulz/cordova-plugin-image-resizer',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
@@ -13,9 +13,10 @@ import { Injectable } from '@angular/core';
|
||||
* constructor(private store: InAppPurchase2) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* * @advanced
|
||||
*
|
||||
*
|
||||
* ```typescript
|
||||
* // After Platform Ready
|
||||
* this.store.verbosity = this.store.DEBUG;
|
||||
@@ -34,12 +35,12 @@ import { Injectable } from '@angular/core';
|
||||
* this.store.when(productId).updated( (product: IAPProduct) => {
|
||||
* console.log('Loaded' + JSON.stringify(product));
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Issue with buying
|
||||
* this.store.when(productId).cancelled( (product) => {
|
||||
* alert('Purchase was Cancelled');
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // Track All Store Errors
|
||||
* this.store.error( (err) => {
|
||||
* alert('Store Error ' + JSON.stringify(err));
|
||||
@@ -54,15 +55,15 @@ import { Injectable } from '@angular/core';
|
||||
*
|
||||
* // Errors
|
||||
* this.store.when(productId).error( (error) => {
|
||||
* this.loader.dismiss();
|
||||
* this.loader.dismiss();
|
||||
* alert('An Error Occured' + JSON.stringify(error));
|
||||
* });
|
||||
* // Refresh Starts Handlers
|
||||
* // Refresh Starts Handlers
|
||||
* console.log('Refresh Store');
|
||||
* this.store.refresh();
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* // To Purchase
|
||||
* this.store.order(productId);
|
||||
*
|
||||
@@ -168,6 +169,9 @@ export interface IAPProductEvents {
|
||||
downloaded: (callback: IAPQueryCallback) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class IAPError {
|
||||
code: number;
|
||||
message: string;
|
||||
|
||||
136
src/@ionic-native/plugins/index-app-content/index.ts
Normal file
136
src/@ionic-native/plugins/index-app-content/index.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface IndexItem {
|
||||
domain: string;
|
||||
identifier: string;
|
||||
title: string;
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* Url to image
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Item keywords
|
||||
*/
|
||||
keywords?: Array<string>;
|
||||
|
||||
/**
|
||||
* Lifetime in minutes
|
||||
*/
|
||||
lifetime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Index App Content
|
||||
* @description
|
||||
* This plugin gives you a Javascript API to interact with Core Spotlight on iOS (=> iOS 9).
|
||||
* You can add, update and delete items to the spotlight search index.
|
||||
* Spotlight Search will include these items in the result list. You can deep-link the search results with your app.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { IndexAppContent } from '@ionic-native/index-app-content';
|
||||
*
|
||||
*
|
||||
* constructor(private indexAppContent: IndexAppContent) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* var items = [
|
||||
* {
|
||||
* domain: 'com.my.domain',
|
||||
* identifier: '88asdf7dsf',
|
||||
* title: 'Foo',
|
||||
* description: 'Bar',
|
||||
* url: 'http://location/of/my/image.jpg',
|
||||
* },
|
||||
* {
|
||||
* domain: 'com.other.domain',
|
||||
* identifier: '9asd67g6a',
|
||||
* title: 'Baz',
|
||||
* description: 'Woot',
|
||||
* url: 'http://location/of/my/image2.jpg',
|
||||
* }
|
||||
* ];
|
||||
*
|
||||
* this.indexAppContent.setItems(items)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IndexAppContent',
|
||||
plugin: 'cordova-plugin-indexappcontent',
|
||||
pluginRef: 'window.plugins.indexAppContent',
|
||||
repo: 'https://github.com/johanblomgren/cordova-plugin-indexappcontent',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class IndexAppContent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* The option to index app content might not be available at all due to device limitations or user settings.
|
||||
* Therefore it's highly recommended to check upfront if indexing is possible.
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with true if indexing is available, false if not
|
||||
*/
|
||||
@Cordova()
|
||||
isIndexingAvailable(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or change items to spotlight index
|
||||
* @param {Array<IndexItem>} Array of items to index
|
||||
* @return {Promise<any>} Returns if index set was successfull
|
||||
*/
|
||||
@Cordova()
|
||||
setItems(items: Array<IndexItem>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If user taps on a search result in spotlight then the app will be launched.
|
||||
* You can register a Javascript handler to get informed when this happens.
|
||||
* @param {IndexItem} Clicked Item
|
||||
* @return {Promise<any>} Returns promise
|
||||
*/
|
||||
@Cordova()
|
||||
onItemPressed(payload: IndexItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all items stored for a given array of domains
|
||||
* @param {Array<string>} Array of domains to clear
|
||||
* @return {Promise<any>} Resolve if successfull
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForDomains(domains: Array<string>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all items stored for a given array of identifiers
|
||||
* @param {Array<string>} Array of identifiers to clear
|
||||
* @return {Promise<any>} Resolve if successfull
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* You might want to avoid to update spotlight index too frequently.
|
||||
* Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)!
|
||||
* @param {number} Numeric value => 0
|
||||
*/
|
||||
@Cordova()
|
||||
setIndexingInterval(intervalMinutes: number) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
88
src/@ionic-native/plugins/keychain-touch-id/index.ts
Normal file
88
src/@ionic-native/plugins/keychain-touch-id/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Keychain Touch Id
|
||||
* @description
|
||||
* A cordova plugin adding the iOS TouchID / Android fingerprint to your
|
||||
* app and allowing you to store a password securely in the device keychain.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { KeychainTouchId } from '@ionic-native/keychain-touch-id';
|
||||
*
|
||||
*
|
||||
* constructor(private keychainTouchId: KeychainTouchId) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.keychainTouchId.isAvailable()
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'KeychainTouchId',
|
||||
plugin: 'cordova-plugin-keychain-touch-id',
|
||||
pluginRef: 'plugins.touchid',
|
||||
repo: 'https://github.com/sjhoeksma/cordova-plugin-keychain-touch-id',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class KeychainTouchId extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check if Touch ID / Fingerprint is supported by the device
|
||||
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
|
||||
*/
|
||||
@Cordova()
|
||||
isAvailable(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
|
||||
* successful authentication using fingerprint
|
||||
* @param key {string} the key you want to store
|
||||
* @param password {string} the password you want to encrypt and store
|
||||
* @return {Promise<any>} Returns a promise that resolves when there is a result
|
||||
*/
|
||||
@Cordova()
|
||||
save(key: string, password: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve
|
||||
* with the password stored in keychain or will resolve an error code, where -1 indicated not available.
|
||||
* @param key {string} the key you want to retrieve from keychain
|
||||
* @param message {string} a message to the user
|
||||
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
|
||||
*/
|
||||
@Cordova()
|
||||
verify(key: string, message: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if there is a password stored within the keychain for the given key.
|
||||
* @param key {string} the key you want to check from keychain
|
||||
* @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
|
||||
*/
|
||||
@Cordova()
|
||||
has(key: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Deletes the password stored under given key from the keychain.
|
||||
* @param key {string} the key you want to delete from keychain
|
||||
* @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
|
||||
*/
|
||||
@Cordova()
|
||||
delete(key: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets the language of the fingerprint dialog
|
||||
* @param locale {string} locale subtag from [this list](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
|
||||
*/
|
||||
@Cordova()
|
||||
setLocale(locale: string): void {}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-ios-keychain`. For more info, please see the [Keychain plugin docs](https://github.com/ionic-team/cordova-plugin-ios-keychain).
|
||||
*
|
||||
* See also [Secure Storage](https://ionicframework.com/docs/native/secure-storage/) for more supported platforms.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Keychain } from '@ionic-native/keychain';
|
||||
|
||||
@@ -1,10 +1,125 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface PromptsOptions {
|
||||
|
||||
/**
|
||||
* a function to pass the user's decision whether to remember their choice of app.
|
||||
* This will be passed a single boolean value indicating the user's decision.
|
||||
* @param rememberChoice
|
||||
*/
|
||||
callback?: (rememberChoice: boolean) => void;
|
||||
|
||||
/**
|
||||
* text to display in the native prompt header asking user whether to remember their choice.
|
||||
* Defaults to "Remember your choice?" if not specified.
|
||||
*/
|
||||
headerText?: string;
|
||||
|
||||
/**
|
||||
* text to display in the native prompt body asking user whether to remember their choice.
|
||||
* Defaults to "Use the same app for navigating next time?" if not specified.
|
||||
*/
|
||||
bodyText?: string;
|
||||
|
||||
|
||||
/**
|
||||
* text to display for the Yes button.
|
||||
* Defaults to "Yes" if not specified.
|
||||
*/
|
||||
yesButtonText?: string;
|
||||
|
||||
/**
|
||||
* text to display for the No button.
|
||||
* Defaults to "No" if not specified.
|
||||
*/
|
||||
noButtonText?: string;
|
||||
}
|
||||
|
||||
export interface RememberChoiceOptions {
|
||||
|
||||
/**
|
||||
* whether to remember user choice of app for next time, instead of asking again for user choice.
|
||||
* `"prompt"` - Prompt user to decide whether to remember choice.
|
||||
* - Default value if unspecified.
|
||||
* - If `promptFn` is defined, this will be used for user confirmation.
|
||||
* - Otherwise (by default), a native dialog will be displayed to ask user.
|
||||
* `false` - Do not remember user choice.
|
||||
* `true` - Remember user choice.
|
||||
*/
|
||||
enabled?: boolean | string;
|
||||
|
||||
|
||||
/**
|
||||
* a function which asks the user whether to remember their choice of app.
|
||||
* If this is defined, then the default dialog prompt will not be shown, allowing for a custom UI for asking the user.
|
||||
* This will be passed a callback function which should be invoked with a single boolean argument which indicates the user's decision to remember their choice.
|
||||
* @param callback
|
||||
*/
|
||||
promptFn?: (callback: (rememberChoice: boolean) => void) => void;
|
||||
|
||||
/**
|
||||
* options related to the default dialog prompt used to ask the user whether to remember their choice of app.
|
||||
*/
|
||||
prompt?: PromptsOptions;
|
||||
}
|
||||
|
||||
export interface AppSelectionOptions {
|
||||
/**
|
||||
* text to display in the native picker which enables user to select which navigation app to launch.
|
||||
* Defaults to "Select app for navigation" if not specified.
|
||||
*/
|
||||
dialogHeaderText?: string;
|
||||
|
||||
/**
|
||||
* text to display for the cancel button in the native picker which enables user to select which navigation app to launch.
|
||||
* Defaults to "Cancel" if not specified.
|
||||
*/
|
||||
cancelButtonText?: string;
|
||||
|
||||
/**
|
||||
* List of apps, defined as `launchnavigator.APP` constants, which should be displayed in the picker if the app is available.
|
||||
* This can be used to restrict which apps are displayed, even if they are installed.
|
||||
* By default, all available apps will be displayed.
|
||||
*/
|
||||
list?: string[];
|
||||
|
||||
/**
|
||||
* Callback to invoke when the user selects an app in the native picker.
|
||||
* A single string argument is passed which is the app what was selected defined as a `launchnavigator.APP` constant.
|
||||
*/
|
||||
callback?: (app: string) => void;
|
||||
|
||||
/**
|
||||
* (Android only) native picker theme. Specify using `actionsheet.ANDROID_THEMES` constants.
|
||||
* Default `actionsheet.ANDROID_THEMES.THEME_HOLO_LIGHT`
|
||||
*/
|
||||
androidTheme?: number;
|
||||
|
||||
/**
|
||||
* options related to whether to remember user choice of app for next time, instead of asking again for user choice.
|
||||
*/
|
||||
rememberChoice?: RememberChoiceOptions;
|
||||
}
|
||||
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
/**
|
||||
* name of the navigation app to use for directions. Specify using launchnavigator.APP constants. If not specified, defaults to User Selection.
|
||||
* A callback to invoke when the navigation app is successfully launched.
|
||||
*/
|
||||
successCallback?: Function;
|
||||
|
||||
/**
|
||||
* A callback to invoke if an error is encountered while launching the app.
|
||||
* A single string argument containing the error message will be passed in.
|
||||
*/
|
||||
errorCallback?: (error: string) => void;
|
||||
|
||||
/**
|
||||
* name of the navigation app to use for directions.
|
||||
* Specify using launchnavigator.APP constants.
|
||||
* e.g. `launchnavigator.APP.GOOGLE_MAPS`.
|
||||
* If not specified, defaults to User Selection.
|
||||
*/
|
||||
app?: string;
|
||||
|
||||
@@ -14,7 +129,12 @@ export interface LaunchNavigatorOptions {
|
||||
destinationName?: string;
|
||||
|
||||
/**
|
||||
* Start point of the navigation
|
||||
* Start point of the navigation.
|
||||
* If not specified, the current device location will be used.
|
||||
* Either:
|
||||
* - a {string} containing the address. e.g. "Buckingham Palace, London"
|
||||
* - a {string} containing a latitude/longitude coordinate. e.g. "50.1. -4.0"
|
||||
* - an {array}, where the first element is the latitude and the second element is a longitude, as decimal numbers. e.g. [50.1, -4.0]
|
||||
*/
|
||||
start?: string | number[];
|
||||
|
||||
@@ -39,23 +159,82 @@ export interface LaunchNavigatorOptions {
|
||||
extras?: any;
|
||||
|
||||
/**
|
||||
* (Android only) mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified. Specify using launchnavigator.LAUNCH_MODE constants.
|
||||
* (Android only) mode in which to open Google Maps app.
|
||||
* `launchnavigator.LAUNCH_MODE.MAPS` or `launchnavigator.LAUNCH_MODE.TURN_BY_TURN`
|
||||
* Defaults to `launchnavigator.LAUNCH_MODE.MAPS` if not specified.
|
||||
*/
|
||||
launchMode?: string;
|
||||
launchModeGoogleMaps?: string;
|
||||
|
||||
/**
|
||||
* text to display in the native picker which enables user to select which navigation app to launch. Defaults to "Select app for navigation" if not specified.
|
||||
* (iOS only) method to use to open Apple Maps app.
|
||||
* `launchnavigator.LAUNCH_MODE.URI_SCHEME` or `launchnavigator.LAUNCH_MODE.MAPKIT`
|
||||
* Defaults to `launchnavigator.LAUNCH_MODE.URI_SCHEME` if not specified.
|
||||
*/
|
||||
appSelectionDialogHeader?: string;
|
||||
launchModeAppleMaps?: string;
|
||||
|
||||
|
||||
/**
|
||||
* text to display for the cancel button in the native picker which enables user to select which navigation app to launch. Defaults to "Cancel" if not specified.
|
||||
* If true, and input location type(s) doesn't match those required by the app, use geocoding to obtain the address/coords as required. Defaults to true.
|
||||
*/
|
||||
appSelectionCancelButton?: string;
|
||||
enableGeolocation?: boolean;
|
||||
|
||||
successCallback?: Function;
|
||||
/**
|
||||
* options related to the default native actionsheet picker which enables user to select which navigation app to launch if `app` is not specified.
|
||||
*/
|
||||
appSelection?: AppSelectionOptions;
|
||||
}
|
||||
|
||||
errorCallback?: Function;
|
||||
export interface UserChoice {
|
||||
|
||||
/**
|
||||
* Indicates whether a user choice exists for a preferred navigator app.
|
||||
* @param callback - function to pass result to: will receive a boolean argument.
|
||||
*/
|
||||
exists: (callback: (exists: boolean) => void) => void;
|
||||
|
||||
/**
|
||||
* Returns current user choice of preferred navigator app.
|
||||
* @param callback - function to pass result to: will receive a string argument indicating the app, which is a constant in `launchnavigator.APP`.
|
||||
*/
|
||||
get: (callback: (app: string) => void) => void;
|
||||
|
||||
/**
|
||||
* Sets the current user choice of preferred navigator app.
|
||||
* @param app - app to set as preferred choice as a constant in `launchnavigator.APP`.
|
||||
* @param callback - function to call once operation is complete.
|
||||
*/
|
||||
set: (app: string, callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* Clears the current user choice of preferred navigator app.
|
||||
* @param callback - function to call once operation is complete.
|
||||
*/
|
||||
clear: (callback: () => void) => void;
|
||||
}
|
||||
|
||||
export interface UserPrompted {
|
||||
/**
|
||||
* Indicates whether user has already been prompted whether to remember their choice a preferred navigator app.
|
||||
* @param callback - function to pass result to: will receive a boolean argument.
|
||||
*/
|
||||
get: (callback: (exists: boolean) => void) => void;
|
||||
|
||||
/**
|
||||
* Sets flag indicating user has already been prompted whether to remember their choice a preferred navigator app.
|
||||
* @param callback - function to call once operation is complete.
|
||||
*/
|
||||
set: ( callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* Clears flag which indicates if user has already been prompted whether to remember their choice a preferred navigator app.
|
||||
* @param callback - function to call once operation is complete.
|
||||
*/
|
||||
clear: ( callback: () => void) => void;
|
||||
}
|
||||
|
||||
export interface AppSelection {
|
||||
userChoice: UserChoice;
|
||||
userPrompted: UserPrompted;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,6 +265,12 @@ export interface LaunchNavigatorOptions {
|
||||
* ```
|
||||
* @interfaces
|
||||
* LaunchNavigatorOptions
|
||||
* PromptsOptions
|
||||
* RememberChoiceOptions
|
||||
* AppSelectionOptions
|
||||
* UserChoice
|
||||
* UserPrompted
|
||||
* AppSelection
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LaunchNavigator',
|
||||
@@ -97,6 +282,30 @@ export interface LaunchNavigatorOptions {
|
||||
@Injectable()
|
||||
export class LaunchNavigator extends IonicNativePlugin {
|
||||
|
||||
APP: any = {
|
||||
USER_SELECT: 'user_select',
|
||||
APPLE_MAPS: 'apple_maps',
|
||||
GOOGLE_MAPS: 'google_maps',
|
||||
WAZE: 'waze',
|
||||
CITYMAPPER: 'citymapper',
|
||||
NAVIGON: 'navigon',
|
||||
TRANSIT_APP: 'transit_app',
|
||||
YANDEX: 'yandex',
|
||||
UBER: 'uber',
|
||||
TOMTOM: 'tomtom',
|
||||
BING_MAPS: 'bing_maps',
|
||||
SYGIC: 'sygic',
|
||||
HERE_MAPS: 'here_maps',
|
||||
MOOVIT: 'moovit'
|
||||
};
|
||||
|
||||
TRANSPORT_MODE: any = {
|
||||
DRIVING: 'driving',
|
||||
WALKING: 'walking',
|
||||
BICYCLING: 'bicycling',
|
||||
TRANSIT: 'transit'
|
||||
};
|
||||
|
||||
/**
|
||||
* Launches navigator app
|
||||
* @param destination {string|number[]} Location name or coordinates (as string or array)
|
||||
@@ -104,13 +313,10 @@ export class LaunchNavigator extends IonicNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
navigate(
|
||||
destination: string | number[],
|
||||
options?: LaunchNavigatorOptions
|
||||
): Promise<any> { return; }
|
||||
navigate(destination: string | number[], options?: LaunchNavigatorOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Determines if the given app is installed and available on the current device.
|
||||
@@ -162,14 +368,12 @@ export class LaunchNavigator extends IonicNativePlugin {
|
||||
getTransportModes(app: string, platform: string): string[] { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of launch mode.
|
||||
* Note that currently only Google Maps on Android does.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
supportsLaunchMode(app: string, platform: string): boolean { return; }
|
||||
supportsDestName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of start location.
|
||||
@@ -189,41 +393,21 @@ export class LaunchNavigator extends IonicNativePlugin {
|
||||
supportsStartName(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* Indicates if an app on a given platform supports specification of launch mode.
|
||||
* Note that currently only Google Maps on Android does.
|
||||
* @param app {string}
|
||||
* @param platform {string}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
supportsDestName(app: string, platform: string): boolean { return; }
|
||||
supportsLaunchMode(app: string, platform: string): boolean { return; }
|
||||
|
||||
/**
|
||||
* @param destination {string | number[]}
|
||||
* @param options {LaunchNavigatorOptions}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
userSelect(destination: string | number[], options: LaunchNavigatorOptions): void { }
|
||||
userSelect(destination: string | number[], options: LaunchNavigatorOptions): void {}
|
||||
|
||||
APP: any = {
|
||||
USER_SELECT: 'user_select',
|
||||
APPLE_MAPS: 'apple_maps',
|
||||
GOOGLE_MAPS: 'google_maps',
|
||||
WAZE: 'waze',
|
||||
CITYMAPPER: 'citymapper',
|
||||
NAVIGON: 'navigon',
|
||||
TRANSIT_APP: 'transit_app',
|
||||
YANDEX: 'yandex',
|
||||
UBER: 'uber',
|
||||
TOMTOM: 'tomtom',
|
||||
BING_MAPS: 'bing_maps',
|
||||
SYGIC: 'sygic',
|
||||
HERE_MAPS: 'here_maps',
|
||||
MOOVIT: 'moovit'
|
||||
};
|
||||
|
||||
TRANSPORT_MODE: any = {
|
||||
DRIVING: 'driving',
|
||||
WALKING: 'walking',
|
||||
BICYCLING: 'bicycling',
|
||||
TRANSIT: 'transit'
|
||||
};
|
||||
appSelection: AppSelection;
|
||||
}
|
||||
|
||||
@@ -324,5 +324,15 @@ export class LocalNotifications extends IonicNativePlugin {
|
||||
})
|
||||
on(eventName: string, callback: any): void { }
|
||||
|
||||
/**
|
||||
* Removes a callback of a specific event
|
||||
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall
|
||||
* @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
un(eventName: string, callback: any): void { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,62 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
declare const Media: any;
|
||||
// TODO for ionic native 4.x ... rename plugin class to Media and use Media.getPlugin() to retrieve the original media object
|
||||
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin, InstanceProperty } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class MediaObject {
|
||||
|
||||
constructor(private _objectInstance: any) {}
|
||||
/**
|
||||
* An observable that notifies you on actions success
|
||||
*/
|
||||
onSuccess: Observable<any>;
|
||||
|
||||
/**
|
||||
* An observable that notifies you when an error occurs
|
||||
*/
|
||||
onError: Observable<MEDIA_ERROR>;
|
||||
|
||||
/**
|
||||
* An observable that notifies you when the file status changes
|
||||
*/
|
||||
onStatusUpdate: Observable<MEDIA_STATUS>;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@InstanceProperty
|
||||
successCallback: Function;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@InstanceProperty
|
||||
errorCallback: Function;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@InstanceProperty
|
||||
statusCallback: Function;
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
this.onSuccess = new Observable<any>((observer: Observer<any>) => {
|
||||
this.successCallback = observer.next.bind(observer);
|
||||
return () => this.successCallback = () => {};
|
||||
});
|
||||
|
||||
this.onError = new Observable<MEDIA_ERROR>((observer: Observer<MEDIA_ERROR>) => {
|
||||
this.errorCallback = observer.next.bind(observer);
|
||||
return () => this.errorCallback = () => {};
|
||||
});
|
||||
|
||||
this.onStatusUpdate = new Observable<MEDIA_STATUS>((observer: Observer<MEDIA_STATUS>) => {
|
||||
this.statusCallback = observer.next.bind(observer);
|
||||
return () => this.statusCallback = () => {};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current amplitude of the current recording.
|
||||
@@ -67,6 +114,9 @@ export class MediaObject {
|
||||
@CordovaInstance({ sync: true })
|
||||
setVolume(volume: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setRate(speedRate: number): void {}
|
||||
|
||||
/**
|
||||
* Starts recording an audio file.
|
||||
*/
|
||||
@@ -115,6 +165,21 @@ export interface MediaError {
|
||||
|
||||
}
|
||||
|
||||
export enum MEDIA_STATUS {
|
||||
NONE = 0,
|
||||
STARTING,
|
||||
RUNNING,
|
||||
PAUSED,
|
||||
STOPPED
|
||||
}
|
||||
|
||||
export enum MEDIA_ERROR {
|
||||
ABORTED = 1,
|
||||
NETWORK,
|
||||
DECODE,
|
||||
SUPPORTED
|
||||
}
|
||||
|
||||
export type MediaErrorCallback = (error: MediaError) => void;
|
||||
|
||||
/**
|
||||
@@ -122,50 +187,29 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
||||
* @description
|
||||
* This plugin provides the ability to record and play back audio files on a device.
|
||||
*
|
||||
* Some hints if you are using iOS and recording doesn't work:
|
||||
* 1.) Try to use a absolute file path but remove beginning "file://".
|
||||
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
|
||||
* Example: `this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a')`
|
||||
* 2.) If that's not working, too, create the file before using.
|
||||
* Example:
|
||||
* ```typescript
|
||||
* import { MediaPlugin, MediaObject } from '@ionic-native/media';
|
||||
* import { File } from '@ionic-native/file';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* constructor(private media: MediaPlugin, private file: File) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.file.createFile(this.file.tempDirectory, 'my_file.m4a', true).then(() => {
|
||||
* let file = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a');
|
||||
* file.startRecord();
|
||||
* window.setTimeout(() => file.stopRecord(), 10000);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaPlugin, MediaObject } from '@ionic-native/media';
|
||||
* import { Media, MediaObject } from '@ionic-native/media';
|
||||
*
|
||||
*
|
||||
* constructor(private media: MediaPlugin) { }
|
||||
* constructor(private media: Media) { }
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* // Create a MediaPlugin instance. Expects path to file or url as argument
|
||||
* // Create a Media instance. Expects path to file or url as argument
|
||||
* // We can optionally pass a second argument to track the status of the media
|
||||
*
|
||||
* const onStatusUpdate = (status) => console.log(status);
|
||||
* const onSuccess = () => console.log('Action is successful.');
|
||||
* const onError = (error) => console.error(error.message);
|
||||
* const file: MediaObject = this.media.create('file.mp3');
|
||||
*
|
||||
* const file: MediaObject = this.media.create('path/to/file.mp3', onStatusUpdate, onSuccess, onError);
|
||||
* // to listen to plugin events:
|
||||
*
|
||||
* file.onStatusUpdate.subscribe(status => console.log(status)); // fires when file status changes
|
||||
*
|
||||
* file.onSuccess.subscribe(() => console.log('Action is successful'));
|
||||
*
|
||||
* file.onError.subscribe(error => console.log('Error!', error));
|
||||
*
|
||||
* // play the file
|
||||
* file.play();
|
||||
@@ -205,20 +249,45 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* Some hints if you are using iOS and recording doesn't work:
|
||||
* 1.) Try to use a absolute file path but remove beginning "file://".
|
||||
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
|
||||
* Example: `this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a')`
|
||||
* 2.) If that's not working, too, create the file before using.
|
||||
* Example:
|
||||
* ```typescript
|
||||
* import { Media, MediaObject } from '@ionic-native/media';
|
||||
* import { File } from '@ionic-native/file';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* constructor(private media: Media, private file: File) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.file.createFile(this.file.tempDirectory, 'my_file.m4a', true).then(() => {
|
||||
* let file = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a');
|
||||
* file.startRecord();
|
||||
* window.setTimeout(() => file.stopRecord(), 10000);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906
|
||||
* @classes
|
||||
* MediaObject
|
||||
* @interfaces
|
||||
* MediaError
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MediaPlugin',
|
||||
pluginName: 'Media',
|
||||
repo: 'https://github.com/apache/cordova-plugin-media',
|
||||
plugin: 'cordova-plugin-media',
|
||||
pluginRef: 'Media',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||
})
|
||||
@Injectable()
|
||||
export class MediaPlugin extends IonicNativePlugin {
|
||||
export class Media extends IonicNativePlugin {
|
||||
|
||||
// Constants
|
||||
/**
|
||||
@@ -263,25 +332,17 @@ export class MediaPlugin extends IonicNativePlugin {
|
||||
/**
|
||||
* Open a media file
|
||||
* @param src {string} A URI containing the audio content.
|
||||
* @param [onStatusUpdate] {MediaStatusUpdateCallback} A callback function to be invoked when the status of the file changes
|
||||
* @param [onSuccess] {Function} A callback function to be invoked after the current play, record, or stop action is completed
|
||||
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
|
||||
* @return {MediaObject}
|
||||
*/
|
||||
create(src: string,
|
||||
onStatusUpdate?: MediaStatusUpdateCallback,
|
||||
onSuccess?: Function,
|
||||
onError?: MediaErrorCallback): MediaObject {
|
||||
|
||||
create(src: string): MediaObject {
|
||||
let instance: any;
|
||||
|
||||
if (checkAvailability(MediaPlugin.getPluginRef(), null, MediaPlugin.getPluginName()) === true) {
|
||||
if (checkAvailability(Media.getPluginRef(), null, Media.getPluginName()) === true) {
|
||||
// Creates a new media object
|
||||
instance = new Media(src, onSuccess, onError, onStatusUpdate);
|
||||
instance = new (Media.getPlugin())(src);
|
||||
}
|
||||
|
||||
return new MediaObject(instance);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
157
src/@ionic-native/plugins/ms-adal/index.ts
Normal file
157
src/@ionic-native/plugins/ms-adal/index.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
import { Plugin, IonicNativePlugin, checkAvailability, InstanceProperty, CordovaInstance } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface AuthenticationResult {
|
||||
|
||||
accessToken: string;
|
||||
accesSTokenType: string;
|
||||
expiresOn: Date;
|
||||
idToken: string;
|
||||
isMultipleResourceRefreshToken: boolean;
|
||||
status: string;
|
||||
statusCode: number;
|
||||
tenantId: string;
|
||||
|
||||
/**
|
||||
* Creates authorization header for web requests.
|
||||
* @returns {String} The authorization header.
|
||||
*/
|
||||
createAuthorizationHeader(): string;
|
||||
|
||||
}
|
||||
|
||||
export interface TokenCache {
|
||||
clear(): void;
|
||||
readItems(): Promise<TokenCacheItem[]>;
|
||||
deleteItem(item: TokenCacheItem): void;
|
||||
}
|
||||
|
||||
export interface TokenCacheItem {
|
||||
accessToken: string;
|
||||
authority: string;
|
||||
clientId: string;
|
||||
displayableId: string;
|
||||
expiresOn: Date;
|
||||
isMultipleResourceRefreshToken: boolean;
|
||||
resource: string;
|
||||
tenantId: string;
|
||||
userInfo: UserInfo;
|
||||
}
|
||||
|
||||
export interface UserInfo {
|
||||
displayableId: string;
|
||||
userId: string;
|
||||
familyName: string;
|
||||
givenName: string;
|
||||
identityProvider: string;
|
||||
passwordChangeUrl: string;
|
||||
passwordExpiresOn: Date;
|
||||
uniqueId: string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name MS ADAL
|
||||
* @description
|
||||
* Active Directory Authentication Library (ADAL) plugin.
|
||||
* Active Directory Authentication Library ([ADAL](https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory?view=azure-dotnet))
|
||||
* plugin provides easy to use authentication functionality for your Apache Cordova apps by taking advantage of
|
||||
* Windows Server Active Directory and Windows Azure Active Directory. Here you can find the source code for the library.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal';
|
||||
*
|
||||
*
|
||||
* constructor(private msAdal: MSAdal) {}
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
|
||||
*
|
||||
* authContext.acquireTokenAsync('https://graph.windows.net', 'a5d92493-ae5a-4a9f-bcbf-9f1d354067d3', 'http://MyDirectorySearcherApp')
|
||||
* .then((authResponse: AuthenticationResult) => {
|
||||
* console.log('Token is' , authResponse.accessToken);
|
||||
* console.log('Token will expire on', authResponse.expiresOn);
|
||||
* })
|
||||
* .catch((e: any) => console.log('Authentication failed', e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @classes
|
||||
* AuthenticationContext
|
||||
* @interfaces
|
||||
* AuthenticationResult
|
||||
* TokenCache
|
||||
* TokenCacheItem
|
||||
* UserInfo
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MSADAL',
|
||||
plugin: 'cordova-plugin-ms-adal',
|
||||
pluginRef: 'Microsoft.ADAL',
|
||||
repo: 'https://github.com/AzureAD/azure-activedirectory-library-for-cordova',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class MSAdal extends IonicNativePlugin {
|
||||
|
||||
createAuthenticationContext(authority: string, validateAuthority: boolean = true) {
|
||||
let authContext: any;
|
||||
if (checkAvailability(MSAdal.getPluginRef(), null, MSAdal.getPluginName()) === true) {
|
||||
authContext = new (MSAdal.getPlugin()).AuthenticationContext(authority);
|
||||
}
|
||||
return new AuthenticationContext(authContext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class AuthenticationContext {
|
||||
|
||||
@InstanceProperty
|
||||
authority: string;
|
||||
|
||||
@InstanceProperty
|
||||
validateAuthority: boolean;
|
||||
|
||||
@InstanceProperty
|
||||
tokenCache: any;
|
||||
|
||||
constructor(private _objectInstance: any) {}
|
||||
|
||||
/**
|
||||
* Acquires token using interactive flow. It always shows UI and skips token from cache.
|
||||
*
|
||||
* @param {String} resourceUrl Resource identifier
|
||||
* @param {String} clientId Client (application) identifier
|
||||
* @param {String} redirectUrl Redirect url for this application
|
||||
* @param {String} userId User identifier (optional)
|
||||
* @param {String} extraQueryParameters
|
||||
* Extra query parameters (optional)
|
||||
* Parameters should be escaped before passing to this method (e.g. using 'encodeURI()')
|
||||
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
|
||||
*/
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
|
||||
|
||||
/**
|
||||
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
|
||||
* if not expired. It tries to use refresh token if available. If it fails to get token without
|
||||
* displaying UI it will fail. This method guarantees that no UI will be shown to user.
|
||||
*
|
||||
* @param {String} resourceUrl Resource identifier
|
||||
* @param {String} clientId Client (application) identifier
|
||||
* @param {String} userId User identifier (optional)
|
||||
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
|
||||
*/
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise<AuthenticationResult> { return; }
|
||||
|
||||
}
|
||||
@@ -10,6 +10,10 @@ export interface MusicControlsOptions {
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasSkipForward: boolean;
|
||||
hasSkipBackward: boolean;
|
||||
skipForwardInterval: number;
|
||||
skipBackwardInterval: number;
|
||||
hasClose: boolean;
|
||||
album: string;
|
||||
duration: number;
|
||||
@@ -50,6 +54,10 @@ export interface MusicControlsOptions {
|
||||
* 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
|
||||
*
|
||||
* // Android only, optional
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated
|
||||
@@ -89,6 +97,12 @@ export interface MusicControlsOptions {
|
||||
* });
|
||||
* // Do something
|
||||
* break;
|
||||
* case 'music-controls-skip-forward':
|
||||
* // Do something
|
||||
* break;
|
||||
* case 'music-controls-skip-backward':
|
||||
* // Do something
|
||||
* break;
|
||||
*
|
||||
* // Headset events (Android only)
|
||||
* // All media button events are listed below
|
||||
@@ -164,7 +178,7 @@ export class MusicControls extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Update elapsed time, optionally toggle play/pause:
|
||||
* @param args {Object}
|
||||
* @param args {Object}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* ...
|
||||
*
|
||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
||||
* .then((result: NativeGeocoderReverseResult) => console.log('The address is ' + result.street + ' in ' + result.countryCode))
|
||||
* .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* this.nativeGeocoder.forwardGeocode('Berlin')
|
||||
@@ -40,7 +40,7 @@ export class NativeGeocoder extends IonicNativePlugin {
|
||||
* Reverse geocode a given latitude and longitude to find location address
|
||||
* @param latitude {number} The latitude
|
||||
* @param longitude {number} The longitude
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<NativeGeocoderReverseResult>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -50,48 +50,59 @@ export class NativeGeocoder extends IonicNativePlugin {
|
||||
/**
|
||||
* Forward geocode a given address to find coordinates
|
||||
* @param addressString {string} The address to be geocoded
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<NativeGeocoderForwardResult>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates format information about a reverse geocoding result.
|
||||
* more Info:
|
||||
* - https://developer.apple.com/documentation/corelocation/clplacemark
|
||||
* - https://developer.android.com/reference/android/location/Address.html
|
||||
*/
|
||||
export interface NativeGeocoderReverseResult {
|
||||
/**
|
||||
* The street.
|
||||
* The country code.
|
||||
*/
|
||||
street: string;
|
||||
/**
|
||||
* The house number.
|
||||
*/
|
||||
houseNumber: string;
|
||||
/**
|
||||
* The postal code.
|
||||
*/
|
||||
postalCode: string;
|
||||
/**
|
||||
* The city.
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* The district.
|
||||
*/
|
||||
district: string;
|
||||
countryCode: string;
|
||||
/**
|
||||
* The country name.
|
||||
*/
|
||||
countryName: string;
|
||||
/**
|
||||
* The country code.
|
||||
* The postal code.
|
||||
*/
|
||||
countryCode: string;
|
||||
postalCode: string;
|
||||
/**
|
||||
* The administrativeArea.
|
||||
*/
|
||||
administrativeArea: string;
|
||||
/**
|
||||
* The subAdministrativeArea.
|
||||
*/
|
||||
subAdministrativeArea: string;
|
||||
/**
|
||||
* The locality.
|
||||
*/
|
||||
locality: string;
|
||||
/**
|
||||
* The subLocality.
|
||||
*/
|
||||
subLocality: string;
|
||||
/**
|
||||
* The thoroughfare.
|
||||
*/
|
||||
thoroughfare: string;
|
||||
/**
|
||||
* The subThoroughfare.
|
||||
*/
|
||||
subThoroughfare: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates format information about a forward geocoding result.
|
||||
*/
|
||||
|
||||
@@ -172,14 +172,12 @@ export interface NativeKeyboardUpdateMessengerOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* @paid
|
||||
* @name Native Keyboard
|
||||
* @description
|
||||
* A cross platform WhatsApp / Messenger / Slack -style keyboard even. For your Cordova app.
|
||||
*
|
||||
*
|
||||
* IMPORTANT NOTICE: this plugin is paid, please read more about this at the [plugin's repo](https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard#i-like-it-hook-me-up).
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { NativeKeyboard } from '@ionic-native/native-keyboard';
|
||||
|
||||
@@ -23,8 +23,17 @@ declare let window: any;
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let message = this.ndef.textRecord('Hello world');
|
||||
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
||||
* this.nfc.addNdefListener(() => {
|
||||
* console.log('successfully attached ndef listener');
|
||||
* }, (err) => {
|
||||
* console.log('error attaching ndef listener', err);
|
||||
* }).subscribe((event) => {
|
||||
* console.log('received ndef message. the tag contains: ', event.tag);
|
||||
* console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
|
||||
*
|
||||
* let message = this.ndef.textRecord('Hello world');
|
||||
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -97,13 +97,13 @@ export enum OSLockScreenVisibility {
|
||||
* Fully visible (default)
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
* Contents are hidden
|
||||
*/
|
||||
/**
|
||||
* Contents are hidden
|
||||
*/
|
||||
Private = 0,
|
||||
/**
|
||||
* Not shown
|
||||
*/
|
||||
/**
|
||||
* Not shown
|
||||
*/
|
||||
Secret = -1
|
||||
}
|
||||
|
||||
@@ -115,13 +115,13 @@ export enum OSDisplayType {
|
||||
* notification is silent, or inFocusDisplaying is disabled.
|
||||
*/
|
||||
None = 0,
|
||||
/**
|
||||
* (**DEFAULT**) - native alert dialog display.
|
||||
*/
|
||||
/**
|
||||
* (**DEFAULT**) - native alert dialog display.
|
||||
*/
|
||||
InAppAlert = 1,
|
||||
/**
|
||||
* native notification display.
|
||||
*/
|
||||
/**
|
||||
* native notification display.
|
||||
*/
|
||||
Notification = 2
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
@@ -236,10 +236,10 @@ export interface OSPermissionState {
|
||||
* OSSubscriptionState
|
||||
*/
|
||||
export interface OSSubscriptionState {
|
||||
subscribed: boolean;
|
||||
userSubscriptionSetting: any;
|
||||
userId: any;
|
||||
pushToken: any;
|
||||
subscribed: boolean;
|
||||
userSubscriptionSetting: any;
|
||||
userId: any;
|
||||
pushToken: any;
|
||||
}
|
||||
/**
|
||||
* Subscription and permissions status
|
||||
@@ -305,14 +305,14 @@ export enum OSActionType {
|
||||
*
|
||||
* #### Icons
|
||||
* If you want to use generated icons with command `ionic cordova resources`:
|
||||
*
|
||||
*
|
||||
* 1. Add a file to your `hooks` directory inside the `after_prepare` folder called `030_copy_android_notification_icons.js`
|
||||
*
|
||||
* 2. Put the following code in it:
|
||||
*
|
||||
* ```
|
||||
* #!/usr/bin/env node
|
||||
*
|
||||
*
|
||||
* var filestocopy = [{
|
||||
* "resources/android/icon/drawable-hdpi-icon.png":
|
||||
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
|
||||
@@ -329,13 +329,13 @@ export enum OSActionType {
|
||||
* "resources/android/icon/drawable-xxxhdpi-icon.png":
|
||||
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
|
||||
* } ];
|
||||
*
|
||||
*
|
||||
* var fs = require('fs');
|
||||
* var path = require('path');
|
||||
*
|
||||
*
|
||||
* // no need to configure below
|
||||
* var rootdir = process.argv[2];
|
||||
*
|
||||
*
|
||||
* filestocopy.forEach(function(obj) {
|
||||
* Object.keys(obj).forEach(function(key) {
|
||||
* var val = obj[key];
|
||||
@@ -449,7 +449,10 @@ export class OneSignal extends IonicNativePlugin {
|
||||
* Launch notifications with a launch URL as an in app webview.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS']
|
||||
})
|
||||
iOSSettings(settings: {
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
@@ -463,6 +466,15 @@ export class OneSignal extends IonicNativePlugin {
|
||||
@Cordova({ sync: true })
|
||||
endInit(): any { return; }
|
||||
|
||||
/**
|
||||
* Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
promptForPushNotificationsWithUserResponse(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Retrieve a list of tags that have been set on the user from the OneSignal server.
|
||||
*
|
||||
@@ -530,67 +542,74 @@ export class OneSignal extends IonicNativePlugin {
|
||||
registerForPushNotifications(): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
enableVibrate(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
* Warning:
|
||||
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
|
||||
*
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
enableSound(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {DisplayType} displayOption
|
||||
* @returns {any}
|
||||
*/
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {DisplayType} displayOption
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
inFocusDisplaying(displayOption: OSDisplayType): any { return; }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setSubscription(enable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
|
||||
*
|
||||
* @returns {Promise<OSPermissionSubscriptionState>}
|
||||
*/
|
||||
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
|
||||
*
|
||||
* @returns {Promise<OSPermissionSubscriptionState>}
|
||||
*/
|
||||
@Cordova()
|
||||
getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
*
|
||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
postNotification(notificationObj: OSNotification): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
* Cancels a single OneSignal notification based on its Android notification integer id. Use instead of NotificationManager.cancel(id); otherwise the notification will be restored when your app is restarted.
|
||||
* @param notificationId {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
cancelNotification(notificationId: string): void {}
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
promptLocation(): void { }
|
||||
|
||||
@@ -602,17 +621,44 @@ export class OneSignal extends IonicNativePlugin {
|
||||
syncHashedEmail(email: string): void { }
|
||||
|
||||
/**
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
* Enable logging to help debug if you run into an issue setting up OneSignal.
|
||||
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
|
||||
* The higher the value the more information is shown.
|
||||
*
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
* The higher the value the more information is shown.
|
||||
*
|
||||
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setLogLevel(logLevel: {
|
||||
logLevel: number,
|
||||
visualLevel: number
|
||||
}): void { }
|
||||
|
||||
/**
|
||||
* The passed in function will be fired when a notification permission setting changes.
|
||||
* This includes the following events:
|
||||
* - Notification permission prompt shown
|
||||
* - The user accepting or declining the permission prompt
|
||||
* - Enabling/disabling notifications for your app in the device Settings after returning to your app.
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
addPermissionObserver(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* The passed in function will be fired when a notification subscription property changes.
|
||||
* This includes the following events:
|
||||
* - Getting a push token from Apple / Google.
|
||||
* - Getting a player / user id from OneSignal
|
||||
* - OneSignal.setSubscription is called
|
||||
* - User disables or enables notifications
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
addSubscriptionObserver(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
111
src/@ionic-native/plugins/open-native-settings/index.ts
Normal file
111
src/@ionic-native/plugins/open-native-settings/index.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name Open Native Settings
|
||||
* @description
|
||||
* Plugin to open native screens of iOS/android settings
|
||||
* @usage
|
||||
* You can open any of these settings:
|
||||
* ```
|
||||
* "about", // ios
|
||||
"accessibility", // ios, android
|
||||
"account", // ios, android
|
||||
"airplane_mode", // ios, android
|
||||
"apn", // android
|
||||
"application_details", // ios, android
|
||||
"application_development", // android
|
||||
"application", // android
|
||||
"autolock", // ios
|
||||
"battery_optimization", // android
|
||||
"bluetooth", // ios, android
|
||||
"castle", // ios
|
||||
"captioning", // android
|
||||
"cast", // android
|
||||
"cellular_usage", // ios
|
||||
"configuration_list", // ios
|
||||
"data_roaming", // android
|
||||
"date", // ios, android
|
||||
"display", // ios, android
|
||||
"dream", // android
|
||||
"facetime", // ios
|
||||
"home", // android
|
||||
"keyboard", // ios, android
|
||||
"keyboard_subtype", // android
|
||||
"locale", // ios, android
|
||||
"location", // ios, android
|
||||
"locations", // ios
|
||||
"manage_all_applications", // android
|
||||
"manage_applications", // android
|
||||
"memory_card", // android
|
||||
"music", // ios
|
||||
"music_equalizer", // ios
|
||||
"music_volume", // ios
|
||||
"network", // ios, android
|
||||
"nike_ipod", // ios
|
||||
"nfcsharing", // android
|
||||
"nfc_payment", // android
|
||||
"nfc_settings", // android
|
||||
"notes", // ios
|
||||
"notification_id", // ios
|
||||
"passbook", // ios
|
||||
"phone", // ios
|
||||
"photos", // ios
|
||||
"print", // android
|
||||
"privacy", // android
|
||||
"quick_launch", // android
|
||||
"reset", // ios
|
||||
"ringtone", // ios
|
||||
"browser", // ios
|
||||
"search", // ios, android
|
||||
"security", // android
|
||||
"settings", // ios, android
|
||||
"show_regulatory_info",
|
||||
"sound", // ios, android
|
||||
"software_update", // ios
|
||||
"storage", // ios, android
|
||||
"store", // ios, android
|
||||
"sync", // android
|
||||
"tethering", // ios
|
||||
"twitter", // ios
|
||||
"touch", // ios
|
||||
"usage", // ios, android
|
||||
"user_dictionary", // android
|
||||
"video", // ios
|
||||
"voice_input", // android
|
||||
"vpn", // ios
|
||||
"wallpaper", // ios
|
||||
"wifi_ip", // android
|
||||
"wifi", // ios, android
|
||||
"wireless" // android
|
||||
```
|
||||
* ```typescript
|
||||
* import { OpenNativeSettings } from '@ionic-native/open-native-settings';
|
||||
*
|
||||
*
|
||||
* constructor(private openNativeSettings: OpenNativeSettings) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OpenNativeSettings',
|
||||
plugin: 'cordova-open-native-settings',
|
||||
pluginRef: 'cordova.plugins.settings',
|
||||
repo: 'https://github.com/guyromb/Cordova-open-native-settings',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class OpenNativeSettings extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Opens a setting dialog
|
||||
* @param setting {string} setting name
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
open(setting: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -204,6 +204,12 @@ export class PayPalPayment {
|
||||
*/
|
||||
items: Array<PayPalItem>;
|
||||
|
||||
/**
|
||||
* Optional payee email, if your app is paying a third-party merchant.
|
||||
* The payee's email. It must be a valid PayPal email address.
|
||||
*/
|
||||
payeeEmail: string;
|
||||
|
||||
/**
|
||||
* Optional customer shipping address, if your app wishes to provide this to the SDK.
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,7 @@ export interface LocalNotificationOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Phonegap Local Notifications',
|
||||
plugin: 'phonegap-local-notifications',
|
||||
plugin: 'phonegap-plugin-local-notification',
|
||||
pluginRef: 'Notification',
|
||||
repo: 'https://github.com/phonegap/phonegap-plugin-local-notification',
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
|
||||
@@ -31,8 +31,8 @@ import { Injectable } from '@angular/core';
|
||||
* console.log(libraryItem.albumIds); // array of ids of appropriate AlbumItem, only of includeAlbumsData was used
|
||||
* });
|
||||
* },
|
||||
* error: err => {},
|
||||
* complete: () => { console.log('could not get photos'); }
|
||||
* error: err => { console.log('could not get photos'); },
|
||||
* complete: () => { console.log('done getting photos'); }
|
||||
* });
|
||||
* })
|
||||
* .catch(err => console.log('permissions weren\'t granted'));
|
||||
|
||||
@@ -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 { }
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export interface PrintOptions {
|
||||
export class Printer extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Checks whether to device is capable of printing.
|
||||
* Checks whether the device is capable of printing (uses `check()` internally)
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
isAvailable(): Promise<boolean> {
|
||||
|
||||
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; }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var window: any;
|
||||
declare const window: any;
|
||||
|
||||
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
|
||||
|
||||
@@ -62,16 +62,10 @@ export interface NotificationEventAdditionalData {
|
||||
}
|
||||
|
||||
export interface IOSPushOptions {
|
||||
/**
|
||||
* Maps to the project number in the Google Developer Console. Setting this
|
||||
* uses GCM for notifications instead of native.
|
||||
*/
|
||||
senderID?: string;
|
||||
|
||||
/**
|
||||
* Whether to use prod or sandbox GCM setting.
|
||||
*/
|
||||
gcmSandbox?: boolean | string;
|
||||
fcmSandbox?: boolean | string;
|
||||
|
||||
/**
|
||||
* If true the device shows an alert on receipt of notification.
|
||||
@@ -137,11 +131,6 @@ 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.
|
||||
@@ -186,12 +175,37 @@ export interface AndroidPushOptions {
|
||||
* subscribe to a GcmPubSub topic.
|
||||
*/
|
||||
topics?: string[];
|
||||
|
||||
/**
|
||||
* The key to search for text of notification.
|
||||
*/
|
||||
messageKey?: string;
|
||||
|
||||
/**
|
||||
* The key to search for title of notification.
|
||||
*/
|
||||
titleKey?: string;
|
||||
}
|
||||
|
||||
export interface BrowserPushOptions {
|
||||
/**
|
||||
* Optional. Your GCM API key if you are using VAPID keys.
|
||||
*/
|
||||
applicationServerKey?: string;
|
||||
|
||||
/**
|
||||
* URL for the push server you want to use.
|
||||
* Default: http://push.api.phonegap.com/v1/push Optional.
|
||||
*/
|
||||
pushServiceURL?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface PushOptions {
|
||||
ios?: IOSPushOptions;
|
||||
android?: AndroidPushOptions;
|
||||
windows?: any;
|
||||
browser?: BrowserPushOptions;
|
||||
}
|
||||
|
||||
export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
@@ -229,15 +243,16 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
* // to initialize push notifications
|
||||
*
|
||||
* const options: PushOptions = {
|
||||
* android: {
|
||||
* senderID: '12345679'
|
||||
* },
|
||||
* android: {},
|
||||
* ios: {
|
||||
* alert: 'true',
|
||||
* badge: true,
|
||||
* sound: 'false'
|
||||
* },
|
||||
* windows: {}
|
||||
* windows: {},
|
||||
* browser: {
|
||||
* pushServiceURL: 'http://push.api.phonegap.com/v1/push'
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* const pushObject: PushObject = this.push.init(options);
|
||||
@@ -257,6 +272,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
* NotificationEventAdditionalData
|
||||
* IOSPushOptions
|
||||
* AndroidPushOptions
|
||||
* BrowserPushOptions
|
||||
* PushOptions
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -264,8 +280,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
plugin: 'phonegap-plugin-push',
|
||||
pluginRef: 'PushNotification',
|
||||
repo: 'https://github.com/phonegap/phonegap-plugin-push',
|
||||
install: 'ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX',
|
||||
installVariables: ['SENDER_ID'],
|
||||
install: 'ionic cordova plugin add phonegap-plugin-push',
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
235
src/@ionic-native/plugins/qr-scanner/index.ts
Normal file
235
src/@ionic-native/plugins/qr-scanner/index.ts
Normal file
@@ -0,0 +1,235 @@
|
||||
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface QRScannerStatus {
|
||||
/**
|
||||
* On iOS and Android 6.0+, camera access is granted at runtime by the user (by clicking "Allow" at the dialog).
|
||||
* The authorized property is a boolean value which is true only when the user has allowed camera access to your app (AVAuthorizationStatus.Authorized).
|
||||
* On platforms with permissions granted at install (Android pre-6.0, Windows Phone) this property is always true.
|
||||
*/
|
||||
authorized: boolean;
|
||||
/**
|
||||
* A boolean value which is true if the user permanently denied camera access to the app (AVAuthorizationStatus.Denied).
|
||||
* Once denied, camera access can only be gained by requesting the user change their decision (consider offering a link to the setting via openSettings()).
|
||||
*/
|
||||
denied: boolean;
|
||||
/**
|
||||
* A boolean value which is true if the user is unable to grant permissions due to parental controls, organization security configuration profiles, or similar reasons.
|
||||
*/
|
||||
restricted: boolean;
|
||||
/**
|
||||
* A boolean value which is true if QRScanner is prepared to capture video and render it to the view.
|
||||
*/
|
||||
prepared: boolean;
|
||||
/**
|
||||
* A boolean value which is true when the preview layer is visible (and on all platforms but browser, the native webview background is transparent).
|
||||
*/
|
||||
showing: boolean;
|
||||
/**
|
||||
* A boolean value which is true if QRScanner is actively scanning for a QR code.
|
||||
*/
|
||||
scanning: boolean;
|
||||
/**
|
||||
* A boolean value which is true if QRScanner is displaying a live preview from the device's camera. Set to false when the preview is paused.
|
||||
*/
|
||||
previewing: boolean;
|
||||
/**
|
||||
* A boolean value which is true if the light is enabled.
|
||||
*/
|
||||
lightEnabled: boolean;
|
||||
/**
|
||||
* A boolean value which is true only if the users' operating system is able to QRScanner.openSettings().
|
||||
*/
|
||||
canOpenSettings: boolean;
|
||||
/**
|
||||
* A boolean value which is true only if the users' device can enable a light in the direction of the currentCamera.
|
||||
*/
|
||||
canEnableLight: boolean;
|
||||
/**
|
||||
* A boolean value which is true only if the current device "should" have a front camera.
|
||||
* The camera may still not be capturable, which would emit error code 3, 4, or 5 when the switch is attempted.
|
||||
* (On the browser platform, this value is false until the prepare method is called.)
|
||||
*/
|
||||
canChangeCamera: boolean;
|
||||
/**
|
||||
* A number representing the index of the currentCamera. 0 is the back camera, 1 is the front.
|
||||
*/
|
||||
currentCamera: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name QR Scanner
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner';
|
||||
*
|
||||
*
|
||||
* constructor(private qrScanner: QRScanner) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Optionally request the permission early
|
||||
* this.qrScanner.prepare()
|
||||
* .then((status: QRScannerStatus) => {
|
||||
* if (status.authorized) {
|
||||
* // camera permission was granted
|
||||
*
|
||||
*
|
||||
* // start scanning
|
||||
* let scanSub = this.qrScanner.scan().subscribe((text: string) => {
|
||||
* console.log('Scanned something', text);
|
||||
*
|
||||
* this.qrScanner.hide(); // hide camera preview
|
||||
* scanSub.unsubscribe(); // stop scanning
|
||||
* });
|
||||
*
|
||||
* // show camera preview
|
||||
* this.qrScanner.show();
|
||||
*
|
||||
* // wait for user to scan something, then the observable callback will be called
|
||||
*
|
||||
* } else if (status.denied) {
|
||||
* // camera permission was permanently denied
|
||||
* // you must use QRScanner.openSettings() method to guide the user to the settings page
|
||||
* // then they can grant the permission from there
|
||||
* } else {
|
||||
* // permission was denied, but not permanently. You can ask for permission again at a later time.
|
||||
* }
|
||||
* })
|
||||
* .catch((e: any) => console.log('Error is', e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* QRScannerStatus
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'QRScanner',
|
||||
plugin: 'cordova-plugin-qrscanner',
|
||||
pluginRef: 'QRScanner',
|
||||
repo: 'https://github.com/bitpay/cordova-plugin-qrscanner',
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class QRScanner extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Request permission to use QR scanner.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
prepare(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Call this method to enable scanning. You must then call the `show` method to make the camera preview visible.
|
||||
* @return {Observable<string>} returns an Observable that emits the scanned text. Unsubscribe from the observable to stop scanning.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node',
|
||||
observable: true,
|
||||
clearFunction: 'cancelScan'
|
||||
})
|
||||
scan(): Observable<string> { return; }
|
||||
|
||||
/**
|
||||
* Configures the native webview to have a transparent background, then sets the background of the <body> and <html> DOM elements to transparent, allowing the webview to re-render with the transparent background.
|
||||
* @returns {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
show(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Configures the native webview to be opaque with a white background, covering the video preview.
|
||||
* @returns {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
hide(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Enable the device's light (for scanning in low-light environments).
|
||||
* @returns {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
enableLight(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Destroy the scanner instance.
|
||||
* @returns {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
destroy(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Disable the device's light.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
disableLight(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Use front camera
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
useFrontCamera(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Use back camera
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
useBackCamera(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Set camera to be used.
|
||||
* @param camera {number} Provide `0` for back camera, and `1` for front camera.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
useCamera(camera: number): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Pauses the video preview on the current frame and pauses scanning.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
pausePreview(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Resumse the video preview and resumes scanning.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
resumePreview(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Returns permission status
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
getStatus(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Opens settings to edit app permissions.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
openSettings(): void {}
|
||||
|
||||
}
|
||||
46
src/@ionic-native/plugins/regula-document-reader/index.ts
Normal file
46
src/@ionic-native/plugins/regula-document-reader/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @paid
|
||||
* @beta
|
||||
* @name Regula Document Reader
|
||||
* @description
|
||||
* Plugin for reading and validation of identification documents.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
|
||||
*
|
||||
* let license; // read regula.license file
|
||||
* RegulaDocumentReader.initReader(license); // initialize reader
|
||||
* RegulaDocumentReader.scanDocument().then((result) => {
|
||||
* // read result
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Regula Document Reader',
|
||||
plugin: 'cordova-plugin-documentreader',
|
||||
pluginRef: 'DocumentReader',
|
||||
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
|
||||
platforms: ['iOS', 'Android'],
|
||||
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
|
||||
})
|
||||
@Injectable()
|
||||
export class RegulaDocumentReader extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* 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(): Promise<string[]> { return; }
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface SafariViewControllerOptions {
|
||||
animated?: boolean;
|
||||
@@ -37,7 +38,7 @@ export interface SafariViewControllerOptions {
|
||||
* enterReaderModeIfAvailable: true,
|
||||
* tintColor: '#ff0000'
|
||||
* })
|
||||
* .then((result: any) => {
|
||||
* .subscribe((result: any) => {
|
||||
* if(result.event === 'opened') console.log('Opened');
|
||||
* else if(result.event === 'loaded') console.log('Loaded');
|
||||
* else if(result.event === 'closed') console.log('Closed');
|
||||
@@ -74,13 +75,14 @@ export class SafariViewController extends IonicNativePlugin {
|
||||
/**
|
||||
* Shows Safari View Controller
|
||||
* @param options {SafariViewControllerOptions} optional
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
errorIndex: 2,
|
||||
observable: true
|
||||
})
|
||||
show(options?: SafariViewControllerOptions): Promise<any> { return; }
|
||||
show(options?: SafariViewControllerOptions): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Hides Safari View Controller
|
||||
|
||||
@@ -12,6 +12,12 @@ export interface SerialPermissionOptions {
|
||||
|
||||
export interface SerialOpenOptions {
|
||||
baudRate: number;
|
||||
dataBits: number;
|
||||
stopBits: number;
|
||||
parity: number;
|
||||
dtr: boolean;
|
||||
rts: boolean;
|
||||
sleepOnPause: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +35,13 @@ export interface SerialOpenOptions {
|
||||
*
|
||||
* this.serial.requestPermission().then(() => {
|
||||
* this.serial.open({
|
||||
* baudRate: 9800
|
||||
* baudRate: 9800,
|
||||
* dataBits: 4,
|
||||
* stopBits: 1,
|
||||
* parity: 0,
|
||||
* dtr: true,
|
||||
* rts: true,
|
||||
* sleepOnPause: false
|
||||
* }).then(() => {
|
||||
* console.log('Serial connection opened');
|
||||
* });
|
||||
|
||||
@@ -49,7 +49,10 @@ export class SocialSharing extends IonicNativePlugin {
|
||||
* @param url {string} A URL to share
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 4,
|
||||
errorIndex: 5
|
||||
})
|
||||
share(message?: string, subject?: string, file?: string | string[], url?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface SpinnerDialogIOSOptions {
|
||||
@Plugin({
|
||||
pluginName: 'SpinnerDialog',
|
||||
plugin: 'cordova-plugin-native-spinner',
|
||||
pluginRef: 'window.plugins.spinnerDialog',
|
||||
pluginRef: 'SpinnerDialog',
|
||||
repo: 'https://github.com/greybax/cordova-plugin-native-spinner',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows']
|
||||
})
|
||||
|
||||
@@ -20,6 +20,10 @@ export interface SQLiteDatabaseConfig {
|
||||
* support opening pre-filled databases with https://github.com/litehelpers/cordova-sqlite-ext
|
||||
*/
|
||||
createFromLocation?: number;
|
||||
/**
|
||||
* support encrypted databases with https://github.com/litehelpers/Cordova-sqlcipher-adapter
|
||||
*/
|
||||
key?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,11 +99,11 @@ export class SQLiteObject {
|
||||
executeSql(statement: string, params: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* @param sqlStatements {Array<string | string[]>}
|
||||
* @param sqlStatements {Array<string | string[] | any>}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
sqlBatch(sqlStatements: Array<string | string[]>): Promise<any> { return; }
|
||||
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({
|
||||
sync: true
|
||||
|
||||
@@ -79,6 +79,31 @@ export interface StripeBankAccountParams {
|
||||
account_holder_type?: string;
|
||||
}
|
||||
|
||||
export interface StripeCardTokenRes {
|
||||
/**
|
||||
* Card Object.
|
||||
*/
|
||||
card: {
|
||||
brand: string,
|
||||
exp_month: number,
|
||||
exp_year: number,
|
||||
funding: string,
|
||||
last4: string
|
||||
};
|
||||
/**
|
||||
* Token Request Date Time.
|
||||
*/
|
||||
created: string;
|
||||
/**
|
||||
* Card Token.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Source Type (card or account).
|
||||
*/
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Stripe
|
||||
* @description
|
||||
@@ -102,7 +127,7 @@ export interface StripeBankAccountParams {
|
||||
* };
|
||||
*
|
||||
* this.stripe.createCardToken(card)
|
||||
* .then(token => console.log(token))
|
||||
* .then(token => console.log(token.id))
|
||||
* .catch(error => console.error(error));
|
||||
*
|
||||
* ```
|
||||
@@ -131,10 +156,10 @@ export class Stripe extends IonicNativePlugin {
|
||||
/**
|
||||
* Create Credit Card Token
|
||||
* @param params {StripeCardTokenParams} Credit card information
|
||||
* @return {Promise<string>} returns a promise that resolves with the token, or rejects with an error
|
||||
* @return {Promise<StripeCardTokenRes>} returns a promise that resolves with the token object, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
createCardToken(params: StripeCardTokenParams): Promise<string> { return; }
|
||||
createCardToken(params: StripeCardTokenParams): Promise<StripeCardTokenRes> { return; }
|
||||
|
||||
/**
|
||||
* Create a bank account token
|
||||
|
||||
@@ -55,9 +55,9 @@ export interface TwitterConnectResponse {
|
||||
pluginName: 'TwitterConnect',
|
||||
plugin: 'twitter-connect-plugin',
|
||||
pluginRef: 'TwitterConnect',
|
||||
repo: 'https://github.com/ManifestWebDesign/twitter-connect-plugin',
|
||||
install: 'ionic cordova plugin add twitter-connect-plugin --variable FABRIC_KEY=fabric_API_key',
|
||||
installVariables: ['FABRIC_KEY'],
|
||||
repo: 'https://github.com/chroa/twitter-connect-plugin',
|
||||
install: 'ionic cordova plugin add https://github.com/chroa/twitter-connect-plugin --variable FABRIC_KEY=<Fabric API Key> --variable TWITTER_KEY=<Twitter Consumer Key> --variable TWITTER_SECRET=<Twitter Consumer Secret>',
|
||||
installVariables: ['FABRIC_KEY', 'TWITTER_KEY', 'TWITTER_SECRET'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
69
src/@ionic-native/plugins/uid/index.ts
Normal file
69
src/@ionic-native/plugins/uid/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Uid
|
||||
* @description
|
||||
* Get unique identifiers: UUID, IMEI, IMSI, ICCID and MAC.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Uid } from '@ionic-native/uid';
|
||||
* import { AndroidPermissions } from '@ionic-native/android-permissions';
|
||||
*
|
||||
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
|
||||
*
|
||||
*
|
||||
* async getImei() {
|
||||
* const { hasPermission } = await this.androidPermissions.checkPermission(
|
||||
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||
* );
|
||||
*
|
||||
* if (!hasPermission) {
|
||||
* const result = await this.androidPermissions.requestPermission(
|
||||
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||
* );
|
||||
*
|
||||
* if (!result.hasPermission) {
|
||||
* throw new Error('Permissions required');
|
||||
* }
|
||||
*
|
||||
* // ok, a user gave us permission, we can get him identifiers after restart app
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* return this.uid.IMEI
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Uid',
|
||||
plugin: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
||||
pluginRef: 'cordova.plugins.uid',
|
||||
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class Uid extends IonicNativePlugin {
|
||||
|
||||
/** Get the device Universally Unique Identifier (UUID). */
|
||||
@CordovaProperty
|
||||
UUID: string;
|
||||
|
||||
/** Get the device International Mobile Station Equipment Identity (IMEI). */
|
||||
@CordovaProperty
|
||||
IMEI: string;
|
||||
|
||||
/** Get the device International mobile Subscriber Identity (IMSI). */
|
||||
@CordovaProperty
|
||||
IMSI: string;
|
||||
|
||||
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
|
||||
@CordovaProperty
|
||||
ICCID: string;
|
||||
|
||||
/** Get the Media Access Control address (MAC). */
|
||||
@CordovaProperty
|
||||
MAC: string;
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export interface VideoOptions {
|
||||
*/
|
||||
volume?: number;
|
||||
/**
|
||||
* There are to options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
|
||||
* There are two options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
|
||||
* These strings are the only ones which can be passed as option.
|
||||
*/
|
||||
scalingMode?: number;
|
||||
|
||||
@@ -5,6 +5,11 @@ export interface WheelSelectorItem {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface DefaultItem {
|
||||
index: number;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface WheelSelectorOptions {
|
||||
/**
|
||||
* The title of the selector's input box
|
||||
@@ -17,9 +22,9 @@ export interface WheelSelectorOptions {
|
||||
items: Array<Array<WheelSelectorItem>>;
|
||||
|
||||
/**
|
||||
* Which items to display by default, example ["2","Apple"] (if items.length is 2 for instance)
|
||||
* Which items to display by default.
|
||||
*/
|
||||
defaultItems?: Array<WheelSelectorItem>;
|
||||
defaultItems?: Array<DefaultItem>;
|
||||
|
||||
/**
|
||||
* The 'ok' button text
|
||||
@@ -127,9 +132,9 @@ export interface WheelSelectorData {
|
||||
* positiveButtonText: "Ok",
|
||||
* negativeButtonText: "Nope",
|
||||
* defaultItems: [
|
||||
* this.jsonData.numbers[2], // '3'
|
||||
* this.jsonData.fruits[3] // 'Banana'
|
||||
* ]
|
||||
* {index:0, value: this.jsonData.numbers[2].description},
|
||||
* {index: 1, value: this.jsonData.fruits[3].description}
|
||||
* ]
|
||||
* }).then(
|
||||
* result => {
|
||||
* console.log(result[0].description + ' ' + result[1].description);
|
||||
@@ -150,8 +155,8 @@ export interface WheelSelectorData {
|
||||
* ],
|
||||
* displayKey: 'name',
|
||||
* defaultItems: [
|
||||
* this.jsonData.firstNames[2],
|
||||
* this.jsonData.lastNames[3]
|
||||
* {index:0, value: this.jsonData.firstNames[2].name},
|
||||
* {index: 0, value: this.jsonData.lastNames[3].name}
|
||||
* ]
|
||||
* }).then(
|
||||
* result => {
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface ZeroconfService {
|
||||
}
|
||||
|
||||
export interface ZeroconfResult {
|
||||
action: 'registered' | 'added' | 'removed';
|
||||
action: 'registered' | 'added' | 'removed' | 'resolved';
|
||||
service: ZeroconfService;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user