Compare commits

...

81 Commits

Author SHA1 Message Date
Ibby Hadeed
b64d61828a chore(): update changelog 2016-11-24 05:25:14 -05:00
Ibby Hadeed
08d66ead9b 2.2.7 2016-11-24 05:22:45 -05:00
Ibby Hadeed
9bd8997a31 fix(file): correct writeFile flags
fixes #789
2016-11-24 05:22:04 -05:00
Ibby Hadeed
156328c9de refractor(): change return type of writeFile 2016-11-24 05:19:12 -05:00
Ibby Hadeed
78b3ec5b1f fix(googlemap): fix typoe googledesic to geodesic
fixes #765
2016-11-23 08:55:49 -05:00
Ibby Hadeed
f07431a14c fix(video-player): scalingMode is number
fixes #774
2016-11-23 08:53:20 -05:00
Ibby Hadeed
8439faf6b8 docs(imagepicker): update repo url 2016-11-23 08:51:04 -05:00
Ibby Hadeed
51ab03d097 feat(google-map): add get and set methods to Marker class
fixes #798
2016-11-23 08:44:43 -05:00
Ibby Hadeed
abd910de67 feat(google-analytics): new interval period parameter
closes #816
2016-11-23 08:34:04 -05:00
Ibby Hadeed
24184a5a6a chore(): tslint 2016-11-23 08:23:55 -05:00
Ibby Hadeed
0b39ff8b7d docs(push): fix install command
closes #803
2016-11-23 08:22:35 -05:00
Ibby Hadeed
6ad54ecf86 feat(camera-preview): add disable method 2016-11-23 08:16:02 -05:00
Ibby Hadeed
3dd863cb49 Merge branch 'master' of github.com:driftyco/ionic-native 2016-11-23 08:05:34 -05:00
Ibby Hadeed
b719a0372b fix(native-audio): completeCallback is optional on play method
closes #792
2016-11-23 08:05:04 -05:00
Ibby Hadeed
bdef1daba5 docs(backgroundmode): remove anchor from repo link 2016-11-23 08:01:10 -05:00
Yasin Simsek
695099b2b0 fix(3dTouch): fixes onHomeIconPressed (#813) 2016-11-23 04:48:08 -05:00
Max Lynch
28f4680575 Merge pull request #764 from shamsher31/patch-1
Update Example for Ionic Native Google Map
2016-11-20 08:16:57 -06:00
Max Lynch
40a7b138e2 Merge pull request #768 from stalniy/fix/file.writeFile
refactor(file): add return value to be  file entry in writeFile
2016-11-20 08:13:53 -06:00
Max Lynch
fa624df1da Merge pull request #769 from ValentinKlinghammer/patch-1
docs(admob) Added basic usage description
2016-11-20 08:12:02 -06:00
Max Lynch
5577c51dbc fix(camera-preview): formatting. Closes #790 2016-11-20 07:54:44 -06:00
Max Lynch
1ab76ae693 Merge pull request #797 from shanesmith/patch-1
docs(media-capture): fix documentation mixup
2016-11-20 07:51:57 -06:00
Max Lynch
98bd5cee38 Merge pull request #801 from morrisonbrett/master
GoogleAnalytics TS file updated to include 'Browser', now that 'Brows…
2016-11-20 07:50:42 -06:00
Max Lynch
f6903cdcdf Merge pull request #804 from nakulgulati/patch-1
Plugin reference fix
2016-11-20 07:50:25 -06:00
Alex Muramoto
b5cc14c546 docs(camera preview): update to correct repo
* docs(camera preview): update to correct repo

* docs(camera preview): fix typo

* docs(camera preview): Update to other repo

* fix(camera preview): revert to old plugin and update repo to matching repo
2016-11-18 17:30:06 -05:00
Nakul Gulati
8988fad713 Plugin reference fix
The plugin reference is available as part of the global `cordova` object and not the global `plugins` object. This caused the plugin to `Plugin not installed warning` even though the plugin is installed and works when using through `cordova.plugins.market.open(appId);`
2016-11-18 17:08:42 +05:30
Brett Morrison
7b8b2d7136 GoogleAnalytics TS file updated to include 'Browser', now that 'Browser' is supported: https://github.com/danwilson/google-analytics-plugin/pull/313 2016-11-17 16:14:02 -08:00
Alex Muramoto
dd2ccef0c7 docs(camera preview): update to correct repo
* docs(camera preview): update to correct repo

* docs(camera preview): fix typo

* docs(camera preview): Update to other repo
2016-11-17 12:53:24 -05:00
Shane Smith
e46f10878e docs(media-capture): fix documentation mixup 2016-11-16 14:43:52 -05:00
mhartington
2dacec0cb5 docs(): hide old open method 2016-11-09 14:14:26 -05:00
Anıl ÜNAL
0c5fadee86 docs(apprate): update usage (#778) 2016-11-08 17:02:10 -05:00
Ramon Henrique Ornelas
01b30c68e1 fix(diagnostics): fix #776 (#777) 2016-11-08 17:01:38 -05:00
Valentin Klinghammer
e5b0365d0c Added basic usage description to AdMob 2016-11-03 10:41:41 +01:00
Sergii Stotskyi
867400d1ac refactor(file): add return value to be updated file entry in writeFile method
Also remove code duplication in writeExistingFile
2016-11-03 06:16:08 +02:00
Mark McEahern
88f6ecf250 docs(inappbrowser): fix typo (#766) 2016-11-02 17:49:34 -04:00
Shamsher Ansari
e6beaa49a4 Update Example for Google Map 2016-11-02 16:44:06 +05:30
Andrew Mitchell
fa03fa544f fix(datepicker): fix allowOldDates option (#761) 2016-11-02 00:13:43 -04:00
Ibby
c22747fa2e chore(): go to SITE_DIR if checking out 2016-10-27 19:18:29 -04:00
Ibby
fd8f80e92b test(): add mixpanel test back 2016-10-27 19:04:59 -04:00
Ibby
17f2fcb829 chore(): update changelog 2016-10-27 19:02:50 -04:00
Ibby
6a412155a3 2.2.6 2016-10-27 19:02:32 -04:00
Ibby
489d860264 chore(): update changelog 2016-10-27 19:02:12 -04:00
Ramon Henrique Ornelas
ca43394185 fix(nfc): don't bind to name field, fix #740 (#749) 2016-10-27 18:51:21 -04:00
Perry Govier
b3eed47cbb Merge pull request #738 from driftyco/clean-docs
chore(scripts): clean old docs before processing
2016-10-27 16:46:56 -05:00
Max Lynch
71916a85dd fix(plugin): don't bind to name field. Fixes #740 2016-10-27 12:48:50 -05:00
Ibby
0669ba5222 2.2.5 2016-10-27 09:17:35 -04:00
Ibby
bec0eac122 style(): tslint 2016-10-27 09:17:11 -04:00
Daniel Flood
00e63d9fc8 docs(youtube-video-player): fix typo (#747)
Changed YouTubeVideoPlayer.openVideo to YoutubeVideoPlayer.openVideo  (notice the T in Youtube).
2016-10-27 09:15:03 -04:00
Ibby
ac181c5439 fix(nfc): fix Ndef class
closes #713
2016-10-27 08:24:28 -04:00
Ibby
8fbf1f2b34 feat(sms): add hasPermission method
closes #721
2016-10-27 08:14:47 -04:00
Ibby
685ac5c7a0 refractor(contacts): export ContactError
closes #731
2016-10-27 08:11:45 -04:00
Ibby
634843e1b2 Merge branch 'master' of github.com:driftyco/ionic-native 2016-10-27 08:09:46 -04:00
Ibby
d5310b0f73 fix(geolocation): fix watchPosition return type
closes #741
2016-10-27 08:09:36 -04:00
Ibby
a72cd59b99 fix(sqlite): fix callback issue with transaction method
closes #732
2016-10-27 08:00:47 -04:00
Ibby
6f4737190b fix(sqlite): check if plugin exists before opening database 2016-10-27 08:00:47 -04:00
Ibby
c98b4f4c85 fix(sqlite): check if plugin exists before opening database 2016-10-27 07:30:06 -04:00
Ibby
8f5532eb74 refractor(mixpanel): remove pluginMeta variable 2016-10-27 07:26:12 -04:00
Ibby
4340597fc9 Merge branch 'master' of github.com:driftyco/ionic-native 2016-10-27 07:25:22 -04:00
Andrew Cole
7324246e6a refractor(mixpanel): remove pluginMeta variable (#742)
Documentation doesn't specify the repo or the correct command for ionic plugin add ...
2016-10-27 07:25:12 -04:00
Ibby
55b6ab9c54 refractor(file): remove pluginMeta variable 2016-10-27 07:24:19 -04:00
Ibby
a5e591cfa6 refractor(googlemap): remove pluginMap constant 2016-10-27 07:23:13 -04:00
Ibby
48e5d46f1e refractor(googlemap): googlemaps.ts to googlemap.ts 2016-10-27 07:17:14 -04:00
Ibrahim Hadeed
62d8645468 leave index.md untouched 2016-10-27 07:09:38 -04:00
Ibby
0388ac3f6b test(): fix tests 2016-10-27 06:59:00 -04:00
Ibby
24752652b7 style(): tslint 2016-10-27 06:40:22 -04:00
Ibby
eb03de96ba feat(diagnostic): add missing functions
closes #743
2016-10-27 06:38:46 -04:00
twaldecker
0317d4455f docs(transfer): add how-to download files (#745)
also add information how to browse your app
files directory, which is hard to find.
I needed very long time to check where my files are.
2016-10-27 06:30:02 -04:00
AndreasGassmann
757d0961b9 fix(3dtouch): add missing property (#739) 2016-10-24 16:12:01 -04:00
Ramon Henrique Ornelas
693ba01137 chore(location-accuracy): add name field (#724) 2016-10-22 13:19:49 -04:00
Ramon Henrique Ornelas
fa0175d248 chore(http): add name field (#725) 2016-10-22 13:19:43 -04:00
Ramon Henrique Ornelas
04d01ac1b3 chore(zbar): add name field see 96776567eb (#723) 2016-10-22 13:19:38 -04:00
Ramon Henrique Ornelas
77c7b9d00a chore(stepcounter): add name field (#726) 2016-10-22 13:19:32 -04:00
Ramon Henrique Ornelas
ee4cfadff1 chore(devicefeedback): add name field (#727) 2016-10-22 13:19:25 -04:00
Ramon Henrique Ornelas
49d8348db3 chore(themeable-browser): add name field (#728) 2016-10-22 13:19:19 -04:00
Ramon Henrique Ornelas
6e445b1beb chore(templates): add name field (#729) 2016-10-22 13:19:13 -04:00
Ibrahim Hadeed
970eb755b6 chore(scripts): clean old docs before processing
This should clean the old docs before processing the new ones, to remove any old directories.
2016-10-22 13:17:44 -04:00
Ramon Henrique Ornelas
1a803e70be refractor(filepath): add name field (#722) 2016-10-18 22:37:53 -04:00
Max Lynch
6982a2d35f chore(deeplinks): Updated Deeplinks docs 2016-10-18 12:22:09 -05:00
Colin Frick
0660a3bc67 feat(filepath): add cordova-plugin-filepath (#714) 2016-10-18 06:05:19 -04:00
Max Lynch
96776567eb feat(plugins): add name field 2016-10-17 20:38:25 -05:00
Matt Kane
d09018d2d4 docs(camera): correct costants paths (#706) 2016-10-17 05:34:16 -04:00
Ramon Henrique Ornelas
0649d8ca8c style(device-feedback): fix angular style (#703) 2016-10-16 03:00:27 -07:00
117 changed files with 602 additions and 214 deletions

View File

@@ -1,3 +1,52 @@
<a name="2.2.7"></a>
## [2.2.7](https://github.com/driftyco/ionic-native/compare/v2.2.5...v2.2.7) (2016-11-24)
### Bug Fixes
* **3dTouch:** fixes onHomeIconPressed ([#813](https://github.com/driftyco/ionic-native/issues/813)) ([695099b](https://github.com/driftyco/ionic-native/commit/695099b))
* **camera-preview:** formatting. Closes [#790](https://github.com/driftyco/ionic-native/issues/790) ([5577c51](https://github.com/driftyco/ionic-native/commit/5577c51))
* **datepicker:** fix allowOldDates option ([#761](https://github.com/driftyco/ionic-native/issues/761)) ([fa03fa5](https://github.com/driftyco/ionic-native/commit/fa03fa5))
* **diagnostics:** fix [#776](https://github.com/driftyco/ionic-native/issues/776) ([#777](https://github.com/driftyco/ionic-native/issues/777)) ([01b30c6](https://github.com/driftyco/ionic-native/commit/01b30c6))
* **file:** correct writeFile flags ([9bd8997](https://github.com/driftyco/ionic-native/commit/9bd8997)), closes [#789](https://github.com/driftyco/ionic-native/issues/789)
* **googlemap:** fix typoe googledesic to geodesic ([78b3ec5](https://github.com/driftyco/ionic-native/commit/78b3ec5)), closes [#765](https://github.com/driftyco/ionic-native/issues/765)
* **native-audio:** completeCallback is optional on play method ([b719a03](https://github.com/driftyco/ionic-native/commit/b719a03)), closes [#792](https://github.com/driftyco/ionic-native/issues/792)
* **nfc:** don't bind to name field, fix [#740](https://github.com/driftyco/ionic-native/issues/740) ([#749](https://github.com/driftyco/ionic-native/issues/749)) ([ca43394](https://github.com/driftyco/ionic-native/commit/ca43394))
* **plugin:** don't bind to name field. Fixes [#740](https://github.com/driftyco/ionic-native/issues/740) ([71916a8](https://github.com/driftyco/ionic-native/commit/71916a8))
* **video-player:** scalingMode is number ([f07431a](https://github.com/driftyco/ionic-native/commit/f07431a)), closes [#774](https://github.com/driftyco/ionic-native/issues/774)
### Features
* **camera-preview:** add disable method ([6ad54ec](https://github.com/driftyco/ionic-native/commit/6ad54ec))
* **google-analytics:** new interval period parameter ([abd910d](https://github.com/driftyco/ionic-native/commit/abd910d)), closes [#816](https://github.com/driftyco/ionic-native/issues/816)
* **google-map:** add get and set methods to Marker class ([51ab03d](https://github.com/driftyco/ionic-native/commit/51ab03d)), closes [#798](https://github.com/driftyco/ionic-native/issues/798)
<a name="2.2.5"></a>
## [2.2.5](https://github.com/driftyco/ionic-native/compare/v2.2.4...v2.2.5) (2016-10-27)
### Bug Fixes
* **3dtouch:** add missing property ([#739](https://github.com/driftyco/ionic-native/issues/739)) ([757d096](https://github.com/driftyco/ionic-native/commit/757d096))
* **geolocation:** fix watchPosition return type ([d5310b0](https://github.com/driftyco/ionic-native/commit/d5310b0)), closes [#741](https://github.com/driftyco/ionic-native/issues/741)
* **nfc:** fix Ndef class ([ac181c5](https://github.com/driftyco/ionic-native/commit/ac181c5)), closes [#713](https://github.com/driftyco/ionic-native/issues/713)
* **sqlite:** check if plugin exists before opening database ([6f47371](https://github.com/driftyco/ionic-native/commit/6f47371))
* **sqlite:** check if plugin exists before opening database ([c98b4f4](https://github.com/driftyco/ionic-native/commit/c98b4f4))
* **sqlite:** fix callback issue with transaction method ([a72cd59](https://github.com/driftyco/ionic-native/commit/a72cd59)), closes [#732](https://github.com/driftyco/ionic-native/issues/732)
### Features
* **diagnostic:** add missing functions ([eb03de9](https://github.com/driftyco/ionic-native/commit/eb03de9)), closes [#743](https://github.com/driftyco/ionic-native/issues/743)
* **filepath:** add cordova-plugin-filepath ([#714](https://github.com/driftyco/ionic-native/issues/714)) ([0660a3b](https://github.com/driftyco/ionic-native/commit/0660a3b))
* **plugins:** add name field ([9677656](https://github.com/driftyco/ionic-native/commit/9677656))
* **sms:** add hasPermission method ([8fbf1f2](https://github.com/driftyco/ionic-native/commit/8fbf1f2)), closes [#721](https://github.com/driftyco/ionic-native/issues/721)
<a name="2.2.4"></a>
## [2.2.4](https://github.com/driftyco/ionic-native/compare/v2.2.3...v2.2.4) (2016-10-15)
@@ -70,7 +119,6 @@
* **native-transitions:** add missing interface properties ([35c8bbd](https://github.com/driftyco/ionic-native/commit/35c8bbd))
* **onesignal:** update to match latest api ([#671](https://github.com/driftyco/ionic-native/issues/671)) ([7c6e6d8](https://github.com/driftyco/ionic-native/commit/7c6e6d8)), closes [#667](https://github.com/driftyco/ionic-native/issues/667)
* **thmeable-browser:** fix the name of the plugin ([#663](https://github.com/driftyco/ionic-native/issues/663)) ([1368175](https://github.com/driftyco/ionic-native/commit/1368175))
### Features
@@ -80,23 +128,15 @@
<a name="2.1.9"></a>
## [2.1.9](https://github.com/driftyco/ionic-native/compare/v2.1.8...v2.1.9) (2016-10-09)
### Bug Fixes
* **paypal:** add optional details param to paypalpayment ([7200845](https://github.com/driftyco/ionic-native/commit/7200845))
* **paypal:** problems with selection of PayPal environment ([#662](https://github.com/driftyco/ionic-native/issues/662)) ([3dd6a92](https://github.com/driftyco/ionic-native/commit/3dd6a92))
<a name="2.1.8"></a>
## [2.1.8](https://github.com/driftyco/ionic-native/compare/v2.1.7...v2.1.8) (2016-10-08)
## [2.1.9](https://github.com/driftyco/ionic-native/compare/v2.1.7...v2.1.9) (2016-10-09)
### Bug Fixes
* **googlemaps:** fixes GoogleMapsLatLng class ([11653ce](https://github.com/driftyco/ionic-native/commit/11653ce))
* **paypal:** add optional details param to paypalpayment ([7200845](https://github.com/driftyco/ionic-native/commit/7200845))
* **paypal:** problems with selection of PayPal environment ([#662](https://github.com/driftyco/ionic-native/issues/662)) ([3dd6a92](https://github.com/driftyco/ionic-native/commit/3dd6a92))
* **thmeable-browser:** fix the name of the plugin ([#663](https://github.com/driftyco/ionic-native/issues/663)) ([1368175](https://github.com/driftyco/ionic-native/commit/1368175))
@@ -111,27 +151,13 @@
<a name="2.1.6"></a>
## [2.1.6](https://github.com/driftyco/ionic-native/compare/v2.1.5...v2.1.6) (2016-10-06)
### Bug Fixes
* **paypal:** fix helper classes ([f002657](https://github.com/driftyco/ionic-native/commit/f002657))
<a name="2.1.5"></a>
## [2.1.5](https://github.com/driftyco/ionic-native/compare/v2.1.4...v2.1.5) (2016-10-06)
<a name="2.1.4"></a>
## [2.1.4](https://github.com/driftyco/ionic-native/compare/v2.1.3...v2.1.4) (2016-10-06)
## [2.1.6](https://github.com/driftyco/ionic-native/compare/v2.1.3...v2.1.6) (2016-10-06)
### Bug Fixes
* **google-analytics:** specify successIndex and errorIndex for methods with optional params ([6f23bef](https://github.com/driftyco/ionic-native/commit/6f23bef))
* **paypal:** fix helper classes ([f002657](https://github.com/driftyco/ionic-native/commit/f002657))
@@ -148,7 +174,7 @@
<a name="2.1.2"></a>
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.1...v2.1.2) (2016-10-06)
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.2) (2016-10-06)
### Bug Fixes
@@ -162,11 +188,6 @@
<a name="2.1.1"></a>
## [2.1.1](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.1) (2016-10-03)
<a name="2.1.0"></a>
# [2.1.0](https://github.com/driftyco/ionic-native/compare/v2.0.3...v2.1.0) (2016-10-03)

View File

@@ -22,6 +22,7 @@ module.exports = config => {
},
browserify: {
debug: true,
plugin: [ 'tsify' ],
extensions: ['.js', '.ts']
},

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "2.2.4",
"version": "2.2.7",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",

View File

@@ -21,13 +21,17 @@ function run {
./git/clone.sh --repository="ionic-site" \
--directory="$SITE_DIR" \
--branch="master"
ls -al $SITE_DIR
cd $SITE_DIR
ls -al
else
echo "using existing"
cd $SITE_DIR
git reset --hard
git pull origin master
fi
git rm -rf docs/v2/native/*/
}
source $(dirname $0)/../utils.inc.sh

View File

@@ -11,6 +11,7 @@ import { Plugin } from './plugin';
* ```
*/
@Plugin({
name: 'PluginName',
plugin: '',
pluginRef: '',
repo: ''

View File

@@ -29,6 +29,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
name: 'PluginName',
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

View File

@@ -44,13 +44,14 @@ import { Facebook } from './plugins/facebook';
import { File } from './plugins/file';
import { FileChooser } from './plugins/file-chooser';
import { FileOpener } from './plugins/file-opener';
import { FilePath } from './plugins/filepath';
import { Transfer } from './plugins/filetransfer';
import { Flashlight } from './plugins/flashlight';
import { Geofence } from './plugins/geofence';
import { Geolocation } from './plugins/geolocation';
import { Globalization } from './plugins/globalization';
import { GooglePlus } from './plugins/google-plus';
import { GoogleMap } from './plugins/googlemaps';
import { GoogleMap } from './plugins/googlemap';
import { GoogleAnalytics } from './plugins/googleanalytics';
import { Hotspot } from './plugins/hotspot';
import { HTTP } from './plugins/http';
@@ -153,13 +154,14 @@ export * from './plugins/file';
export * from './plugins/file-chooser';
export * from './plugins/file-opener';
export * from './plugins/filetransfer';
export * from './plugins/filepath';
export * from './plugins/flashlight';
export * from './plugins/geofence';
export * from './plugins/geolocation';
export * from './plugins/globalization';
export * from './plugins/google-plus';
export * from './plugins/googleanalytics';
export * from './plugins/googlemaps';
export * from './plugins/googlemap';
export * from './plugins/hotspot';
export * from './plugins/http';
export * from './plugins/httpd';
@@ -262,6 +264,7 @@ window['IonicNative'] = {
File,
FileChooser,
FileOpener,
FilePath,
Flashlight,
Geofence,
Geolocation,

View File

@@ -54,7 +54,7 @@ declare var window: any;
* ];
* ThreeDeeTouch.configureQuickActions(actions);
*
* ThreeDeeTouchForceTouch.onHomeIconPressed().subscribe(
* ThreeDeeTouch.onHomeIconPressed().subscribe(
* (payload) => {
* // returns an object that is the button you presed
* console.log('Pressed the ${payload.title} button')
@@ -65,6 +65,7 @@ declare var window: any;
* ```
*/
@Plugin({
pluginName: 'ThreeDeeTouch',
plugin: 'cordova-plugin-3dtouch',
pluginRef: 'ThreeDeeTouch',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
@@ -94,6 +95,7 @@ export class ThreeDeeTouch {
* @param {string} title Title for your action
* @param {string} subtitle (optional) A short description for your action
* @param {string} iconType (optional) Choose between Prohibit, Contact, Home, MarkLocation, Favorite, Love, Cloud, Invitation, Confirmation, Mail, Message, Date, Time, CapturePhoto, CaptureVideo, Task, TaskCompleted, Alarm, Bookmark, Shuffle, Audio, Update
* @param {string} iconTemplate (optional) Can be used to provide your own icon
*/
@Cordova({
sync: true
@@ -106,7 +108,7 @@ export class ThreeDeeTouch {
*/
static onHomeIconPressed(): Observable<any> {
return new Observable(observer => {
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) {
if (window.ThreeDeeTouch) {
window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
} else {
observer.error('3dTouch plugin is not available.');
@@ -139,6 +141,7 @@ export interface ThreeDeeTouchQuickAction {
title: string;
subtitle?: string;
iconType?: string;
iconTemplate?: string;
}
export interface ThreeDeeTouchForceTouch {

View File

@@ -41,6 +41,7 @@ import { Cordova, Plugin } from './plugin';
*
*/
@Plugin({
pluginName: 'ActionSheet',
plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',

View File

@@ -5,9 +5,24 @@ import { Observable } from 'rxjs/Observable';
* @name AdMob
* @description Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
* @usage
* ```typescript
* import { AdMob } from 'ionic-native';
*
* ionViewDidLoad() {
* AdMob.onBannerDismiss()
* .subscribe(() => { console.log('User returned from interstitial'); });
* }
*
* public onClick() {
* AdMob.prepareInterstitial('YOUR_ADID')
* .then(() => { AdMob.showInterstitial(); });
* }
*
* ```
* Please refer the the plugin's original repository for detailed usage.
*/
@Plugin({
pluginName: 'AdMob',
plugin: 'cordova-plugin-admobpro',
pluginRef: 'AdMob',
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',

View File

@@ -30,6 +30,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'AndroidFingerprintAuth',
plugin: 'cordova-plugin-android-fingerprint-auth',
pluginRef: 'FingerprintAuth',
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'

View File

@@ -28,6 +28,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'AppAvailability',
plugin: 'cordova-plugin-appavailability',
pluginRef: 'appAvailability',
repo: 'https://github.com/ohh2ahh/AppAvailability',

View File

@@ -19,7 +19,7 @@ declare var window;
* android: 'market://details?id=<package_name>',
* };
*
* AppRate.promptForRating();
* AppRate.promptForRating(false);
* ```
*
* @advanced
@@ -44,6 +44,7 @@ declare var window;
*/
@Plugin({
pluginName: 'AppRate',
plugin: 'cordova-plugin-apprate',
pluginRef: 'AppRate',
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',

View File

@@ -19,6 +19,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'AppVersion',
plugin: 'cordova-plugin-app-version',
pluginRef: 'cordova.getAppVersion',
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',

View File

@@ -272,6 +272,7 @@ export interface Config {
* Config
*/
@Plugin({
pluginName: 'BackgroundGeolocation',
plugin: 'cordova-plugin-mauron85-background-geolocation',
pluginRef: 'backgroundGeolocation',
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',

View File

@@ -6,7 +6,7 @@ import { Observable } from 'rxjs/Observable';
* @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#android-customization
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode
*@usage
* ```typescript
* import { BackgroundMode } from 'ionic-native';
@@ -28,6 +28,7 @@ import { Observable } from 'rxjs/Observable';
*
*/
@Plugin({
pluginName: 'BackgroundMode',
plugin: 'cordova-plugin-background-mode',
pluginRef: 'cordova.plugins.backgroundMode',
repo: 'https://github.com/katzer/cordova-plugin-background-mode',

View File

@@ -18,6 +18,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Badge',
plugin: 'cordova-plugin-badge',
pluginRef: 'cordova.plugins.notification.badge',
repo: 'https://github.com/katzer/cordova-plugin-badge',

View File

@@ -20,6 +20,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'BarcodeScanner',
plugin: 'phonegap-plugin-barcodescanner',
pluginRef: 'cordova.plugins.barcodeScanner',
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',

View File

@@ -14,6 +14,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Base64ToGallery',
plugin: 'cordova-base64-to-gallery',
pluginRef: 'cordova',
repo: 'https://github.com/Nexxa/cordova-base64-to-gallery',
@@ -24,7 +25,7 @@ export class Base64ToGallery {
/**
* Converts a base64 string to an image file in the device gallery
* @param {string} data The actual base64 string that you want to save
* @param {any} options (optional) An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
* @param {any} options (optional) An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
* @returns {Promise} returns a promise that resolves when the image is saved.
*/
@Cordova({

View File

@@ -24,6 +24,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'BatteryStatus',
plugin: 'cordova-plugin-battery-status',
repo: 'https://github.com/apache/cordova-plugin-battery-status',
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']

View File

@@ -160,6 +160,7 @@ import { Observable } from 'rxjs/Observable';
*
*/
@Plugin({
pluginName: 'BLE',
plugin: 'cordova-plugin-ble-central',
pluginRef: 'ble',
repo: 'https://github.com/don/cordova-plugin-ble-central',

View File

@@ -28,6 +28,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'BluetoothSerial',
repo: 'https://github.com/don/BluetoothSerial',
plugin: 'cordova-plugin-bluetooth-serial',
pluginRef: 'bluetoothSerial',

View File

@@ -18,6 +18,7 @@ import { Cordova, Plugin } from './plugin';
*
*/
@Plugin({
pluginName: 'Brightness',
plugin: 'cordova-plugin-brightness',
pluginRef: 'cordova.plugins.brightness',
repo: 'https://github.com/mgcrea/cordova-plugin-brightness',

View File

@@ -38,6 +38,7 @@ export interface CalendarOptions {
*
*/
@Plugin({
pluginName: 'Calendar',
plugin: 'cordova-plugin-calendar',
pluginRef: 'plugins.calendar',
repo: 'https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin',

View File

@@ -16,6 +16,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'CallNumber',
plugin: 'call-number',
pluginRef: 'plugins.CallNumber',
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',

View File

@@ -19,11 +19,11 @@ export interface CameraPreviewSize {
* @description
* Showing camera preview in HTML
*
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/westonganger/cordova-plugin-camera-preview).
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
*
* @usage
* ```
* import { CameraPreview } from 'ionic-native';
* import { CameraPreview, CameraPreviewRect } from 'ionic-native';
*
* // camera options (Size and location)
* let cameraRect: CameraPreviewRect = {
@@ -38,7 +38,7 @@ export interface CameraPreviewSize {
* CameraPreview.startCamera(
* cameraRect, // position and size of preview
* 'front', // default camera
* true, // tape to take picture
* true, // tap to take picture
* false, // disable drag
* true // send the preview to the back of the screen so we can add overlaying elements
* );
@@ -69,9 +69,10 @@ export interface CameraPreviewSize {
*
*/
@Plugin({
pluginName: 'CameraPreview',
plugin: 'cordova-plugin-camera-preview',
pluginRef: 'cordova.plugins.camerapreview',
repo: 'https://github.com/westonganger/cordova-plugin-camera-preview',
repo: 'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
platforms: ['Android', 'iOS']
})
export class CameraPreview {
@@ -88,7 +89,7 @@ export class CameraPreview {
@Cordova({
sync: true
})
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { };
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { }
/**
* Stops the camera preview instance.
@@ -96,7 +97,7 @@ export class CameraPreview {
@Cordova({
sync: true
})
static stopCamera(): void { };
static stopCamera(): void { }
/**
* Take the picture, the parameter size is optional
@@ -105,7 +106,7 @@ export class CameraPreview {
@Cordova({
sync: true
})
static takePicture(size: CameraPreviewSize): void { };
static takePicture(size: CameraPreviewSize): void { }
/**
* Register a callback function that receives the original picture and the image captured from the preview box.
@@ -113,7 +114,7 @@ export class CameraPreview {
@Cordova({
observable: true
})
static setOnPictureTakenHandler(): Observable<any> { return; };
static setOnPictureTakenHandler(): Observable<any> { return; }
/**
* Switch from the rear camera and front camera, if available.
@@ -121,7 +122,7 @@ export class CameraPreview {
@Cordova({
sync: true
})
static switchCamera(): void { };
static switchCamera(): void { }
/**
* Show the camera preview box.
@@ -129,7 +130,7 @@ export class CameraPreview {
@Cordova({
sync: true
})
static show(): void { };
static show(): void { }
/**
* Hide the camera preview box.
@@ -137,7 +138,15 @@ export class CameraPreview {
@Cordova({
sync: true
})
static hide(): void { };
static hide(): void { }
/**
* Disables the camera preview
*/
@Cordova({
sync: true
})
static disable(): void { }
/**
* Set camera color effect.
@@ -145,5 +154,5 @@ export class CameraPreview {
@Cordova({
sync: true
})
static setColorEffect(effect: string): void { };
static setColorEffect(effect: string): void { }
}

View File

@@ -6,7 +6,7 @@ export interface CameraOptions {
quality?: number;
/**
* Choose the format of the return value.
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
* Defined in Camera.DestinationType. Default is FILE_URI.
* DATA_URL : 0, Return image as base64-encoded string,
* FILE_URI : 1, Return image file URI,
* NATIVE_URI : 2 Return image native URI
@@ -15,7 +15,7 @@ export interface CameraOptions {
destinationType?: number;
/**
* Set the source of the picture.
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
* Defined in Camera.PictureSourceType. Default is CAMERA.
* PHOTOLIBRARY : 0,
* CAMERA : 1,
* SAVEDPHOTOALBUM : 2
@@ -25,7 +25,7 @@ export interface CameraOptions {
allowEdit?: boolean;
/**
* Choose the returned image file's encoding.
* Defined in navigator.camera.EncodingType. Default is JPEG
* Defined in Camera.EncodingType. Default is JPEG
* JPEG : 0 Return JPEG encoded image
* PNG : 1 Return PNG encoded image
*/
@@ -42,7 +42,7 @@ export interface CameraOptions {
targetHeight?: number;
/**
* Set the type of media to select from. Only works when PictureSourceType
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in Camera.MediaType
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
* Will return format specified via DestinationType
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
@@ -55,7 +55,7 @@ export interface CameraOptions {
saveToPhotoAlbum?: boolean;
/**
* Choose the camera to use (front- or back-facing).
* Defined in navigator.camera.Direction. Default is BACK.
* Defined in Camera.Direction. Default is BACK.
* FRONT: 0
* BACK: 1
*/
@@ -110,6 +110,7 @@ export interface CameraPopoverOptions {
* CameraPopoverOptions
*/
@Plugin({
pluginName: 'Camera',
plugin: 'cordova-plugin-camera',
pluginRef: 'navigator.camera',
repo: 'https://github.com/apache/cordova-plugin-camera',

View File

@@ -25,6 +25,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'CardIO',
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
pluginRef: 'CardIO',
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',

View File

@@ -28,6 +28,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Clipboard',
plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git',
pluginRef: 'cordova.plugins.clipboard',
repo: 'https://github.com/VersoSolutions/CordovaClipboard',

View File

@@ -420,6 +420,7 @@ export interface DownloadProgress {
* ```
*/
@Plugin({
pluginName: 'CodePush',
plugin: 'cordova-plugin-code-push',
pluginRef: 'codePush',
repo: 'https://github.com/Microsoft/cordova-plugin-code-push',

View File

@@ -80,7 +80,7 @@ export class Contact implements IContactProperties {
/**
* @private
*/
interface IContactError {
export interface IContactError {
/** Error code */
code: number;
/** Error message */
@@ -90,7 +90,7 @@ interface IContactError {
/**
* @private
*/
declare var ContactError: {
export declare var ContactError: {
new (code: number): IContactError;
UNKNOWN_ERROR: number;
INVALID_ARGUMENT_ERROR: number;
@@ -316,6 +316,7 @@ export class ContactFindOptions implements IContactFindOptions {
* ContactAddress
*/
@Plugin({
pluginName: 'Contacts',
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts'

View File

@@ -16,6 +16,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Crop',
plugin: 'cordova-plugin-crop',
pluginRef: 'plugins',
repo: 'https://github.com/jeduan/cordova-plugin-crop'

View File

@@ -59,7 +59,7 @@ export interface DatePickerOptions {
/**
* Shows or hide dates earlier then selected date.
*/
allowOldDate?: boolean;
allowOldDates?: boolean;
/**
* Shows or hide dates after selected date.
*/
@@ -128,6 +128,7 @@ export interface DatePickerOptions {
* DatePickerOptions
*/
@Plugin({
pluginName: 'DatePicker',
plugin: 'cordova-plugin-datepicker',
pluginRef: 'datePicker',
repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker'

View File

@@ -31,6 +31,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'DBMeter',
plugin: 'cordova-plugin-dbmeter',
pluginRef: 'DBMeter',
repo: 'https://github.com/akofman/cordova-plugin-dbmeter',

View File

@@ -28,11 +28,38 @@ export interface DeeplinkMatch {
*
* @usage
* ```typescript
* import { IonicDeeplinks } from 'ionic-native';
* import { Deeplinks } from 'ionic-native';
*
* Deeplinks.route({
'/about-us': AboutPage,
'/universal-links-test': AboutPage,
'/products/:productId': ProductPage
}).subscribe((match) => {
// match.$route - the route we matched, which is the matched entry from the arguments to route()
// match.$args - the args passed in the link
// match.$link - the full link data
console.log('Successfully matched route', match);
}, (nomatch) => {
// nomatch.$link - the full link data
console.error('Got a deeplink that didn\'t match', nomatch);
});
* ```
*
* Alternatively, if you're using Ionic 2, there's a convenience method that takes a reference to a `NavController` and handles
* the actual navigation for you:
*
* ```typescript
* Deeplinks.routeWithNavController(this.navController, {
'/about-us': AboutPage,
'/products/:productId': ProductPage
});
* ```
*
* See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
* retrieve the `NavController` reference at runtime.
*/
@Plugin({
pluginName: 'Deeplinks',
plugin: 'ionic-plugin-deeplinks',
pluginRef: 'IonicDeeplink',
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
@@ -48,8 +75,8 @@ export class Deeplinks {
* paths takes an object of the form { 'path': data }. If a deeplink
* matches the path, the resulting path-data pair will be returned in the
* promise result which you can then use to navigate in the app as you see fit.
* @returns {Promise} Returns a Promise that resolves when a deeplink comes through, and
* is rejected if a deeplink comes through that does not match a given path.
* @returns {Observable} Returns an Observable that is called each time a deeplink comes through, and
* errors if a deeplink comes through that does not match a given path.
*/
@Cordova({
observable: true
@@ -71,8 +98,8 @@ export class Deeplinks {
* matches the path, the resulting path-data pair will be returned in the
* promise result which you can then use to navigate in the app as you see fit.
*
* @returns {Promise} Returns a Promise that resolves when a deeplink comes through, and
* is rejected if a deeplink comes through that does not match a given path.
* @returns {Observable} Returns an Observable that resolves each time a deeplink comes through, and
* errors if a deeplink comes through that does not match a given path.
*/
@Cordova({
observable: true

View File

@@ -1,4 +1,4 @@
import {Plugin, Cordova} from './plugin';
import { Plugin, Cordova } from './plugin';
/**
* @name DeviceFeedback
* @description
@@ -25,6 +25,7 @@ import {Plugin, Cordova} from './plugin';
* ```
*/
@Plugin({
pluginName: 'DeviceFeedback',
plugin: 'cordova-plugin-velda-devicefeedback',
pluginRef: 'plugins.deviceFeedback',
repo: 'https://github.com/VVelda/device-feedback',

View File

@@ -41,6 +41,7 @@ export interface Device {
* ```
*/
@Plugin({
pluginName: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device',
repo: 'https://github.com/apache/cordova-plugin-device'

View File

@@ -2,6 +2,7 @@ import { Cordova, Plugin } from './plugin';
@Plugin({
pluginName: 'DeviceAccounts',
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
pluginRef: 'plugins.DeviceAccounts',
repo: 'https://github.com/loicknuchel/cordova-device-accounts',

View File

@@ -62,6 +62,7 @@ export interface AccelerometerOptions {
* ```
*/
@Plugin({
pluginName: 'DeviceMotion',
plugin: 'cordova-plugin-device-motion',
pluginRef: 'navigator.accelerometer',
repo: 'https://github.com/apache/cordova-plugin-device-motion'

View File

@@ -67,6 +67,7 @@ export interface CompassOptions {
* ```
*/
@Plugin({
pluginName: 'DeviceOrientation',
plugin: 'cordova-plugin-device-orientation',
pluginRef: 'navigator.compass',
repo: 'https://github.com/apache/cordova-plugin-device-orientation'

View File

@@ -29,6 +29,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Diagnostic',
plugin: 'cordova.plugins.diagnostic',
pluginRef: 'cordova.plugins.diagnostic',
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
@@ -214,7 +215,7 @@ export class Diagnostic {
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
static requestLocationAuthorization(mode?: string): Promise<any> { return; }
/**
@@ -440,6 +441,24 @@ export class Diagnostic {
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
static requestRuntimePermissions(permissions: any[]): Promise<any> { return; }
/**
* Indicates if the plugin is currently requesting a runtime permission via the native API.
* Note that only one request can be made concurrently because the native API cannot handle concurrent requests,
* so the plugin will invoke the error callback if attempting to make more than one simultaneous request.
* Multiple permission requests should be grouped into a single call since the native API is setup to handle batch requests of multiple permission groups.
* @return {boolean}
*/
@Cordova({ sync: true })
static isRequestingPermission(): boolean { return; }
/**
* Registers a function to be called when a runtime permission request has completed.
* Pass in a falsey value to de-register the currently registered function.
* @param handler {Function}
*/
@Cordova({ sync: true })
static registerPermissionRequestCompleteHandler(handler: Function): void { return; }
/**
* Checks if the device setting for Bluetooth is switched on.
* This requires `BLUETOOTH` permission on Android

View File

@@ -32,6 +32,7 @@ export interface PromptCallback {
* ```
*/
@Plugin({
pluginName: 'Dialogs',
plugin: 'cordova-plugin-dialogs',
pluginRef: 'navigator.notification',
repo: 'https://github.com/apache/cordova-plugin-dialogs.git'

View File

@@ -44,6 +44,7 @@ declare var cordova: any;
* ```
*/
@Plugin({
pluginName: 'EmailComposer',
plugin: 'cordova-plugin-email',
pluginRef: 'cordova.plugins.email',
repo: 'https://github.com/hypery2k/cordova-email-plugin',

View File

@@ -9,6 +9,7 @@ import { Observable } from 'rxjs/Observable';
*
*/
@Plugin({
pluginName: 'EstimoteBeacons',
plugin: 'cordova-plugin-estimote',
pluginRef: 'estimote.beacons',
repo: 'https://github.com/evothings/phonegap-estimotebeacons',

View File

@@ -78,6 +78,7 @@ import { Cordova, Plugin } from './plugin';
*
*/
@Plugin({
pluginName: 'Facebook',
plugin: 'cordova-plugin-facebook4',
pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',

View File

@@ -16,6 +16,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'FileChooser',
plugin: 'http://github.com/don/cordova-filechooser.git',
pluginRef: 'fileChooser',
repo: 'https://github.com/don/cordova-filechooser',

View File

@@ -13,6 +13,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'FileOpener',
plugin: 'cordova-plugin-file-opener2',
pluginRef: 'cordova.plugins.fileOpener2',
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'

View File

@@ -171,6 +171,7 @@ export interface Flags {
}
export interface WriteOptions {
create?: boolean;
replace?: boolean;
append?: boolean;
truncate?: number; // if present, number of bytes to truncate file to before writing
@@ -337,11 +338,6 @@ declare var FileError: {
PATH_EXISTS_ERR: number;
};
let pluginMeta = {
plugin: 'cordova-plugin-file',
pluginRef: 'cordova.file',
repo: 'https://github.com/apache/cordova-plugin-file'
};
/**
* @name File
@@ -364,7 +360,12 @@ let pluginMeta = {
* Although most of the plugin code was written when an earlier spec was current: http://www.w3.org/TR/2011/WD-file-system-api-20110419/
* It also implements the FileWriter spec : http://dev.w3.org/2009/dap/file-system/file-writer.html
*/
@Plugin(pluginMeta)
@Plugin({
pluginName: 'File',
plugin: 'cordova-plugin-file',
pluginRef: 'cordova.file',
repo: 'https://github.com/apache/cordova-plugin-file'
})
export class File {
static cordovaFileError: {} = {
1: 'NOT_FOUND_ERR',
@@ -390,7 +391,10 @@ export class File {
static getFreeDiskSpace(): Promise<number> {
return new Promise<any>((resolve, reject) => {
if (!cordova || !cordova.exec) {
pluginWarn(pluginMeta);
pluginWarn({
pluginName: 'File',
plugin: 'cordova-plugin-file'
});
reject({ error: 'plugin_not_installed' });
} else {
cordova.exec(resolve, reject, 'File', 'getFreeDiskSpace', []);
@@ -664,19 +668,19 @@ export class File {
* @param {string} fileName path relative to base path
* @param {string | Blob} text content or blob to write
* @param {WriteOptions} options replace file if set to true. See WriteOptions for more information.
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
* @returns {Promise<FileEntry>} Returns a Promise that resolves to updated file entry or rejects with an error.
*/
static writeFile(path: string, fileName: string,
text: string | Blob, options: WriteOptions): Promise<void> {
text: string | Blob, options: WriteOptions = {}): Promise<any> {
if ((/^\//.test(fileName))) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file-name cannot start with \/';
return Promise.reject(err);
}
let getFileOpts: Flags = {
create: true,
exclusive: options.replace
const getFileOpts: Flags = {
create: !options.append,
exclusive: !options.replace
};
return File.resolveDirectoryUrl(path)
@@ -684,10 +688,21 @@ export class File {
return File.getFile(fse, fileName, getFileOpts);
})
.then((fe) => {
return File.createWriter(fe);
})
.then((writer) => {
return File.writeFileEntry(fe, text, options);
});
}
/** Write content to FileEntry.
*
* @private
* @param {FileEntry} fe file entry object
* @param {string | Blob} text content or blob to write
* @param {WriteOptions} options replace file if set to true. See WriteOptions for more information.
* @returns {Promise<FileEntry>} Returns a Promise that resolves to updated file entry or rejects with an error.
*/
private static writeFileEntry(fe: FileEntry, text: string | Blob, options: WriteOptions) {
return File.createWriter(fe)
.then((writer) => {
if (options.append) {
writer.seek(writer.length);
}
@@ -697,9 +712,11 @@ export class File {
}
return File.write(writer, text);
});
})
.then(() => fe);
}
/** Write to an existing file.
*
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
@@ -708,22 +725,7 @@ export class File {
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
*/
static writeExistingFile(path: string, fileName: string, text: string | Blob): Promise<void> {
if ((/^\//.test(fileName))) {
let err = new FileError(5);
err.message = 'file-name cannot start with \/';
return Promise.reject(err);
}
return File.resolveDirectoryUrl(path)
.then((fse) => {
return File.getFile(fse, fileName, {create: false});
})
.then((fe) => {
return File.createWriter(fe);
})
.then((writer) => {
return File.write(writer, text);
});
return File.writeFile(path, fileName, text, { create: false });
}
/**

35
src/plugins/filepath.ts Normal file
View File

@@ -0,0 +1,35 @@
import { Plugin, Cordova } from './plugin';
declare var window: any;
/**
* @name FilePath
* @description
*
* This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.
*
* @usage
* ```
* import {FilePath} from 'ionic-native';
*
* FilePath.resolveNativePath(path)
* .then(filePath => console.log(filePath);
* .catch(err => console.log(err);
*
* ```
*/
@Plugin({
pluginName: 'FilePath',
plugin: 'cordova-plugin-filepath',
pluginRef: 'window.FilePath',
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
platforms: ['Android']
})
export class FilePath {
/**
* Resolve native path for given content URL/path.
* @param {String} path Content URL/path.
*/
@Cordova()
static resolveNativePath(path: string): Promise<string> {return; }
}

View File

@@ -138,7 +138,7 @@ export interface FileTransferError {
* fileKey: 'file',
* fileName: 'name.jpg',
* headers: {}
* .....
* .....
* }
* fileTransfer.upload("<file path>", "<api endpoint>", options)
* .then((data) => {
@@ -148,10 +148,32 @@ export interface FileTransferError {
* })
* }
*
* // Cordova
* declare var cordova: any;
*
* download() {
* const fileTransfer = new Transfer();
* let url = 'http://www.example.com/file.pdf';
* fileTransfer.download(url, cordova.file.dataDirectory + 'file.pdf').then((entry) => {
* console.log('download complete: ' + entry.toURL());
* }, (error) => {
* // handle error
* });
* }
*
* ```
*
* Note: You will not see your documents using a file explorer on your device. Use adb:
*
* ```
* adb shell
* run-as com.your.app
* cd files
* ls
* ```
*/
@Plugin({
pluginName: 'FileTransfer',
plugin: 'cordova-plugin-file-transfer',
pluginRef: 'FileTransfer',
repo: 'https://github.com/apache/cordova-plugin-file-transfer'

View File

@@ -16,6 +16,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Flashlight',
plugin: 'cordova-plugin-flashlight',
pluginRef: 'window.plugins.flashlight',
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git'

View File

@@ -74,6 +74,7 @@ import { Observable } from 'rxjs/Observable';
declare var window: any;
@Plugin({
pluginName: 'Geofence',
plugin: 'cordova-plugin-geofence',
pluginRef: 'geofence',
repo: 'https://github.com/cowbell/cordova-plugin-geofence/',
@@ -146,7 +147,7 @@ export class Geofence {
}
/**
* Called when the user clicks a geofence notification. iOS and Android only.
* Called when the user clicks a geofence notification. iOS and Android only.
*
* @return {Promise<Object>}
*/

View File

@@ -139,6 +139,7 @@ export interface GeolocationOptions {
* GeolocationOptions
*/
@Plugin({
pluginName: 'Geolocation',
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation'
@@ -173,7 +174,7 @@ export class Geolocation {
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
* @return Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
*/
static watchPosition(options?: GeolocationOptions): Observable<Geoposition | PositionError> {
static watchPosition(options?: GeolocationOptions): Observable<Geoposition & PositionError> {
return new Observable<Geoposition>(
(observer: any) => {
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);

View File

@@ -11,6 +11,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Globalization',
plugin: 'cordova-plugin-globalization',
pluginRef: 'navigator.globalization',
repo: 'https://github.com/apache/cordova-plugin-globalization'

View File

@@ -12,11 +12,12 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
plugin: 'cordova-plugin-googleplus',
pluginRef: 'window.plugins.googleplus',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
platforms: ['Web', 'Android', 'iOS'],
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid'
pluginName: 'GooglePlus',
plugin: 'cordova-plugin-googleplus',
pluginRef: 'window.plugins.googleplus',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
platforms: ['Web', 'Android', 'iOS'],
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid'
})
export class GooglePlus {

View File

@@ -13,20 +13,22 @@ declare var window;
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
*/
@Plugin({
pluginName: 'GoogleAnalytics',
plugin: 'cordova-plugin-google-analytics',
pluginRef: 'ga',
repo: 'https://github.com/danwilson/google-analytics-plugin',
platforms: ['Android', 'iOS']
platforms: ['Android', 'iOS', 'Browser']
})
export class GoogleAnalytics {
/**
* In your 'deviceready' handler, set up your Analytics tracker.
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
* @param {string} id Your Google Analytics Mobile App property
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
* @return {Promise<any>}
*/
@Cordova()
static startTrackerWithId(id: string): Promise<any> { return; }
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
/**
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more

View File

@@ -41,55 +41,72 @@ export const GoogleMapsAnimation = {
* @description This plugin uses the native Google Maps SDK
* @usage
* ```
* import { GoogleMap, GoogleMapsEvent } from 'ionic-native';
* import {
* GoogleMap,
* GoogleMapsEvent,
* GoogleMapsLatLng,
* CameraPosition,
* GoogleMapsMarkerOptions,
* GoogleMapsMarker
* } from 'ionic-native';
*
* // create a new map using element ID
* let map = new GoogleMap('elementID');
* export class MapPage {
* constructor() {}
*
* // or create a new map by passing HTMLElement
* let element: HTMLElement = document.getElementById('elementID');
* // Load map only after view is initialize
* ngAfterViewInit() {
* this.loadMap();
* }
*
* // In Angular 2 or Ionic 2, if we have this element in html: <div #map></div>
* // then we can use @ViewChild to find the element and pass it to GoogleMaps
* @ViewChild('map') mapElement;
* let map = new GoogleMap(mapElement);
* loadMap() {
* // make sure to create following structure in your view.html file
* // <ion-content>
* // <div #map id="map"></div>
* // </ion-content>
*
* // listen to MAP_READY event
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
* // create a new map by passing HTMLElement
* let element: HTMLElement = document.getElementById('map');
*
* let map = new GoogleMap(element);
*
* // create LatLng object
* let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
* // listen to MAP_READY event
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
*
* // create CameraPosition
* let position: CameraPosition = {
* target: ionic,
* zoom: 18,
* tilt: 30
* };
* // create LatLng object
* let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
*
* // move the map's camera to position
* map.moveCamera(position);
* // create CameraPosition
* let position: CameraPosition = {
* target: ionic,
* zoom: 18,
* tilt: 30
* };
*
* // create new marker
* let markerOptions: GoogleMapsMarkerOptions = {
* position: ionic,
* title: 'Ionic'
* };
* // move the map's camera to position
* map.moveCamera(position);
*
* map.addMarker(markerOptions)
* .then((marker: GoogleMapsMarker) => {
* marker.showInfoWindow();
* });
* // create new marker
* let markerOptions: GoogleMapsMarkerOptions = {
* position: ionic,
* title: 'Ionic'
* };
*
* map.addMarker(markerOptions)
* .then((marker: GoogleMapsMarker) => {
* marker.showInfoWindow();
* });
* }
*
* }
* ```
*/
let pluginMap = {
@Plugin({
pluginName: 'GoogleMap',
pluginRef: 'plugin.google.maps.Map',
plugin: 'cordova-plugin-googlemaps',
repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps',
install: 'ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"'
};
@Plugin(pluginMap)
})
export class GoogleMap {
_objectInstance: any;
@@ -108,7 +125,10 @@ export class GoogleMap {
}
this._objectInstance = plugin.google.maps.Map.getMap(element, options);
} else {
pluginWarn(pluginMap);
pluginWarn({
pluginName: 'GoogleMap',
plugin: 'plugin.google.maps.Map'
});
}
}
@@ -466,6 +486,21 @@ export class GoogleMapsMarker {
);
}
/**
* Gets a value
* @param key
*/
@CordovaInstance({sync: true})
get(key: string): any { return; }
/**
* Sets a value
* @param key
* @param value
*/
@CordovaInstance({sync: true})
set(key: string, value: any): void { }
@CordovaInstance({ sync: true })
isVisible(): boolean { return; }
@@ -621,7 +656,7 @@ export class GoogleMapsCircle {
export interface GoogleMapsPolylineOptions {
points?: Array<GoogleMapsLatLng>;
visible?: boolean;
googledesic?: boolean;
geodesic?: boolean;
color?: string;
width?: number;
zIndex?: number;
@@ -978,7 +1013,10 @@ export class Geocoder {
static geocode(request: GeocoderRequest): Promise<GeocoderResult[] | any> {
return new Promise<GeocoderResult[]>((resolve, reject) => {
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) {
pluginWarn(pluginMap);
pluginWarn({
pluginName: 'GoogleMap',
plugin: 'plugin.google.maps.Map'
});
reject({ error: 'plugin_not_installed' });
} else {
plugin.google.maps.Geocoder.geocode(request, resolve);

View File

@@ -15,6 +15,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Hotspot',
plugin: 'cordova-plugin-hotspot',
pluginRef: 'cordova.plugins.hotspot',
repo: 'https://github.com/hypery2k/cordova-hotspot-plugin',

View File

@@ -33,6 +33,7 @@ import { Plugin, Cordova } from './plugin';
* HTTPResponse
*/
@Plugin({
pluginName: 'HTTP',
plugin: 'cordova-plugin-http',
pluginRef: 'cordovaHTTP',
repo: 'https://github.com/wymsee/cordova-HTTP',

View File

@@ -23,6 +23,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'Httpd',
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
pluginRef: 'cordova.plugins.CorHttpd',
repo: 'https://github.com/floatinghotpot/cordova-httpd',

View File

@@ -268,6 +268,7 @@ export interface Delegate {
* ```
*/
@Plugin({
pluginName: 'IBeacon',
plugin: 'cordova-plugin-ibeacon',
pluginRef: 'cordova.plugins.locationManager',
repo: 'https://github.com/petermetz/cordova-plugin-ibeacon',

View File

@@ -46,9 +46,10 @@ export interface ImagePickerOptions {
* ImagePickerOptions
*/
@Plugin({
plugin: 'cordova-plugin-image-picker',
pluginName: 'ImagePicker',
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
pluginRef: 'window.imagePicker',
repo: 'https://github.com/wymsee/cordova-imagePicker'
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker'
})
export class ImagePicker {
/**

View File

@@ -67,6 +67,7 @@ export interface ImageResizerOptions {
* ```
*/
@Plugin({
pluginName: 'ImageResizer',
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
pluginRef: 'ImageResizer',
repo: 'https://github.com/protonet/cordova-plugin-image-resizer'

View File

@@ -31,14 +31,18 @@ export interface InAppBrowserEvent extends Event {
* ```
*/
@Plugin({
pluginName: 'InAppBrowser',
plugin: 'cordova-plugin-inappbrowser',
pluginRef: 'cordova.InAppBrowser',
repo: 'https://github.com/apache/cordova-plugin-inappbrowser'
})
export class InAppBrowser {
/**
* @private
*/
static open(url: string, target?: string, options?: string): void {
console.warn('Native: Your current usage of the InAppBrowser plugin is depreciated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.');
console.warn('Native: Your current usage of the InAppBrowser plugin is deprecated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.');
}
private _objectInstance: any;

View File

@@ -51,6 +51,7 @@ import { Plugin, Cordova } from './plugin';
*
*/
@Plugin({
pluginName: 'InAppPurchase',
plugin: 'cordova-plugin-inapppurchase',
pluginRef: 'inAppPurchase',
platforms: ['Android', 'iOS'],

View File

@@ -26,6 +26,7 @@ import { Cordova, Plugin } from './plugin';
*
*/
@Plugin({
pluginName: 'Insomnia',
plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git',
pluginRef: 'plugins.insomnia',
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',

View File

@@ -15,6 +15,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Instagram',
plugin: 'cordova-instagram-plugin',
pluginRef: 'Instagram',
repo: 'https://github.com/vstirbu/InstagramPlugin'

View File

@@ -17,6 +17,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'IsDebug',
plugin: 'cordova-plugin-is-debug',
pluginRef: 'cordova.plugins.IsDebug',
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'

View File

@@ -14,6 +14,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'Keyboard',
plugin: 'ionic-plugin-keyboard',
pluginRef: 'cordova.plugins.Keyboard',
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'

View File

@@ -82,6 +82,7 @@ export interface LaunchNavigatorOptions {
* ```
*/
@Plugin({
pluginName: 'LaunchNavigator',
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
pluginRef: 'launchnavigator',
repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git'

View File

@@ -45,6 +45,7 @@ import { Cordova, Plugin } from './plugin';
*
*/
@Plugin({
pluginName: 'LocalNotifications',
plugin: 'de.appplant.cordova.plugin.local-notification',
pluginRef: 'cordova.plugins.notification.local',
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'

View File

@@ -23,6 +23,7 @@ import {Plugin, Cordova} from './plugin';
* ```
*/
@Plugin({
pluginName: 'LocationAccuracy',
plugin: 'cordova-plugin-request-location-accuracy',
pluginRef: 'cordova.plugins.locationAccuracy',
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'

View File

@@ -13,8 +13,9 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Market',
plugin: 'cordova-plugin-market',
pluginRef: 'plugins.market',
pluginRef: 'cordova.plugins.market',
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
})
export class Market {

View File

@@ -22,13 +22,14 @@ declare var navigator: any;
* ```
*/
@Plugin({
pluginName: 'MediaCapture',
plugin: 'cordova-plugin-media-capture',
pluginRef: 'navigator.device.capture',
repo: 'https://github.com/apache/cordova-plugin-media-capture'
})
export class MediaCapture {
/**
* The audio recording formats supported by the device.
* The recording image sizes and formats supported by the device.
* @returns {ConfigurationData[]}
*/
@CordovaProperty
@@ -37,7 +38,7 @@ export class MediaCapture {
}
/**
* The recording image sizes and formats supported by the device.
* The audio recording formats supported by the device.
* @returns {ConfigurationData[]}
*/
@CordovaProperty

View File

@@ -67,12 +67,12 @@ export interface MediaError {
*
* ```
*/
let pluginMeta = {
@Plugin({
pluginName: 'MediaPlugin',
repo: 'https://github.com/apache/cordova-plugin-media',
plugin: 'cordova-plugin-media',
pluginRef: 'Media'
};
@Plugin(pluginMeta)
})
export class MediaPlugin {
// Constants
@@ -131,7 +131,10 @@ export class MediaPlugin {
this._objectInstance = new Media(src, resolve, reject, onStatusUpdate);
});
} else {
pluginWarn(pluginMeta);
pluginWarn({
pluginName: 'MediaPlugin',
plugin: 'cordova-plugin-media'
});
}
}

View File

@@ -2,15 +2,6 @@ import { Cordova, Plugin } from './plugin';
declare var mixpanel: any;
/**
* @private
*/
export const pluginMeta = {
plugin: 'cordova-plugin-mixpanel',
pluginRef: 'mixpanel',
repo: 'https://github.com/samzilverberg/cordova-mixpanel-plugin'
};
/**
* @name Mixpanel
* @description
@@ -26,7 +17,12 @@ export const pluginMeta = {
*
* ```
*/
@Plugin(pluginMeta)
@Plugin({
pluginName: 'Mixpanel',
plugin: 'cordova-plugin-mixpanel',
pluginRef: 'mixpanel',
repo: 'https://github.com/samzilverberg/cordova-mixpanel-plugin'
})
export class Mixpanel {
/**
*
@@ -112,11 +108,11 @@ export class MixpanelPeople {
/**
* @private
*/
static plugin: string = pluginMeta.plugin;
static plugin: string = 'cordova-plugin-mixpanel';
/**
* @private
*/
static pluginRef: string = pluginMeta.pluginRef + '.people';
static pluginRef: string = 'mixpanel.people';
/**
*

View File

@@ -73,6 +73,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'MusicControls',
plugin: 'cordova-plugin-music-controls',
pluginRef: 'MusicControls',
repo: 'https://github.com/homerours/cordova-music-controls-plugin'

View File

@@ -10,6 +10,10 @@ import { Plugin, Cordova } from './plugin';
* NativeAudio.preloadComplex('uniqueId2', 'path/to/file2.mp3', 1, 1, 0).then(onSuccess, onError);
*
* NativeAudio.play('uniqueId1').then(onSuccess, onError);
*
* // can optionally pass a callback to be called when the file is done playing
* NativeAudio.play('uniqueId1', () => console.log('uniqueId1 is done playing'));
*
* NativeAudio.loop('uniqueId2').then(onSuccess, onError);
*
* NativeAudio.setVolumeForComplexAsset('uniqueId2', 0.6).then(onSuccess,onError);
@@ -21,6 +25,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'NativeAudio',
plugin: 'cordova-plugin-nativeaudio',
pluginRef: 'plugins.NativeAudio',
repo: 'https://github.com/floatinghotpot/cordova-plugin-nativeaudio'
@@ -56,7 +61,7 @@ export class NativeAudio {
successIndex: 1,
errorIndex: 2
})
static play(id: string, completeCallback: Function): Promise<any> {return; }
static play(id: string, completeCallback?: Function): Promise<any> {return; }
/**
* Stops playing an audio

View File

@@ -27,6 +27,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'NativePageTransitions',
plugin: 'com.telerik.plugins.nativepagetransitions',
pluginRef: 'plugins.nativepagetransitions',
repo: 'https://github.com/Telerik-Verified-Plugins/NativePageTransitions',

View File

@@ -23,6 +23,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'NativeStorage',
plugin: 'cordova-plugin-nativestorage',
pluginRef: 'NativeStorage',
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'

View File

@@ -43,6 +43,7 @@ declare var navigator: any;
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
*/
@Plugin({
pluginName: 'Network',
plugin: 'cordova-plugin-network-information',
repo: 'https://github.com/apache/cordova-plugin-network-information',
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser'],

View File

@@ -1,5 +1,6 @@
import { Plugin, Cordova } from './plugin';
import { Observable } from 'rxjs/Observable';
declare let window: any;
/**
* @name NFC
* @description
@@ -23,6 +24,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'NFC',
plugin: 'phonegap-nfc',
pluginRef: 'nfc',
repo: 'https://github.com/chariotsolutions/phonegap-nfc'
@@ -155,9 +157,29 @@ export class NFC {
/**
* @private
*/
export declare class Ndef {
static uriRecord(uri: string): any;
static textRecord(text: string): any;
static mimeMediaRecord(mimeType: string, payload: string): any;
static androidApplicationRecord(packageName: string): any;
export class Ndef {
/**
* @private
*/
static pluginName = 'NFC';
/**
* @private
*/
static plugin = 'phonegap-nfc';
/**
* @private
*/
static pluginRef = 'ndef';
@Cordova({ sync: true })
static uriRecord(uri: string): any { return; }
@Cordova({ sync: true })
static textRecord(text: string): any { return; }
@Cordova({ sync: true })
static mimeMediaRecord(mimeType: string, payload: string): any { return; }
@Cordova({ sync: true })
static androidApplicationRecord(packageName: string): any { return; }
}

View File

@@ -30,6 +30,7 @@ import { Observable } from 'rxjs/Observable';
*
*/
@Plugin({
pluginName: 'OneSignal',
plugin: 'onesignal-cordova-plugin',
pluginRef: 'plugins.OneSignal',
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'

View File

@@ -58,6 +58,7 @@ import { Plugin, Cordova } from './plugin';
* PayPalShippingAddress
*/
@Plugin({
pluginName: 'PayPal',
plugin: 'com.paypal.cordova.mobilesdk',
pluginRef: 'PayPalMobile',
repo: 'https://github.com/paypal/PayPal-Cordova-Plugin'

View File

@@ -12,6 +12,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'PhotoViewer',
plugin: 'com-sarriaroman-photoviewer',
pluginRef: 'PhotoViewer',
repo: 'https://github.com/sarriaroman/photoviewer'

View File

@@ -20,6 +20,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'PinDialog',
plugin: 'cordova-plugin-pin-dialog',
pluginRef: 'plugins.pinDialog',
repo: 'https://github.com/Paldom/PinDialog'

View File

@@ -19,7 +19,7 @@ export const getPlugin = function(pluginRef: string): any {
* @param method
*/
export const pluginWarn = function(pluginObj: any, method?: string) {
let pluginName = pluginObj.name, plugin = pluginObj.plugin;
let pluginName = pluginObj.pluginName, plugin = pluginObj.plugin;
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
} else {
@@ -65,20 +65,33 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
obj[opts.errorName] = reject;
args.push(obj);
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
const setSuccessIndex = () => {
// If we've specified a success/error index
if (opts.successIndex > args.length) {
args[opts.successIndex] = resolve;
} else {
args.splice(opts.successIndex, 0, resolve);
}
};
if (opts.successIndex > args.length) {
args[opts.successIndex] = resolve;
const setErrorIndex = () => {
// We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
if (opts.errorIndex > args.length) {
args[opts.errorIndex] = reject; // insert the reject fn at the correct specific index
} else {
args.splice(opts.errorIndex, 0, reject); // otherwise just splice it into the array
}
};
if (opts.successIndex > opts.errorIndex) {
setErrorIndex();
setSuccessIndex();
} else {
args.splice(opts.successIndex, 0, resolve);
setSuccessIndex();
setErrorIndex();
}
// We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
if (opts.errorIndex > args.length) {
args[opts.errorIndex] = reject; // insert the reject fn at the correct specific index
} else {
args.splice(opts.errorIndex, 0, reject); // otherwise just splice it into the array
}
} else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
@@ -98,7 +111,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
if (!pluginInstance) {
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
if (!window.cordova) {
cordovaWarn(pluginObj.name, methodName);
cordovaWarn(pluginObj.pluginName, methodName);
return {
error: 'cordova_not_available'
};
@@ -183,7 +196,7 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
return get(window, pluginObj.pluginRef)[opts.clearFunction].call(pluginObj, pluginResult);
}
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
console.warn('Unable to clear the previous observable watch for', pluginObj.pluginName, methodName);
console.error(e);
}
};
@@ -210,7 +223,7 @@ function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
}
return pluginObj._objectInstance[opts.clearFunction].call(pluginObj, pluginResult);
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
console.warn('Unable to clear the previous observable watch for', pluginObj.pluginName, methodName);
console.error(e);
}
};
@@ -255,7 +268,7 @@ function overrideFunction(pluginObj: any, methodName: string, args: any[], opts:
if (!pluginInstance) {
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
if (!window.cordova) {
cordovaWarn(pluginObj.name, methodName);
cordovaWarn(pluginObj.pluginName, methodName);
observer.error({
error: 'cordova_not_available'
});
@@ -313,7 +326,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
* @usage
* ```typescript
* @Plugin({
* name: 'MyPlugin',
* pluginName: 'MyPlugin',
* plugin: 'cordova-plugin-myplugin',
* pluginRef: 'window.myplugin'
* })

View File

@@ -16,6 +16,7 @@ import { Plugin, Cordova } from './plugin';
* ```
*/
@Plugin({
pluginName: 'PowerManagement',
plugin: 'cordova-plugin-powermanagement-orig',
pluginRef: 'powerManagement',
repo: 'https://github.com/Viras-/cordova-plugin-powermanagement'

View File

@@ -61,6 +61,7 @@ export interface PrintOptions {
* ```
*/
@Plugin({
pluginName: 'Printer',
plugin: 'de.appplant.cordova.plugin.printer',
pluginRef: 'cordova.plugins.printer',
repo: 'https://github.com/katzer/cordova-plugin-printer.git',

View File

@@ -286,9 +286,11 @@ declare var PushNotification: {
* ```
*/
@Plugin({
pluginName: 'Push',
plugin: 'phonegap-plugin-push',
pluginRef: 'PushNotification',
repo: 'https://github.com/phonegap/phonegap-plugin-push'
repo: 'https://github.com/phonegap/phonegap-plugin-push',
install: 'ionic plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX'
})
export class Push {

View File

@@ -39,6 +39,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'SafariViewController',
plugin: 'cordova-plugin-safariviewcontroller',
pluginRef: 'SafariViewController',
platforms: ['iOS', 'Android'],

View File

@@ -23,9 +23,9 @@ declare var window;
* ```
*
* @advanced
*
*
* Accepted orientation values:
*
*
* | Value | Description |
* |-------------------------------|------------------------------------------------------------------------------|
* | portrait-primary | The orientation is in the primary portrait mode. |
@@ -34,9 +34,10 @@ declare var window;
* | landscape-secondary | The orientation is in the secondary landscape mode. |
* | portrait | The orientation is either portrait-primary or portrait-secondary (sensor). |
* | landscape | The orientation is either landscape-primary or landscape-secondary (sensor). |
*
*
*/
@Plugin({
pluginName: 'ScreenOrientation',
plugin: 'cordova-plugin-screen-orientation',
pluginRef: 'window.screen',
repo: 'https://github.com/apache/cordova-plugin-screen-orientation',

View File

@@ -17,6 +17,7 @@ declare var navigator: any;
* ```
*/
@Plugin({
pluginName: 'Screenshot',
plugin: 'https://github.com/gitawego/cordova-screenshot.git',
pluginRef: 'navigator.screenshot',
repo: 'https://github.com/gitawego/cordova-screenshot.git'

View File

@@ -40,6 +40,7 @@ declare var cordova: any;
* ```
*/
@Plugin({
pluginName: 'SecureStorage',
plugin: 'cordova-plugin-secure-storage',
pluginRef: 'plugins.securestorage',
repo: 'https://github.com/Crypho/cordova-plugin-secure-storage',

View File

@@ -15,6 +15,7 @@ import { Observable } from 'rxjs/Observable';
* ```
*/
@Plugin({
pluginName: 'Shake',
plugin: 'cordova-plugin-shake',
pluginRef: 'shake',
repo: 'https://github.com/leecrossley/cordova-plugin-shake'

View File

@@ -20,6 +20,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Sim',
plugin: 'cordova-plugin-sim',
pluginRef: 'plugins.sim',
repo: 'https://github.com/pbakondy/cordova-plugin-sim',

View File

@@ -40,6 +40,7 @@ export interface SmsOptionsAndroid {
* ```
*/
@Plugin({
pluginName: 'SMS',
plugin: 'cordova-sms-plugin',
pluginRef: 'sms',
repo: 'https://github.com/cordova-sms/cordova-sms-plugin',
@@ -59,6 +60,15 @@ export class SMS {
phoneNumber: string | string[],
message: string,
options?: SmsOptions
): Promise<any> { return; }
): Promise<any> { return; }
/**
* This function lets you know if the app has permission to send SMS
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if we have permission
*/
@Cordova({
platforms: ['Android']
})
static hasPermission(): Promise<boolean> { return; }
}

View File

@@ -25,6 +25,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'SocialSharing',
plugin: 'cordova-plugin-x-socialsharing',
pluginRef: 'plugins.socialsharing',
repo: 'https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin',

View File

@@ -15,6 +15,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'SpinnerDialog',
plugin: 'cordova-plugin-spinner-dialog',
pluginRef: 'window.plugins.spinnerDialog',
repo: 'https://github.com/Paldom/SpinnerDialog',

View File

@@ -15,6 +15,7 @@ import { Cordova, Plugin } from './plugin';
* ```
*/
@Plugin({
pluginName: 'Splashscreen',
plugin: 'cordova-plugin-splashscreen',
pluginRef: 'navigator.splashscreen',
repo: 'https://github.com/apache/cordova-plugin-splashscreen'

Some files were not shown because too many files have changed in this diff Show More