Compare commits

..

137 Commits

Author SHA1 Message Date
Ibby Hadeed
7df7a557da chore(): update changelog 2017-04-18 17:48:08 -04:00
Ibby Hadeed
c720bfead1 3.5.0 2017-04-18 17:48:00 -04:00
Ibby Hadeed
b4102310e7 tslint 2017-04-18 17:47:24 -04:00
Ibby Hadeed
1b84db035f feat(camera-preview): add new plugin methods
New methods and constants available for CameraPreview
2017-04-18 17:44:01 -04:00
Ibby Hadeed
37e8eddd86 feat(background-fetch): add new status method
feat(background-fetch): add status method
2017-04-18 17:42:00 -04:00
Ibby Hadeed
4fb9b949d7 feat(action-sheet): update to match latest version
feat(action-sheet): update to newest version
2017-04-18 17:41:11 -04:00
Ibby Hadeed
66bc034c80 fix(google-maps): fix Geocoder pluginRef
Fix Geocoder's pluginRef
2017-04-18 17:40:33 -04:00
Ibby Hadeed
593c1ee6ca feat(health): update datatypes
Update datatypes to match recent release of plugin
2017-04-18 17:39:47 -04:00
Ibby Hadeed
91439be0bd feat(native-geocoder): add district property
native-geocoder: added district for larger cities
2017-04-18 17:38:17 -04:00
Ibby Hadeed
4ae50561b4 feat(flurry-analytics): add flurry analytics plugin
Added Flurry Analytics wrapper
2017-04-18 17:37:39 -04:00
Ibby Hadeed
1f0986fa6f docs(): fix reference
change executeSql doc to mention create instead of openDatabase
2017-04-18 17:36:39 -04:00
Ibby Hadeed
1be4c1c669 docs(): battery-status example fix (#1387)
Closes #1383
2017-04-18 17:36:15 -04:00
Dylan v.d Merwe
c7a6e6625a docs(): fix typo in media example (#1386) 2017-04-18 17:35:27 -04:00
SVANNER
0a7f56d960 New methods and constants available 2017-04-18 07:15:15 +02:00
Dylan v.d Merwe
f7044a08de bug(doc): battery-status example fix
Fix for https://github.com/driftyco/ionic-native/issues/1383
2017-04-17 23:26:56 +02:00
John-Luke
6168eaee47 feat(background-fetch): add status method 2017-04-17 15:22:44 -03:00
John-Luke
9c925806ed feat(action-sheet): update to newest version 2017-04-17 14:27:13 -03:00
Robert Coie
3e8211461a change executeSql doc to mention create instead of openDatabase 2017-04-16 16:27:09 -07:00
hodak
b2120c68e2 Fix Geocoder's pluginRef 2017-04-15 13:29:10 +02:00
Ankush Aggarwal
1da12b9330 added HealthDataType interface and usage instructions 2017-04-14 08:21:45 -07:00
Amit Moryossef
4bd6aaba2b fix(core): fix bug when checking if plugin exists (#1348)
* fix(cordova-plugin): add check if method exists

For https://github.com/driftyco/ionic-native/issues/1327

* fix(plugin): add typeof to undefined check
2017-04-14 09:49:57 -04:00
Ibby Hadeed
f396940044 fix(rollbar): fix pluginRef 2017-04-14 09:42:46 -04:00
Ibby Hadeed
6bba72d32a fix(media): fix issue with create method
closes #1333
2017-04-14 09:19:25 -04:00
Juan J. San Emeterio
d30b534150 docs(google-plus): options parameter is required (#1368)
Issue reported: https://forum.ionicframework.com/t/ionic-native-googleplus-unrecognized-selector-sent-to-instance/81944/3

In order to correctly call the login method on the GooglePlus provider you need to pass it the 'options' parameter even if it's empty.
2017-04-14 09:14:41 -04:00
Kendall González León
8edc27079c docs(): fix example (#1362)
Line 224 fixed, Incorrect single quotes in the string.
(don't -> do not) remove quotes for avoid bad format.
2017-04-14 09:13:52 -04:00
Stefan Huber
55f9943f86 docs(media): minor fix (#1358)
`getDuration` is synchronous, inside the example it was used with a promise, which is quite missleading...
2017-04-14 09:07:27 -04:00
Ctibor Laky
352ad7ab2f docs(): fix example (#1355) 2017-04-14 09:04:46 -04:00
Gianfrancø Palumbo
15bf509ae0 docs(): fix typo (#1354) 2017-04-14 09:04:32 -04:00
Nikhil
6b9f650a19 docs(social-sharing): fix example (#1351)
ShareViaEmail parameter for providing email "must be null or an array" because it's type is "string:[]" and the provided syntax is wrong, so i have updated that syntax.
2017-04-14 09:04:11 -04:00
Leonardo Ruhland
b30883a876 docs(): fix package name (#1340)
Fixes documentation with the new import syntax
2017-04-14 08:59:15 -04:00
Garry-H
caec80b661 docs(nfc): enhance docs (#1325)
labeled methods with classes, improved method descriptions
2017-04-14 08:58:53 -04:00
LAÉCIO FERREIRA MORAIS
620289f54b docs(): fix typo (#1324) 2017-04-14 08:58:01 -04:00
Lenglet Anthony
5a6246425f docs(): fix typo (#1323) 2017-04-14 08:57:41 -04:00
Ankush Aggarwal
43b75af58b changed any to specific types 2017-04-13 17:56:59 -07:00
Ankush Aggarwal
44957e2197 Update datatypes to match recent release of plugin
I made changes to cordova-plugin-health to accept the following array as datatypes. Earlier it was just an array of strings. Now it also contains an object with `read` and `write` array.

```
[
  'calories', 'distance',   //read and write permissions
  {
    read : ['steps'],       //read only permission
    write : ['height', 'weight']  //write only permission
  }
]
```

Don't know how to specify this array in typescript so just replaced by 'any'
2017-04-11 09:39:24 -07:00
fredroo
c15c11cf95 docs(): enhance example (#1336) 2017-04-08 16:58:36 -04:00
Ankush Aggarwal
1b429638fe docs(): add types (#1342)
Resolves - https://github.com/driftyco/ionic-native/issues/1331
2017-04-08 16:58:07 -04:00
Andréas Hanss
99576d823d Edit for 3.0 (#1345) 2017-04-08 16:57:38 -04:00
Robert Herhold
0147704a4f docs(): fix typo (#1329) 2017-04-05 23:37:08 -04:00
Yasin Simsek
f6a7e5fe9b native-geocoder: added district for larger cities 2017-04-03 12:49:29 +02:00
anastasia
ebb47ce591 fixed doc of flurry analytics wrapper 2017-04-03 13:14:08 +03:00
gujiman
57eabc002a docs(paypal): fix package name in example (#1313)
The import ref for paypal is incorrect. I've added the correct name.
2017-04-01 22:38:42 -04:00
Joel Szwarga
24c8d5d627 docs(music-controls): fix example code (#1315)
The sample code does not work...this change returns the observable first with subscribe() before actually calling the Observable's subscribe method.

In fact, the way it's written in the example, the code would not build because of typescript errors.
2017-04-01 22:38:17 -04:00
Ibby Hadeed
4ceb340630 docs(admob-free): fix plugin name 2017-03-31 23:15:27 -04:00
anastasia
ec8d318280 Finish flurry-analytics 2017-03-31 17:38:11 +03:00
anastasia
8add83612d added flurry analytics wrapper 2017-03-31 17:36:09 +03:00
Gengjun Wu
0beefb3079 docs(flashlight): fix typo (#1306)
There is a typo on line 14, changed from

 * constructor(private flashlight: FlashLight) { }

to

 * constructor(private flashlight: Flashlight) { }
2017-03-31 03:02:39 -04:00
Ibby Hadeed
4d2f720b01 chore(): update changelog 2017-03-30 15:58:15 -04:00
Ibby Hadeed
d29ca88b18 3.4.4 2017-03-30 15:58:12 -04:00
Ibby Hadeed
c94dd41f92 Merge branch 'master' of github.com:driftyco/ionic-native 2017-03-30 15:58:11 -04:00
gurnard123
b005efc52b docs(intel-security): fix references (#1305)
corrected the documentation to correct the read code snippet. As detailed here:
https://forum.ionicframework.com/t/crypto-libraries-with-ionic-2/84629
2017-03-30 15:50:26 -04:00
mugenyi henry
f4c4317f16 docs(admob): fix package name (#1301)
remove the dash "import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';" to import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob' because typescript will not import the specified clases
2017-03-30 15:50:02 -04:00
Ibby Hadeed
145577f9bc fix(push): hasPermission is part of Push object
addresses comment in #1297
2017-03-30 15:48:46 -04:00
Ibby Hadeed
390f474ad5 chore(): update changelog 2017-03-29 19:21:14 -04:00
Ibby Hadeed
d8655f055e 3.4.3 2017-03-29 19:21:07 -04:00
Ibby Hadeed
65cf94b67b fix(app-preferences): fix bug with fetch method
closes #1299
2017-03-29 19:20:46 -04:00
Ibby Hadeed
b91757e7e9 fix(secure-storage): return unfunctional SecureStorageObject if plugin doesn't exist 2017-03-29 19:15:54 -04:00
Ibby Hadeed
612cb963e1 Merge branch 'master' of github.com:driftyco/ionic-native 2017-03-29 19:11:01 -04:00
Odd Christer Brovig
8b31d72139 feat(secure-storage): add keys() and clear() methods (#1281) 2017-03-29 19:10:49 -04:00
mchristofersenrealnets
3b9e7253db docs(admob): @ionic-native (#1298)
Can't import from 'ionic-native'. need to use "@ionic-native/admob-free".
2017-03-29 19:08:54 -04:00
Ibby Hadeed
8b86a12e07 docs(native-storage): add platforms info 2017-03-29 19:02:12 -04:00
Josh Babb
543ae7abf8 docs(jins-meme): add extended usage example (#1286) 2017-03-29 18:56:35 -04:00
Ibby Hadeed
6ccf3a66bb docs(native-page-transitions): improve docs
closes #1294
2017-03-29 18:56:15 -04:00
Ibby Hadeed
2b94ffdc44 fix(admob): add missing license property
fixes #1291
2017-03-29 18:39:46 -04:00
Ibby Hadeed
208748a660 fix(push): add missing plugin decorator
closes #1297
2017-03-29 18:34:02 -04:00
perry
47b593b43d chore(docs): moving docs from /docs/v2/native to /docs/native 2017-03-29 11:19:31 -05:00
Perry Govier
947bf227d0 Running CI2 on master 2017-03-29 10:23:28 -05:00
Perry Govier
4f7718b03e Merge pull request #1289 from driftyco/cci2
chore(): use CircleCI 2
2017-03-29 10:22:41 -05:00
Ibby Hadeed
31d0f71cc9 works 100% 2017-03-28 20:32:14 -04:00
Ibby Hadeed
723ac779df test doc update 2017-03-28 20:30:41 -04:00
Ibby Hadeed
ebd272e30a revert last test commit 2017-03-28 20:28:27 -04:00
Ibby Hadeed
029a196f38 test doc update 2017-03-28 20:27:35 -04:00
Ibby Hadeed
b872bd01ce docs(): update docs 2017-03-28 20:26:43 -04:00
Ibby Hadeed
d6711080e3 update docs on master only 2017-03-28 20:22:34 -04:00
Ibby Hadeed
3e124f1807 update docs only master 2017-03-28 20:13:44 -04:00
Ibby Hadeed
e474b2987f replace cache pattern since we messed it up 2017-03-28 20:06:28 -04:00
Ibby Hadeed
75ee0418bf replace cache pattern since we messed it up 2017-03-28 20:04:03 -04:00
Ibby Hadeed
7c8c71bdc8 fix node_modules path 2017-03-28 20:02:33 -04:00
Ibby Hadeed
3d82d0d592 fix restore cache key 2017-03-28 20:01:17 -04:00
Ibby Hadeed
3f2a983c6e more caching 2017-03-28 19:59:33 -04:00
Ibby Hadeed
7953ca0e72 fixes 2017-03-28 19:46:17 -04:00
Ibby Hadeed
117b0578b0 fixes 2017-03-28 19:45:44 -04:00
Ibby Hadeed
cadafaa3b6 build timeouts 2017-03-28 19:41:50 -04:00
Ibby Hadeed
4778637bd5 Remove machine option 2017-03-28 19:37:52 -04:00
Ibby Hadeed
a1ff059e90 try building 2017-03-28 19:37:05 -04:00
Ibby Hadeed
15237ea983 fix syntax 2017-03-28 19:32:07 -04:00
Ibby Hadeed
b0710cad1e test cci2 2017-03-28 19:31:39 -04:00
Ibby Hadeed
ee269669aa 3.4.2 2017-03-28 11:23:37 -04:00
Ibby Hadeed
97307a2b8c amend(network): fix observable import 2017-03-28 09:41:12 -04:00
Ibby Hadeed
0ae3cb0d00 chore(): update changelog 2017-03-28 09:34:55 -04:00
Ibby Hadeed
0dee3500f7 3.4.1 2017-03-28 09:34:37 -04:00
Ibby Hadeed
b53af8e3c9 fix(admob): fix event listeners
fixes #1165
2017-03-28 09:28:02 -04:00
Ibby Hadeed
006f7dc2ad fix(network): fix onchange method
fixes #1173
2017-03-28 09:07:12 -04:00
Ibby Hadeed
19bc8419e0 fix(network): remove ontypechange method 2017-03-28 09:04:45 -04:00
Ibby Hadeed
d3d8f8264c docs(): add platforms tag 2017-03-28 08:54:40 -04:00
Ibby Hadeed
8262219d05 docs(): update developer docs
closes #1210
2017-03-28 08:49:36 -04:00
Ibby Hadeed
39a91d9520 chore(): update changelog 2017-03-28 08:26:22 -04:00
Ibby Hadeed
88a19af21e 3.4.0 2017-03-28 08:25:59 -04:00
Ibby Hadeed
1dccff5e49 3.3.2 2017-03-28 08:25:38 -04:00
Ibby Hadeed
689f0f159c chore(): add platforms tag 2017-03-28 08:25:07 -04:00
Ibby Hadeed
5aa484c024 docs(): add platforms 2017-03-28 08:24:04 -04:00
Ibby Hadeed
ea88c9e4a8 fix(sqlite): fix SQLiteDatabaseConfig interface
closes #1280
2017-03-28 08:09:07 -04:00
Ibby Hadeed
bc364d1cb1 docs(admob-free): improve docs 2017-03-28 06:54:03 -04:00
Ibby Hadeed
ffa37e2932 feat(taptic-engine): add taptic engine plugin support (#1271)
* Added taptic plugin. #571

* docs(taptic): improve docs

* update to v3
2017-03-28 06:49:32 -04:00
Ibby Hadeed
f911366c54 feat(sqlite-porter): add SQLite porter plugin (#1273)
closes #485
2017-03-28 06:49:27 -04:00
Ibby Hadeed
0ef4a7394e feat(admob-free): add AdMobFree plugin (#1272)
closes #1170
2017-03-28 06:49:22 -04:00
Thomas Kemmer
68d99461c6 feat(zeroconf): add cordova-plugin-zeroconf support (#1260)
* feat(zeroconf): add cordova-plugin-zeroconf support

* feat(zeroconf): restructure documentation
2017-03-28 06:48:43 -04:00
Ibby Hadeed
6a458b52cc chore(): update changelog 2017-03-28 04:45:08 -04:00
Ibby Hadeed
a1a4ef94cc 3.3.1 2017-03-28 04:44:59 -04:00
Ibby Hadeed
6e20137340 fix(contacts): fix major bug 2017-03-28 04:44:48 -04:00
Ibby Hadeed
961727ee61 fix(contacts): handle cordova_not_found errors 2017-03-28 04:37:35 -04:00
Ibby Hadeed
9c30a1d0dd fix(background-mode): add missing config options
closes #1277
2017-03-28 04:31:53 -04:00
Ibby Hadeed
ee79278503 docs(sqlite): improve echoTest and deleteDatabase docs 2017-03-28 04:27:49 -04:00
Ibby Hadeed
544e7ef4fc feat(sqlite): add SQLiteDatabaseConfig interface 2017-03-28 04:13:29 -04:00
Ibby Hadeed
01aece1fbb fix(sqlite): fixes echoTest and deleteDatabase
echoTest and deleteDatabase methods belong to the SQLite class, and not the SQLiteObject class

closes #1275
2017-03-28 04:11:19 -04:00
MobGG
a7854b7fad docs(google-map): change GoogleMapsLatLng to LatLng
change GoogleMapsLatLng to LatLng
2017-03-28 02:16:48 -04:00
Ibby Hadeed
27d3d2d1c9 chore(templates): fix variable 2017-03-27 15:07:48 -04:00
Ibby Hadeed
9074362cae fix(core): handle unexpected errors in wrapOtherPromise
fixes #1185
2017-03-27 15:00:04 -04:00
Ibby Hadeed
fd0a2e9acd fix(core): return errors from CordovaCheck decorators
fixes comment mentioned in #1268
2017-03-27 14:54:25 -04:00
Ibby Hadeed
9348415cf5 chore(): update changelog 2017-03-27 14:22:50 -04:00
Ibby Hadeed
ad8c04bf9f 3.3.0 2017-03-27 14:22:43 -04:00
Ibby Hadeed
667f9bdde9 refactor(intel-security): cleanup 2017-03-27 14:22:13 -04:00
Eric Horodyski
aedc9d65c8 feat(intel-security): add com-intel-security-cordova-plugin support (#1256)
* Initial plugin pass

* Remove unneeded imports, or else plugins will not build.

* Add try-catch blocks.
Applications will not bomb if the plugin is not installed or user is running in browser.

* handle missing intel variable.

* Add documentation

* Conform to Cordova decorators.

* Add IntelSecurityDataOptions

* Update plugin to use plain `return` method statements.

* Better conform to Ionic Native
2017-03-27 14:18:23 -04:00
Ibby Hadeed
2869c644ed docs(secure-storage): remove browser from platforms
fixes #1268
2017-03-27 13:26:47 -04:00
Ibby Hadeed
200618dee7 Merge branch 'master' of github.com:driftyco/ionic-native 2017-03-27 13:22:55 -04:00
Ibby Hadeed
5d14b16d73 refactor(): revert last commit 2017-03-27 13:22:39 -04:00
Thomas Kemmer
b08e3a8ee1 feat(android-full-screen): add cordova-plugin-fullscreen support (#1255) 2017-03-26 04:02:53 -04:00
eddyTheDove
3511f24a26 docs(); fix typo (#1257)
In the documentation, when calling `show()`, you logged 'any' in the console, instead of logging 'result'
2017-03-26 04:02:12 -04:00
eddyTheDove
fa803f2258 docs(music-controls): remove duplicate subscribe (#1258)
There was a double .subscribe() function in `this.musicControls.subscribe()`
2017-03-26 04:01:55 -04:00
Ibby Hadeed
d23f13f837 chore(): update changelog 2017-03-26 02:00:57 -04:00
Ibby Hadeed
d4c876d009 chore(): add postchangelog script 2017-03-26 02:00:52 -04:00
Ibby Hadeed
d2ef40ccb7 3.2.4 2017-03-26 01:59:37 -04:00
Ibby Hadeed
8cf332f0ff refactor(decorators): use arrow functions 2017-03-26 01:58:46 -04:00
Ibby Hadeed
be345ea829 chore(build): ship source maps 2017-03-26 01:53:54 -04:00
Ibby Hadeed
c52bb832b4 chore(): fix plugin create command and templtes 2017-03-25 21:48:45 -04:00
Guille
1eebea9df5 docs(google-maps): fix plugin reference (#1251) 2017-03-24 15:45:05 -04:00
Ibby Hadeed
150b236468 chore(publish): a way to re-try in case something happens 2017-03-24 15:42:52 -04:00
84 changed files with 1941 additions and 245 deletions

View File

@@ -4,8 +4,8 @@
#### There are no rules, but here are a few things to consider:
###### Before you submit an issue:
* Do a quick search to see if there are similar issues
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/v2/api/platform/Platform/#ready).
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save ionic-native@latest`
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
###### Still having problems? submit an issue with the following details:
* Short description of the issue
@@ -16,4 +16,4 @@
## Feature request?
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.

View File

@@ -1,3 +1,125 @@
<a name="3.5.0"></a>
# [3.5.0](https://github.com/driftyco/ionic-native/compare/v3.4.4...v3.5.0) (2017-04-18)
### Bug Fixes
* **core:** fix bug when checking if plugin exists (#1348) ([4bd6aab](https://github.com/driftyco/ionic-native/commit/4bd6aab)), closes [#1348](https://github.com/driftyco/ionic-native/issues/1348)
* **media:** fix issue with create method ([6bba72d](https://github.com/driftyco/ionic-native/commit/6bba72d)), closes [#1333](https://github.com/driftyco/ionic-native/issues/1333)
* **rollbar:** fix pluginRef ([f396940](https://github.com/driftyco/ionic-native/commit/f396940))
### Features
* **action-sheet:** update to newest version ([9c92580](https://github.com/driftyco/ionic-native/commit/9c92580))
* **background-fetch:** add status method ([6168eae](https://github.com/driftyco/ionic-native/commit/6168eae))
<a name="3.4.4"></a>
## [3.4.4](https://github.com/driftyco/ionic-native/compare/v3.4.3...v3.4.4) (2017-03-30)
### Bug Fixes
* **push:** hasPermission is part of Push object ([145577f](https://github.com/driftyco/ionic-native/commit/145577f))
<a name="3.4.3"></a>
## [3.4.3](https://github.com/driftyco/ionic-native/compare/v3.4.2...v3.4.3) (2017-03-29)
### Bug Fixes
* **admob:** add missing license property ([2b94ffd](https://github.com/driftyco/ionic-native/commit/2b94ffd)), closes [#1291](https://github.com/driftyco/ionic-native/issues/1291)
* **app-preferences:** fix bug with fetch method ([65cf94b](https://github.com/driftyco/ionic-native/commit/65cf94b)), closes [#1299](https://github.com/driftyco/ionic-native/issues/1299)
* **push:** add missing plugin decorator ([208748a](https://github.com/driftyco/ionic-native/commit/208748a)), closes [#1297](https://github.com/driftyco/ionic-native/issues/1297)
* **secure-storage:** return unfunctional SecureStorageObject if plugin doesn't exist ([b91757e](https://github.com/driftyco/ionic-native/commit/b91757e))
### Features
* **secure-storage:** add keys() and clear() methods (#1281) ([8b31d72](https://github.com/driftyco/ionic-native/commit/8b31d72))
<a name="3.4.2"></a>
## [3.4.2](https://github.com/driftyco/ionic-native/compare/v3.4.1...v3.4.2) (2017-03-28)
<a name="3.4.1"></a>
## [3.4.1](https://github.com/driftyco/ionic-native/compare/v3.4.0...v3.4.1) (2017-03-28)
### Bug Fixes
* **admob:** fix event listeners ([b53af8e](https://github.com/driftyco/ionic-native/commit/b53af8e)), closes [#1165](https://github.com/driftyco/ionic-native/issues/1165)
* **network:** fix onchange method ([006f7dc](https://github.com/driftyco/ionic-native/commit/006f7dc)), closes [#1173](https://github.com/driftyco/ionic-native/issues/1173)
* **network:** remove ontypechange method ([19bc841](https://github.com/driftyco/ionic-native/commit/19bc841))
<a name="3.4.0"></a>
# [3.4.0](https://github.com/driftyco/ionic-native/compare/v3.3.2...v3.4.0) (2017-03-28)
<a name="3.3.2"></a>
## [3.3.2](https://github.com/driftyco/ionic-native/compare/v3.3.1...v3.3.2) (2017-03-28)
### Bug Fixes
* **sqlite:** fix SQLiteDatabaseConfig interface ([ea88c9e](https://github.com/driftyco/ionic-native/commit/ea88c9e)), closes [#1280](https://github.com/driftyco/ionic-native/issues/1280)
### Features
* **admob-free:** add AdMobFree plugin (#1272) ([0ef4a73](https://github.com/driftyco/ionic-native/commit/0ef4a73)), closes [#1170](https://github.com/driftyco/ionic-native/issues/1170)
* **sqlite-porter:** add SQLite porter plugin (#1273) ([f911366](https://github.com/driftyco/ionic-native/commit/f911366)), closes [#485](https://github.com/driftyco/ionic-native/issues/485)
* **taptic-engine:** add taptic engine plugin support (#1271) ([ffa37e2](https://github.com/driftyco/ionic-native/commit/ffa37e2))
* **zeroconf:** add cordova-plugin-zeroconf support (#1260) ([68d9946](https://github.com/driftyco/ionic-native/commit/68d9946))
<a name="3.3.1"></a>
## [3.3.1](https://github.com/driftyco/ionic-native/compare/v3.3.0...v3.3.1) (2017-03-28)
### Bug Fixes
* **background-mode:** add missing config options ([9c30a1d](https://github.com/driftyco/ionic-native/commit/9c30a1d)), closes [#1277](https://github.com/driftyco/ionic-native/issues/1277)
* **contacts:** fix major bug ([6e20137](https://github.com/driftyco/ionic-native/commit/6e20137))
* **contacts:** handle cordova_not_found errors ([961727e](https://github.com/driftyco/ionic-native/commit/961727e))
* **core:** handle unexpected errors in wrapOtherPromise ([9074362](https://github.com/driftyco/ionic-native/commit/9074362)), closes [#1185](https://github.com/driftyco/ionic-native/issues/1185)
* **core:** return errors from CordovaCheck decorators ([fd0a2e9](https://github.com/driftyco/ionic-native/commit/fd0a2e9)), closes [#1268](https://github.com/driftyco/ionic-native/issues/1268)
* **sqlite:** fixes echoTest and deleteDatabase ([01aece1](https://github.com/driftyco/ionic-native/commit/01aece1)), closes [#1275](https://github.com/driftyco/ionic-native/issues/1275)
### Features
* **sqlite:** add SQLiteDatabaseConfig interface ([544e7ef](https://github.com/driftyco/ionic-native/commit/544e7ef))
<a name="3.3.0"></a>
# [3.3.0](https://github.com/driftyco/ionic-native/compare/v3.2.4...v3.3.0) (2017-03-27)
### Features
* **android-full-screen:** add cordova-plugin-fullscreen support (#1255) ([b08e3a8](https://github.com/driftyco/ionic-native/commit/b08e3a8))
* **intel-security:** add com-intel-security-cordova-plugin support (#1256) ([aedc9d6](https://github.com/driftyco/ionic-native/commit/aedc9d6))
<a name="3.2.4"></a>
## [3.2.4](https://github.com/driftyco/ionic-native/compare/v3.2.3...v3.2.4) (2017-03-26)
<a name="3.2.3"></a>
## [3.2.3](https://github.com/driftyco/ionic-native/compare/v3.2.2...v3.2.3) (2017-03-24)

View File

@@ -17,6 +17,7 @@ gulp plugin:create -n PluginName
gulp plugin:create -m -n PluginName
```
Running the command above will create a new directory `src/@ionic-native/plugins/plugin-name/` with a single file in there: `index.ts`. This file is where all the plugin definitions should be.
Let's take a look at the existing plugin wrapper for Geolocation to see what goes into an Ionic Native plugin (comments have been removed for clarity):
@@ -110,7 +111,7 @@ The `@Cordova` decorator has a few more options now.
### Testing your changes
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. Then, you must go to your ionic application folder and replace your current `node_modules/ionic-native/dist/` with the newly generated one.
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. The `dist` directory will contain a sub directory `@ionic-native` with all the packages compiled in there. Copy the package(s) you created/modified to your app's node_modules under the `@ionic-native` directory. (e.g. `cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/`).
### Cleaning the code
@@ -147,4 +148,65 @@ The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* do not capitalize first letter
* do not place a period (.) at the end
* entire length of the commit message must not go over 50 characters
* entire length of the commit message must not go over 50 characters
### Ionic Native Decorators
#### Plugin
A decorator to wrap the main plugin class, and any other classes that will use `@Cordova` or `@CordovaProperty` decorators. This decorator accepts the following configuration:
- *pluginName*: Plugin name, this should match the class name
- *plugin*: The plugin's NPM package, or Github URL if NPM is not available.
- *pluginRef*: The plugin object reference. Example: 'cordova.file'.
- *repo*: The plugin's Github Repository URL
- *install*: (optional) Install command. This is used in case a plugin has a custom install command (takes variables).
- *platforms*: An array of strings indicating the supported platforms.
#### Cordova
Checks if the plugin and the method are available before executing. By default, the decorator will wrap the callbacks of the function and return a Promise. This decorator takes the following configuration options:
- **observable**: set to true to return an Observable
- **clearFunction**: an optional name of a method to clear the observable we returned
- **clearWithArgs**: This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used in the initial function.
- **sync**: set to true if the method should return the value as-is without wrapping with Observable/Promise
- **callbackOrder**: set to `reverse` if the success and error callbacks are the first two arguements of the method
- **callbackStyle**: set to `node` if the plugin has one callback with a node style (e.g: `function(err, result){}`), or set to `object` if the callbacks are part of an object
- **successName**: Success function property name. This must be set if callbackStyle is set to object.
- **errorName**: Error function property name. This must be set if callbackStyle is set to object.
- **successIndex**: Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **errorIndex**: Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **eventObservable**: set to true to return an observable that wraps an event listener
- **event**: Event name, this must be set if eventObservable is set to true
- **element**: Element to attach the event listener to, this is optional, defaults to `window`
- **otherPromise**: Set to true if the wrapped method returns a promise
- **platforms**: array of strings indicating supported platforms. Specify this if the supported platforms doesn't match the plugin's supported platforms.
Example:
```ts
@Cordova()
someMethod(): Promise<any> { return; }
@Cordova({ sync: true })
syncMethod(): number { }
```
#### CordovaProperty
Checks if the plugin and property exist before getting/setting the property's value
Example:
```ts
@CordovaProperty
someProperty: string;
```
#### CordovaCheck
Checks if the plugin exists before performing a custom written method. By default, the method will return a promise that will reject with an error if the plugin is not available. This wrapper accepts two optional configurations:
- **observable**: set to true to return an empty Observable if the plugin isn't available
- **sync**: set to true to return nothing if the plugin isn't available
Example:
```ts
@CordovaCheck()
someMethod(): Promise<any> {
// anything here will only run if the plugin is available
}
```

View File

@@ -14,11 +14,11 @@ Run following command to install Ionic Native in your project.
npm install @ionic-native/core --save
```
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](http://ionicframework.com/docs/v2/native/) for complete instructions on how to add and use the plugins.
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](http://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
## Documentation
For the full Ionic Native documentation, please visit [http://ionicframework.com/docs/v2/native/](http://ionicframework.com/docs/v2/native/).
For the full Ionic Native documentation, please visit [http://ionicframework.com/docs/native/](http://ionicframework.com/docs/native/).
### Basic Usage

View File

@@ -1,26 +1,38 @@
machine:
node:
version: 5.5.0
ruby:
version: 2.1.2
general:
branches:
only:
- master # ignore PRs and branches
dependencies:
pre:
- ./scripts/docs/prepare.sh
cache_directories:
- "~/ionic-site" # cache ionic-site
test:
override:
- echo "No tests to run"
deployment:
staging:
branch: master
commands:
- ./scripts/docs/update_docs.sh
version: 2
jobs:
build:
working_directory: ~/ionic-native/
docker:
- image: node:7
steps:
- checkout
- restore_cache:
key: ionic-site
- run:
name: Prepare ionic-site repo
command: ./scripts/docs/prepare.sh
- save_cache:
key: ionic-site
paths:
- ~/ionic-site/
- restore_cache:
key: node_modules_{{ checksum "package.json" }}
- run:
name: Install node modules
command: npm i
- save_cache:
key: node_modules_{{ checksum "package.json" }}
paths:
- ~/ionic-native/node_modules/
- run:
name: Run tslint
command: npm run lint
- add_ssh_keys
- deploy:
name: Update docs
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./scripts/docs/update_docs.sh
else
echo "We are on ${CIRCLE_BRANCH} branch, not going to update docs."
fi

View File

@@ -5,7 +5,8 @@ const gulp = require('gulp'),
rename = require("gulp-rename"),
tslint = require('gulp-tslint'),
decamelize = require('decamelize'),
replace = require('gulp-replace');
replace = require('gulp-replace'),
_ = require('lodash');
const flagConfig = {
string: ['port', 'version', 'ngVersion', 'animations'],
@@ -31,16 +32,16 @@ gulp.task('lint', () => {
gulp.task('plugin:create', () => {
if (flags.n && flags.n !== ''){
const src = flags.m?'./scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl',
const src = flags.m ? './scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl',
pluginName = flags.n,
pluginPackageName = decamelize(pluginName, '-'),
pluginNameSpaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1');
return gulp.src(src)
.pipe(replace('PluginName', pluginName))
.pipe(replace('Plugin Name', pluginNameSpaced))
.pipe(replace('$PluginName', pluginName))
.pipe(replace('$Plugin_Name', pluginNameSpaced))
.pipe(replace('$pluginName', _.lowerFirst(pluginName)))
.pipe(rename('index.ts'))
.pipe(gulp.dest('./src/@ionic-native/plugins/' + pluginPackageName));
.pipe(gulp.dest('./src/@ionic-native/plugins/' + _.kebabCase(pluginName)));
} else {
console.log("Usage is: gulp plugin:create -n PluginName");

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "3.2.3",
"version": "3.5.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"license": "MIT",
"devDependencies": {
@@ -43,7 +43,8 @@
"clean": "rimraf dist .tmp",
"shipit": "npm run build && gulp readmes && npm run npmpub",
"npmpub": "node scripts/build/publish.js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"postchangelog": "git commit -am \"chore(): update changelog\""
},
"config": {
"commitizen": {

View File

@@ -13,6 +13,7 @@ const FLAGS = '--access public'; // add any flags here if you want... (example:
const PACKAGES = fs.readdirSync(DIST);
const failedPackages = [];
const QUEUE = queue({
concurrency: 10
@@ -26,7 +27,15 @@ PACKAGES.forEach(packageName => {
const packagePath = path.resolve(DIST, packageName);
exec(`npm publish ${packagePath} ${FLAGS}`)
.then(() => done())
.catch(done);
.catch((e) => {
if (e.stderr && e.stderr.indexOf('previously published version') === -1) {
failedPackages.push({
cmd: e.cmd,
stderr: e.stderr
});
}
done();
});
});
@@ -36,9 +45,14 @@ QUEUE.start((err) => {
if (err) {
console.log('Error publishing ionic-native. ', err);
} else if (failedPackages.length > 0) {
console.log(`${failedPackages.length} packages failed to publish.`);
console.log(failedPackages);
} else {
console.log('Done publishing ionic-native!');
}
});

View File

@@ -11,7 +11,9 @@
"rootDir": "../../src/",
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
"sourceMap": true,
"inlineSources": true
},
"files": [
"../../src/@ionic-native/core/index.ts"

View File

@@ -14,7 +14,9 @@
"rootDir": "../../../src/@ionic-native/plugins/",
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
"sourceMap": true,
"inlineSources": true
},
"files": []
}

View File

@@ -1,6 +1,6 @@
{
"sitePath": "../ionic-site",
"v2DocsDir": "docs/v2/native",
"docsDest": "../ionic-site/content/docs/v2/native",
"v2DocsDir": "docs/native",
"docsDest": "../ionic-site/content/docs/native",
"pluginDir": "dist/@ionic-native"
}

View File

@@ -30,7 +30,7 @@ function run {
git pull origin master
fi
git rm -rf content/docs/v2/native/*/ || true
git rm -rf content/docs/native/*/ || true
}

View File

@@ -19,7 +19,7 @@ module.exports = function jekyll(renderDocsProcessor) {
docs.forEach(doc => {
doc.outputPath = doc.outputPath.toLowerCase().replace(/\s/g, '-');
doc.URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
doc.URL = doc.outputPath.replace('docs//', 'docs/')
.replace('/index.md', '')
.replace('content/', '');
});
@@ -29,7 +29,7 @@ module.exports = function jekyll(renderDocsProcessor) {
docType: 'nativeMenu',
id: 'native_menu',
template: 'native_menu.template.html',
outputPath: 'content/_includes/v2_fluid/native_menu.html'
outputPath: 'content/_includes/fluid/native_menu.html'
});
return docs;

View File

@@ -1,5 +1,5 @@
---
layout: "v2_fluid/docs_base"
layout: "fluid/docs_base"
version: "<$ version.current.name $>"
versionHref: "<$ version.current.href.replace('content/','') $>"
path: "<$ doc.path $>"

View File

@@ -1,8 +1,8 @@
<li class="capitalize {% if page.id == 'overview' %}active{% endif %}">
<a href="/docs/v2/native/">Overview</a>
<a href="/docs/native/">Overview</a>
</li>
<li class="capitalize {% if page.id == 'mocking' %}active{% endif %}">
<a href="/docs/v2/native/browser.html">Browser Usage</a>
<a href="/docs/native/browser.html">Browser Usage</a>
</li>
<@- for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">

View File

@@ -20,7 +20,7 @@ $ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plug
$ npm install --save @ionic-native/<$ doc.npmId $>
```
## [Usage Documentation](https://ionicframework.com/docs/v2/native/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/')|replace('index.ts','')|replace('src/@ionic-native/plugins/','') $>)
## [Usage Documentation](https://ionicframework.com/docs/native/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/')|replace('index.ts','')|replace('src/@ionic-native/plugins/','') $>)
Plugin Repo: [<$ prop.repo $>](<$ prop.repo $>)

View File

@@ -2,23 +2,29 @@ import { Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name Plugin Name
* @name $Plugin_Name
* @description
*
* @usage
* ```
* import { PluginName } from 'ionic-native';
* import { $PluginName } from 'ionic-native';
*
*
* constructor(private $pluginName: $PluginName) { }
*
* ...
*
*
* ```
*/
@Plugin({
pluginName: 'PluginName',
pluginName: '$PluginName',
plugin: '',
pluginRef: '',
repo: ''
repo: '',
platforms: []
})
@Injectable()
export class PluginName {
export class $PluginName {
}

View File

@@ -15,29 +15,36 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
/**
* @name Plugin Name
* @name $Plugin_Name
* @description
* This plugin does something
*
* @usage
* ```
* import { PluginName } from 'ionic-native';
* import { $PluginName } from 'ionic-native';
*
* PluginName.functionName('Hello', 123)
* .then((something: any) => doSomething(something))
* .catch((error: any) => console.log(error));
*
* constructor(private $pluginName: $PluginName) { }
*
* ...
*
*
* this.$pluginName.functionName('Hello', 123)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'PluginName',
pluginName: '$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
install: '' // OPTIONAL install command, in case the plugin requires variables
platforms: [], // Array of platforms supported, example: ['Android', 'iOS']
install: '', // OPTIONAL install command, in case the plugin requires variables
})
@Injectable()
export class PluginName {
export class $PluginName {
/**
* This function does something

View File

@@ -1,6 +1,7 @@
import { instanceAvailability, checkAvailability, wrap, wrapInstance, overrideFunction } from './plugin';
import { getPlugin, getPromise } from './util';
import { Observable } from 'rxjs/Observable';
import 'rxjs/observable/throw';
export interface PluginConfig {
/**
@@ -145,15 +146,16 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
return (pluginObj: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
return {
value: function(...args: any[]): any {
if (checkAvailability(pluginObj) === true) {
const check = checkAvailability(pluginObj);
if (check === true) {
return descriptor.value.apply(this, args);
} else {
if (opts.sync) {
return;
return null;
} else if (opts.observable) {
return new Observable<any>(() => {});
return Observable.throw(new Error(check && check.error));
}
return getPromise(() => {});
return Promise.reject(check && check.error);
}
}
};
@@ -203,15 +205,19 @@ export function Plugin(config: PluginConfig) {
cls['getPluginName'] = function() {
return config.pluginName;
};
cls['getPluginRef'] = function() {
return config.pluginRef;
};
cls['getPluginInstallName'] = function() {
return config.plugin;
};
cls['getPluginRepo'] = function() {
return config.repo;
};
cls['getSupportedPlatforms'] = function() {
return config.platforms;
};

View File

@@ -32,7 +32,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
pluginInstance = getPlugin(pluginRef);
if (!pluginInstance || (!!methodName && pluginInstance[methodName] === 'undefined')) {
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
if (!window.cordova) {
cordovaWarn(pluginName, methodName);
return {
@@ -54,7 +54,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
* @private
*/
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
return pluginObj._objectInstance && (!methodName || pluginObj._objectInstance[methodName] !== 'undefined');
return pluginObj._objectInstance && (!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined');
}
function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
@@ -152,11 +152,16 @@ function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any= {}) {
return getPromise((resolve, reject) => {
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
if (pluginResult && pluginResult.error) {
reject(pluginResult.error);
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
if (pluginResult) {
if (pluginResult.error) {
reject(pluginResult.error);
} else if (pluginResult.then) {
pluginResult.then(resolve).catch(reject);
}
} else {
reject({ error: 'unexpected_error' });
}
pluginResult.then(resolve).catch(reject);
});
}

View File

@@ -13,6 +13,11 @@ export interface ActionSheetOptions {
*/
title?: string;
/**
* The subtitle for the actionsheet (IOS only)
*/
subtitle?: string;
/**
* Theme to be used on Android
*/
@@ -43,6 +48,10 @@ export interface ActionSheetOptions {
*/
position?: number[];
/**
* Choose if destructive button will be the last
*/
destructiveButtonLast: boolean;
}
/**
@@ -65,10 +74,12 @@ export interface ActionSheetOptions {
*
* const options: ActionSheetOptions = {
* title: 'What do you want with this image?',
* subtitle: 'Choose an action'
* buttonLabels: buttonLabels,
* addCancelButtonWithLabel: 'Cancel',
* addDestructiveButtonWithLabel: 'Delete',
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK,
* destructiveButtonLast: true
* };
*
* this.actionSheet.show(options).then((buttonIndex: number) => {
@@ -83,7 +94,7 @@ export interface ActionSheetOptions {
plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
platforms: ['Android', 'iOS', 'Windows Phone 8']
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Browser']
})
@Injectable()
export class ActionSheet {

View File

@@ -0,0 +1,294 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
export interface AdMobFreeBannerConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
/**
* Set to true, to put banner at top
*/
bannerAtTop?: boolean;
/**
* Set to true, to allow banner overlap WebView
*/
overlap?: boolean;
/**
* Set to true to avoid ios7 status bar overlap
*/
offsetTopBar?: boolean;
/**
* Banner size
*/
size?: string;
}
export interface AdMobFreeInterstitialConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
}
export interface AdMobFreeRewardVideoConfig {
/**
* Ad Unit ID
*/
id?: string;
/**
* Receiving test ad
*/
isTesting?: boolean;
/**
* Auto show ad when loaded
*/
autoShow?: boolean;
}
/**
* @name AdMob Free
* @description
*
* @usage
* ```
* import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
*
*
* constructor(private admobFree: AdMobFree) { }
*
*
* ...
*
*
* const bannerConfig: AdMobFreeBannerConfig = {
* // add your config here
* // for the sake of this example we will just use the test config
* isTesting: true,
* autoShow: true
* };
* this.admobFree.banner.config(bannerConfig);
*
* this.admobFree.banner.prepare()
* .then(() => {
* // banner Ad is ready
* // if we set autoShow to false, then we will need to call the show method here
* })
* .catch(e => console.log(e));
*
*
* ```
*/
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob',
repo: 'https://github.com/ratson/cordova-plugin-admob-free',
platforms: ['Android', 'iOS']
})
@Injectable()
export class AdMobFree {
/**
* Convenience constructor to get event names
*/
events = {
BANNER_LOAD: 'admob.banner.events.LOAD',
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
BANNER_OPEN: 'admob.banner.events.OPEN',
BANNER_CLOSE: 'admob.banner.events.CLOSE',
BANNER_EXIT_APP: 'admob.banner.events.EXIT_APP',
INTERSTITIAL_LOAD: 'admob.interstitial.events.LOAD',
INTERSTITIAL_LOAD_FAIL: 'admob.interstitial.events.LOAD_FAIL',
INTERSTITIAL_OPEN: 'admob.interstitial.events.OPEN',
INTERSTITIAL_CLOSE: 'admob.interstitial.events.CLOSE',
INTERSTITIAL_EXIT_APP: 'admob.interstitial.events.EXIT_APP',
REWARD_VIDEO_LOAD: 'admob.rewardvideo.events.LOAD',
REWARD_VIDEO_LOAD_FAIL: 'admob.rewardvideo.events.LOAD_FAIL',
REWARD_VIDEO_OPEN: 'admob.rewardvideo.events.OPEN',
REWARD_VIDEO_CLOSE: 'admob.rewardvideo.events.CLOSE',
REWARD_VIDEO_EXIT_APP: 'admob.rewardvideo.events.EXIT_APP',
REWARD_VIDEO_START: 'admob.rewardvideo.events.START',
REWARD_VIDEO_REWARD: 'admob.rewardvideo.events.REWARD'
};
/**
* Watch an event
* @param event {string} event name
* @return {Observable<any>}
*/
on(event: string): Observable<any> {
return Observable.fromEvent(document, event);
}
/**
*
* @type {AdMobFreeBanner}
*/
banner: AdMobFreeBanner = new AdMobFreeBanner();
/**
*
* @type {AdMobFreeInterstitial}
*/
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
/**
*
* @type {AdMobFreeRewardVideo}
*/
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
}
/**
* @hidden
*/
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.banner',
})
export class AdMobFreeBanner {
/**
* Update config.
* @param options
* @return {AdMobFreeBannerConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { return; }
/**
* Hide the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
hide(): Promise<any> { return; }
/**
* Create banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
prepare(): Promise<any> { return; }
/**
* Remove the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
remove(): Promise<any> { return; }
/**
* Show the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
show(): Promise<any> { return; }
}
/**
* @hidden
*/
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.interstitial',
})
export class AdMobFreeInterstitial {
/**
* Update config.
* @param options
* @return {AdMobFreeInterstitialConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { return; }
/**
* Check if interstitial is ready
* @return {Promise<any>}
*/
@Cordova({ sync: true })
isReady(): Promise<any> { return; }
/**
* Prepare interstitial
* @return {Promise<any>}
*/
@Cordova({ sync: true })
prepare(): Promise<any> { return; }
/**
* Show the interstitial
* @return {Promise<any>}
*/
@Cordova({ sync: true })
show(): Promise<any> { return; }
}
/**
* @hidden
*/
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.rewardvideo',
})
export class AdMobFreeRewardVideo {
/**
* Update config.
* @param options
* @return {AdMobFreeRewardVideoConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { return; }
/**
* Check if reward video is ready
* @return {Promise<any>}
*/
@Cordova({ sync: true })
isReady(): Promise<any> { return; }
/**
* Prepare reward video
* @return {Promise<any>}
*/
@Cordova({ sync: true })
prepare(): Promise<any> { return; }
/**
* Show the reward video
* @return {Promise<any>}
*/
@Cordova({ sync: true })
show(): Promise<any> { return; }
}

View File

@@ -66,6 +66,11 @@ export interface AdMobOptions {
*/
adExtras?: AdExtras;
/**
* License key for the plugin
*/
license?: any;
}
export interface AdExtras {
@@ -90,7 +95,7 @@ export interface AdExtras {
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
* @usage
* ```typescript
* import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';
* import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob';
*
* constructor(private admob: AdMob){}
*
@@ -242,7 +247,8 @@ export class AdMob {
*/
@Cordova({
eventObservable: true,
event: 'onAdFailLoad'
event: 'onAdFailLoad',
element: document
})
onAdFailLoad(): Observable<any> { return; }
@@ -252,7 +258,8 @@ export class AdMob {
*/
@Cordova({
eventObservable: true,
event: 'onAdLoaded'
event: 'onAdLoaded',
element: document
})
onAdLoaded(): Observable<any> { return; }
@@ -262,7 +269,8 @@ export class AdMob {
*/
@Cordova({
eventObservable: true,
event: 'onAdPresent'
event: 'onAdPresent',
element: document
})
onAdPresent(): Observable<any> { return; }
@@ -272,7 +280,8 @@ export class AdMob {
*/
@Cordova({
eventObservable: true,
event: 'onAdLeaveApp'
event: 'onAdLeaveApp',
element: document
})
onAdLeaveApp(): Observable<any> { return; }
@@ -282,7 +291,8 @@ export class AdMob {
*/
@Cordova({
eventObservable: true,
event: 'onAdDismiss'
event: 'onAdDismiss',
element: document
})
onAdDismiss(): Observable<any> { return; }

View File

@@ -144,7 +144,8 @@ export interface AFAEncryptResponse {
pluginName: 'AndroidFingerprintAuth',
plugin: 'cordova-plugin-android-fingerprint-auth',
pluginRef: 'FingerprintAuth',
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth',
platforms: ['Android']
})
@Injectable()
export class AndroidFingerprintAuth {

View File

@@ -0,0 +1,95 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
/**
* @name Android Full Screen
* @description
* This plugin enables developers to offer users a true full screen experience in their Cordova and PhoneGap apps for Android.
* Using Android 4.0+, you can use true full screen in "lean mode", the way you see in apps like YouTube, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts. This is ideally suited to video or cut-scene content.
* In Android 4.4+, however, you can now enter true full screen, fully interactive immersive mode. In this mode, your app will remain in true full screen until you choose otherwise; users can swipe down from the top of the screen to temporarily display the system UI.
* @usage
* ```typescript
* import { AndroidFullScreen } from '@ionic-native/android-full-screen';
*
* constructor(private androidFullScreen: AndroidFullScreen) { }
*
* ...
*
* this.androidFullScreen.isImmersiveModeSupported()
* .then(() => this.androidFullScreen.immersiveMode())
* .catch((error: any) => console.log(error));
*
* ```
*/
@Plugin({
pluginName: 'AndroidFullScreen',
plugin: 'cordova-plugin-fullscreen',
pluginRef: 'AndroidFullScreen',
repo: 'https://github.com/mesmotronic/cordova-plugin-fullscreen',
platforms: ['Android']
})
@Injectable()
export class AndroidFullScreen {
/**
* Is this plugin supported?
* @return {Promise<void>}
*/
@Cordova()
isSupported(): Promise<void> { return; }
/**
* Is immersive mode supported?
* @return {Promise<void>}
*/
@Cordova()
isImmersiveModeSupported(): Promise<void> { return; }
/**
* The width of the screen in immersive mode.
* @return {Promise<number>}
*/
@Cordova()
immersiveWidth(): Promise<number> { return; }
/**
* The height of the screen in immersive mode.
* @return {Promise<number>}
*/
@Cordova()
immersiveHeight(): Promise<number> { return; }
/**
* Hide system UI until user interacts.
* @return {Promise<void>}
*/
@Cordova()
leanMode(): Promise<void> { return; }
/**
* Show system UI.
* @return {Promise<void>}
*/
@Cordova()
showSystemUI(): Promise<void> { return; }
/**
* Extend your app underneath the status bar (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
showUnderStatusBar(): Promise<void> { return; }
/**
* Extend your app underneath the system UI (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
showUnderSystemUI(): Promise<void> { return; }
/**
* Hide system UI and keep it hidden (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
immersiveMode(): Promise<void> { return; }
}

View File

@@ -21,9 +21,10 @@ import { Injectable } from '@angular/core';
*/
@Plugin({
pluginName: 'AppPreferences',
plugin: 'cordova-plugin-app-preferences', // npm package name, example: cordova-plugin-camera
pluginRef: 'plugins.appPreferences', // the variable reference to call the plugin, example: navigator.geolocation
repo: 'https://github.com/apla/me.apla.cordova.app-preferences', // the github repository URL for the plugin
plugin: 'cordova-plugin-app-preferences',
pluginRef: 'plugins.appPreferences',
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'OS X', 'Windows 8', 'Windows Phone']
})
@Injectable()
export class AppPreferences {
@@ -36,7 +37,6 @@ export class AppPreferences {
* @return {Promise<any>} Returns a promise
*/
@Cordova({
sync: true,
callbackOrder: 'reverse'
})
fetch(dict: string, key?: string): Promise<any> { return; }

View File

@@ -28,7 +28,7 @@ import { Injectable } from '@angular/core';
plugin: 'https://github.com/appodeal/appodeal-cordova-plugin',
pluginRef: 'Appodeal',
repo: 'https://github.com/appodeal/appodeal-cordova-plugin.git',
platforms: [ 'ios', 'android' ]
platforms: [ 'iOS', 'Android' ]
})
@Injectable()
export class Appodeal {

View File

@@ -100,4 +100,11 @@ export class BackgroundFetch {
})
finish(): void { }
/**
* Return the status of the background-fetch
* @returns {Promise<any>}
*/
@Cordova()
status(): Promise<any> { return; }
}

View File

@@ -13,26 +13,37 @@ export interface BackgroundModeConfiguration {
*/
title?: String;
/**
* The text that scrolls itself on statusbar
*/
ticker?: String;
/**
* Description of background task
*/
text?: String;
/**
* if true plugin will not display a notification. Default is false.
* This will look for <icon name>.png in platforms/android/res/drawable|mipmap
*/
silent?: boolean;
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.
*/
resume?: boolean;
hidden?: boolean;
bigText?: boolean;
/**
* The text that scrolls itself on statusbar
*/
ticker?: String;
/**
* if true plugin will not display a notification. Default is false.
*/
silent?: boolean;
}
/**

View File

@@ -32,7 +32,7 @@ export interface BatteryStatusResponse {
*
* // watch change in battery status
* let subscription = this.batteryStatus.onChange().subscribe(
* (status: StatusObject) => {
* (status: BatteryStatusResponse) => {
* console.log(status.level, status.isPlugged);
* }
* );

View File

@@ -134,6 +134,38 @@ export interface CameraPreviewPictureOptions {
@Injectable()
export class CameraPreview {
EXPOSURE_MODES = {
LOCK: 'lock', // IOS Only
AUTO: 'auto', // IOS Only
CONTINUOUS: 'continuous',
CUSTOM: 'custom'
};
FLASH_MODE = {
OFF: 'off',
ON: 'on',
AUTO: 'auto',
RED_EYE: 'red-eye',
TORCH: 'torch' // Android Only
};
COLOR_EFFECT = {
AQUA: 'aqua', // Android Only
BLACKBOARD: 'blackboard', // Android Only
MONO: 'mono',
NEGATIVE: 'negative',
NONE: 'none',
POSTERIZE: 'posterize',
SEPIA: 'sepia',
SOLARIZE: 'solarize', // Android Only
WHITEBOARD: 'whiteboard' // Android Only
};
CAMERA_DIRECTION = {
BACK: 'back',
FRONT: 'front'
};
/**
* Starts the camera preview instance.
* @param {CameraPreviewOptions} options
@@ -149,40 +181,28 @@ export class CameraPreview {
* Stops the camera preview instance. (iOS & Android)
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
stopCamera(): Promise<any> { return; }
/**
* Switch from the rear camera and front camera, if available.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
switchCamera(): Promise<any> { return; }
/**
* Hide the camera preview box.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
hide(): Promise<any> { return; }
/**
* Show the camera preview box.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
@Cordova()
show(): Promise<any> { return; }
/**
@@ -220,6 +240,19 @@ export class CameraPreview {
})
setZoom(zoom?: number): Promise<any> { return; }
/**
* Get the maximum zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getMaxZoom(): Promise<any> { return; }
/**
* Get current zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getZoom(): Promise<any> { return; }
/**
* Set the preview Size
@@ -228,8 +261,7 @@ export class CameraPreview {
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
platforms: ['Android']
errorIndex: 2
})
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
@@ -244,4 +276,68 @@ export class CameraPreview {
})
setFlashMode(flashMode?: string): Promise<any> { return; }
/**
* Get supported picture sizes
* @return {Promise<any>}
*/
@Cordova()
getSupportedPictureSizes(): Promise<any> { return; }
/**
* Get supported flash modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFlashModes(): Promise<any> { return; }
/**
* Get exposure mode
* @return {Promise<any>}
*/
@Cordova()
getExposureMode(): Promise<any> { return; }
/**
* Get exposure modes
* @return {Promise<any>}
*/
@Cordova()
getExposureModes(): Promise<any> { return; }
/**
* Set exposure mode
* @param [lock] {string}
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
setExposureMode(lock?: string): Promise<any> { return; }
/**
* Get exposure compensation (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensation(): Promise<any> { return; }
/**
* Set exposure compensation (Android)
* @param [exposureCompensation] {number}
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
/**
* Get exposure compensation range (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensationRange(): Promise<any> { return; }
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability } from '@ionic-native/core';
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck } from '@ionic-native/core';
declare var window: any,
navigator: any;
@@ -72,7 +72,7 @@ export class Contact implements IContactProperties {
@InstanceProperty urls: IContactField[];
constructor() {
if (checkAvailability(navigator.contacts, 'create', 'Contacts') === true) {
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
this._objectInstance = navigator.contacts.create();
}
}
@@ -290,7 +290,8 @@ export class ContactFindOptions implements IContactFindOptions {
pluginName: 'Contacts',
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts'
repo: 'https://github.com/apache/cordova-plugin-contacts',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
})
@Injectable()
export class Contacts {
@@ -309,6 +310,7 @@ export class Contacts {
* @param options {IContactFindOptions} Optional options for the query
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
*/
@CordovaCheck()
find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
return getPromise((resolve, reject) => {
navigator.contacts.find(fields, (contacts) => {
@@ -321,6 +323,7 @@ export class Contacts {
* Select a single Contact.
* @returns {Promise<Contact>} Returns a Promise that resolves with the selected Contact
*/
@CordovaCheck()
pickContact(): Promise<Contact> {
return getPromise((resolve, reject) => {
navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);

View File

@@ -26,6 +26,7 @@ import { Injectable } from '@angular/core';
plugin: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
pluginRef: 'cblite',
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
platforms: ['Android', 'iOS']
})
@Injectable()
export class CouchbaseLite {

View File

@@ -23,7 +23,8 @@ import { Cordova, Plugin } from '@ionic-native/core';
pluginName: 'Crop',
plugin: 'cordova-plugin-crop',
pluginRef: 'plugins',
repo: 'https://github.com/jeduan/cordova-plugin-crop'
repo: 'https://github.com/jeduan/cordova-plugin-crop',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Crop {

View File

@@ -78,7 +78,7 @@ export interface DeeplinkMatch {
plugin: 'ionic-plugin-deeplinks',
pluginRef: 'IonicDeeplink',
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
platforms: ['iOS', 'Android'],
platforms: ['iOS', 'Android', 'Browser'],
install: 'ionic plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX']
})

View File

@@ -71,7 +71,8 @@ export interface DeviceMotionAccelerometerOptions {
pluginName: 'DeviceMotion',
plugin: 'cordova-plugin-device-motion',
pluginRef: 'navigator.accelerometer',
repo: 'https://github.com/apache/cordova-plugin-device-motion'
repo: 'https://github.com/apache/cordova-plugin-device-motion',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class DeviceMotion {

View File

@@ -76,7 +76,8 @@ export interface DeviceOrientationCompassOptions {
pluginName: 'DeviceOrientation',
plugin: 'cordova-plugin-device-orientation',
pluginRef: 'navigator.compass',
repo: 'https://github.com/apache/cordova-plugin-device-orientation'
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class DeviceOrientation {

View File

@@ -23,7 +23,8 @@ declare var window: any;
pluginName: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device',
repo: 'https://github.com/apache/cordova-plugin-device'
repo: 'https://github.com/apache/cordova-plugin-device',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Device {

View File

@@ -38,7 +38,8 @@ import {Cordova, Plugin, CordovaProperty} from '@ionic-native/core';
pluginName: 'Diagnostic',
plugin: 'cordova.plugins.diagnostic',
pluginRef: 'cordova.plugins.diagnostic',
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class Diagnostic {

View File

@@ -45,7 +45,8 @@ export interface DialogsPromptCallback {
pluginName: 'Dialogs',
plugin: 'cordova-plugin-dialogs',
pluginRef: 'navigator.notification',
repo: 'https://github.com/apache/cordova-plugin-dialogs.git'
repo: 'https://github.com/apache/cordova-plugin-dialogs.git',
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Dialogs {

View File

@@ -113,7 +113,8 @@ export interface FacebookLoginResponse {
pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
install: 'ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
installVariables: ['APP_ID', 'APP_NAME']
installVariables: ['APP_ID', 'APP_NAME'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Facebook {

View File

@@ -24,7 +24,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'FileOpener',
plugin: 'cordova-plugin-file-opener2',
pluginRef: 'cordova.plugins.fileOpener2',
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2',
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
})
@Injectable()
export class FileOpener {

View File

@@ -18,8 +18,8 @@ declare var window: any;
* ...
*
* this.filePath.resolveNativePath(path)
* .then(filePath => console.log(filePath);
* .catch(err => console.log(err);
* .then(filePath => console.log(filePath))
* .catch(err => console.log(err));
*
* ```
*/

View File

@@ -367,7 +367,8 @@ export declare var FileError: {
pluginName: 'File',
plugin: 'cordova-plugin-file',
pluginRef: 'cordova.file',
repo: 'https://github.com/apache/cordova-plugin-file'
repo: 'https://github.com/apache/cordova-plugin-file',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class File {

View File

@@ -30,7 +30,7 @@ export interface FingerprintOptions {
* ```typescript
* import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
*
* constructor(private faio: FingerpirntAIO) { }
* constructor(private faio: FingerprintAIO) { }
*
* ...
*
@@ -39,7 +39,7 @@ export interface FingerprintOptions {
* clientSecret: "password", //Only necessary for Android
* disableBackup:true //Only for Android(optional)
* })
* .then((result: any) => console.log(any))
* .then((result: any) => console.log(result))
* .catch((error: any) => console.log(error));
*
* ```

View File

@@ -11,7 +11,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
* ```typescript
* import { Flashlight } from '@ionic-native/flashlight';
*
* constructor(private flashlight: FlashLight) { }
* constructor(private flashlight: Flashlight) { }
*
* ...
*
@@ -24,7 +24,8 @@ import { Cordova, Plugin } from '@ionic-native/core';
pluginName: 'Flashlight',
plugin: 'cordova-plugin-flashlight',
pluginRef: 'window.plugins.flashlight',
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git'
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Flashlight {

View File

@@ -0,0 +1,221 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface FlurryAnalyticsOptions {
/** Flurry API key is required */
appKey: string;
/**
* Overrides the version of the app
*/
version?: string;
/**
* How long can the app be paused before a new session is created,
* must be less than or equal to five for Android devices
*/
continueSessionSeconds?: number;
/**
* Set id of the user
*/
userId?: string;
/**
* Set gender of the user
* Valid values are "m", "M", "f" and "F"
*/
gender?: string;
/**
* Set age of the user
*/
age?: number;
/**
* Set error for log
* Values: VERBOSE, DEBUG, INFO, WARN, ERROR
*/
logLevel?: string;
/**
* Defaults to false
*/
enableLogging?: boolean;
/**
* Should every event show up the app's log, defaults to true
*/
enableEventLogging?: boolean;
/**
* Should app crashes be recorded in flurry, defaults to false, iOS only
*/
enableCrashReporting?: boolean;
/**
* Should the session continue when the app is the background, defaults to false, iOS only
*/
enableBackgroundSessions?: boolean;
/**
* Should data be pushed to flurry when the app closes, defaults to true, iOS only
*/
reportSessionsOnClose?: boolean;
/**
* Should data be pushed to flurry when the app is paused, defaults to true, iOS only
*/
reportSessionsOnPause?: boolean;
}
export interface FlurryAnalyticsLocation {
latitude: number;
longitude: number;
/**
* Set altitude
* It is optional and use only for iOS
*/
verticalAccuracy?: number;
/**
* Set radius about 2d point
* It is optional and use only for iOS
*/
horizontalAccuracy?: number;
}
/**
* @name Flurry Analytics
* @description
* This plugin connects to Flurry Analytics SDK
*
* @usage
* ```
* import { FlurryAnalytics } from 'ionic-native/flurry-analytics';
*
* constructor(private flurryAnalytics: FlurryAnalytics) { }
*
* ...
*
* constant options: FlurryAnalyticsOptions = {
* reportSessionsOnClose: true,
* enableLogging: true
* }
*
* FlurryAnalytics.init('12345678965412303214', options)
* .then((something: any) => doSomething(something))
* .catch((error: any) => console.log(error));
*
* ```
* @interfaces
* FlurryAnalyticsOptions
* FlurryAnalyticsLocation
*/
@Plugin({
pluginName: 'FlurryAnalyticsPlugin',
plugin: 'cordova-plugin-flurryanalytics',
pluginRef: 'fa',
repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics.git',
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class FlurryAnalytics {
/**
* Set the setting for Flurry Analytics
* @param appKey {string} API key is required
* @param options {FlurryAnalyticsOptions} is optional
* @return {Promise<any>}
*/
@Cordova()
init(appKey: string, options?: FlurryAnalyticsOptions): Promise<any> {
return;
}
/**
* This function set the Event
* @param eventName {string} The param to configure name of Event
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when event is set
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
logEvent(eventName: string, params?: any): Promise<any> {
return;
}
/**
* This function start a timed event
* @param eventName
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when timed event is started tracking
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
startTimedEvent(eventName: string, params?: Object): Promise<any> {
return;
}
/**
* This function complete a timed event
* @param eventName
* @param params {Object} optional
* @return {Promise<any>} Returns a promise that resolves when timed event is ended tracking
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
endTimedEvent(eventName: string, params?: Object): Promise<any> {
return;
}
/**
* This function log an error
* @param code
* @param message
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
logError(code, message): Promise<any> {
return;
}
/**
* This function log a page view
* @return {Promise<any>}
*/
@Cordova()
logPageView(): Promise<any> {
return;
}
/**
* This function set the location for the event
* (this is will only be used for very course grained statistics like city)
* @param location
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 0
})
setLocation(location: FlurryAnalyticsLocation): Promise<any> {
return;
}
/**
* This function start the session
* Only needed for older versions of Android
* @return {Promise<any>}
*/
@Cordova()
startSession(): Promise<any> {
return;
}
/**
* This function end the session
* Only needed for older versions of Android
* @return {Promise<any>}
*/
@Cordova()
endSession(): Promise<any> {
return;
}
}

View File

@@ -152,7 +152,8 @@ export interface GeolocationOptions {
pluginName: 'Geolocation',
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation'
repo: 'https://github.com/apache/cordova-plugin-geolocation',
platforms: ['Android', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class Geolocation {

View File

@@ -22,6 +22,7 @@ declare var window;
* this.ga.startTrackerWithId('YOUR_TRACKER_ID')
* .then(() => {
* console.log('Google analytics is ready now');
this.ga.trackView('test');
* // Tracker is ready
* // You can now track pages or set additional information such as AppVersion or UserId
* })

View File

@@ -384,7 +384,7 @@ export class GoogleMap {
* export class MapPage {
* constructor(private googleMaps: GoogleMaps) {}
*
* // Load map only after view is initialize
* // Load map only after view is initialized
* ngAfterViewInit() {
* this.loadMap();
* }
@@ -399,14 +399,14 @@ export class GoogleMap {
* // create a new map by passing HTMLElement
* let element: HTMLElement = document.getElementById('map');
*
* let map: GoogleMap = GoogleMaps.create(element);
* let map: GoogleMap = this.googleMaps.create(element);
*
* // listen to MAP_READY event
* // You must wait for this event to fire before adding something to the map or modifying it in anyway
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
*
* // create LatLng object
* let ionic: LatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
* let ionic: LatLng = new LatLng(43.0741904,-89.3809802);
*
* // create CameraPosition
* let position: CameraPosition = {
@@ -451,7 +451,8 @@ export class GoogleMap {
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"',
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS']
installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class GoogleMaps {
@@ -1748,7 +1749,7 @@ export interface GeocoderResult {
*/
@Plugin({
pluginName: 'Geocoder',
pluginRef: 'plugins.google.maps.Geocoder',
pluginRef: 'plugin.google.maps.Geocoder',
plugin: 'cordova-plugin-googlemaps',
repo: ''
})

View File

@@ -12,7 +12,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
*
* ...
*
* this.googlePlus.login()
* this.googlePlus.login({})
* .then(res => console.log(res))
* .catch(err => console.error(err));
*

View File

@@ -1,6 +1,21 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @hidden
*/
export interface HealthDataType {
/**
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
read?: string[];
/**
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
write?: string[];
}
/**
* @hidden
*/
@@ -154,9 +169,19 @@ export interface HealthData {
* ...
*
* this.health.isAvailable()
* .then((available:boolean) => {
* console.log(available);
* this.health.requestAuthorization([
* 'distance', 'nutrition', //read and write permissions
* {
* read: ['steps'], //read only permission
* write: ['height', 'weight'] //write only permission
* }
* ])
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
* })
* .catch(e => console.log(e));
*
* ```
* See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.
@@ -171,7 +196,8 @@ export interface HealthData {
pluginName: 'Health',
plugin: 'cordova-plugin-health',
pluginRef: 'navigator.health',
repo: 'https://github.com/dariosalvi78/cordova-plugin-health'
repo: 'https://github.com/dariosalvi78/cordova-plugin-health',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Health {
@@ -203,7 +229,7 @@ export class Health {
promptInstallFit(): Promise<any> { return; }
/**
* Requests read and write access to a set of data types. It is recommendable to always explain why the app
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
* needs access to the data before asking the user to authorize it.
* This function must be called before using the query and store functions, even if the authorization has already
* been given at some point in the past.
@@ -218,22 +244,25 @@ export class Health {
* In Android 6 and over, this function will also ask for some dynamic permissions if needed
* (e.g. in the case of "distance", it will need access to ACCESS_FINE_LOCATION).
*
* @param {Array<String>} datatypes a list of data types you want to be granted access to
*
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to be granted access to.
* @return {Promise<any>}
*/
@Cordova()
requestAuthorization(datatypes: Array<string>): Promise<any> { return; }
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
/**
* Check if the app has authorization to read/write a set of datatypes.
* This function is similar to requestAuthorization() and has similar quirks.
*
* @param {Array<String>} datatypes a list of data types you want to be granted access to
* Quirks of isAuthorized()
*
* In iOS, this function will only check authorization status for writeable data.
* Read-only data will always be considered as not authorized. This is an intended behaviour of HealthKit.
*
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to check access of, same as in requestAuthorization
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
*/
@Cordova()
isAuthorized(datatypes: Array<string>): Promise<boolean> { return; }
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
/**
* Gets all the data points of a certain data type within a certain time window.

View File

@@ -59,7 +59,8 @@ export interface ImagePickerOptions {
pluginName: 'ImagePicker',
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
pluginRef: 'window.imagePicker',
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker'
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
platforms: ['Android', 'iOS']
})
@Injectable()
export class ImagePicker {

View File

@@ -76,7 +76,8 @@ export interface ImageResizerOptions {
pluginName: 'ImageResizer',
plugin: 'https://github.com/protonet/cordova-plugin-image-resizer.git',
pluginRef: 'ImageResizer',
repo: 'https://github.com/protonet/cordova-plugin-image-resizer'
repo: 'https://github.com/protonet/cordova-plugin-image-resizer',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class ImageResizer {

View File

@@ -162,7 +162,8 @@ export class InAppBrowserObject {
pluginName: 'InAppBrowser',
plugin: 'cordova-plugin-inappbrowser',
pluginRef: 'cordova.InAppBrowser',
repo: 'https://github.com/apache/cordova-plugin-inappbrowser'
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
platforms: ['Amazon', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class InAppBrowser {

View File

@@ -23,7 +23,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'Instagram',
plugin: 'cordova-instagram-plugin',
pluginRef: 'Instagram',
repo: 'https://github.com/vstirbu/InstagramPlugin'
repo: 'https://github.com/vstirbu/InstagramPlugin',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Instagram {

View File

@@ -0,0 +1,250 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
declare var window: any;
export interface IntelSecurityDataOptions {
/** Non-empty string. **/
data: String;
/** Tag text. */
tag?: String;
/** Valid secure data instance ID. */
extraKey?: Number;
/** Application access control policy. */
appAccessControl?: Number;
/** Device locality policy. */
deviceLocality?: Number;
/** Sensitivity level policy. */
sensitivityLevel?: Number;
/** Disallow sealed blob access. */
noStore?: Boolean;
/** Disallow plain-text data access. */
noRead?: Boolean;
/** Creator unique ID. */
creator?: Number;
/** Array of owners unique IDs. */
owners?: Number[];
/** List of trusted web domains. */
webOwners?: String[];
}
/**
* @name Intel Security
* @description
* The App Security API enables the use of security properties and capabilities on the platform, using a new set of API defined for application developers. You are not required to be a security expert to make good use of the API. Key elements, such as encryption of data and establishments of capabilities, is abstracted and done by the API implementation, for you.
*
* For example:
* - Use the API to store (E.g. cache) data locally, using the device non-volatile storage. Data protection/encryption will be done for you by the API implementation
* - Establish a connection with remote server (E.g. XHR) using a protected channel. SSL/TLS establishment and usage will be done for you by the API implementation
*
* For more information please visit the [API documentation](https://software.intel.com/en-us/app-security-api/api).
*
* @usage
* ```
* import { IntelSecurity } from '@ionic-native/intel-security';
* ...
* constructor(private intelSecurity: IntelSecurity) { }
* ...
*
* let storageID = 'id';
*
* this.intelSecurity.data.createFromData({ data: 'Sample Data' })
* .then((instanceID: Number) => this.intelSecurity.storage.write({ id: storageId, instanceID: instanceID }))
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.read({id: storageID })
* .then((instanceID: number) => this.intelSec.data.getData(instanceID))
* .then((data: string) => console.log(data)) // Resolves to 'Sample Data'
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.delete({ id: storageID })
* .then(() => console.log('Deleted Successfully'))
* .catch((error: any) => console.log(error));
* ```
* @classes
* IntelSecurityData
* IntelSecurityStorage
* @interfaces
* IntelSecurityDataOptions
*/
@Plugin({
pluginName: 'IntelSecurity',
plugin: 'com-intel-security-cordova-plugin',
pluginRef: 'intel.security',
repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class IntelSecurity {
/**
* returns an IntelSecurityStorage object
* @type {IntelSecurityStorage}
*/
storage: IntelSecurityStorage = new IntelSecurityStorage();
/**
* Returns an IntelSecurityData object
* @type {IntelSecurityData}
*/
data: IntelSecurityData = new IntelSecurityData();
}
/**
* @hidden
*/
@Plugin({
pluginName: 'IntelSecurity',
plugin: 'com-intel-security-cordova-plugin',
pluginRef: 'intel.security.secureData'
})
export class IntelSecurityData {
/**
* This creates a new instance of secure data using plain-text data.
* @param options {IntelSecurityDataOptions}
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
*/
@Cordova({ otherPromise: true })
createFromData(options: IntelSecurityDataOptions): Promise<Number> { return; }
/**
* This creates a new instance of secure data (using sealed data)
* @param options {Object}
* @param options.sealedData {string} Sealed data in string format.
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
*/
@Cordova({ otherPromise: true })
createFromSealedData(options: { sealedData: string }): Promise<Number> { return; }
/**
* This returns the plain-text data of the secure data instance.
* @param instanceID {Number} Secure data instance ID.
* @returns {Promise<string>} Returns a Promise that resolves to the data as plain-text, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getData(instanceID: Number): Promise<string> { return; }
/**
* This returns the sealed chunk of a secure data instance.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<any>} Returns a Promise that resolves to the sealed data, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getSealedData(instanceID: any): Promise<any> { return; }
/**
* This returns the tag of the secure data instance.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<string>} Returns a Promise that resolves to the tag, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getTag(instanceID: any): Promise<string> { return; }
/**
* This returns the data policy of the secure data instance.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<any>} Returns a promise that resolves to the policy object, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getPolicy(instanceID: any): Promise<any> { return; }
/**
* This returns an array of the data owners unique IDs.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<Array>} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getOwners(instanceID: any): Promise<Array<any>> { return; }
/**
* This returns the data creator unique ID.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<Number>} Returns a promsie that resolves to the creator's unique ID, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getCreator(instanceID: any): Promise<Number> { return; }
/**
* This returns an array of the trusted web domains of the secure data instance.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<Array>} Returns a promise that resolves to a list of web owners, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getWebOwners(instanceID: any): Promise<Array<any>> { return; }
/**
* This changes the extra key of a secure data instance. To successfully replace the extra key, the calling application must have sufficient access to the plain-text data.
* @param options {Object}
* @param options.instanceID {any} Secure data instance ID.
* @param options.extraKey {Number} Extra sealing secret for secure data instance.
* @returns {Promise<any>} Returns a promise that resolves with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
changeExtraKey(options: any): Promise<any> { return; }
/**
* This releases a secure data instance.
* @param instanceID {any} Secure data instance ID.
* @returns {Promise<any>} Returns a promise that resovles with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
destroy(instanceID: any): Promise<any> { return; }
}
/**
* @hidden
*/
@Plugin({
pluginName: 'IntelSecurity',
plugin: 'com-intel-security-cordova-plugin',
pluginRef: 'intel.security.secureStorage'
})
export class IntelSecurityStorage {
/**
* This deletes a secure storage resource (indicated by id).
* @param options {Object}
* @param options.id {String} Storage resource identifier.
* @param [options.storageType] {Number} Storage type.
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
delete(options: {
id: string,
storageType?: Number
}): Promise<any> { return; }
/**
* This reads the data from secure storage (indicated by id) and creates a new secure data instance.
* @param options {Object}
* @param options.id {String} Storage resource identifier.
* @param [options.storageType] {Number} Storage type.
* @param [options.extraKey] {Number} Valid secure data instance ID.
* @returns {Promise<Number>} Returns a Promise that resolves with the instance ID of the created secure data instance, or rejects with an error.
*/
@Cordova({ otherPromise: true })
read(options: {
id: string,
storageType?: Number,
extraKey?: Number
}): Promise<Number> { return; }
/**
* This writes the data contained in a secure data instance into secure storage.
* @param options {Object}
* @param options.id {String} Storage resource identifier.
* @param options.instanceID {Number} Valid secure data instance ID
* @param [options.storageType] {Number} Storage type.
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
write(options: {
id: String,
instanceID: Number,
storageType?: Number
}): Promise<any> { return; }
}

View File

@@ -25,7 +25,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'IsDebug',
plugin: 'cordova-plugin-is-debug',
pluginRef: 'cordova.plugins.IsDebug',
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug'
repo: 'https://github.com/mattlewis92/cordova-plugin-is-debug',
platforms: ['Android', 'iOS']
})
@Injectable()
export class IsDebug {

View File

@@ -17,9 +17,16 @@ declare var cordova: any;
*
* ...
*
* this.jinsMeme.setAppClientID(appClientId: string, clientSecret: string)
* .then(this.jinsMeme.startScan())
* .catch(console.log('jinsMeme.setAppClientID authentication error!'));
* this.jinsMeme.setAppClientID(appClientId: string, clientSecret: string).then(
* // Bluetooth should be enabled and the JINS MEME powered on (blinking blue light)
* this.jinsMeme.startScan().subscribe((meme_addr) => {
* this.jinsMeme.connect(meme_addr).subscribe((connectResult) => {
* this.memeService.startDataReport().subscribe((dataReport) => {
* console.log(dataReport);
* });
* });
* });
* .catch(console.log('jinsMeme.setAppClientID authentication error'));
*
* ```
*/
@@ -27,13 +34,15 @@ declare var cordova: any;
pluginName: 'Jins Meme',
plugin: 'JinsMemeSDK-Plugin-Cordova',
pluginRef: 'cordova.plugins.JinsMemePlugin',
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova.git'
repo: 'https://github.com/jins-meme/JinsMemeSDK-Plugin-Cordova',
platforms: ['Android', 'iOS']
})
@Injectable()
export class JinsMeme {
/**
* Authentication and authorization of App and SDK.
* Must call this method at first.
* Must call this method first.
* Sign up for an app ID (and get an app/client secret) at developers.jins.com
*
*@param {string} setAppClientID
*@param {string} clientSecret

View File

@@ -24,7 +24,8 @@ import { Observable } from 'rxjs/Observable';
pluginName: 'Keyboard',
plugin: 'ionic-plugin-keyboard',
pluginRef: 'cordova.plugins.Keyboard',
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
repo: 'https://github.com/driftyco/ionic-plugin-keyboard',
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
})
@Injectable()
export class Keyboard {

View File

@@ -91,7 +91,8 @@ export interface LaunchNavigatorOptions {
pluginName: 'LaunchNavigator',
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
pluginRef: 'launchnavigator',
repo: 'https://github.com/dpa99c/phonegap-launch-navigator.git'
repo: 'https://github.com/dpa99c/phonegap-launch-navigator',
platforms: ['Android', 'iOS']
})
@Injectable()
export class LaunchNavigator {

View File

@@ -53,7 +53,8 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
plugin: 'cordova-plugin-linkedin',
pluginRef: 'cordova.plugins.LinkedIn',
repo: 'https://github.com/zyramedia/cordova-plugin-linkedin',
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID'
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
platforms: ['Android', 'iOS']
})
@Injectable()
export class LinkedIn {

View File

@@ -144,7 +144,8 @@ export interface ILocalNotification {
pluginName: 'LocalNotifications',
plugin: 'de.appplant.cordova.plugin.local-notification',
pluginRef: 'cordova.plugins.notification.local',
repo: 'https://github.com/katzer/cordova-plugin-local-notifications'
repo: 'https://github.com/katzer/cordova-plugin-local-notifications',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class LocalNotifications {

View File

@@ -32,7 +32,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'LocationAccuracy',
plugin: 'cordova-plugin-request-location-accuracy',
pluginRef: 'cordova.plugins.locationAccuracy',
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy',
platforms: ['Android', 'iOS']
})
@Injectable()
export class LocationAccuracy {

View File

@@ -21,7 +21,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'Market',
plugin: 'cordova-plugin-market',
pluginRef: 'cordova.plugins.market',
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
repo: 'https://github.com/xmartlabs/cordova-plugin-market',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Market {

View File

@@ -160,9 +160,8 @@ export class MediaObject {
* });
*
* // get file duration
* file.getDuration().then((duration) => {
* console.log(position);
* });
* let duration = file.getDuration();
* console.log(duration);
*
* // skip to 10 seconds (expects int value in ms)
* file.seekTo(10000);
@@ -182,7 +181,7 @@ export class MediaObject {
*
* // Recording to a file
* this.media.create('path/to/file.mp3')
* .then((file: MedieObject) => {
* .then((file: MediaObject) => {
*
* file.startRecord();
*
@@ -256,8 +255,7 @@ export class MediaPlugin {
// Creates a new media object
// Resolves with the media object
// or rejects with the error
const instance = new Media(src, resolve, reject, onStatusUpdate);
return resolve(new MediaObject(instance));
const instance = new Media(src, () => resolve(new MediaObject(instance)), reject, onStatusUpdate);
});
}

View File

@@ -80,6 +80,10 @@ export interface NativeGeocoderReverseResult {
* The city.
*/
city: string;
/**
* The district.
*/
district: string;
/**
* The country name.
*/

View File

@@ -29,21 +29,35 @@ export interface NativeTransitionOptions {
*
* ...
*
* let options: NativeTransitionOptions = {
* direction: 'up',
* duration: 500,
* slowdownfactor: 3,
* slidePixels: 20,
* iosdelay: 100,
* androiddelay: 150,
* winphonedelay: 250,
* fixedPixelsTop: 0,
* fixedPixelsBottom: 60
* };
*
* this.nativePageTransitions.slide(options)
* .then(onSuccess)
* .catch(onError);
* // example of adding a transition when a page/modal closes
* ionViewWillLeave() {
*
* let options: NativeTransitionOptions = {
* direction: 'up',
* duration: 500,
* slowdownfactor: 3,
* slidePixels: 20,
* iosdelay: 100,
* androiddelay: 150,
* fixedPixelsTop: 0,
* fixedPixelsBottom: 60
* };
*
* this.nativePageTransitions.slide(options)
* .then(onSuccess)
* .catch(onError);
*
* }
*
*
* // example of adding a transition when pushing a new page
* openPage(page: any) {
*
* this.nativePageTransitions.slide(options);
* this.navCtrl.push(page);
*
* }
*
* ```
*/

View File

@@ -31,7 +31,8 @@ import { Cordova, Plugin } from '@ionic-native/core';
pluginName: 'NativeStorage',
plugin: 'cordova-plugin-nativestorage',
pluginRef: 'NativeStorage',
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
export class NativeStorage {

View File

@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import {Cordova, CordovaProperty, Plugin, CordovaFunctionOverride} from '@ionic-native/core';
import { Cordova, CordovaProperty, Plugin, CordovaCheck } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge';
declare var navigator: any;
@@ -75,15 +76,10 @@ export class Network {
* Returns an observable to watch connection changes
* @return {Observable<any>}
*/
@CordovaFunctionOverride()
onchange(): Observable<any> { return; }
/**
* Returns an observable to watch connection type changes
* @return {Observable<any>}
*/
@CordovaFunctionOverride()
ontypechange(): Observable<any> { return; }
@CordovaCheck()
onchange(): Observable<any> {
return Observable.merge(this.onConnect(), this.onDisconnect());
}
/**
* Get notified when the device goes offline

View File

@@ -34,6 +34,9 @@ declare let window: any;
pluginRef: 'nfc',
repo: 'https://github.com/chariotsolutions/phonegap-nfc'
})
/**
*@{ NFC } class methods
*/
@Injectable()
export class NFC {
/**
@@ -96,7 +99,7 @@ export class NFC {
addNdefFormatableListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
/**
* Qrites an NdefMessage to a NFC tag.
* Writes an NdefMessage(array of ndef records) to a NFC tag.
* @param message {any[]}
* @returns {Promise<any>}
*/
@@ -110,7 +113,7 @@ export class NFC {
makeReadyOnly(): Promise<any> {return; }
/**
* Shares an NDEF Message via peer-to-peer.
* Shares an NDEF Message(array of ndef records) via peer-to-peer.
* @param message An array of NDEF Records.
* @returns {Promise<any>}
*/
@@ -146,7 +149,7 @@ export class NFC {
stopHandover(): Promise<any> {return; }
/**
* Show the NFC settings on the device.
* Opens the device's NFC settings.
* @returns {Promise<any>}
*/
@Cordova()
@@ -159,21 +162,26 @@ export class NFC {
@Cordova()
enabled(): Promise<any> {return; }
/**
* Convert bytes to string
* @{ NFC } class utility methods
* for use with
*/
/**
* Convert byte array to string
* @param bytes {number[]}
* @returns {string}
*/
@Cordova({ sync: true })
bytesToString(bytes: number[]): string {return; }
/**
* Convert string to bytes
* Convert string to byte array.
* @param str {string}
* @returns {number[]}
*/
@Cordova({ sync: true })
stringToBytes(str: string): number[] {return; };
/**
* Convert bytes to hex string
* Convert byte array to hex string
*
* @param bytes {number[]}
* @returns {string}
*/
@@ -189,6 +197,14 @@ export class NFC {
plugin: 'phonegap-nfc',
pluginRef: 'ndef'
})
/**
*@{ Ndef } class methods
*@description
* Utility methods for creating ndef records for the ndef tag format.
* Move records into array before usage. Then pass an array to methods as parameters.
* Do not pass bytes as parameters for these methods, conversion is built in.
* For usage with nfc.write() and nfc.share()
*/
@Injectable()
export class Ndef {

View File

@@ -7,7 +7,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
*
* @usage
* ```
* import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/pay-pal';
* import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal';
*
* constructor(private payPal: PayPal) { }
*
@@ -67,7 +67,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'PayPal',
plugin: 'com.paypal.cordova.mobilesdk',
pluginRef: 'PayPalMobile',
repo: 'https://github.com/paypal/PayPal-Cordova-Plugin'
repo: 'https://github.com/paypal/PayPal-Cordova-Plugin',
platforms: ['Android', 'iOS']
})
@Injectable()
export class PayPal {

View File

@@ -44,7 +44,8 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-photo-library',
pluginRef: 'cordova.plugins.photoLibrary',
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"'
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class PhotoLibrary {

View File

@@ -20,7 +20,8 @@ import { Plugin, Cordova } from '@ionic-native/core';
pluginName: 'PhotoViewer',
plugin: 'com-sarriaroman-photoviewer',
pluginRef: 'PhotoViewer',
repo: 'https://github.com/sarriaroman/photoviewer'
repo: 'https://github.com/sarriaroman/photoviewer',
platforms: ['Android', 'iOS']
})
@Injectable()
export class PhotoViewer {

View File

@@ -213,6 +213,21 @@ export type PushEvent = 'registration' | 'error' | 'notification';
*
* ...
*
*
* // to check if we have permission
* this.push.hasPermission()
* .then((res: any) => {
*
* if (res.isEnabled) {
* console.log('We have permission to send push notifications');
* } else {
* console.log('We do not have permission to send push notifications');
* }
*
* });
*
* // to initialize push notifications
*
* const options: PushOptions = {
* android: {
* senderID: '12345679'
@@ -227,9 +242,9 @@ export type PushEvent = 'registration' | 'error' | 'notification';
*
* const pushObject: PushObject = this.push.init(options);
*
* pushObject.on('notification').subscribe(notification => console.log('Received a notification', notification));
* pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));
*
* pushObject.on('registration').subscribe(registration => console.log('Device registered', registration));
* pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
*
* pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
*
@@ -264,11 +279,23 @@ export class Push {
return new PushObject(options);
}
/**
* Check whether the push notification permission has been granted.
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
*/
@Cordova()
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
}
/**
* @hidden
*/
@Plugin({
pluginName: 'Push',
plugin: 'phonegap-plugin-push',
pluginRef: 'PushNotification'
})
export class PushObject {
private _objectInstance: any;
@@ -279,13 +306,6 @@ export class PushObject {
}
}
/**
* Check whether the push notification permission has been granted.
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
*/
@Cordova()
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
/**
* Adds an event listener
* @param event {string}

View File

@@ -22,7 +22,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
@Plugin({
pluginName: 'Rollbar',
plugin: 'resgrid-cordova-plugins-rollbar',
pluginRef: 'Rollbar',
pluginRef: 'cordova.plugins.Rollbar',
repo: 'https://github.com/Resgrid/cordova-plugins-rollbar',
platforms: ['Android', 'iOS'],
install: 'ionic plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"',

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, CordovaCheck } from '@ionic-native/core';
import { CordovaInstance, Plugin, checkAvailability } from '@ionic-native/core';
declare var cordova: any;
@@ -8,7 +8,7 @@ declare var cordova: any;
*/
export class SecureStorageObject {
constructor(private _objectInstance: any) {}
constructor(private _objectInstance?: any) {}
/**
* Gets a stored item
@@ -41,6 +41,24 @@ export class SecureStorageObject {
})
remove(reference: string): Promise<any> { return; }
/**
* Get all references from the storage.
* @returns {Promise<any>}
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
keys(): Promise<any> { return; }
/**
* Clear all references from the storage.
* @returns {Promise<any>}
*/
@CordovaInstance({
callbackOrder: 'reverse'
})
clear(): Promise<any> { return; }
}
/**
@@ -92,7 +110,7 @@ export class SecureStorageObject {
plugin: 'cordova-plugin-secure-storage',
pluginRef: 'cordova.plugins.SecureStorage',
repo: 'https://github.com/Crypho/cordova-plugin-secure-storage',
platforms: ['Android', 'iOS', 'Windows Phone', 'Browser']
platforms: ['Android', 'iOS', 'Windows Phone']
})
@Injectable()
export class SecureStorage {
@@ -102,10 +120,13 @@ export class SecureStorage {
* @param store {string}
* @returns {Promise<SecureStorageObject>}
*/
@CordovaCheck()
create(store: string): Promise<SecureStorageObject> {
return new Promise((res, rej) => {
const instance = new cordova.plugins.SecureStorage(() => res(new SecureStorageObject(instance)), rej, store);
if (checkAvailability('cordova.plugins.SecureStorage', null, 'SecureStorage') === true) {
const instance = new cordova.plugins.SecureStorage(() => res(new SecureStorageObject(instance)), rej, store);
} else {
res(new SecureStorageObject());
}
});
}

View File

@@ -22,7 +22,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
* });
*
* // Share via email
* this.socialSharing.shareViaEmail('Body', 'Subject', 'recipient@example.org').then(() => {
* this.socialSharing.shareViaEmail('Body', 'Subject', ['recipient@example.org']).then(() => {
* // Success!
* }).catch(() => {
* // Error!

View File

@@ -0,0 +1,113 @@
import { Plugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name SQLite Porter
* @description
* This Cordova/Phonegap plugin can be used to import/export to/from a SQLite database using either SQL or JSON.
*
* @usage
* ```
* import { SQLitePorter } from '@ionic-native/sqlite-porter';
*
*
* constructor(private sqlitePorter: SQLitePorter) { }
*
* ...
*
* let db = window.openDatabase("Test", "1.0", "TestDB", 1 * 1024);
* // or we can use SQLite plugin
* // we will assume that we injected SQLite into this component as sqlite
* this.sqlite.create({
* name: 'data.db',
* location: 'default'
* })
* .then((db: any) => {
* let dbInstance = db._objectInstance;
* // we can pass db._objectInstance as the database option in all SQLitePorter methods
* });
*
*
* let sql = "CREATE TABLE Artist ([Id] PRIMARY KEY, [Title]);" +
* "INSERT INTO Artist(Id,Title) VALUES ('1','Fred');";
*
* this.sqlitePorter.importSqlToDb(db, sql)
* .then(() => console.log('Imported'))
* .catch(e => console.error(e));
*
*
* ```
*/
@Plugin({
pluginName: 'SQLitePorter',
plugin: 'uk.co.workingedge.cordova.plugin.sqliteporter',
pluginRef: 'cordova.plugins.sqlitePorter',
repo: 'https://github.com/dpa99c/cordova-sqlite-porter',
platforms: ['Android', 'iOS', 'Tizen', 'BlackBerry 10']
})
@Injectable()
export class SQLitePorter {
/**
* Executes a set of SQL statements against the defined database. Can be used to import data defined in the SQL statements into the database, and may additionally include commands to create the table structure.
* @param db {Object} Database object
* @param sql {string} SQL statements to execute against the database
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'successFn',
errorName: 'errorFn'
})
importSqlToDb(db: any, sql: string): Promise<any> { return; }
/**
* Exports a SQLite DB as a set of SQL statements.
* @param db {Object} Database object
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'successFn',
errorName: 'errorFn'
})
exportDbToSql(db: any): Promise<any> { return; }
/**
* Converts table structure and/or row data contained within a JSON structure into SQL statements that can be executed against a SQLite database. Can be used to import data into the database and/or create the table structure.
* @param db {Object} Database object
* @param json {Object|string} JSON structure containing row data and/or table structure as either a JSON object or string
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'successFn',
errorName: 'errorFn'
})
importJsonToDb(db: any, json: any): Promise<any> { return; }
/**
* Exports a SQLite DB as a JSON structure
* @param db {Object} Database object
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'successFn',
errorName: 'errorFn'
})
exportDbToJson(db: any): Promise<any> { return; }
/**
* Wipes all data from a database by dropping all existing tables
* @param db {Object} Database object
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'successFn',
errorName: 'errorFn'
})
wipeDb(db: any): Promise<any> { return; }
}

View File

@@ -4,12 +4,27 @@ import { Cordova, CordovaInstance, Plugin, CordovaCheck, InstanceProperty } from
declare var sqlitePlugin;
export interface SQLiteDatabaseConfig {
/**
* Name of the database. Example: 'my.db'
*/
name: string;
/**
* Location of the database. Example: 'default'
*/
location?: string;
/**
* iOS Database Location. Example: 'Library'
*/
iosDatabaseLocation?: string;
}
/**
* @hidden
*/
export class SQLiteObject {
constructor(private _objectInstance: any) { }
constructor(public _objectInstance: any) { }
@InstanceProperty databaseFeatures: any;
@@ -52,7 +67,7 @@ export class SQLiteObject {
start(): void { }
/**
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
* Execute SQL on the opened database. Note, you must call `create` first, and
* ensure it resolved and successfully opened the database.
*/
@CordovaInstance()
@@ -124,19 +139,6 @@ export class SQLiteObject {
})
abortFromQ(sqlerror): void { }
/**
* @returns {Promise<any>}
*/
@Cordova()
echoTest(): Promise<any> { return; }
/**
* @param first
* @returns {Promise<any>}
*/
@Cordova()
deleteDatabase(first): Promise<any> { return; }
}
/**
@@ -173,6 +175,8 @@ export class SQLiteObject {
*
* @classes
* SQLiteObject
* @interfaces
* SQLiteDatabaseConfig
*/
@Plugin({
pluginName: 'SQLite',
@@ -188,14 +192,29 @@ export class SQLite {
*
* See the plugin docs for an explanation of all options: https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database
*
* @param config the config for opening the database.
* @param config {SQLiteDatabaseConfig} database configuration
* @return Promise<SQLiteObject>
*/
@CordovaCheck()
create(config: any): Promise<SQLiteObject> {
create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
return new Promise((resolve, reject) => {
sqlitePlugin.openDatabase(config, db => resolve(new SQLiteObject(db)), reject);
});
}
/**
* Verify that both the Javascript and native part of this plugin are installed in your application
* @returns {Promise<any>}
*/
@Cordova()
echoTest(): Promise<any> { return; }
/**
* Deletes a database
* @param config {SQLiteDatabaseConfig} database configuration
* @returns {Promise<any>}
*/
@Cordova()
deleteDatabase(config: SQLiteDatabaseConfig): Promise<any> { return; }
}

View File

@@ -19,10 +19,11 @@ declare var window;
*
* ...
*
* // let status bar overlay webview
* this.statusBar.overlaysWebView(true);
*
* this.statusBar.overlaysWebView(true); // let status bar overlay webview
*
* this.statusBar.backgroundColorByHexString('#ffffff'); // set status bar to white
* // set status bar to white
* this.statusBar.backgroundColorByHexString('#ffffff');
* ```
*
*/

View File

@@ -0,0 +1,62 @@
import { Cordova, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name Taptic Engine
* @description
* An Ionic plugin to use Taptic Engine API on iPHone 7, 7 Plus or newer.
*
* @usage
* ```ts
* import { TapticEngine } from '@ionic-native/taptic-engine;
*
* ...
*
* constructor(private taptic: TapticEngine) { }
*
* ...
*
* this.taptic.selection();
*
* this.taptic.notification();
*
* this.taptic.impact();
*
* ```
*/
@Plugin({
pluginName: 'TapticEngine',
plugin: 'cordova-plugin-taptic-engine',
pluginRef: 'TapticEngine',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-taptic-engine',
platforms: ['iOS']
})
@Injectable()
export class TapticEngine {
/**
* Use selection feedback generators to indicate a change in selection.
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
selection(): Promise<any> { return; }
/**
* Use this to indicate success/failure/warning to the user.
* @param options {Object} should be of the type { type: 'success' } (or 'warning'/'error')
* @param options.type {string}
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
notification(options: { type: string }): Promise<any> { return; }
/**
* Use this to indicate success/failure/warning to the user.
* @param options {Object} should be of the type { style: 'light' } (or 'medium'/'heavy')
* @param options.type {string}
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
impact(options: { style: string }): Promise<any> { return; }
}

View File

@@ -26,7 +26,7 @@ export interface VideoOptions {
*
* @usage
* ```typescript
* import { VideoPlayer } from '@ionic-native/video-player;
* import { VideoPlayer } from '@ionic-native/video-player';
*
* constructor(private videoPlayer: VideoPlayer) { }
*

View File

@@ -0,0 +1,126 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface ZeroconfService {
domain: string;
type: string;
name: string;
port: number;
hostname: string;
ipv4Addresses: Array<string>;
ipv6Addresses: Array<string>;
txtRecord: any;
}
export interface ZeroconfResult {
action: 'registered' | 'added' | 'removed';
service: ZeroconfService;
}
/**
* @name Zeroconf
* @description
* This plugin allows you to browse and publish Zeroconf/Bonjour/mDNS services.
* @usage
* ```typescript
* import { Zeroconf } from '@ionic-native/zeroconf';
*
* constructor(private zeroconf: Zeroconf) { }
*
* ...
*
* // watch for services of a specified type
* this.zeroconf.watch('_http._tcp.', 'local.').subscribe(result => {
* if (result.action == 'added') {
* console.log('service added', result.service);
* } else {
* console.log('service removed', result.service);
* }
* });
*
* // publish a zeroconf service of your own
* this.zeroconf.register('_http._tcp.', 'local.', 'Becvert\'s iPad', 80, {
* 'foo': 'bar'
* }).then(result => {
* console.log('Service registered', result.service);
* });
*
*
* // unregister your service
* this.zeroconf.unregister('_http._tcp.', 'local.', 'Becvert\'s iPad');
* ```
*/
@Plugin({
pluginName: 'Zeroconf',
plugin: 'cordova-plugin-zeroconf',
pluginRef: 'cordova.plugins.zeroconf',
repo: 'https://github.com/becvert/cordova-plugin-zeroconf'
})
@Injectable()
export class Zeroconf {
/**
* Returns this device's hostname.
* @return {Promise<string>}
*/
@Cordova()
getHostname(): Promise<string> { return; }
/**
* Publishes a new service.
* @param type {string} Service type name, e.g. "_http._tcp".
* @param domain {string} Domain scope of the service, typically "local.".
* @param name {string} Unqualified service instance name.
* @param port {number} Local port on which the service runs.
* @param txtRecord {any} Arbitrary key/value pairs describing the service.
* @return {Promise<ZeroconfResult>} Returns a Promise that resolves with the registered service.
*/
@Cordova()
register(type: string, domain: string, name: string, port: number, txtRecord: any): Promise<ZeroconfResult> { return; }
/**
* Unregisters a service.
* @param type {string} Service type name, e.g. "_http._tcp".
* @param domain {string} Domain scope of the service, typically "local.".
* @param name {string} Unqualified service instance name.
* @return {Promise<void>}
*/
@Cordova()
unregister(type: string, domain: string, name: string): Promise<void> { return; }
/**
* Unregisters all published services.
* @return {Promise<void>}
*/
@Cordova()
stop(): Promise<void> { return; }
/**
* Starts watching for services of the specified type.
* @param type {string} Service type name, e.g. "_http._tcp".
* @param domain {string} Domain scope of the service, typically "local.".
* @return {Observable<ZeroconfResult>} Returns an Observable that notifies of each service added or removed.
*/
@Cordova({
observable: true,
clearFunction: 'unwatch',
clearWithArgs: true
})
watch(type: string, domain: string): Observable<ZeroconfResult> { return; }
/**
* Stops watching for services of the specified type.
* @param type {string} Service type name, e.g. "_http._tcp".
* @param domain {string} Domain scope of the service, typically "local.".
* @return {Promise<void>}
*/
@Cordova()
unwatch(type: string, domain: string): Promise<void> { return; }
/**
* Closes the service browser and stops watching.
* @return {Promise<void>}
*/
@Cordova()
close(): Promise<void> { return; }
}