forked from github/awesome-cordova-plugins
Compare commits
166 Commits
v4.0.1
...
v5.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a12dc0792 | ||
|
|
2093c5cb29 | ||
|
|
d43fe72f7b | ||
|
|
c038c6331c | ||
|
|
212bd63191 | ||
|
|
4694c422aa | ||
|
|
38bbf01e8c | ||
|
|
b9b781ddee | ||
|
|
6053296998 | ||
|
|
9f72592fcc | ||
|
|
7c2a761078 | ||
|
|
9a5211001f | ||
|
|
03f578909b | ||
|
|
acd1a80e4d | ||
|
|
bf41506324 | ||
|
|
47dd7e90ed | ||
|
|
afca8761d7 | ||
|
|
5159367db8 | ||
|
|
d06fa48866 | ||
|
|
8f00e44d21 | ||
|
|
9e6f178378 | ||
|
|
997c96b97f | ||
|
|
ae94c710af | ||
|
|
86b2a2ca73 | ||
|
|
c1ce5dac18 | ||
|
|
091ac7a68c | ||
|
|
bd5bcdc9b7 | ||
|
|
dc707fd80c | ||
|
|
3e933bbaff | ||
|
|
86181afc27 | ||
|
|
784f948a5b | ||
|
|
2a4bcee6a0 | ||
|
|
d95ae68c9c | ||
|
|
8b78644680 | ||
|
|
5d48cfd419 | ||
|
|
b2c873cc99 | ||
|
|
bb2291cd16 | ||
|
|
7255795ae5 | ||
|
|
c9b49ccc39 | ||
|
|
9844274213 | ||
|
|
154a4bcacb | ||
|
|
10a96fcdd6 | ||
|
|
7ab522edec | ||
|
|
50d7762b8a | ||
|
|
0a8146b76c | ||
|
|
2d60db9d3b | ||
|
|
3378d7a398 | ||
|
|
61defd480c | ||
|
|
4e28295486 | ||
|
|
dee32c921c | ||
|
|
2475c57e00 | ||
|
|
79b522f832 | ||
|
|
ccb2e55435 | ||
|
|
f09c9cfe9a | ||
|
|
d96d3eef07 | ||
|
|
95daca166b | ||
|
|
196be026ea | ||
|
|
1fa7c91105 | ||
|
|
ba105be55f | ||
|
|
92d26eab94 | ||
|
|
ce6e412788 | ||
|
|
7243ed3960 | ||
|
|
264670211d | ||
|
|
847147a5fa | ||
|
|
4639bf9a94 | ||
|
|
abb77e3e08 | ||
|
|
975f08b7b5 | ||
|
|
773722b767 | ||
|
|
447aa56e3c | ||
|
|
8d22798278 | ||
|
|
30297fb81d | ||
|
|
ac777fca40 | ||
|
|
43b70a12b5 | ||
|
|
ef28078815 | ||
|
|
e304ce0e53 | ||
|
|
9e5f03f15d | ||
|
|
465d5519d0 | ||
|
|
d683b9e5df | ||
|
|
2b2476e873 | ||
|
|
196adc8b2f | ||
|
|
363b41e075 | ||
|
|
2179699622 | ||
|
|
e65406cc2f | ||
|
|
ddb6d43ffa | ||
|
|
30ed33a046 | ||
|
|
3d0a12d40d | ||
|
|
6ca5beaf0b | ||
|
|
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 | ||
|
|
247efa656a |
8
.github/ISSUE_TEMPLATE.md
vendored
8
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,7 +1,7 @@
|
||||
**I'm submitting a ...** (check one with "x")
|
||||
[ ] bug report
|
||||
[ ] feature request
|
||||
<!-- Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/ -->
|
||||
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
|
||||
|
||||
**Current behavior:**
|
||||
<!-- Describe how the bug manifests. -->
|
||||
@@ -21,8 +21,8 @@ insert any relevant code here
|
||||
**Other information:**
|
||||
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
|
||||
|
||||
**package.json info:**
|
||||
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):
|
||||
|
||||
```json
|
||||
insert the content here
|
||||
```
|
||||
insert the output from ionic info here
|
||||
```
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,5 +3,5 @@ node_modules/
|
||||
.idea
|
||||
.tmp
|
||||
aot/
|
||||
dist/
|
||||
scripts/ionic-native-bower
|
||||
dist/
|
||||
|
||||
200
CHANGELOG.md
200
CHANGELOG.md
@@ -1,3 +1,199 @@
|
||||
<a name="4.5.0"></a>
|
||||
# [4.5.0](https://github.com/ionic-team/ionic-native/compare/v4.4.2...v4.5.0) (2017-12-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **alipay:** add 'string' as an alternative type for 'pay()' input parameter; ([#2172](https://github.com/ionic-team/ionic-native/issues/2172)) ([d43fe72](https://github.com/ionic-team/ionic-native/commit/d43fe72))
|
||||
* **app-rate:** add simpleMode ([#2155](https://github.com/ionic-team/ionic-native/issues/2155)) ([9844274](https://github.com/ionic-team/ionic-native/commit/9844274))
|
||||
* **app-rate:** change openStoreInApp to inAppReview ([#2097](https://github.com/ionic-team/ionic-native/issues/2097)) ([d95ae68](https://github.com/ionic-team/ionic-native/commit/d95ae68))
|
||||
* **camera-preview:** add missing `tapToFocus` camera option ([#2046](https://github.com/ionic-team/ionic-native/issues/2046)) ([b9b781d](https://github.com/ionic-team/ionic-native/commit/b9b781d))
|
||||
* **deeplinks:** add options parameter([#1601](https://github.com/ionic-team/ionic-native/issues/1601)) ([#2141](https://github.com/ionic-team/ionic-native/issues/2141)) ([bb2291c](https://github.com/ionic-team/ionic-native/commit/bb2291c))
|
||||
* **ftp:** return observable (not promise) for upload and download method ([#2174](https://github.com/ionic-team/ionic-native/issues/2174)) ([5159367](https://github.com/ionic-team/ionic-native/commit/5159367))
|
||||
* **indexappcontent:** Return observable for onItemPressed ([#2006](https://github.com/ionic-team/ionic-native/issues/2006)) ([9a52110](https://github.com/ionic-team/ionic-native/commit/9a52110))
|
||||
* **mobile-accessibility:** change signature references to the correct names ([#2139](https://github.com/ionic-team/ionic-native/issues/2139)) ([b2c873c](https://github.com/ionic-team/ionic-native/commit/b2c873c))
|
||||
* **ms-adal:** add userInfo in the AuthenticationResult ([#2160](https://github.com/ionic-team/ionic-native/issues/2160)) ([c038c63](https://github.com/ionic-team/ionic-native/commit/c038c63))
|
||||
* **music-controls:** various fixes ([#2094](https://github.com/ionic-team/ionic-native/issues/2094)) ([afca876](https://github.com/ionic-team/ionic-native/commit/afca876))
|
||||
* **push:** add senderID to AndroidPushOptions ([#2060](https://github.com/ionic-team/ionic-native/issues/2060)) ([4694c42](https://github.com/ionic-team/ionic-native/commit/4694c42))
|
||||
* **web-intent:** fix false negative of plugin installation ([#2062](https://github.com/ionic-team/ionic-native/issues/2062)) ([ae94c71](https://github.com/ionic-team/ionic-native/commit/ae94c71))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android exoplayer:** add cordova-plugin-exoplayer ([#2180](https://github.com/ionic-team/ionic-native/issues/2180)) ([d06fa48](https://github.com/ionic-team/ionic-native/commit/d06fa48))
|
||||
* **android-fingerprint:** add getSigningCertificateFingerprint() method ([#2076](https://github.com/ionic-team/ionic-native/issues/2076)) ([bd5bcdc](https://github.com/ionic-team/ionic-native/commit/bd5bcdc))
|
||||
* **apple-pay:** add cordova-plugin-applepay ([#2081](https://github.com/ionic-team/ionic-native/issues/2081)) ([784f948](https://github.com/ionic-team/ionic-native/commit/784f948))
|
||||
* **apple-pay:** update for version 3 of the Apple Pay plugin. ([#2177](https://github.com/ionic-team/ionic-native/issues/2177)) ([bf41506](https://github.com/ionic-team/ionic-native/commit/bf41506))
|
||||
* **ble:** support startStateNotifications & stopStateNotifications ([#2085](https://github.com/ionic-team/ionic-native/issues/2085)) ([2a4bcee](https://github.com/ionic-team/ionic-native/commit/2a4bcee))
|
||||
* **braintree:** add support for cordova-plugin-braintree to [@ionic-native](https://github.com/ionic-native) ([#2073](https://github.com/ionic-team/ionic-native/issues/2073)) ([091ac7a](https://github.com/ionic-team/ionic-native/commit/091ac7a))
|
||||
* **call-number:** add isCallSupported method ([#2051](https://github.com/ionic-team/ionic-native/issues/2051)) ([6053296](https://github.com/ionic-team/ionic-native/commit/6053296))
|
||||
* **dns:** add cordova-plugin-dns plugin ([#2083](https://github.com/ionic-team/ionic-native/issues/2083)) ([212bd63](https://github.com/ionic-team/ionic-native/commit/212bd63))
|
||||
* **firebase:** add new Firebase phone verification methods ([#2157](https://github.com/ionic-team/ionic-native/issues/2157)) ([86181af](https://github.com/ionic-team/ionic-native/commit/86181af))
|
||||
* **GooglePlayGamesServices:** add plugin ([#1904](https://github.com/ionic-team/ionic-native/issues/1904)) ([03f5789](https://github.com/ionic-team/ionic-native/commit/03f5789))
|
||||
* **network-interface:** add plugin support ([#2063](https://github.com/ionic-team/ionic-native/issues/2063)) ([86b2a2c](https://github.com/ionic-team/ionic-native/commit/86b2a2c))
|
||||
* **nfc:** add interfaces and missing references to UriHelper and TextHelper ([#2104](https://github.com/ionic-team/ionic-native/issues/2104)) ([8b78644](https://github.com/ionic-team/ionic-native/commit/8b78644))
|
||||
* **nfc:** add support for iOS ([#2050](https://github.com/ionic-team/ionic-native/issues/2050)) ([9f72592](https://github.com/ionic-team/ionic-native/commit/9f72592))
|
||||
* **push:** add support for version 2.1.0 ([#2064](https://github.com/ionic-team/ionic-native/issues/2064)) ([c1ce5da](https://github.com/ionic-team/ionic-native/commit/c1ce5da))
|
||||
* **zeroconf:** add reInit() method ([#2144](https://github.com/ionic-team/ionic-native/issues/2144)) ([7255795](https://github.com/ionic-team/ionic-native/commit/7255795))
|
||||
|
||||
|
||||
|
||||
<a name="4.4.2"></a>
|
||||
## [4.4.2](https://github.com/ionic-team/ionic-native/compare/v4.4.1...v4.4.2) (2017-11-15)
|
||||
|
||||
|
||||
|
||||
<a name="4.4.1"></a>
|
||||
## [4.4.1](https://github.com/ionic-team/ionic-native/compare/v4.4.0...v4.4.1) (2017-11-13)
|
||||
|
||||
|
||||
|
||||
<a name="4.4.0"></a>
|
||||
# [4.4.0](https://github.com/ionic-team/ionic-native/compare/v4.3.3...v4.4.0) (2017-11-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-maps:** accept own properties for `addMarker()` and others ([#2093](https://github.com/ionic-team/ionic-native/issues/2093)) ([196be02](https://github.com/ionic-team/ionic-native/commit/196be02))
|
||||
* **http:** add support for new methods ([#2054](https://github.com/ionic-team/ionic-native/issues/2054)) ([d96d3ee](https://github.com/ionic-team/ionic-native/commit/d96d3ee))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.3"></a>
|
||||
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/v4.3.2...v4.3.3) (2017-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** HtmlInfoWindow should extend BaseClass [#2034](https://github.com/ionic-team/ionic-native/issues/2034) ([#2035](https://github.com/ionic-team/ionic-native/issues/2035)) ([ce6e412](https://github.com/ionic-team/ionic-native/commit/ce6e412))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.2) (2017-10-18)
|
||||
|
||||
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.1...4.3.2) (2017-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-maps:** remove type from GoogleMapsEvent constant ([4639bf9](https://github.com/ionic-team/ionic-native/commit/4639bf9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pro:** support corova-plugin-ionic v2.0.0 ([975f08b](https://github.com/ionic-team/ionic-native/commit/975f08b))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.1"></a>
|
||||
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...4.3.1) (2017-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **BLE:** make readRSSI() not static ([#2011](https://github.com/ionic-team/ionic-native/issues/2011)) ([363b41e](https://github.com/ionic-team/ionic-native/commit/363b41e))
|
||||
* **google-maps:** various fixed introduced in previous release ([#2024](https://github.com/ionic-team/ionic-native/issues/2024)) ([6ca5bea](https://github.com/ionic-team/ionic-native/commit/6ca5bea))
|
||||
* **onesignal:** fix property name ([#2019](https://github.com/ionic-team/ionic-native/issues/2019)) ([30ed33a](https://github.com/ionic-team/ionic-native/commit/30ed33a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
|
||||
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.0"></a>
|
||||
# [4.3.0](https://github.com/ionic-team/ionic-native/compare/v4.2.1...v4.3.0) (2017-09-27)
|
||||
|
||||
|
||||
### 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:** 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.1"></a>
|
||||
## [4.2.1](https://github.com/ionic-team/ionic-native/compare/v4.2.0...v4.2.1) (2017-08-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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))
|
||||
|
||||
|
||||
|
||||
<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)
|
||||
|
||||
@@ -1702,13 +1898,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; }
|
||||
```
|
||||
18
README.md
18
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();
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
4890
package-lock.json
generated
4890
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "4.0.1",
|
||||
"version": "4.5.0",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "4.1.3",
|
||||
"@angular/compiler-cli": "4.1.3",
|
||||
"@angular/core": "4.1.3",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.5.51",
|
||||
"@types/node": "^7.0.27",
|
||||
"@types/jasmine": "^2.6.3",
|
||||
"@types/node": "^8.0.50",
|
||||
"canonical-path": "0.0.2",
|
||||
"child-process-promise": "2.2.1",
|
||||
"conventional-changelog-cli": "1.3.1",
|
||||
"cpr": "2.0.2",
|
||||
"conventional-changelog-cli": "1.3.4",
|
||||
"cpr": "2.0.0",
|
||||
"cz-conventional-changelog": "2.0.0",
|
||||
"decamelize": "1.2.0",
|
||||
"dgeni": "0.4.7",
|
||||
@@ -39,12 +39,12 @@
|
||||
"q": "1.5.0",
|
||||
"queue": "4.2.1",
|
||||
"rimraf": "2.6.1",
|
||||
"rxjs": "5.4.0",
|
||||
"rxjs": "5.5.2",
|
||||
"semver": "5.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"typescript": "2.3.3",
|
||||
"zone.js": "0.8.12"
|
||||
"typescript": "~2.4.2",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run test:watch",
|
||||
|
||||
@@ -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 || >=4.0.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,6 +22,10 @@ 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 = [];
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
import { Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
/**
|
||||
* This is a template for new plugin wrappers
|
||||
*
|
||||
* TODO:
|
||||
* - Add/Change information below
|
||||
* - Document usage (importing, executing main functionality)
|
||||
* - Remove any imports that you are not using
|
||||
* - Add this file to /src/index.ts (follow style of other plugins)
|
||||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added
|
||||
* - Remove this note
|
||||
*
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name {{ Plugin_Name }}
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -15,16 +29,33 @@ import { Injectable } from '@angular/core';
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.{{ pluginName }}.functionName('Hello', 123)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: '{{ PluginName }}',
|
||||
plugin: '',
|
||||
pluginRef: '',
|
||||
repo: '',
|
||||
platforms: []
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
installVariables: [], // OPTIONAL the plugin requires variables
|
||||
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class {{ PluginName }} extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function does something
|
||||
* @param arg1 {string} Some param to configure something
|
||||
* @param arg2 {number} Another param to configure something
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
functionName(arg1: string, arg2: number): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,8 +40,9 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: '', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: '', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: '', // the github repository URL for the plugin
|
||||
platforms: [], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
installVariables: [], // OPTIONAL the plugin requires variables
|
||||
platforms: [] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class {{ PluginName }} extends IonicNativePlugin {
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -104,17 +105,6 @@ export interface CordovaCheckOptions {
|
||||
observable?: boolean;
|
||||
}
|
||||
|
||||
export interface CordovaFiniteObservableOptions extends CordovaOptions {
|
||||
/**
|
||||
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
|
||||
*/
|
||||
resultFinalPredicate?: (result: any) => boolean;
|
||||
/**
|
||||
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
|
||||
*/
|
||||
resultTransform?: (result: any) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@@ -166,7 +156,6 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
@@ -252,7 +241,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[]) {
|
||||
@@ -322,39 +311,3 @@ export function CordovaFunctionOverride(opts: any = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
|
||||
*
|
||||
*/
|
||||
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
|
||||
if (opts.observable === false) {
|
||||
throw new Error('CordovaFiniteObservable decorator can only be used on methods that returns observable. Please provide correct option.');
|
||||
}
|
||||
opts.observable = true;
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
let wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
|
||||
return new Observable<any>((observer) => {
|
||||
let wrappedSubscription = wrappedObservable.subscribe({
|
||||
next: (x) => {
|
||||
observer.next(opts.resultTransform ? opts.resultTransform(x) : x);
|
||||
if (opts.resultFinalPredicate && opts.resultFinalPredicate(x)) {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
error: (err) => { observer.error(err); },
|
||||
complete: () => { observer.complete(); }
|
||||
});
|
||||
return () => {
|
||||
wrappedSubscription.unsubscribe();
|
||||
};
|
||||
});
|
||||
},
|
||||
enumerable: true
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -101,17 +101,17 @@ export interface AlipayOrder {
|
||||
plugin: 'cordova-alipay-base',
|
||||
pluginRef: 'Alipay.Base',
|
||||
repo: 'https://github.com/xueron/cordova-alipay-base',
|
||||
install: 'ionic cordova plugin add cordova-alipay-base --variable APP_ID=your_app_id',
|
||||
installVariables: ['APP_ID'],
|
||||
install: 'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id',
|
||||
installVariables: ['ALI_PID'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Alipay extends IonicNativePlugin {
|
||||
/**
|
||||
* Open Alipay to perform App pay
|
||||
* @param order { AlipayOrder } alipay options
|
||||
* @param order { AlipayOrder | string } alipay options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
pay(order: AlipayOrder): Promise<any> { return; }
|
||||
pay(order: AlipayOrder | string): Promise<any> { return; }
|
||||
}
|
||||
|
||||
273
src/@ionic-native/plugins/android-exoplayer/index.ts
Normal file
273
src/@ionic-native/plugins/android-exoplayer/index.ts
Normal file
@@ -0,0 +1,273 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AndroidExoPlayerAspectRatio = 'FILL_SCREEN' | 'FIT_SCREEN';
|
||||
|
||||
export interface AndroidExoPlayerParams {
|
||||
/**
|
||||
* Url of the video to play.
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Set the user agent. Default is `ExoPlayerPlugin`
|
||||
*/
|
||||
userAgent?: string;
|
||||
|
||||
/**
|
||||
* Set the player aspect ratio.
|
||||
*/
|
||||
aspectRatio?: AndroidExoPlayerAspectRatio;
|
||||
|
||||
/**
|
||||
* Hide controls after this many milliseconds, default is `5000`.
|
||||
*/
|
||||
hideTimeout?: number;
|
||||
|
||||
/**
|
||||
* When set to false stream will not automatically start.
|
||||
*/
|
||||
autoPlay?: boolean;
|
||||
|
||||
/**
|
||||
* Start playback at this many milliseconds into video, default is `0`.
|
||||
*/
|
||||
seekTo?: number;
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds to use when skipping forward, default is `1000`.
|
||||
*/
|
||||
forwardTime?: number;
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds to use when skipping backward, default is `1000`.
|
||||
*/
|
||||
rewindTime?: number;
|
||||
|
||||
/**
|
||||
* Only play audio in the backgroud, default is `false`.
|
||||
* If you pass in `audioOnly: true`, make sure to manually close the player on some event (like escape button) since the plugin won't be detecting keypresses when playing audio in the background.
|
||||
*/
|
||||
audioOnly?: true;
|
||||
|
||||
/**
|
||||
* Optional subtitle url to display over the video.
|
||||
* We currently support .srt and .vtt subtitle formats. Subtitles are not supported on all stream types, as ExoPlayer has requirement that both video and subtitle "must have the same number of periods, and must not have any dynamic windows", which means for simple mp4s it should work, but on more complex HLS/Dash setups it might not.
|
||||
*/
|
||||
subtitleUrl?: string;
|
||||
|
||||
/**
|
||||
* okhttp connect timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
connectTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp read timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
readTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp write timeout in milliseconds (default is `0`)
|
||||
*/
|
||||
writeTimeout?: number;
|
||||
|
||||
/**
|
||||
* okhttp socket ping interval in milliseconds (default is `0` or disabled)
|
||||
*/
|
||||
pingInterval?: number;
|
||||
|
||||
/**
|
||||
* Number of times datasource will retry the stream before giving up (default is `3`)
|
||||
*/
|
||||
retryCount?: number;
|
||||
|
||||
/**
|
||||
* If this object is not present controller will not be visible.
|
||||
*/
|
||||
controller?: AndroidExoPlayerControllerConfig;
|
||||
}
|
||||
|
||||
export interface AndroidExoplayerState {
|
||||
[s: string]: string;
|
||||
}
|
||||
|
||||
export interface AndroidExoPlayerControllerConfig {
|
||||
/**
|
||||
* Image in the controller.
|
||||
*/
|
||||
streamImage: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
streamTitle: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
streamDescription: string;
|
||||
|
||||
/**
|
||||
* Hide entire progress bar.
|
||||
*/
|
||||
hideProgress?: true;
|
||||
|
||||
/**
|
||||
* If progress bar is visible hide current position from it
|
||||
*/
|
||||
hidePosition: false;
|
||||
|
||||
/**
|
||||
* If progress bar is visible Hide stream duration from it
|
||||
*/
|
||||
hideDuration: false;
|
||||
|
||||
/**
|
||||
* Override the player control button icons.
|
||||
*/
|
||||
controlIcons?: {
|
||||
/**
|
||||
* Rewind button icon.
|
||||
*/
|
||||
exo_rew: string;
|
||||
|
||||
/**
|
||||
* Play button icon.
|
||||
*/
|
||||
exo_play: string;
|
||||
|
||||
/**
|
||||
* Payse button icon.
|
||||
*/
|
||||
exo_pause: string;
|
||||
|
||||
/**
|
||||
* Fast forward button icon.
|
||||
*/
|
||||
exo_ffwd: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Android ExoPlayer
|
||||
* @description
|
||||
* Cordova media player plugin using Google's ExoPlayer framework.
|
||||
*
|
||||
* https://github.com/google/ExoPlayer
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AndroidExoPlayer } from '@ionic-native/android-exoplayer';
|
||||
*
|
||||
* constructor(private androidExoPlayer: AndroidExoPlayer) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.androidExoPlayer.show({url: 'http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube'});
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* AndroidExoPlayerParams
|
||||
* AndroidExoplayerState
|
||||
* AndroidExoPlayerControllerConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidExoPlayer',
|
||||
plugin: 'cordova-plugin-exoplayer',
|
||||
pluginRef: 'ExoPlayer',
|
||||
repo: 'https://github.com/frontyard/cordova-plugin-exoplayer',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidExoplayer extends IonicNativePlugin {
|
||||
/**
|
||||
* Show the player.
|
||||
* @param parameters {AndroidExoPlayerParams} Parameters
|
||||
* @return {Observable<AndroidExoplayerState>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'close',
|
||||
clearWithArgs: false,
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
show(parameters: AndroidExoPlayerParams): Observable<AndroidExoplayerState> { return; }
|
||||
|
||||
/**
|
||||
* Switch stream without disposing of the player.
|
||||
* @param url {string} The url of the new stream.
|
||||
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
setStream(url: string, controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Will pause if playing and play if paused
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
playPause(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop playing.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Jump to a particular position.
|
||||
* @param milliseconds {number} Position in stream in milliseconds
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
seekTo(milliseconds: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Jump to a particular time relative to the current position.
|
||||
* @param milliseconds {number} Time in milliseconds
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
seekBy(milliseconds: number): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Get the current player state.
|
||||
* @return {Promise<AndroidExoplayerState>}
|
||||
*/
|
||||
@Cordova()
|
||||
getState(): Promise<AndroidExoplayerState> { return; }
|
||||
|
||||
/**
|
||||
* Show the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
showController(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Hide the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
hideController(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Update the controller configuration.
|
||||
* @param controller {AndroidExoPlayerControllerConfig} Configuration of the controller.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
setController(controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Close and dispose of player, call before destroy.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
close(): Promise<void> { return; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -18,13 +18,15 @@ 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)
|
||||
* result => console.log('Has permission?',result.hasPermission),
|
||||
* err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
|
||||
* );
|
||||
*
|
||||
* this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* Android 26 and above: due to Android 26's changes to permissions handling (permissions are requested at time of use rather than at runtime,) if your app does not include any functions (eg. other Ionic Native plugins) that utilize a particular permission, then `requestPermission()` and `requestPermissions()` will resolve immediately with no prompt shown to the user. Thus, you must include a function utilizing the feature you would like to use before requesting permission for it.
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidPermissions',
|
||||
|
||||
@@ -23,10 +23,15 @@ export interface AppRatePreferences {
|
||||
*/
|
||||
usesUntilPrompt?: number;
|
||||
|
||||
/**
|
||||
* Simple Mode to display the rate dialog directly and bypass negative feedback filtering flow
|
||||
*/
|
||||
simpleMode?: boolean;
|
||||
|
||||
/**
|
||||
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
|
||||
*/
|
||||
openStoreInApp?: boolean;
|
||||
inAppReview?: boolean;
|
||||
|
||||
/**
|
||||
* use custom view for rate dialog. Defaults to `false`
|
||||
|
||||
327
src/@ionic-native/plugins/apple-pay/index.ts
Normal file
327
src/@ionic-native/plugins/apple-pay/index.ts
Normal file
@@ -0,0 +1,327 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {
|
||||
Plugin,
|
||||
Cordova,
|
||||
IonicNativePlugin
|
||||
} from '@ionic-native/core';
|
||||
|
||||
export type IMakePayments = 'This device can make payments and has a supported card' | 'This device cannot make payments.' | 'This device can make payments but has no supported cards';
|
||||
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
|
||||
export type IBillingRequirement = 'none' | 'all' | 'postcode' | 'name' | 'email' | 'phone';
|
||||
export type ITransactionStatus = 'success' | 'failure' | 'invalid-billing-address' | 'invalid-shipping-address' | 'invalid-shipping-contact' | 'require-pin' | 'incorrect-pin' | 'locked-pin';
|
||||
export type ICompleteTransaction = 'Payment status applied.';
|
||||
export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?';
|
||||
|
||||
export interface IPaymentResponse {
|
||||
billingNameFirst?: string;
|
||||
billingNameMiddle?: string;
|
||||
billingNameLast?: string;
|
||||
billingEmailAddress?: string;
|
||||
billingSupplementarySubLocality?: string;
|
||||
billingAddressStreet?: string;
|
||||
billingAddressCity?: string;
|
||||
billingAddressState?: string;
|
||||
billingPostalCode?: string;
|
||||
billingCountry?: string;
|
||||
billingISOCountryCode?: string;
|
||||
|
||||
shippingNameFirst?: string;
|
||||
shippingNameMiddle?: string;
|
||||
shippingNameLast?: string;
|
||||
shippingEmailAddress?: string;
|
||||
shippingPhoneNumber?: string;
|
||||
shippingSupplementarySubLocality?: string;
|
||||
shippingAddressStreet?: string;
|
||||
shippingAddressCity?: string;
|
||||
shippingAddressState?: string;
|
||||
shippingPostalCode?: string;
|
||||
shippingCountry?: string;
|
||||
shippingISOCountryCode?: string;
|
||||
|
||||
paymentData: string;
|
||||
transactionIdentifier: string;
|
||||
paymentMethodDisplayName?: string;
|
||||
paymentMethodNetwork?: string;
|
||||
paymentMethodTypeCard?: string;
|
||||
}
|
||||
|
||||
export interface IOrderItem {
|
||||
label: string;
|
||||
amount: number;
|
||||
}
|
||||
export interface IShippingMethod {
|
||||
identifier: string;
|
||||
label: string;
|
||||
detail: string;
|
||||
amount: number;
|
||||
}
|
||||
export interface IOrderItemsAndShippingMethods {
|
||||
items: IOrderItem[];
|
||||
shippingMethods?: IShippingMethod[];
|
||||
}
|
||||
|
||||
export interface IOrder extends IOrderItemsAndShippingMethods {
|
||||
merchantIdentifier: string;
|
||||
currencyCode: string;
|
||||
countryCode: string;
|
||||
billingAddressRequirement?: IBillingRequirement | IBillingRequirement[];
|
||||
shippingAddressRequirement?: IBillingRequirement | IBillingRequirement[];
|
||||
shippingType?: IShippingType;
|
||||
}
|
||||
|
||||
export interface ISelectedShippingContact {
|
||||
shippingAddressCity: string;
|
||||
shippingAddressState: string;
|
||||
shippingPostalCode: string;
|
||||
shippingISOCountryCode: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Apple Pay
|
||||
* @description
|
||||
* A dependency free Cordova plugin to provide Apple Pay functionality.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ApplePay } from '@ionic-native/apple-pay';
|
||||
*
|
||||
*
|
||||
* constructor(private applePay: ApplePay) { }
|
||||
*
|
||||
* ...
|
||||
* async applePay() {
|
||||
* // This block is optional -- only if you need to update order items/shipping
|
||||
* // methods in response to shipping method selections
|
||||
* this.applePay.startListeningForShippingContactSelection()
|
||||
* .subscribe(async selection => {
|
||||
* try {
|
||||
* await this.applePay.updateItemsAndShippingMethods({
|
||||
* items: getFromSelection(selection),
|
||||
* shippingMethods: getFromSelection(selection),
|
||||
* });
|
||||
* }
|
||||
* catch {
|
||||
* // handle update items error
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* try {
|
||||
* const applePayTransaction = await this.applePay.makePaymentRequest({
|
||||
* items,
|
||||
* shippingMethods,
|
||||
* merchantIdentifier,
|
||||
* currencyCode,
|
||||
* countryCode,
|
||||
* billingAddressRequirement: ['name', 'email', 'phone'],
|
||||
* shippingAddressRequirement: 'none',
|
||||
* shippingType: 'shipping'
|
||||
* });
|
||||
*
|
||||
* const transactionStatus = await completeTransactionWithMerchant(applePayTransaction);
|
||||
* await this.applePay.completeLastTransaction(transactionStatus);
|
||||
* } catch {
|
||||
* // handle payment request error
|
||||
* // Can also handle stop complete transaction but these should normally not occur
|
||||
* }
|
||||
*
|
||||
* // only if you started listening before
|
||||
* await this.applePay.stopListeningForShippingContactSelection();
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ApplePay',
|
||||
plugin: 'cordova-plugin-applepay',
|
||||
pluginRef: 'ApplePay',
|
||||
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class ApplePay extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Detects if the current device supports Apple Pay and has any capable cards registered.
|
||||
* @return {Promise<IMakePayments>} Returns a promise
|
||||
*
|
||||
* @usage
|
||||
* try {
|
||||
* const message = await this.applePay.canMakePayments();
|
||||
* // Apple Pay is enabled and a supported card is setup. Expect:
|
||||
* // 'This device can make payments and has a supported card'
|
||||
* } catch (message) {
|
||||
* // There is an issue, examine the message to see the details, will be:
|
||||
* // 'This device cannot make payments.''
|
||||
* // 'This device can make payments but has no supported cards'
|
||||
* }
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
canMakePayments(): Promise<IMakePayments> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts listening for shipping contact selection changes
|
||||
* Any time the user selects shipping contact, this callback will fire.
|
||||
* You *must* call `updateItemsAndShippingMethods` in response or else the
|
||||
* user will not be able to process payment.
|
||||
* @return {Observable<ISelectedShippingContact>} emits with shipping contact information on
|
||||
* shipping contact selection changes
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopListeningForShippingContactSelection'
|
||||
})
|
||||
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops listening for shipping contact selection changes
|
||||
* @return {Promise} whether stop listening was successful. This should
|
||||
* really only fail if this is called without starting listening
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
stopListeningForShippingContactSelection(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the list of pay sheet items and shipping methods in response to
|
||||
* a shipping contact selection event. This *must* be called in response to
|
||||
* any shipping contact selection event or else the user will not be able
|
||||
* to complete a transaction on the pay sheet. Do not call without
|
||||
* subscribing to shipping contact selection events first
|
||||
* @returns {Promise}
|
||||
*
|
||||
* @param {Object} including `items` and `shippingMethods` properties.
|
||||
*
|
||||
* @usage
|
||||
* this.applePay.startListeningForShippingContactSelection().pluck('shippingAddressState').subscribe(shippingAddressState => {
|
||||
* let shippingMethods;
|
||||
* if ('AK' === shippingAddressState) {
|
||||
* shippingMethods = [{
|
||||
* identifier: 'Alaska',
|
||||
* label: 'Alaska',
|
||||
* detail: 'For shipping to Alaska',
|
||||
* amount: 9.99
|
||||
* },];
|
||||
* } else {
|
||||
* shippingMethods = [{
|
||||
* identifier: 'Continental',
|
||||
* label: 'Continental',
|
||||
* detail: 'For shipping Continentally',
|
||||
* amount: 5.99
|
||||
* }];
|
||||
* }
|
||||
* this.paySheetItems.shippingCost = {
|
||||
* label: 'Shipping Cost',
|
||||
* amount: shippingMethod[0].amount
|
||||
* };
|
||||
* this.applePay.updateItemsAndShippingMethods(this.paySheetItems, shippingMethods);
|
||||
* });
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a payment with Apple Pay
|
||||
* @return {Promise<IPaymentResponse>} Returns a promise that resolves when something happens
|
||||
*
|
||||
* @param order {IOrder}
|
||||
*
|
||||
* @usage
|
||||
* try {
|
||||
* const paymentResponse = this.applePay.makePaymentRequest({
|
||||
* items: [
|
||||
* {
|
||||
* label: '3 x Basket Items',
|
||||
* amount: 49.99
|
||||
* },
|
||||
* {
|
||||
* label: 'Next Day Delivery',
|
||||
* amount: 3.99
|
||||
* },
|
||||
* {
|
||||
* label: 'My Fashion Company',
|
||||
* amount: 53.98
|
||||
* }
|
||||
* ],
|
||||
* shippingMethods: [
|
||||
* {
|
||||
* identifier: 'NextDay',
|
||||
* label: 'NextDay',
|
||||
* detail: 'Arrives tomorrow by 5pm.',
|
||||
* amount: 3.99
|
||||
* },
|
||||
* {
|
||||
* identifier: 'Standard',
|
||||
* label: 'Standard',
|
||||
* detail: 'Arrive by Friday.',
|
||||
* amount: 4.99
|
||||
* },
|
||||
* {
|
||||
* identifier: 'SaturdayDelivery',
|
||||
* label: 'Saturday',
|
||||
* detail: 'Arrive by 5pm this Saturday.',
|
||||
* amount: 6.99
|
||||
* }
|
||||
* ],
|
||||
* merchantIdentifier: 'merchant.apple.test',
|
||||
* currencyCode: 'GBP',
|
||||
* countryCode: 'GB',
|
||||
* billingAddressRequirement: 'none',
|
||||
* shippingAddressRequirement: 'none',
|
||||
* shippingType: 'shipping',
|
||||
* });
|
||||
*
|
||||
* // The user has authorized the payment.
|
||||
*
|
||||
* // Handle the token, asynchronously, i.e. pass to your merchant bank to
|
||||
* // action the payment, then once finished, depending on the outcome:
|
||||
*
|
||||
* // Here is an example implementation:
|
||||
*
|
||||
* const captureStatus = await MyPaymentProvider.authorizeApplePayToken(paymentResponse.paymentData);
|
||||
* await this.applePay.completeLastTransaction('success');
|
||||
* }
|
||||
* catch (err) {
|
||||
* if (isPaymentAuthError(err)) {
|
||||
* this.completeLastTransaction('failure');
|
||||
* }
|
||||
* else {
|
||||
* // Failed to open pay sheet or user canceled payment
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
makePaymentRequest(order: IOrder): Promise<IPaymentResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Once the makePaymentRequest has been resolved successfully, the device will be waiting for a completion event.
|
||||
* This means, that the application must proceed with the token authorisation and return a success, failure,
|
||||
* or other validation error. Once this has been passed back, the Apple Pay sheet will be dismissed via an animation.
|
||||
* @return {Promise<ICompleteTransaction>} Returns a promise that resolves after confirmation of payment authorization completion
|
||||
*
|
||||
* @param complete {ITransactionStatus}
|
||||
*
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true
|
||||
})
|
||||
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -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'],
|
||||
|
||||
@@ -417,6 +417,33 @@ export class BLE extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
isEnabled(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Register to be notified when Bluetooth state changes on the device.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startStateNotifications().subscribe(state => {
|
||||
* console.log("Bluetooth is " + state);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @return Returns an Observable that notifies when the Bluetooth is enabled or disabled on the device.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopStateNotifications',
|
||||
clearWithArgs: false
|
||||
})
|
||||
startStateNotifications(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop state notifications.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
stopStateNotifications(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
*
|
||||
@@ -441,7 +468,7 @@ export class BLE extends IonicNativePlugin {
|
||||
*@returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static readRSSI(
|
||||
readRSSI(
|
||||
deviceId: string,
|
||||
): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
250
src/@ionic-native/plugins/braintree/index.ts
Normal file
250
src/@ionic-native/plugins/braintree/index.ts
Normal file
@@ -0,0 +1,250 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* Options for the setupApplePay method.
|
||||
*/
|
||||
export interface ApplePayOptions {
|
||||
/**
|
||||
* Apple Merchant ID - can be obtained from the Apple Developer Portal.
|
||||
*/
|
||||
merchantId: string;
|
||||
|
||||
/**
|
||||
* The currency in which to receive payment.
|
||||
* This is a 3 letter currency code (ISO-4217) - e.g. "GBP", "USD", "MXN", etc.
|
||||
*/
|
||||
currency: string;
|
||||
|
||||
/**
|
||||
* The locale in which payment is accepted.
|
||||
* This is a 2 letter country code (ISO-3166-1) - e.g. "GB", "US", "MX"
|
||||
*/
|
||||
country: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for the presentDropInPaymentUI method.
|
||||
*/
|
||||
export interface PaymentUIOptions {
|
||||
/**
|
||||
* The amount of the transaction to show in the drop-in UI on the
|
||||
* summary row as well as the call-to-action button, as a string.
|
||||
* If not provided, this value will default to "0.00", e.g. free.
|
||||
* Unless you are simply capturing authorizations, you probably
|
||||
* want to fill this value in!
|
||||
*/
|
||||
amount?: string;
|
||||
|
||||
/**
|
||||
* The description of the transaction to show in the drop-in UI on the summary row.
|
||||
* Defaults to empty string.
|
||||
*/
|
||||
primaryDescription?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Successful callback result for the presentDropInPaymentUI method.
|
||||
*/
|
||||
export interface PaymentUIResult {
|
||||
/**
|
||||
* Indicates if the user used the cancel button to close the dialog without
|
||||
* completing the payment.
|
||||
*/
|
||||
userCancelled: boolean;
|
||||
|
||||
/**
|
||||
* The nonce returned for the payment transaction (if a payment was completed).
|
||||
*/
|
||||
nonce: string;
|
||||
|
||||
/**
|
||||
* The payment type (if a payment was completed) (credit card, check, paypal, etc).
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* A description of the payment method (if a payment was completed).
|
||||
*/
|
||||
localizedDescription: string;
|
||||
|
||||
/**
|
||||
* Information about the credit card used to complete a payment (if a credit card was used).
|
||||
*/
|
||||
card: {
|
||||
/**
|
||||
* The last two digits of the credit card used.
|
||||
*/
|
||||
lastTwo: string;
|
||||
|
||||
/**
|
||||
* An enumerated value used to indicate the type of credit card used.
|
||||
*
|
||||
* Can be one of the following values:
|
||||
*
|
||||
* BTCardNetworkUnknown
|
||||
* BTCardNetworkAMEX
|
||||
* BTCardNetworkDinersClub
|
||||
* BTCardNetworkDiscover
|
||||
* BTCardNetworkMasterCard
|
||||
* BTCardNetworkVisa
|
||||
* BTCardNetworkJCB
|
||||
* BTCardNetworkLaser
|
||||
* BTCardNetworkMaestro
|
||||
* BTCardNetworkUnionPay
|
||||
* BTCardNetworkSolo
|
||||
* BTCardNetworkSwitch
|
||||
* BTCardNetworkUKMaestro
|
||||
*/
|
||||
network: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the PayPal account used to complete a payment (if a PayPal account was used).
|
||||
*/
|
||||
payPalAccount: {
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
phone: string;
|
||||
billingAddress: string;
|
||||
shippingAddress: string;
|
||||
clientMetadataId: string;
|
||||
payerId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the Apple Pay card used to complete a payment (if Apple Pay was used).
|
||||
*/
|
||||
applePaycard: {
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about 3D Secure card used to complete a payment (if 3D Secure was used).
|
||||
*/
|
||||
threeDSecureCard: {
|
||||
liabilityShifted: boolean;
|
||||
liabilityShiftPossible: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about Venmo account used to complete a payment (if a Venmo account was used).
|
||||
*/
|
||||
venmoAccount: {
|
||||
username: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Braintree
|
||||
* @description
|
||||
* This plugin enables the use of the Braintree Drop-In Payments UI in your Ionic applications on Android and iOS, using the native Drop-In UI for each platform (not the Javascript SDK).
|
||||
*
|
||||
* Ionic Native utilizes [a maintaned fork](https://github.com/taracque/cordova-plugin-braintree) of the original `cordova-plugin-braintree`
|
||||
*
|
||||
* For information on how to use Apple Pay with this plugin, please refer to the [plugin documentation](https://github.com/Taracque/cordova-plugin-braintree#apple-pay-ios-only)
|
||||
*
|
||||
* **NOTE**: This is not a complete payments solution. All of the Braintree client-side UIs simply generate a payment nonce that must then be processed by your server to complete the payment.
|
||||
* See the [Braintree Node server documentation](https://developers.braintreepayments.com/start/hello-server/node) for details and a [sample Express server](https://github.com/braintree/braintree_express_example) that implements the required functionality.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Braintree, ApplePayOptions, PaymentUIOptions } from '@ionic-native/braintree';
|
||||
*
|
||||
* constructor(private braintree: Braintree) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Your Braintree `Tokenization Key` from the Braintree dashboard.
|
||||
* // Alternatively you can also generate this token server-side
|
||||
* // using a client ID in order to allow users to use stored payment methods.
|
||||
* // See the [Braintree Client Token documentation](https://developers.braintreepayments.com/reference/request/client-token/generate/node#customer_id) for details.
|
||||
* const BRAINTREE_TOKEN = '<YOUR_BRAINTREE_TOKEN>';
|
||||
*
|
||||
* // NOTE: Do not provide this unless you have configured your Apple Developer account
|
||||
* // as well as your Braintree merchant account, otherwise the Braintree module will fail.
|
||||
* const appleOptions: ApplePayOptions = {
|
||||
* merchantId: '<YOUR MERCHANT ID>',
|
||||
* currency: 'USD',
|
||||
* country: 'US'
|
||||
* };
|
||||
*
|
||||
* const paymentOptions: PaymentUIOptions = {
|
||||
* amount: '14.99',
|
||||
* primaryDescription: 'Your product or service (per /item, /month, /week, etc)',
|
||||
* };
|
||||
*
|
||||
* this.braintree.initialize(BRAINTREE_TOKEN)
|
||||
* .then(() => this.braintree.setupApplePay(appleOptions))
|
||||
* .then(() => this.braintree.presentDropInPaymentUI(paymentOptions))
|
||||
* .then((result: PaymentUIResult) => {
|
||||
* if (result.userCancelled) {
|
||||
* console.log("User cancelled payment dialog.");
|
||||
* } else {
|
||||
* console.log("User successfully completed payment!");
|
||||
* console.log("Payment Nonce: " + result.nonce);
|
||||
* console.log("Payment Result.", result);
|
||||
* }
|
||||
* })
|
||||
* .catch((error: string) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ApplePayOptions
|
||||
* PaymentUIOptions
|
||||
* PaymentUIResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Braintree',
|
||||
plugin: 'cordova-plugin-braintree',
|
||||
pluginRef: 'BraintreePlugin',
|
||||
repo: 'https://github.com/taracque/cordova-plugin-braintree',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic cordova plugin add https://github.com/taracque/cordova-plugin-braintree',
|
||||
installVariables: [],
|
||||
})
|
||||
@Injectable()
|
||||
export class Braintree extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Used to initialize the Braintree client. This function must be called before other methods can be used.
|
||||
* As the initialize code is async, be sure you call all Braintree related methods after the initialize promise has resolved.
|
||||
*
|
||||
* @param token {string} The client token or tokenization key to use with the Braintree client.
|
||||
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
initialize(token: string): Promise<undefined | string> { return; }
|
||||
|
||||
/**
|
||||
* Used to configure Apple Pay on iOS.
|
||||
* In order for Apple Pay payments to appear on the Drop-In Payments UI, you must initialize the Apple Pay framework before using the Drop-In Payments UI.
|
||||
*
|
||||
* Do not turn on Apple Pay in Braintree if you don't have Apple Pay entitlements - the Braintree module will reject the attempt to set up Apple Pay.
|
||||
* Please refer to the [Braintree Merchant Documentation](https://developers.braintreepayments.com/guides/apple-pay/configuration/ios/v4#apple-pay-certificate-request-and-provisioning) to set up a Merchant Account.
|
||||
*
|
||||
* Calling this function on Android is a `noop` so you can call it without having to check which cordova platform you are on! :D
|
||||
*
|
||||
* @param options {ApplePayOptions} The options used to configure Apple Pay.
|
||||
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
setupApplePay(options: ApplePayOptions): Promise<undefined | string> { return; }
|
||||
|
||||
/**
|
||||
* Shows Braintree's Drop-In Payments UI.
|
||||
* Apple Pay is only shown in the Drop In UI if you have previously called `setupApplePay`.
|
||||
*
|
||||
* @param options {PaymentUIOptions} An optional argument used to configure the payment UI; see type definition for parameters. If not provided, the UI will show "0.00" as the price and an empty description.
|
||||
* @return {Promise<PaymentUIResult | string>} Returns a promise that resolves with a PaymentUIResult object on successful payment (or the user cancels), or rejects with a string message describing the failure.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
presentDropInPaymentUI(options?: PaymentUIOptions): Promise<PaymentUIResult | string> { return; }
|
||||
}
|
||||
@@ -44,4 +44,14 @@ export class CallNumber extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if call feature is available
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
isCallSupported(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ export interface CameraPreviewOptions {
|
||||
|
||||
/** Alpha channel of the preview box, float, [0,1], default 1 */
|
||||
alpha?: number;
|
||||
|
||||
/** Tap to set specific focus point. Note, this assumes the camera is full-screen. default false */
|
||||
tapToFocus?: boolean;
|
||||
}
|
||||
|
||||
export interface CameraPreviewPictureOptions {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -32,7 +32,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
plugin: 'cordova-clipboard',
|
||||
pluginRef: 'cordova.plugins.clipboard',
|
||||
repo: 'https://github.com/ihadeed/cordova-clipboard',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
@Injectable()
|
||||
export class Clipboard extends IonicNativePlugin {
|
||||
|
||||
@@ -10,14 +10,105 @@ 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');
|
||||
* })
|
||||
* }
|
||||
* // DOCUMENTS //
|
||||
* getAllDocuments(database_name:string){
|
||||
* let url = this.getUrl();
|
||||
* // include_docs=true will include a doc inside response, it is false by default
|
||||
* url = url + database_name + '/_all_docs?include_docs=true';
|
||||
* return this._http
|
||||
* .get(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* createDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name;
|
||||
* return this._http
|
||||
* .post(url,document)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* let document = {
|
||||
* _id:'You can either specify the document ID (must be string) else couchbase generates one for your doc',
|
||||
* data:{name:'sandman',age:25,city:pune}
|
||||
* }
|
||||
* createDocument('justbe', document);
|
||||
* // successful response
|
||||
* { "id": "string","rev": "string","ok": true }
|
||||
* updateDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name + '/' + document._id;
|
||||
* return this._http
|
||||
* .put(url,document)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
* // for updation of document your document must contain most recent rev(revision) id.
|
||||
* // for each updation of document new rev id is get generated
|
||||
* // successful response
|
||||
* { "id": "string","rev": "string(new revision id)","ok": true }
|
||||
* deleteDocument(database_name:string,document){
|
||||
* let url = this.getUrl();
|
||||
* url = url + database_name + '/' + document._id +'?rev='+doc._rev;
|
||||
* return this._http
|
||||
* .delete(url)
|
||||
* .map(data => { this.results = data['results'] })
|
||||
* .catch((error:any) => {
|
||||
* return Observable.throw(error.json() || 'Couchbase Lite error');
|
||||
* }) .
|
||||
* }
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,13 @@ export interface DeeplinkMatch {
|
||||
|
||||
}
|
||||
|
||||
export interface DeeplinkOptions {
|
||||
/**
|
||||
* Set the matched route as root page using `navCtrl.setRoot()` method.
|
||||
*/
|
||||
root: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Deeplinks
|
||||
* @description This plugin handles deeplinks on iOS and Android for both custom URL scheme links
|
||||
@@ -116,6 +123,8 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
* promise result which you can then use to navigate in the app as you see fit.
|
||||
*
|
||||
* @param {Object} paths
|
||||
*
|
||||
* @param {DeeplinkOptions} options
|
||||
*
|
||||
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
|
||||
* errors if a deeplink comes through that does not match a given path.
|
||||
@@ -123,6 +132,6 @@ export class Deeplinks extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch> { return; }
|
||||
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -125,6 +125,16 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
POWERING_OFF: string;
|
||||
};
|
||||
|
||||
@CordovaProperty
|
||||
motionStatus: {
|
||||
NOT_REQUESTED: string;
|
||||
GRANTED: string;
|
||||
DENIED: string;
|
||||
RESTRICTED: string;
|
||||
NOT_AVAILABLE: string;
|
||||
NOT_DETERMINED: string;
|
||||
UNKNOWN: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if app is able to access device location.
|
||||
@@ -162,7 +172,7 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
/**
|
||||
* Displays the device location settings to allow user to enable location services/change location mode.
|
||||
*/
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
|
||||
@Cordova({ sync: true, platforms: ['Android', 'Windows 10', 'iOS'] })
|
||||
switchToLocationSettings(): void { }
|
||||
|
||||
/**
|
||||
@@ -609,7 +619,26 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
})
|
||||
registerNFCStateChangeHandler(handler: Function): void { }
|
||||
|
||||
/**
|
||||
* Checks if the device data roaming setting is enabled.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isDataRoamingEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device setting for ADB(debug) is switched on.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isADBModeEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Checks if the device is rooted.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
isDeviceRooted(): Promise<boolean> { return; }
|
||||
|
||||
// IOS ONLY
|
||||
|
||||
@@ -640,7 +669,7 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
* Checks if remote (push) notifications are enabled.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
@Cordova({ platforms: ['iOS', 'Android'] })
|
||||
isRemoteNotificationsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
@@ -650,6 +679,14 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isRegisteredForRemoteNotifications(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Returns the authorization status for the application to use Remote Notifications.
|
||||
* Note: Works on iOS 10+ only (iOS 9 and below will invoke the error callback).
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
getRemoteNotificationsAuthorizationStatus(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Indicates the current setting of notification types for the app in the Settings app.
|
||||
* Note: on iOS 8+, if "Allow Notifications" switch is OFF, all types will be returned as disabled.
|
||||
@@ -720,13 +757,23 @@ export class Diagnostic extends IonicNativePlugin {
|
||||
isMotionRequestOutcomeAvailable(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests and checks motion authorization for the application: there is no way to independently request only or check only, so both must be done in one operation.
|
||||
* Requests motion tracking authorization for the application.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestandcheckmotionauthorization)
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requestmotionauthorization)
|
||||
*
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
requestAndCheckMotionAuthorization(): Promise<any> { return; }
|
||||
requestMotionAuthorization(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Checks motion authorization status for the application.
|
||||
*
|
||||
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#getmotionauthorizationstatus)
|
||||
*
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
getMotionAuthorizationStatus(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
40
src/@ionic-native/plugins/dns/index.ts
Normal file
40
src/@ionic-native/plugins/dns/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @name DNS
|
||||
* @description A plugin for Apache Cordova that enables applications to manually resolve hostnames into an underlying network address. This is mostly useful for determining whether there is a problem with the device's DNS server configuration.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { DNS } from '@ionic-native/dns';
|
||||
*
|
||||
*
|
||||
* constructor(private dns: DNS) { }
|
||||
*
|
||||
* ...
|
||||
* this.dns.resolve(hostname)
|
||||
* .then(
|
||||
* address => console.log('Resolved ' + hostname + ' to ' + address),
|
||||
* error => console.log('Failed to resolve ' + hostname + ': ' + error)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DNS',
|
||||
plugin: 'cordova-plugin-dns',
|
||||
pluginRef: 'cordova.plugins.dns',
|
||||
repo: 'https://bitbucket.org/zegeba/cordova-plugin-dns',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class DNS extends IonicNativePlugin {
|
||||
/**
|
||||
* Resolve hostnames into an underlying network address.
|
||||
* @param hostname
|
||||
* @returns {Promise<string>} Returns a promise that resolves with the resolution.
|
||||
*/
|
||||
@Cordova()
|
||||
resolve(hostname: string): Promise<string> { return; }
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -30,17 +30,18 @@ import { Observable } from 'rxjs/Observable';
|
||||
plugin: 'cordova-plugin-firebase',
|
||||
pluginRef: 'FirebasePlugin',
|
||||
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class Firebase extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the device token
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getToken(): Promise<any> { return; }
|
||||
getToken(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when a token is refreshed
|
||||
@@ -49,7 +50,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
onTokenRefresh(): Observable<any> { return; }
|
||||
onTokenRefresh(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when the user opens a notification
|
||||
@@ -58,7 +61,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
onNotificationOpen(): Observable<any> { return; }
|
||||
onNotificationOpen(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permission to receive push notifications
|
||||
@@ -67,14 +72,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
grantPermission(): Promise<any> { return; }
|
||||
grantPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission to receive push notifications
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
* Check permission to receive push notifications
|
||||
* @return {Promise<{isEnabled: boolean}>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<any> { return; }
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set icon badge number. Set to 0 to clear the badge.
|
||||
@@ -82,14 +91,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setBadgeNumber(badgeNumber: number): Promise<any> { return; }
|
||||
setBadgeNumber(badgeNumber: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get icon badge number
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getBadgeNumber(): Promise<any> { return; }
|
||||
getBadgeNumber(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to a topic
|
||||
@@ -97,7 +110,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
subscribe(topic: string): Promise<any> { return; }
|
||||
subscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from a topic
|
||||
@@ -105,7 +120,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
unsubscribe(topic: string): Promise<any> { return; }
|
||||
unsubscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister from firebase, used to stop receiving push notifications.
|
||||
* Call this when you logout user from your app.
|
||||
*/
|
||||
@Cordova()
|
||||
unregister(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
@@ -114,7 +140,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logEvent(type: string, data: any): Promise<any> { return; }
|
||||
logEvent(type: string, data: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an Error using FirebaseCrash
|
||||
@@ -122,7 +150,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logError(message: string): Promise<any> { return; }
|
||||
logError(message: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the current screen in Analytics
|
||||
@@ -130,7 +160,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setScreenName(name: string): Promise<any> { return; }
|
||||
setScreenName(name: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a user id for use in Analytics
|
||||
@@ -138,7 +170,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setUserId(userId: string): Promise<any> { return; }
|
||||
setUserId(userId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a user property for use in Analytics
|
||||
@@ -147,7 +181,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||
setUserProperty(name: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app
|
||||
@@ -158,14 +194,18 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
fetch(cacheExpirationSeconds?: number): Promise<any> { return; }
|
||||
fetch(cacheExpirationSeconds?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the Remote Config fetched config
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
activateFetched(): Promise<any> { return; }
|
||||
activateFetched(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config value
|
||||
@@ -177,7 +217,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
getValue(key: string, namespace?: string): Promise<any> { return; }
|
||||
getValue(key: string, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a Remote Config byte array
|
||||
@@ -190,7 +232,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
getByteArray(key: string, namespace?: string): Promise<any> { return; }
|
||||
getByteArray(key: string, namespace?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current state of the FirebaseRemoteConfig singleton object
|
||||
@@ -199,7 +243,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
getInfo(): Promise<any> { return; }
|
||||
getInfo(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the settings for the FirebaseRemoteConfig object's operations
|
||||
@@ -209,7 +255,9 @@ export class Firebase extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
setConfigSettings(settings: any): Promise<any> { return; }
|
||||
setConfigSettings(settings: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set defaults in the Remote Config
|
||||
@@ -222,6 +270,34 @@ export class Firebase extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
setDefaults(defaults: any, namespace: string): Promise<any> { return; }
|
||||
setDefaults(defaults: any, namespace: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param phoneNumber {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
getVerificationID(phoneNumber: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param phoneNumber {string} the phone number, including '+' and country code
|
||||
* @param timeoutDuration {number} the timeout in sec - no more SMS will be sent to this number until this timeout expires
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
verifyPhoneNumber(phoneNumber: string, timeoutDuration: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ export class FlurryAnalyticsObject {
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from 'ionic-native/flurry-analytics';
|
||||
* import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from '@ionic-native/flurry-analytics';
|
||||
*
|
||||
* constructor(private flurryAnalytics: FlurryAnalytics) { }
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name FTP
|
||||
@@ -95,24 +96,28 @@ export class FTP extends IonicNativePlugin {
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
upload(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
upload(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Download one remote file on the ftp server to local path.
|
||||
*
|
||||
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||
* @return {Promise<any>} Returns a promise.
|
||||
* @return {Observable<any>} Returns an observable.
|
||||
* It will be triggered many times according the file's size.
|
||||
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||
*/
|
||||
@Cordova()
|
||||
download(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
download(localFile: string, remoteFile: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Cancel all requests. Always success.
|
||||
|
||||
@@ -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()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
264
src/@ionic-native/plugins/google-play-games-services/index.ts
Normal file
264
src/@ionic-native/plugins/google-play-games-services/index.ts
Normal file
@@ -0,0 +1,264 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface ScoreData {
|
||||
|
||||
/**
|
||||
* The score to submit.
|
||||
*/
|
||||
score: number;
|
||||
|
||||
/**
|
||||
* The leaderboard ID from Google Play Developer console.
|
||||
*/
|
||||
leaderboardId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LeaderboardData {
|
||||
|
||||
/**
|
||||
* The leaderboard ID from Goole Play Developer console.
|
||||
*/
|
||||
leaderboardId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface AchievementData {
|
||||
|
||||
/**
|
||||
* The achievement ID from Google Play Developer console.
|
||||
*/
|
||||
achievementId: string;
|
||||
|
||||
}
|
||||
|
||||
export interface IncrementableAchievementData extends AchievementData {
|
||||
|
||||
/**
|
||||
* The amount to increment the achievement by.
|
||||
*/
|
||||
numSteps: number;
|
||||
|
||||
}
|
||||
|
||||
export interface SignedInResponse {
|
||||
|
||||
/**
|
||||
* True or false is the use is signed in.
|
||||
*/
|
||||
isSignedIn: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface Player {
|
||||
|
||||
/**
|
||||
* The players display name.
|
||||
*/
|
||||
displayName: string;
|
||||
|
||||
/**
|
||||
* The ID given to the player by Play Games Services.
|
||||
*/
|
||||
playerId: string;
|
||||
|
||||
/**
|
||||
* The title of the player based on their gameplay activity. Not
|
||||
* all players have this and it may change over time.
|
||||
*/
|
||||
title: string|null;
|
||||
|
||||
/**
|
||||
* Retrieves the URI for loading this player's icon-size profile image.
|
||||
* Returns null if the player has no profile image.
|
||||
*/
|
||||
iconImageUrl: string;
|
||||
|
||||
/**
|
||||
* Retrieves the URI for loading this player's hi-res profile image. Returns
|
||||
* null if the player has no profile image.
|
||||
*/
|
||||
hiResIconImageUrl: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Google Play Games Services
|
||||
* @description
|
||||
* A Cordova plugin that let's you interact with Google Play Games Services.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GooglePlayGamesServices } from '@ionic-native/google-play-games-services';
|
||||
*
|
||||
*
|
||||
* constructor(private googlePlayGamesServices: GooglePlayGamesServices) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Authenticate with Play Games Services
|
||||
* this.googlePlayGamesServices.auth()
|
||||
* .then(() => console.log('Logged in to Play Games Services'))
|
||||
* .catch(e) => console.log('Error logging in Play Games Services', e);
|
||||
*
|
||||
* // Sign out of Play Games Services.
|
||||
* this.googlePlayGamesServices.signOut()
|
||||
* .then(() => console.log('Logged out of Play Games Services'))
|
||||
* .catch(e => console.log('Error logging out of Play Games Services', e);
|
||||
*
|
||||
* // Check auth status.
|
||||
* this.googlePlayGamesServices.isSignedIn()
|
||||
* .then((signedIn: SignedInResponse) => {
|
||||
* if (signedIn.isSignedIn) {
|
||||
* hideLoginButton();
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // Fetch currently authenticated user's data.
|
||||
* this.googlePlayGamesServices.showPlayer().then((data: Player) => {
|
||||
* console.log('Player data', data);
|
||||
* });
|
||||
*
|
||||
* // Submit a score.
|
||||
* this.googlePlayGamesServices.submitScore({
|
||||
* score: 100,
|
||||
* leaderboardId: 'SomeLeaderboardId'
|
||||
* });
|
||||
*
|
||||
* // Show the native leaderboards window.
|
||||
* this.googlePlayGamesServices.showAllLeaderboards()
|
||||
* .then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
* // Show a signle native leaderboard window.
|
||||
* this.googlePlayGamesServices.showLeaderboard({
|
||||
* leaderboardId: 'SomeLeaderBoardId'
|
||||
* }).then(() => console.log('The leaderboard window is visible.'));
|
||||
*
|
||||
* // Unlock an achievement.
|
||||
* this.googlePlayGamesServices.unlockAchievement({
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement unlocked'));
|
||||
*
|
||||
* // Incremement an achievement.
|
||||
* this.googlePlayGamesServices.incrementAchievement({
|
||||
* step: 1,
|
||||
* achievementId: 'SomeAchievementId'
|
||||
* }).then(() => console.log('Achievement incremented'));
|
||||
*
|
||||
* // Show the native achievements window.
|
||||
* this.googlePlayGamesServices.showAchivements()
|
||||
* .then(() => console.log('The achievements window is visible.'));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'GooglePlayGamesServices',
|
||||
plugin: 'cordova-plugin-play-games-service',
|
||||
pluginRef: 'plugins.playGamesServices',
|
||||
repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
|
||||
platforms: ['Android'],
|
||||
install: 'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID',
|
||||
})
|
||||
@Injectable()
|
||||
export class GooglePlayGamesServices extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Initialise native Play Games Service login procedure.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the player
|
||||
* is authenticated with Play Games Services.
|
||||
*/
|
||||
@Cordova()
|
||||
auth(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Sign out of Google Play Games Services.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolve when the player
|
||||
* successfully signs out.
|
||||
*/
|
||||
@Cordova()
|
||||
signOut(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if the user is signed in.
|
||||
*
|
||||
* @return {Promise<SignedInResponse>} Returns a promise that resolves with
|
||||
* the signed in response.
|
||||
*/
|
||||
@Cordova()
|
||||
isSignedIn(): Promise<SignedInResponse> { return; }
|
||||
|
||||
/**
|
||||
* Show the currently authenticated player.
|
||||
*
|
||||
* @return {Promise<Player>} Returns a promise that resolves when Play
|
||||
* Games Services returns the authenticated player.
|
||||
*/
|
||||
@Cordova()
|
||||
showPlayer(): Promise<Player> { return; }
|
||||
|
||||
/**
|
||||
* Submit a score to a leaderboard. You should ensure that you have a
|
||||
* successful return from auth() before submitting a score.
|
||||
*
|
||||
* @param data {ScoreData} The score data you want to submit.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* score is submitted.
|
||||
*/
|
||||
@Cordova()
|
||||
submitScore(data: ScoreData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controller to show all the
|
||||
* leaderboards.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboards window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showAllLeaderboards(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Launches the native Play Games leaderboard view controll to show the
|
||||
* specified leaderboard.
|
||||
*
|
||||
* @param data {LeaderboardData} The leaderboard you want to show.
|
||||
* @return {Promise<any>} Returns a promise that resolves when the native
|
||||
* leaderboard window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showLeaderboard(data: LeaderboardData): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Unlock an achievement.
|
||||
*
|
||||
* @param data {AchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is unlocked.
|
||||
*/
|
||||
@Cordova()
|
||||
unlockAchievement(data: AchievementData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Increment an achievement.
|
||||
*
|
||||
* @param data {IncrementableAchievementData}
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement is incremented.
|
||||
*/
|
||||
@Cordova()
|
||||
incrementAchievement(data: IncrementableAchievementData): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Lauches the native Play Games achievements view controller to show
|
||||
* achievements.
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise that resolves when the
|
||||
* achievement window opens.
|
||||
*/
|
||||
@Cordova()
|
||||
showAchievements(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -63,4 +63,11 @@ export class GooglePlus extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
disconnect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will retrieve the Android signing certificate fingerprint which is required in the Google Developer Console.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSigningCertificateFingerprint(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -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,41 @@ 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 { }
|
||||
|
||||
/**
|
||||
* Disable following redirects automatically
|
||||
* @param disable {boolean} Set to true to disable following redirects automatically
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
disableRedirect(disable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Set request timeout
|
||||
* @param timeout {number} The timeout in seconds. Default 60
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setRequestTimeout(timeout: number): void { }
|
||||
|
||||
/**
|
||||
* Enable or disable SSL Pinning. This defaults to false.
|
||||
*
|
||||
@@ -112,14 +147,6 @@ export class HTTP extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
acceptAllCerts(accept: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Whether or not to validate the domain name in the certificate. This defaults to true.
|
||||
* @param validate {boolean} Set to true to validate
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
validateDomainName(validate: boolean): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Make a POST request
|
||||
* @param url {string} The url to send the request to
|
||||
@@ -131,7 +158,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 +167,46 @@ 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 PATCH request
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
patch(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
|
||||
|
||||
/**
|
||||
* Make a DELETE request
|
||||
* @param url {string} The url to send the request to
|
||||
* @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; }
|
||||
}
|
||||
@@ -248,12 +248,12 @@ export interface IBeaconDelegate {
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didRangeBeaconsInRegion: ', data),
|
||||
* error => console.error();
|
||||
* error => console.error()
|
||||
* );
|
||||
* delegate.didStartMonitoringForRegion()
|
||||
* .subscribe(
|
||||
* data => console.log('didStartMonitoringForRegion: ', data),
|
||||
* error => console.error();
|
||||
* error => console.error()
|
||||
* );
|
||||
* delegate.didEnterRegion()
|
||||
* .subscribe(
|
||||
|
||||
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, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
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.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onItemPressed(): Observable<any> {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,10 +31,10 @@ declare const cordova: any;
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Jins Meme',
|
||||
plugin: 'JinsMemeSDK-Plugin-Cordova',
|
||||
pluginRef: 'cordova.plugins.JinsMemePlugin',
|
||||
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova',
|
||||
pluginName: 'JINS MEME ES',
|
||||
plugin: 'cordova-plugin-jins-meme-es',
|
||||
pluginRef: 'com.jins_jp.meme.plugin',
|
||||
repo: 'https://github.com/BlyncSync/cordova-plugin-jins-meme-es',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
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 {}
|
||||
|
||||
}
|
||||
@@ -313,8 +313,8 @@ 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; }
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* @name Launch Review
|
||||
* @description
|
||||
*
|
||||
* This launches the native store app in order for the user to leave a review.
|
||||
* On Android, the plugin opens the the app's storepage in the Play Store where the user can leave a review by pressing the stars to give a rating.
|
||||
* On iOS, the plugin opens the app's storepage in the App Store and focuses the Review tab, where the user can leave a review by pressing "Write a review".
|
||||
* Assists in leaving user reviews/ratings in the App Stores.
|
||||
* - Launches the platform's App Store page for the current app in order for the user to leave a review.
|
||||
* - On iOS (10.3 and above) invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -17,9 +17,13 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* const appId: string = 'yourAppId';
|
||||
* this.launchReview.launch(appId)
|
||||
* this.launchReview.launch()
|
||||
* .then(() => console.log('Successfully launched store app');
|
||||
*
|
||||
* if(this.launchReview.isRatingSupported()){
|
||||
* this.launchReview.rating()
|
||||
* .then(() => console.log('Successfully launched rating dialog');
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -33,10 +37,34 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
export class LaunchReview extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Launch store app using given app ID
|
||||
* Launches App Store on current platform in order to leave a review for given app.
|
||||
* @param appId {string} - (optional) the platform-specific app ID to use to open the page in the store app.
|
||||
* If not specified, the plugin will use the app ID for the app in which the plugin is contained.
|
||||
* On Android this is the full package name of the app. For example, for Google Maps: `com.google.android.apps.maps`
|
||||
* On iOS this is the Apple ID of the app. For example, for Google Maps: `585027354`
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
launch(appId: string): Promise<void> { return; }
|
||||
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
|
||||
launch(appId?: string): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Invokes the native in-app rating dialog which allows a user to rate your app without needing to open the App Store.
|
||||
* Requires iOS 10.3 and above: Calling this on any platform/version other than iOS 10.3+ will result in the error callback.
|
||||
* Success callback will be called up to 3 times:
|
||||
* - First: after `LaunchReview.rating()` is called and the request to show the dialog is successful. Will be passed the value `requested`.
|
||||
* - Second: if and when the Rating dialog is actually displayed. Will be passed the value `shown`.
|
||||
* - Third: if and when the Rating dialog is dismissed. Will be passed the value `dismissed`.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
rating(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if the current platform/version supports in-app ratings dialog, i.e. calling LaunchReview.rating().
|
||||
* Will return true if current platform is iOS 10.3 or above.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
|
||||
isRatingSupported(): boolean { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export interface ILocalNotification {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
plugin: 'de.appplant.cordova.plugin.local-notification',
|
||||
plugin: 'cordova-plugin-local-notification',
|
||||
pluginRef: 'cordova.plugins.notification.local',
|
||||
repo: 'https://github.com/katzer/cordova-plugin-local-notifications',
|
||||
platforms: ['Android', 'iOS', 'Windows']
|
||||
@@ -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 { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -114,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.
|
||||
*/
|
||||
|
||||
@@ -63,14 +63,14 @@ export class MobileAccessibility extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isVoiceOverRunningCallback(): Promise<boolean> { return; }
|
||||
isVoiceOverRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* An Android/Amazon Fire OS-specific proxy for the MobileAccessibility.isScreenReaderRunning method.
|
||||
* @returns {Promise<boolean>} A result method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
|
||||
*/
|
||||
@Cordova({ platforms: ['Amazon Fire OS', 'Android'] })
|
||||
isTalkBackRunningCallback(): Promise<boolean> { return; }
|
||||
isTalkBackRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* On Android, this method returns true if ChromeVox is active and properly initialized with access to the text to speech API in the WebView.
|
||||
@@ -85,98 +85,98 @@ export class MobileAccessibility extends IonicNativePlugin {
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isBoldTextEnabledCallback(): Promise<boolean> { return; }
|
||||
isBoldTextEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova()
|
||||
isClosedCaptioningEnabledCallback(): Promise<boolean> { return; }
|
||||
isClosedCaptioningEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isDarkerSystemColorsEnabledCallback(): Promise<boolean> { return; }
|
||||
isDarkerSystemColorsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isGrayscaleEnabledCallback(): Promise<boolean> { return; }
|
||||
isGrayscaleEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isGuidedAccessEnabledCallback(): Promise<boolean> { return; }
|
||||
isGuidedAccessEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isInvertColorsEnabledCallback(): Promise<boolean> { return; }
|
||||
isInvertColorsEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isMonoAudioEnabledCallback(): Promise<boolean> { return; }
|
||||
isMonoAudioEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isReduceMotionEnabledCallback(): Promise<boolean> { return; }
|
||||
isReduceMotionEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isReduceTransparencyEnabledCallback(): Promise<boolean> { return; }
|
||||
isReduceTransparencyEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSpeakScreenEnabledCallback(): Promise<boolean> { return; }
|
||||
isSpeakScreenEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSpeakSelectionEnabledCallback(): Promise<boolean> { return; }
|
||||
isSpeakSelectionEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['iOS'] })
|
||||
isSwitchControlRunningCallback(): Promise<boolean> { return; }
|
||||
isSwitchControlRunning(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<boolean>} Returns the result
|
||||
*/
|
||||
@Cordova({ platforms: ['Amazon Fire OS', 'Android'] })
|
||||
isTouchExplorationEnabledCallback(): Promise<boolean> { return; }
|
||||
isTouchExplorationEnabled(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* * @returns {Promise<number>} Returns the result
|
||||
*/
|
||||
@Cordova()
|
||||
getTextZoomCallback(): Promise<number> { return; }
|
||||
getTextZoom(): Promise<number> { return; }
|
||||
|
||||
/**
|
||||
* @param textZoom {number} A percentage value by which text in the WebView should be scaled.
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface AuthenticationResult {
|
||||
status: string;
|
||||
statusCode: number;
|
||||
tenantId: string;
|
||||
userInfo: UserInfo;
|
||||
|
||||
/**
|
||||
* Creates authorization header for web requests.
|
||||
@@ -137,7 +138,7 @@ export class AuthenticationContext {
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
|
||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> { return; }
|
||||
|
||||
/**
|
||||
* Acquires token WITHOUT using interactive flow. It checks the cache to return existing result
|
||||
@@ -152,6 +153,6 @@ export class AuthenticationContext {
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId: string): Promise<AuthenticationResult> { return; }
|
||||
acquireTokenSilentAsync(resourceUrl: string, clientId: string, userId?: string): Promise<AuthenticationResult> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -3,18 +3,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasClose: boolean;
|
||||
album: string;
|
||||
duration: number;
|
||||
elapsed: number;
|
||||
ticker: string;
|
||||
track?: string;
|
||||
artist?: string;
|
||||
cover?: string;
|
||||
isPlaying?: boolean;
|
||||
dismissable?: boolean;
|
||||
hasPrev?: boolean;
|
||||
hasNext?: boolean;
|
||||
hasSkipForward?: boolean;
|
||||
hasSkipBackward?: boolean;
|
||||
skipForwardInterval?: number;
|
||||
skipBackwardInterval?: number;
|
||||
hasScrubbing?: boolean;
|
||||
hasClose?: boolean;
|
||||
album?: string;
|
||||
duration?: number;
|
||||
elapsed?: number;
|
||||
ticker?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,12 +52,17 @@ export interface MusicControlsOptions {
|
||||
* hasClose : true, // show close button, optional, default: false
|
||||
*
|
||||
* // iOS only, optional
|
||||
* album : 'Absolution' // optional, default: ''
|
||||
* album : 'Absolution', // optional, default: ''
|
||||
* duration : 60, // optional, default: 0
|
||||
* elapsed : 10, // optional, default: 0
|
||||
* hasSkipForward : true, // show skip forward button, optional, default: false
|
||||
* hasSkipBackward : true, // show skip backward button, optional, default: false
|
||||
* skipForwardInterval: 15, // display number for skip forward, optional, default: 0
|
||||
* skipBackwardInterval: 15, // display number for skip backward, optional, default: 0
|
||||
* hasScrubbing: false, // enable scrubbing from control center and lockscreen progress bar, optional
|
||||
*
|
||||
* // Android only, optional
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated
|
||||
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
* });
|
||||
*
|
||||
@@ -83,12 +93,18 @@ export interface MusicControlsOptions {
|
||||
* break;
|
||||
* case 'music-controls-seek-to':
|
||||
* const seekToInSeconds = JSON.parse(action).position;
|
||||
* MusicControls.updateElapsed({
|
||||
* this.musicControls.updateElapsed({
|
||||
* elapsed: seekToInSeconds,
|
||||
* isPlaying: true
|
||||
* });
|
||||
* // 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 +180,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.
|
||||
*/
|
||||
|
||||
58
src/@ionic-native/plugins/network-interface/index.ts
Normal file
58
src/@ionic-native/plugins/network-interface/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Network Interface
|
||||
* @description
|
||||
* Network interface information plugin for Cordova/PhoneGap that supports Android, Blackberry 10, Browser, iOS, and Windows Phone 8.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NetworkInterface } from '@ionic-native/network-interface';
|
||||
*
|
||||
*
|
||||
* constructor(private networkInterface: NetworkInterface) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.networkInterface.getWiFiIPAddress(function (ip) { alert(ip); });
|
||||
* this.networkInterface.getCarrierIPAddress(function (ip) { alert(ip); });
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NetworkInterface',
|
||||
plugin: 'cordova-plugin-networkinterface',
|
||||
pluginRef: 'networkinterface',
|
||||
repo: 'https://github.com/salbahra/cordova-plugin-networkinterface',
|
||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Windows', 'Windows Phone'],
|
||||
})
|
||||
@Injectable()
|
||||
export class NetworkInterface extends IonicNativePlugin {
|
||||
|
||||
@Cordova()
|
||||
getIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the WiFi IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
*/
|
||||
@Cordova()
|
||||
getWiFiIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wireless carrier IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
*/
|
||||
@Cordova()
|
||||
getCarrierIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin, CordovaProperty } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
declare let window: any;
|
||||
|
||||
export interface NdefEvent {
|
||||
tag: NdefTag;
|
||||
}
|
||||
|
||||
export interface NdefRecord {
|
||||
id: any[];
|
||||
payload: number[];
|
||||
tnf: number;
|
||||
type: number[];
|
||||
}
|
||||
|
||||
export interface NdefTag {
|
||||
canMakeReadOnly: boolean;
|
||||
id: number[];
|
||||
isWriteable: boolean;
|
||||
maxSize: number;
|
||||
ndefMessage: NdefRecord[];
|
||||
techTypes: string[];
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name NFC
|
||||
* @description
|
||||
@@ -23,8 +45,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);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -40,6 +71,21 @@ declare let window: any;
|
||||
*/
|
||||
@Injectable()
|
||||
export class NFC extends IonicNativePlugin {
|
||||
/**
|
||||
* Starts the NFCNDEFReaderSession allowing iOS to scan NFC tags.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'invalidateSession',
|
||||
clearWithArgs: true
|
||||
})
|
||||
beginSession(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for any NDEF tag.
|
||||
* @param onSuccess
|
||||
@@ -53,7 +99,7 @@ export class NFC extends IonicNativePlugin {
|
||||
clearFunction: 'removeNdefListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
addNdefListener(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
|
||||
addNdefListener(onSuccess?: Function, onFailure?: Function): Observable<NdefEvent> { return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
@@ -209,15 +255,120 @@ export class NFC extends IonicNativePlugin {
|
||||
@Injectable()
|
||||
export class Ndef extends IonicNativePlugin {
|
||||
|
||||
@Cordova({ sync: true })
|
||||
uriRecord(uri: string): any { return; }
|
||||
@CordovaProperty
|
||||
TNF_EMPTY: number;
|
||||
@CordovaProperty
|
||||
TNF_WELL_KNOWN: number;
|
||||
@CordovaProperty
|
||||
TNF_MIME_MEDIA: number;
|
||||
@CordovaProperty
|
||||
TNF_ABSOLUTE_URI: number;
|
||||
@CordovaProperty
|
||||
TNF_EXTERNAL_TYPE: number;
|
||||
@CordovaProperty
|
||||
TNF_UNKNOWN: number;
|
||||
@CordovaProperty
|
||||
TNF_UNCHANGED: number;
|
||||
@CordovaProperty
|
||||
TNF_RESERVED: number;
|
||||
|
||||
@CordovaProperty
|
||||
RTD_TEXT: number[];
|
||||
@CordovaProperty
|
||||
RTD_URI: number[];
|
||||
@CordovaProperty
|
||||
RTD_SMART_POSTER: number[];
|
||||
@CordovaProperty
|
||||
RTD_ALTERNATIVE_CARRIER: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_CARRIER: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_REQUEST: number[];
|
||||
@CordovaProperty
|
||||
RTD_HANDOVER_SELECT: number[];
|
||||
|
||||
@Cordova({ sync: true })
|
||||
textRecord(text: string): any { return; }
|
||||
record(tnf: number, type: number[] | string, id: number[] | string, payload: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
mimeMediaRecord(mimeType: string, payload: string): any { return; }
|
||||
textRecord(text: string, languageCode: string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
androidApplicationRecord(packageName: string): any { return; }
|
||||
uriRecord(uri: string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
absoluteUriRecord(uri: string, payload: number[] | string, id: number[] | string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
mimeMediaRecord(mimeType: string, payload: string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
smartPoster(ndefRecords: any[], id?: number[] | string ): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
emptyRecord(): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
androidApplicationRecord(packageName: string): NdefRecord { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
encodeMessage(ndefRecords: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
decodeMessage(bytes: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
docodeTnf(tnf_byte: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
encodeTnf(mb: any, me: any, cf: any, sr: any, il: any, tnf: any): any { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
tnfToString(tnf: any): string { return; }
|
||||
|
||||
@CordovaProperty
|
||||
textHelper: TextHelper;
|
||||
|
||||
@CordovaProperty
|
||||
uriHelper: UriHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NFC',
|
||||
plugin: 'phonegap-nfc',
|
||||
pluginRef: 'util'
|
||||
})
|
||||
@Injectable()
|
||||
export class NfcUtil extends IonicNativePlugin {
|
||||
|
||||
@Cordova({ sync: true })
|
||||
toHex(i: number): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
toPrintable(i: number): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
bytesToString(i: number[]): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
stringToBytes(s: string): number[] { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
bytesToHexString(bytes: number[]): string { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
isType(record: NdefRecord, tnf: number, type: number[]|string): boolean { return; }
|
||||
}
|
||||
|
||||
export class TextHelper extends IonicNativePlugin {
|
||||
decodePayload(data: number[]): string { return; }
|
||||
encodePayload(text: string, lang: string): number[] { return; }
|
||||
}
|
||||
|
||||
export class UriHelper extends IonicNativePlugin {
|
||||
decodePayload(data: number[]): string { return; }
|
||||
encodePayload(uri: string): number[] { return; }
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export interface OSNotificationPayload {
|
||||
/**
|
||||
* URL to open when opening the notification.
|
||||
*/
|
||||
launchUrl?: string;
|
||||
launchURL?: string;
|
||||
/**
|
||||
* Sound resource to play when the notification is shown.
|
||||
*/
|
||||
@@ -301,7 +301,8 @@ export enum OSActionType {
|
||||
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
|
||||
* OneSignal is a simple implementation for delivering push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
|
||||
* Please view the official [OneSignal Ionic SDK Installation](https://documentation.onesignal.com/docs/ionic-sdk-setup) guide
|
||||
* for more information.
|
||||
*
|
||||
* #### Icons
|
||||
* If you want to use generated icons with command `ionic cordova resources`:
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,7 @@ export interface LocalNotificationOptions {
|
||||
* import { PhonegapLocalNotification } from '@ionic-native/phonegap-local-notification';
|
||||
*
|
||||
*
|
||||
* constructor(private localNotification: PhonegapLocalNotifications) { }
|
||||
* constructor(private localNotification: PhonegapLocalNotification) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
@@ -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']
|
||||
|
||||
@@ -1,7 +1,54 @@
|
||||
import { Plugin, Cordova, CordovaFiniteObservable, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin, CordovaOptions, wrap } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface CordovaFiniteObservableOptions extends CordovaOptions {
|
||||
/**
|
||||
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
|
||||
*/
|
||||
resultFinalPredicate?: string;
|
||||
/**
|
||||
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
|
||||
*/
|
||||
resultTransform?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*
|
||||
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
|
||||
*/
|
||||
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
|
||||
opts.observable = true;
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value: function(...args: any[]) {
|
||||
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
|
||||
return new Observable<any>((observer: Observer<any>) => {
|
||||
const wrappedSubscription = wrappedObservable.subscribe({
|
||||
next: (x: any) => {
|
||||
observer.next(opts.resultTransform ? x[opts.resultTransform] : x);
|
||||
if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
error: (err: any) => { observer.error(err); },
|
||||
complete: () => { observer.complete(); }
|
||||
});
|
||||
return () => {
|
||||
wrappedSubscription.unsubscribe();
|
||||
};
|
||||
});
|
||||
},
|
||||
enumerable: true
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Photo Library
|
||||
* @description
|
||||
@@ -31,8 +78,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'));
|
||||
@@ -58,8 +105,8 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaFiniteObservable({
|
||||
callbackOrder: 'reverse',
|
||||
resultFinalPredicate: (result: { isLastChunk: boolean }) => { return result.isLastChunk; },
|
||||
resultTransform: (result: { library: LibraryItem[] }) => { return result.library; },
|
||||
resultFinalPredicate: 'isLastChunk',
|
||||
resultTransform: 'library'
|
||||
})
|
||||
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
|
||||
|
||||
@@ -69,7 +116,7 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
|
||||
|
||||
@@ -78,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
getAlbums(): Promise<AlbumItem[]> { return; }
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
export interface PhotoViewerOptions {
|
||||
/**
|
||||
* Set to false to disable the share button (Android only). Default: true
|
||||
*/
|
||||
share?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Photo Viewer
|
||||
* @description This plugin can display your image in full screen with the ability to pan, zoom, and share the image.
|
||||
@@ -29,8 +37,8 @@ export class PhotoViewer extends IonicNativePlugin {
|
||||
* Shows an image in full screen
|
||||
* @param url {string} URL or path to image
|
||||
* @param title {string}
|
||||
* @param options {any}
|
||||
* @param options {PhotoViewerOptions}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
show(url: string, title?: string, options?: {share?: boolean}): void { }
|
||||
show(url: string, title?: string, options?: PhotoViewerOptions): void { }
|
||||
}
|
||||
|
||||
173
src/@ionic-native/plugins/pro/index.ts
Normal file
173
src/@ionic-native/plugins/pro/index.ts
Normal file
@@ -0,0 +1,173 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Information about the currently running app
|
||||
*/
|
||||
export interface AppInfo {
|
||||
platform: string;
|
||||
platformVersion: string;
|
||||
version: string;
|
||||
bundleName: string;
|
||||
bundleVersion: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the current live update
|
||||
*/
|
||||
export interface DeployInfo {
|
||||
deploy_uuid: string;
|
||||
channel: string;
|
||||
binary_version: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object for manually configuring deploy
|
||||
*/
|
||||
export interface DeployConfig {
|
||||
appId?: string;
|
||||
host?: string;
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class ProDeploy {
|
||||
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
|
||||
* @param config A valid Deploy config object
|
||||
*/
|
||||
@CordovaInstance()
|
||||
init(config: DeployConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check a channel for an available update
|
||||
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
check(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Download an available version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
download(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Unzip the latest downloaded version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
extract(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Reload app with the deployed version
|
||||
*/
|
||||
@CordovaInstance()
|
||||
redirect(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get info about the version running on the device
|
||||
* @return {Promise<DeployInfo>} Information about the current version running on the app.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
info(): Promise<DeployInfo> { return; }
|
||||
|
||||
/**
|
||||
* List versions stored on the device
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getVersions(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a version stored on the device by UUID
|
||||
* @param version A version UUID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
deleteVersion(version: string): Promise<any> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Pro
|
||||
* @description
|
||||
* This plugin enables Ionic Pro services like live updates and error monitoring
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Pro, AppInfo, DeployInfo } from '@ionic-native/pro';
|
||||
*
|
||||
*
|
||||
* constructor(private pro: Pro) { }
|
||||
*
|
||||
* // Get app info
|
||||
* this.pro.getAppInfo().then((res: AppInfo) => {
|
||||
* console.log(res)
|
||||
* })
|
||||
*
|
||||
* // Get live update info
|
||||
* this.pro.deploy.info().then((res: DeployInfo) => {
|
||||
* console.log(res)
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Pro',
|
||||
plugin: 'cordova-plugin-ionic',
|
||||
pluginRef: 'IonicCordova',
|
||||
repo: 'https://github.com/ionic-team/cordova-plugin-ionic',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Channel"'
|
||||
})
|
||||
@Injectable()
|
||||
export class Pro extends IonicNativePlugin {
|
||||
/**
|
||||
* Ionic Pro Deploy .js API.
|
||||
*/
|
||||
deploy: ProDeploy = new ProDeploy(Pro.getPlugin().deploy);
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
enableCrashLogging(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
checkForPendingCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
loadPendingCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Not yet implemented
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
forceCrash(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get information about the currently running app
|
||||
* @return {Promise<any>} Returns a promise that resolves with current app info
|
||||
*/
|
||||
@Cordova()
|
||||
getAppInfo(): Promise<AppInfo> { return; }
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -186,15 +180,48 @@ 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';
|
||||
export type Priority = 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
export interface Channel {
|
||||
id: string;
|
||||
description: string;
|
||||
importance: Priority;
|
||||
}
|
||||
|
||||
export type PushEvent = string;
|
||||
|
||||
/**
|
||||
* @name Push
|
||||
@@ -226,22 +253,38 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
*
|
||||
* });
|
||||
*
|
||||
* // Create a channel (Android O and above). You'll need to provide the id, description and importance properties.
|
||||
* this.push.createChannel({
|
||||
* id: "testchannel1",
|
||||
* description: "My first test channel",
|
||||
* // The importance property goes from 1 = Lowest, 2 = Low, 3 = Normal, 4 = High and 5 = Highest.
|
||||
* importance: 3
|
||||
* }).then(() => console.log('Channel created'));
|
||||
*
|
||||
* // Delete a channel (Android O and above)
|
||||
* this.push.deleteChannel('testchannel1').then(() => console.log('Channel deleted'));
|
||||
*
|
||||
* // Return a list of currently configured channels
|
||||
* this.push.listChannels().then((channels) => console.log('List of channels', channels))
|
||||
*
|
||||
* // to initialize push notifications
|
||||
*
|
||||
* const options: PushOptions = {
|
||||
* 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);
|
||||
*
|
||||
*
|
||||
* pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));
|
||||
*
|
||||
* pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
|
||||
@@ -257,6 +300,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
* NotificationEventAdditionalData
|
||||
* IOSPushOptions
|
||||
* AndroidPushOptions
|
||||
* BrowserPushOptions
|
||||
* PushOptions
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -264,8 +308,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()
|
||||
@@ -287,6 +330,27 @@ export class Push extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
|
||||
|
||||
/**
|
||||
* Create a new notification channel for Android O and above.
|
||||
* @param channel {Channel}
|
||||
*/
|
||||
@Cordova()
|
||||
createChannel(channel: Channel): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a notification channel for Android O and above.
|
||||
* @param id
|
||||
*/
|
||||
@Cordova()
|
||||
deleteChannel(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns a list of currently configured channels.
|
||||
* @return {Promise<Channel[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
listChannels(): Promise<Channel[]> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,9 +414,10 @@ export class PushObject {
|
||||
* iOS only
|
||||
* Tells the OS that you are done processing a background push notification.
|
||||
* successHandler gets called when background push processing is successfully completed.
|
||||
* @param id
|
||||
*/
|
||||
@CordovaInstance()
|
||||
finish(): Promise<any> { return; }
|
||||
finish(id?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Tells the OS to clear all notifications from the Notification Center
|
||||
|
||||
@@ -159,6 +159,13 @@ export class QRScanner extends IonicNativePlugin {
|
||||
})
|
||||
enableLight(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Destroy the scanner instance.
|
||||
* @returns {Promise<QRScannerStatus>}
|
||||
*/
|
||||
@Cordova()
|
||||
destroy(): Promise<QRScannerStatus> { return; }
|
||||
|
||||
/**
|
||||
* Disable the device's light.
|
||||
* @return {Promise<QRScannerStatus>}
|
||||
|
||||
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; }
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export interface SafariViewControllerOptions {
|
||||
* enterReaderModeIfAvailable: true,
|
||||
* tintColor: '#ff0000'
|
||||
* })
|
||||
* .then((result: any) => {
|
||||
* .subscribe((result: any) => {
|
||||
* if(result.event === 'opened') console.log('Opened');
|
||||
* else if(result.event === 'loaded') console.log('Loaded');
|
||||
* else if(result.event === 'closed') console.log('Closed');
|
||||
|
||||
@@ -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');
|
||||
* });
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface SmsOptionsAndroid {
|
||||
* @name SMS
|
||||
* @description
|
||||
*
|
||||
* Requires Cordova plugin: cordova-plugin-sms. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin).
|
||||
* Requires Cordova plugin: cordova-sms-plugin. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Injectable } from '@angular/core';
|
||||
/**
|
||||
* @name Taptic Engine
|
||||
* @description
|
||||
* An Ionic plugin to use Taptic Engine API on iPHone 7, 7 Plus or newer.
|
||||
* An Ionic plugin to use Taptic Engine API on iPhone 7, 7 Plus or newer.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaFunctionOverride, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window: any;
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
|
||||
/**
|
||||
@@ -165,16 +162,8 @@ export class ThreeDeeTouch extends IonicNativePlugin {
|
||||
* When a home icon is pressed, your app launches and this JS callback is invoked.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch) {
|
||||
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
} else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
@CordovaFunctionOverride()
|
||||
onHomeIconPressed(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable Link Preview.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -29,7 +29,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
@Plugin({
|
||||
pluginName: 'WebIntent',
|
||||
plugin: 'com-darryncampbell-cordova-plugin-intent',
|
||||
pluginRef: 'intentShim',
|
||||
pluginRef: 'plugins.intentShim',
|
||||
repo: 'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
|
||||
platforms: ['Android']
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface ZeroconfService {
|
||||
}
|
||||
|
||||
export interface ZeroconfResult {
|
||||
action: 'registered' | 'added' | 'removed';
|
||||
action: 'registered' | 'added' | 'removed' | 'resolved';
|
||||
service: ZeroconfService;
|
||||
}
|
||||
|
||||
@@ -124,4 +124,11 @@ export class Zeroconf extends IonicNativePlugin {
|
||||
*/
|
||||
@Cordova()
|
||||
close(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Re-initializes the plugin to clean service & browser state.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
reInit(): Promise<void> { return; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user