Compare commits

..

238 Commits
v5 ... v5.4.0

Author SHA1 Message Date
Daniel Sogl
4859387925 chore(): update changelog 2019-04-07 20:02:36 +02:00
Daniel Sogl
10787c8056 5.4.0 2019-04-07 20:02:29 +02:00
Wojciech Bubolka
f874185a35 feat(in-app-purchase-2): add manageSubscriptions() (#2980)
* feat(in-app-purchase-2): add manageSubscriptions()

* feat(in-app-purchase-2): add manageSubscriptions()
2019-04-07 19:59:58 +02:00
Daniel Sogl
00e34877f3 chore(package): bump deps 2019-04-07 19:59:37 +02:00
Daniel Sogl
4de49c37dd feat(nativegeocoder): update plugin to v3.2.0 (#2958) 2019-04-07 19:56:31 +02:00
Daniel Sogl
bd4b2e2bb4 feat(nativegeocoder): update plugin to v3.2.0 (#2958)
* feat(nativegeocoder): update plugin to v3.2.0

* update imports
2019-04-07 19:22:12 +02:00
malua
aa138c4cfe fix(facebook): use object notation, otherwise EVENTS is´ undefined (#2955)
* fix(facebook-events-object): use object notation, otherwise EVENTS is undefined

* reverted prettier double quotes to single quotes
2019-04-07 19:19:42 +02:00
Timur Girgin
4e60c631ae fix(in-app-purchase2): Registering a product with an alias is now optional (#2946)
According to the documentation, alias is optional
https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#storeregisterproduct
2019-04-07 19:15:17 +02:00
Arzan Bhorr
767d3b3dd4 feat(google-play-games-services): add getPlayerScore function (#2949) 2019-04-07 19:13:04 +02:00
Cesar de la Vega
39be27566b feat(purchases): add new plugin for purchases (#2940)
* feat(purchases): create new plugin

* style(purchases): fix double quotes linter warning

* Update instructions to add strip frameworks phase

* removes trailing space

* fixes jsdoc
2019-04-07 19:10:42 +02:00
selected-pixel-jameson
029f82f1fd feat(in-app-purchase-2): add missing property (#2961)
feat(in-app-purchase-2): add missing property
2019-04-07 19:09:59 +02:00
Julián Mesa Llopis
6a19509ded fix(ble): fix definitions (#2974)
* Fix bad definitions in blueooth-le module in initialize and enable funcions

* Fix MATCH_MODE_AGGRESSIVE

* Fix startScan return

* Fix connect return

* Fix rssi function return type

* Fix disconnect return.
Fix close return.
Fix discover return.
Fix services return.
Fix mtu return.
2019-04-07 19:09:22 +02:00
Johan Dufour
c75aeb9c39 fix(background-mode): update types definitions (#2982) 2019-04-07 19:07:48 +02:00
Daniel Sogl
49d7ca7375 chore(): update changelog 2019-03-19 19:03:51 +01:00
Daniel Sogl
8d91856103 5.3.0 2019-03-19 19:03:39 +01:00
Daniel Sogl
5221c8cf41 Merge remote-tracking branch 'origin/master' 2019-03-19 18:36:42 +01:00
Daniel Sogl
d827db27b0 Revert "refactor(template): update Inject decorator"
BREAKING CHANGE: This reverts commit c5ae6362d7.
2019-03-19 18:36:21 +01:00
Daniel Sogl
b9e46730e3 Revert "refactor(template): update Inject decorator"
This reverts commit c5ae6362d7.
2019-03-19 18:35:00 +01:00
Daniel Sogl
fcda5ffcab Revert "refactor: optimize plugins for angular treeshaking"
This reverts commit 8b53c04dc5.
2019-03-19 18:34:54 +01:00
Daniel Sogl
6fde61d69c chore(package): bump deps 2019-03-19 18:34:22 +01:00
Daniel Sogl
c8ff885023 chore: fix linter 2019-03-19 18:25:24 +01:00
Cam Wiegert
06654afae3 fix(scripts): check for TypeDoc tags when selecting plugin class (#2963) 2019-03-14 13:35:32 -05:00
Cesar de la Vega
e1a25af0b5 chore(common): fix linter error (#2941)
fix linter error by using conditional expression instead of assigning to element in multiple places
2019-03-11 14:35:26 -04:00
Sebastian Baar
419b68217e update imports 2019-03-10 13:46:53 +01:00
Sebastian Baar
cd97375e63 feat(nativegeocoder): update plugin to v3.2.0 2019-03-10 13:45:30 +01:00
Cam Wiegert
b0dea6dc58 feat(scripts): add docs-json script (#2947) 2019-03-05 13:22:58 -06:00
Adam Bradley
7e090cc6f2 fix(ssr): remove cordova warning during ssr 2019-02-24 00:16:45 -06:00
Adam Bradley
c2029f7927 fix(ssr): fix window references 2019-02-23 17:05:19 -06:00
Adam Bradley
5b1bdc37e0 fix(ssr): fix window references 2019-02-23 16:54:09 -06:00
Adam Bradley
e3e8c85087 fix(ssr): check for window and document 2019-02-23 11:34:16 -06:00
Daniel Sogl
03c01c687e chore(): update changelog 2019-02-20 18:05:14 +01:00
Daniel Sogl
c0684cb3d8 5.2.0 2019-02-20 18:05:08 +01:00
Daniel Sogl
9a85a5cd62 chore(package): bump deps 2019-02-20 17:54:47 +01:00
Hatem
7ae2ad4e3e feat(apple-wallet): update wrapper to release 2.0 (#2935)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts

* update readme

* feat (apple wallet ): add methods to check existence and ellibagility

* lint

* lint

* Update index.ts
2019-02-20 17:42:41 +01:00
Daniel Sogl
c5ae6362d7 refactor(template): update Inject decorator 2019-02-20 17:40:13 +01:00
Daniel Sogl
8b53c04dc5 refactor: optimize plugins for angular treeshaking
BREAKING CHANGE: You can remove the plugin import from the app.module.ts because of the changed Inject decorator
2019-02-20 17:37:39 +01:00
Daniel Sogl
64230319a2 feat(linkedin): delete plugin
BREAKING: Removes linked in plugin (https://engineering.linkedin.com/blog/2018/12/developer-program-updates)
closes: #2925
2019-02-14 16:54:40 +01:00
Daniel Sogl
3d8cdde7eb chore(): update changelog 2019-02-14 16:39:43 +01:00
Daniel Sogl
e1b7aca3a9 5.1.0 2019-02-14 16:39:37 +01:00
Daniel Sogl
9bdb2fac9d feat(app-launcher): add plugin
related: #2889
2019-02-14 16:37:41 +01:00
Daniel Sogl
41c6bcafe6 feat(firebase-crashlytics): add plugin
related: #2889
2019-02-14 16:34:26 +01:00
Daniel Sogl
d55d1d6f7f chore(build): set min core version 2019-02-14 16:29:31 +01:00
Darshan Pania
aed25a6642 feat(clevertap): update for latest CleverTap Cordova plugin (#2931)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor

* feat(clevertap): update for latest CleverTap Cordova plugin
2019-02-14 11:56:51 +01:00
Edmu
daf04566a1 feat(http): add sendRequest function (#2910)
Adds missing sendRequest feature that has been implemented to cordova-plugin-advanced
which allows overriding global options for single request being sent via this method

Closes #2824
2019-02-14 09:58:22 +01:00
Daniel Sogl
4cb2aee62b chore(package): bump deps 2019-02-14 09:58:03 +01:00
Daniel Sogl
63124f35fd fix(build): remove wrong jsdoc 2019-02-14 09:52:05 +01:00
Doumbia Mahamadou
632dec28ae feat(luxand): add plugin (#2883)
* add Luxand Face SDK plugin

* (fix): alphatize imports for luxand plugin

* fix: changes required

* add git repo url
2019-02-14 09:50:46 +01:00
Carson Chen Zoom
50e05349ec feat(zoom): add plugin (#2916) 2019-02-14 09:49:29 +01:00
Afshawn Lotfi
fd27136de7 feat(magnetometer): add plugin (#2917) 2019-02-14 09:49:00 +01:00
byrner75
2833da472a feat(quikkly): add plugin(#2923) 2019-02-14 09:48:29 +01:00
smelzer
c5ceba1aae feat(photo-viewer): add new params (#2895)
* Change for new 'headers' option

As of 1.1.19 of PhotoViewer, a new PhotoViewer option was added called 'headers' which allows for HTTP headers to be used when requesting the image.  This is useful for authenticated sites.

* Typo in example

* Added new PhotoViewerOptions

There are several other new PhotoViewerOptions besides 'headers' that need to be imported into the latest version.  I was selfishly only concerned about the one I needed, but the build really needs them all.
2019-02-14 09:47:03 +01:00
Keith D. Moore
e1a490357d fix(http): add 'legacy' as valid option to setSSLCertMode (#2913)
* Add 'legacy' as valid option to setSSLCertMode

Fixes #2912

* Add 'legacy' to params for setSSLCertMode

* Update index.ts
2019-02-14 09:46:07 +01:00
mysoret
959a9135e4 feat(abbyy-rtr): add new options (#2915)
* Update index.ts

cordova-plugin-abbyy-rtr-sdk has updated a new field of orientation as per the version 1.0.9

* Update index.ts
2019-02-14 09:45:37 +01:00
Cam Wiegert
fc0a238229 fix(google-play-games-services): correct Cordova plugin name typo (#2920)
closes ionic-team/ionic-docs#424
2019-02-14 09:44:44 +01:00
Daniel Sogl
eeb68f1706 docs(background-geolocation): update usage doc (#2924)
docs(background-geolocation): update usage doc
2019-02-14 09:44:24 +01:00
Daniel Sogl
bceb428690 fix(build): fixed duplicate import identifiers (#2914) 2019-02-14 09:41:26 +01:00
Daniel Sogl
242240c711 chore(lint): update lit-rules 2019-02-14 09:41:16 +01:00
arnauddrain
e9911aa4ad style(background-geolocation): remove trailing whitespace 2019-02-11 14:20:56 +01:00
arnauddrain
04798c7354 docs(background-geolocation): update usage doc 2019-02-11 14:10:53 +01:00
Justin Cuaresma
3aedde55d8 fix(build): fixed duplicate import identifiers 2019-02-01 23:09:50 -05:00
Daniel Sogl
92140cd2db refactor(): small changes 2019-01-26 20:20:55 +01:00
Daniel Sogl
184986f06b docs(readme-gen): remove beta tag 2019-01-24 20:01:57 +01:00
Daniel Sogl
2ce2725b2a docs(gene): remove beta tag 2019-01-24 20:01:03 +01:00
Daniel Sogl
3d8455ae35 docs(readme): remove beta notes 2019-01-24 19:58:56 +01:00
mhartington
bf7ba9bd01 chore(): remove beta flag from release 2019-01-23 14:53:15 -05:00
mhartington
0883240f60 chore(): bump 2019-01-23 14:37:02 -05:00
Nate Drake
b6f340ae82 fix(bluetooth-le): Fix typo in InitializeResult interface definition (#2891) 2019-01-23 16:35:25 +01:00
Daniel
0612aef725 chore(package): update deps 2019-01-23 08:10:51 +01:00
Daniel
4bf7ba6085 chore(build): update update_docs.sh 2019-01-23 08:06:04 +01:00
Daniel
707d40bd83 chore(build): fix lint errors 2019-01-23 08:04:14 +01:00
Daniel
b4e0764d71 chore(build): use node 10 2019-01-23 08:03:18 +01:00
Daniel
c1d7ce13dd chore(build): update utils.inc.sh 2019-01-23 08:02:24 +01:00
Daniel
999853eb32 chore(build): update prepare.sh 2019-01-23 07:58:54 +01:00
Daniel
dfd6714331 chore(package): refresh package-lock 2019-01-23 07:57:02 +01:00
Daniel
898c68bb5e Merge remote-tracking branch 'origin/v5' 2019-01-23 07:54:31 +01:00
Daniel Sogl
9250d49970 chore(): update changelog 2019-01-20 17:09:26 +01:00
Daniel Sogl
2397ef9d60 4.20.0 2019-01-20 17:09:14 +01:00
Daniel Sogl
dbd8b4c080 chore(package): bump deps 2019-01-20 17:06:51 +01:00
Daniel Sogl
1ba6f97082 feat(background-geolocation): add v3 functions and interfaces (#2393)
feat(background-geolocation): add v3 functions and interfaces
2019-01-19 09:42:59 +01:00
Nate Drake
c2f45616ac fix(bluetooth-le): Fix typo in interface definition (#2881) 2019-01-19 09:31:07 +01:00
Nicolas Naso
603d6943ef feat(lottie-splash-screen): add new plugin (#2880)
* feat(lottie-splash-screen): added new plugin

* Update index.ts
2019-01-19 09:30:41 +01:00
JaviRpo
3226f76ef9 feat(web-intent): Add missing type info (#2878) 2019-01-19 09:26:29 +01:00
TobyEb
874be0bb04 feat(colored-browser-tabs): added new plugin (#2876)
* feat(colored-browser-tabs): added new plugin

* feat(colored-browser-tabs): added new plugin

* feat(colored-browser-tabs): added new plugin

* Update index.ts

* Update index.ts
2019-01-19 09:23:32 +01:00
Srđan Tubin
9e6705df7f feat(adjust): add adjust sdk plugin (#2872)
* feat(adjust): add adjust sdk plugin

* Update index.ts
2019-01-19 09:15:44 +01:00
retreatnot
7c46d8c2fc feat(firebase): add clearAllNotifications method (#2867)
* feat(firebase): add clearAllNotifications method

Added new method clearAllNotifications()

https://github.com/arnesson/cordova-plugin-firebase/blob/master/docs/API.md#clearAllNotifications

* remove trailing whitespace
2019-01-19 09:15:35 +01:00
Daniel
7d3ddf89ae chore(): update changelog 2019-01-04 22:22:17 +01:00
Daniel
19b3e8f521 4.19.0 2019-01-04 22:22:10 +01:00
Daniel
c14ea31a8a chore(package): bump deps 2019-01-04 22:21:43 +01:00
AppFeel
707ce1cad9 feat(admob): add plugin (#2864)
* feat(admob): add plugin

* Update index.ts
2019-01-04 22:08:49 +01:00
ewwwgiddings
d33bcb0220 feat(in-app-browser): add 'beforeload' as option (#2863)
Please see the issue I created here for more information: https://github.com/ionic-team/ionic-native/issues/2861

This allows Ionic-Native to be used with the latest features of Cordova InAppBrowser's github.
2019-01-04 22:08:20 +01:00
AppFeel
5df3de7dc0 feat(analytics-firebase): add plugin (#2862)
* feat(analytics-firebase): upload analytics-firebase plugin

* Update index.ts
2019-01-04 22:08:07 +01:00
Matthew Harris
d499a4db8d docs(camera): fix markup (#2858)
camera xml example wasn't wrapped in code brackets
2019-01-04 22:07:46 +01:00
waliu
e2b25deff6 feat(gao-de-location): add plugin (#2857)
* Add a gaode Map Location

* 增加详细的返回信息

* Return type has been added

* Update index.ts
2019-01-04 22:07:01 +01:00
Eric Horodyski
c3de8dfaba feat(baidu-push): add plugin (#2838)
* Initial push.

* Revert tslint.json and switch imports around to be alphabetical.

* Remove non-used plugins to decrease build time.

* Finish the BaiduPush interface.

* Add observables.

* Restore other plugins.

* Restore file formatting.

* Update documentation.

* Update index.ts
2019-01-04 22:06:52 +01:00
Dima Vishnevetsky
448e064012 docs(firebase): add onNotificationOpen usage example (#2835) 2019-01-04 22:06:37 +01:00
João Mourão
6ef854f4f1 docs(camera): update xml in warning part (#2832)
* Update xml in warning part

* Update index.ts
2019-01-04 22:06:17 +01:00
J-Loup
ea3150e99a fix(health): fix typos (#2831) 2019-01-04 22:05:58 +01:00
shinya.saiho
3edd62e56c chore(template): reorder imports (#2839) 2018-12-27 09:31:04 +01:00
Daniel
b63102a5fa Fix random build errors 2018-12-01 16:34:42 +01:00
Daniel
df7ec0146c chore(): update changelog 2018-12-01 16:28:27 +01:00
Daniel
20878516b4 4.18.0 2018-12-01 16:28:20 +01:00
Simon Bang Terkildsen
b166cc51ea fix(local-notifications): update type of the every property (#2825) 2018-12-01 16:21:17 +01:00
Daniel
543fa64b35 Revert "bump deps"
This reverts commit dcac00e7ad.
2018-12-01 15:55:58 +01:00
Daniel
dcac00e7ad bump deps 2018-12-01 15:53:51 +01:00
Luka313
006570483d feat(downloader): add plugin (#2820)
* feat(downloader): add plugin

* Update index.ts
2018-12-01 15:49:50 +01:00
Ziyaddin Sadigov
b7594e201b docs(network): fix typo (#2828) 2018-12-01 15:48:53 +01:00
JMRMourao
1396b61215 docs(camera): improve docs (#2827) 2018-12-01 15:48:41 +01:00
Fabrício Júnio
4f8779a969 refactor(card-io): allow number as type for guideColor (#2815)
* Change guide color to string|number type 

When the platform is Android, the cordova plugin wait for an Int value to set the guide color.

* Update index.ts
2018-11-15 20:11:01 +01:00
nrikiji
7145afa24f feat(line-login): add loginWeb function (#2810)
* add line-login

* Update index.ts

* add params and result type

* Update index.ts

* Update index.ts

* feat(line-login)add method
2018-11-15 07:36:49 +01:00
Appie
66316d29fe refactor(keyboard-setResizeMode): use explicit type (#2811)
This will ensure consumers of this plugin don't need to go on a quest of finding what the possible values are, the values are derived from [here](https://github.com/ionic-team/cordova-plugin-ionic-keyboard#keyboardresizemode)
2018-11-15 07:35:39 +01:00
Suraj Rao
7dcd6b27a0 docs(sqlite): update usage example (#2805)
executeSql takes array param not object according to the function declaration in code.
2018-11-07 08:37:49 +01:00
Daniel
b98393462d chore(): update changelog 2018-11-02 18:04:49 +01:00
Daniel
f9011c89c8 4.17.0 2018-11-02 18:04:43 +01:00
Daniel
4b4b2c45a0 chore: bump deps 2018-11-02 17:54:07 +01:00
Antonio José López
43bfeb487a feat(firebase-authentication): add plugin (#2797)
* feat(firebase-authentication): add plugin

* Update index.ts

* Update index.ts
2018-11-02 17:18:41 +01:00
Philip
accfba8a40 docs(file): update jsdoc (#2757)
* Update index.ts: Fix JSDoc

* Update index.ts

* Update index.ts
2018-11-02 17:17:38 +01:00
nrikiji
dc4183da07 feat(line-login): add plugin (#2782)
* add line-login

* Update index.ts

* add params and result type

* Update index.ts

* Update index.ts
2018-11-02 17:09:15 +01:00
duncan-c
b61b33987f fix(contacts plugin): add the rawId parameter (#2799)
* fix(contacts plugin): add the rawId parameter

This adds the rawId parameter to the contact class which allows the rawId value to be passed to Android which is required for saving contacts.

* Update index.ts
2018-11-02 17:08:43 +01:00
dominic-ks
39b4b85631 docs(social-sharing): update web share api link (#2794)
Just a tiny error in an anchor link there.
2018-10-28 09:38:54 +01:00
Rick Sollet
669dd02285 docs(mobile-accessibility): update usage (#2795) 2018-10-28 09:38:03 +01:00
Ahsan Ayaz
a3bd19769f feat(crashlytics): allow user to set userIdentifier for crashlytics (#2792)
setting user identifier is available since cordova-plugin-firebase@2.0.3 (https://github.com/arnesson/cordova-plugin-firebase/blob/master/CHANGELOG.md#features)
added the functionality to the firebase ionic native plugin
2018-10-27 11:18:04 +02:00
Martin Kausche
ff3ef094e0 docs(admob-plus): fix the Plugin Name, added repo (#2781)
The newly added wrapper for Admob __Plus__  had Admob __Free__ as its name.

This resulted in a broken docs-Page, _Admob Free_ occurred twice, both showing infos for _Admob Plus_
2018-10-18 16:24:46 +02:00
Daniel
2933d40cdc chore(): update changelog 2018-10-17 19:55:57 +02:00
Daniel
874ae88ff4 4.16.0 2018-10-17 19:55:52 +02:00
Marco
a02ca715e9 docs(one-signal): fix target url for notification icon (#2780)
The correct path is described at the official documentation from OneSignal. 
Link: https://documentation.onesignal.com/docs/customize-notification-icons
2018-10-17 19:53:44 +02:00
Daniel Sogl
336b3ff89b fix(local-notifications): add missing functions (#2779)
closes: #2778
2018-10-17 19:53:22 +02:00
Stephen Wolff
2aa73b5546 feat(nfc): add NFC readerMode (#2777)
* Work on NFC reader-mode

* Remove dist files, not needed in plugin development folder

* Revert package changes

This reverts part of commit 24a893fdcf.

* Update index.ts

* Correct the flags and return types for the wrapper

* Add reader flags.

Thanks @sfaizanh
2018-10-17 19:52:52 +02:00
Jordan Benge
99cebcba0b feat(lastCam): add plugin (#2759)
* feat(lastCam): add plugin

* feat: added watchRecordingTimer observer

* fix(lastCam): update plugin name

* refactor: lint file and refactor description
2018-10-17 19:52:39 +02:00
Paul Stelzer
6c99ec8033 feat(admob-plus): Add admob-plus (#2753) 2018-10-17 19:52:25 +02:00
Faizan Hasan
a167bd85aa fix(keyboard) isVisible property missing (#2751)
* isVisible property missing

* fix(lint)

* fix(lint) CI

* fix(CordovaProperty) Imported CordovaProperty from core
2018-10-14 13:31:01 +02:00
Niklas Merz
487acd603b refactor(network): add enum for connection types (#2754) 2018-10-14 13:30:34 +02:00
Sultan
fb4d2640c1 docs(apple-wallet): update example (#2755)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts

* update readme
2018-10-14 13:30:25 +02:00
Markus Karileet
4468b520ad feat(speechkit): plugin updated with voice parameter (#2761) 2018-10-14 13:30:11 +02:00
BradyShober
1a2dc3ee73 feat(firebase-messaging): add revokeToken function (#2763) 2018-10-14 13:30:00 +02:00
Max Lynch
00a1674fd6 Merge pull request #2758 from ajcrites/geo-msg
docs(geolocation): use more generic / professional message
2018-10-03 18:07:12 -05:00
Andrew Crites
2b14bd979e docs(geolocation): use more generic / professional message 2018-10-03 18:59:43 -04:00
Daniel Sogl
fcd6d26727 fix(keyboard): add missing property 2018-09-25 17:11:43 +02:00
Daniel
f95003cbe1 chore(): update changelog 2018-09-25 17:02:43 +02:00
Daniel
8e5f2e5ab3 4.15.0 2018-09-25 17:02:35 +02:00
Sultan
307477da78 feat(plugins): add AppleWallet (#2740)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts
2018-09-25 16:57:01 +02:00
Daniel
f691883a29 disable failing unit test (tmp) 2018-09-25 16:54:58 +02:00
Daniel
0d5d4f30a9 docs(keyboard): fix small typo 2018-09-25 16:51:53 +02:00
Ken Sodemann
1457a1698b fix(keyboard): use cordova-plugin-ionic-keyboard (#2743)
Previous was using the deprecated keyboard plugin.

Fixes #2306
2018-09-25 16:50:29 +02:00
Rahul Pandey
bfd46eed16 feat(SqliteDbCopy):add plugin (#2731)
* feat(SqliteDbCopy):add plugin

* refactor(SqliteDbCopy):add success/error index

* Update index.ts
2018-09-25 16:44:53 +02:00
Bart Wesselink
3eff280127 feat(siri-shortcuts): Add clear option for the activated shortcut (#2734)
* feat(siri-shortcuts): Add clear option for the getActivatedShortcutOperation

* Update index.ts
2018-09-25 16:43:47 +02:00
Benoit Perrin
8116ddd139 feat(plugins): add web-server plugin (#2726)
* feat(plugins): add web-server plugin

Add support of the cordova-plugin-webserver plugin, to start a
a dynamic content web server on iOS and android devices.

* Update index.ts
2018-09-25 16:42:07 +02:00
Daniel
a6bcc9affd feat(taptic-engine): add missing functions and types 2018-09-18 22:35:58 +02:00
Daniel
c0d8c99e8d Merge remote-tracking branch 'origin/master' 2018-09-18 22:29:20 +02:00
Daniel
fe9655ed84 chore(build): fix publish script 2018-09-18 16:08:49 +02:00
Daniel
41c034cc19 chore(): update changelog 2018-09-18 16:03:39 +02:00
Daniel
89631a9fa6 4.14.0 2018-09-18 16:03:29 +02:00
Daniel
04db233b33 feat(chooster): add plugin
closes: #2612
2018-09-18 15:58:57 +02:00
Daniel
10d222dcea feat(local-notifications): add missing functions 2018-09-18 15:37:39 +02:00
Daniel
640da1b618 docs(ibeacon): typo 2018-09-18 15:22:17 +02:00
Daniel
aecb0f9460 chore(package): bump dgeni 2018-09-18 15:17:21 +02:00
Daniel
d077c48205 fix(web-intent): add missing properties
closes: #2701
2018-09-18 11:08:45 +02:00
Daniel
49d27e816c refactor(email-composer): reorder code 2018-09-18 11:03:02 +02:00
Daniel Sogl
3699fa9b50 fix(mobile-accessibility): add correct pluginRef
closes: #1860
2018-09-18 10:12:27 +02:00
Daniel
ab4f1f5bbe docs(onesignal): hide option from docs
closes: #1969
2018-09-18 10:08:24 +02:00
Daniel
51006a76a0 feat(onesignal): add missing functions
closes: #2504
2018-09-18 10:05:34 +02:00
Rishi Hindocha
8bab32173a fix(onesignal): add missing setLocationShared method (#2723)
* fix(onesignal): add missing setLocationShared method

* Update index.ts
2018-09-18 09:40:55 +02:00
Daniel Sogl
3ef9593704 fix(push): add missing Chanel options
closes: #2712
2018-09-18 09:30:09 +02:00
Daniel
ffae843c0f chore(): update changelog 2018-09-17 18:54:45 +02:00
Daniel
33e4392b63 refactor: remove unused lint rules 2018-09-17 17:59:41 +02:00
Daniel
9acbb9fcd6 refactor: follow only-arrow-functions lint rule 2018-09-17 17:56:35 +02:00
Daniel
c1e1c5cb79 refactor: follow order-imports lint rule 2018-09-17 17:50:36 +02:00
Daniel
0c7cfeeeb8 refactor: update lint rules 2018-09-17 17:09:46 +02:00
Daniel
a7830693af chore(scripts): remove fs-extra-promise 2018-09-17 15:14:37 +02:00
Daniel
b60d5d4851 chore(): update changelog 2018-09-15 11:15:09 +02:00
Daniel
0c4aeddd1b 4.13.0 2018-09-15 11:15:04 +02:00
Daniel
667de5ba26 Revert "chore(): update changelog"
This reverts commit 2c2c1e482c.
2018-09-15 11:14:49 +02:00
Daniel
2dc7ee8916 Revert "4.12.3"
This reverts commit 7c419b48ad.
2018-09-15 11:14:41 +02:00
Daniel
2c2c1e482c chore(): update changelog 2018-09-15 11:05:56 +02:00
Daniel
7c419b48ad 4.12.3 2018-09-15 11:05:48 +02:00
弄潮儿
0b9717636c feat(janalytics): add plugin (#2711)
* add janalytics native plugin

* add new plugin of wechat

* rm plugin wechat

* Update index.ts
2018-09-15 11:02:53 +02:00
弄潮儿
10ac9ff9de feat(wechat): add plugin (#2716)
* add janalytics native plugin

* add new plugin of wechat

* rm janalytics plugin

* Update index.ts

* Update index.ts

* Update index.ts
2018-09-15 11:01:10 +02:00
Paul Stelzer
90d75af9d1 feat(branch-io): Add branch.io attribution and invitation plugin (#2691)
* feat(branch-io): Add branch.io attribution and invitation plugin

* Update index.ts
2018-09-15 10:55:01 +02:00
Paul Stelzer
3b3f942ed5 feat(appsflyer): Added Appsflyer Cordova SDK as ionic native plugin (#2690)
* feat(appsflyer): Added Appsflyer Cordova SDK

* fix(appsflyer): Corrected promises

* fix(appsflyer): Add description

* fix(appsflyer): Missing semicolon

* Update index.ts
2018-09-15 10:48:17 +02:00
Niklas Merz
9601a64227 feat(calldirectory): add log function (#2708)
* feat(calldirectory): add log function

* Update index.ts
2018-09-15 10:43:11 +02:00
Paul Stelzer
22fd49b5d3 fix(in-app-review): Transfer Plugin to the correct folder (#2688) 2018-09-15 10:41:20 +02:00
ratnakar24
890129bfda fix(ms-adal): Update createAuthenticationContext (#2705)
* Update createAuthenticationContext

Update createAuthenticationContext to include validateAuthority flag since it is throwing Error: Fail to valid authority with errors: [50049].
Without the flag it is throwing Error: Fail to valid authority with errors: [50049].

* Update index.ts
2018-09-15 10:39:41 +02:00
Tyler Hall
6a9a871758 docs(onesignal): update incorrect path to hook file (#2715) 2018-09-15 10:39:14 +02:00
Todd Vrba
ac467c50ac feat(mixpanel): Update/add functions (#2697)
* Update mixpanel typings for Ionic native.

* Update index.ts
2018-09-15 10:37:52 +02:00
iAmMrHands
267149b16f feat(local-notifications): Added local additional local notification action fields (#2713) 2018-09-15 10:37:24 +02:00
somq
7047920a2a fix(bluetooth-le): Various methods fixes (#2707)
* feat(bluetooth-le): implemented all available methods and refactored existing ones

* fix(bluetooth-le): Removed @memberof jsdoc annotations to avoid ci check failure

* fix(bluetooth-le): Fixed multiple jsdocs typos/misformats preventing CI to pass checks while generating readmes

* fix(bluetooth-le): Removed package-lock.json

* Update index.ts

* fix(bluetooth-le): Fixed stringToBytes method, now properly takes a string as arg and return an Uint8Array

* fix(bluetooth-le): getAdapterInfo now returns an Observable for easier tracking of adapter states

* fix(bluetooth-le): Fixed missing cordova param (observable: true) in initializePeripheral method, fixed getAdapterInfo method, now return an adapterInfo object

* chore(bluetooth-le): Removed @description markup to allow a proper doc auto-format

* fix(bluetooth-le): Reverted getAdapterInfo method to a Promise return
2018-09-15 10:37:03 +02:00
Daniel
aad814fcf1 chore(): update changelog 2018-08-31 19:09:35 +02:00
Daniel
03d6b2373c 4.12.2 2018-08-31 19:09:24 +02:00
Daniel Kasper
d82e675442 fix(in-app-browser): fix mandatory options (#2684)
fix(in-app-browser): fix mandatory options
2018-08-31 19:05:33 +02:00
Daniel
1e84e23fd9 chore(): update changelog 2018-08-31 14:26:00 +02:00
Daniel
f3f12cb306 4.12.1 2018-08-31 14:25:53 +02:00
Daniel
b3bd0a83c7 chore(package): bump deps 2018-08-31 14:24:28 +02:00
rvdleun
03e4f0e439 feat(push): Added voip property to IOSPushOptions (#2681)
* feat(push): Added missing voip property to IOSPushOptions

* Update index.ts
2018-08-31 14:23:40 +02:00
Pandiarajan Nagarajan
a73146648f feat(aes256): Added new utility methods to generate secure key and secure IV (#2675) 2018-08-31 14:21:30 +02:00
Daniel Kasper
d90724ef70 feat(in-app-browser): Add missing InAppBrowserOptions-properties (#2669) 2018-08-31 14:21:19 +02:00
Brad Mallow
be0dc3dac4 fix(open-native-settings): allow supported input (#2666)
* allow supported input

* Update index.ts
2018-08-31 14:21:07 +02:00
Daniel
a0a64da518 chore(package): bump deps 2018-08-25 12:02:03 +02:00
somq
591ee87e05 feat(bluetooth-le): add bluetooth-le plugin (#2651)
* feat(bluetooth-le): implemented all available methods and refactored existing ones

* fix(bluetooth-le): Removed @memberof jsdoc annotations to avoid ci check failure

* fix(bluetooth-le): Fixed multiple jsdocs typos/misformats preventing CI to pass checks while generating readmes

* fix(bluetooth-le): Removed package-lock.json

* Update index.ts
2018-08-25 12:01:05 +02:00
Daniel
8db1dbef71 feat(http): add setSSLCertMode function 2018-08-21 20:39:21 +02:00
Daniel
73ae92d77c chore(): update changelog 2018-08-17 00:33:54 +02:00
Daniel
3c2753df64 4.12.0 2018-08-17 00:33:47 +02:00
Daniel
9035476833 chore(package): bump package-lock 2018-08-17 00:33:34 +02:00
Daniel
5f5e605e66 Merge remote-tracking branch 'origin/master' 2018-08-16 22:23:09 +02:00
Daniel
ea6746d134 chore(build): refactor 2018-08-16 22:23:03 +02:00
Daniel Sogl
753fa4a7a4 Update CHANGELOG.md 2018-08-16 22:19:18 +02:00
Daniel
ff784a4377 Auto stash before revert of "4.12.0" 2018-08-16 22:18:20 +02:00
Daniel
0764e28408 Revert "4.12.0"
This reverts commit 5825932e03.
2018-08-16 22:18:04 +02:00
Daniel
0197c88a03 chore(): update changelog 2018-08-16 22:10:36 +02:00
Daniel
5825932e03 4.12.0 2018-08-16 22:10:23 +02:00
Daniel
bccc8ac379 chore(package): update package-lock 2018-08-16 22:10:15 +02:00
Daniel
3eb382d438 chore(package): bump deps 2018-08-16 22:06:19 +02:00
Ashwin Dinesh
ca9a702808 feat(webengage): add optional config with initialization (#2637)
* feat(webengage): add optional config with initialization

* Update index.ts
2018-08-16 22:01:54 +02:00
Daniel Sogl
3f415f9bef fix(photo-library): interface missing includeVideos
Co-authored-by: @devdaddy 

closes: #2624
2018-08-16 21:58:30 +02:00
Luis Enrique Perez Alvarez
0c6d1eabe2 docs(onesignal): fix typo
OneSignla -> OneSignal
2018-08-16 21:56:11 +02:00
Niklas Merz
61fecf511b docs(firebase-dynamic-links): Change example (#2646)
* docs(firebase-dynamic-links): Change example

* Update index.ts
2018-08-16 21:55:59 +02:00
Daniel Ehrhardt
2ac52822b8 fix(extended-device-information): Fixed Memory Display Bug (#2641)
* Fixed Memory Display Bug with ExtendedDeviceInformation Plugin

* Update index.ts

* Update index.ts
2018-08-16 21:55:51 +02:00
rupendraa
229b62c10b feat(local-notifications): add new foreground property (#2633)
* Update index.ts

* Update index.ts
2018-08-16 21:55:17 +02:00
Gordeev Artem
9b4fd02fa5 feat(fabric): add fabric plugin (#2618)
* feat(fabric): add fabric plugin

* Update index.ts
2018-08-16 21:54:39 +02:00
Marat Dyatko
d10777a33b fix(network): bind listener to document instead of window (#2622)
We noticed that in some cases network state listeners are stopped triggering, but `navigator.onLine` still reflects the state correctly. I used the following code to debug and found out an issue with `window` and `document` difference:

```js
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
window.addEventListener("online", ()=>console.warn('WINDOW ONLINE'), false); // won't be triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
document.addEventListener("online", ()=>console.warn('DOCUMENT ONLINE'), false); // triggered
```

Also, according to plugin documentation, listeners should be bound to `document`: https://github.com/apache/cordova-plugin-network-information#offline
2018-08-01 04:41:51 -04:00
Daniel
4f26069ca6 chore(): update changelog 2018-07-29 10:05:10 +02:00
Daniel
40571e5c99 4.11.0 2018-07-29 10:04:57 +02:00
Daniel
83194f616b Revert "chore(package): upgrade fs-extra"
This reverts commit 4297c3d43e.
2018-07-29 09:59:53 +02:00
Daniel
b1f4df530a rerun build 2018-07-29 09:57:03 +02:00
Daniel
4297c3d43e chore(package): upgrade fs-extra 2018-07-29 09:52:36 +02:00
Daniel
95d495b468 chore(package): bump deps 2018-07-29 09:44:22 +02:00
Daniel
f0989d1b96 chore(package): upgrade to angular 5
BREAKING: Ionic Native v4 requires now Angular 5
2018-07-29 09:21:43 +02:00
Daniel
c113417878 docs(readme): update readme 2018-07-29 09:20:23 +02:00
Daniel
cedd6df423 Merge remote-tracking branch 'origin/master' 2018-07-29 09:16:11 +02:00
Daniel
4b14ce2eec refactor(http): change return type to any 2018-07-29 09:16:00 +02:00
pwilkniss
27d380ef4b feat(clevertap): add CleverTap plugin (#2609)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor
2018-07-29 09:13:37 +02:00
Ashwin Dinesh
bd5bd7ea9d feat(webengage): add webengage plugin (#2604)
* feat(webengage): add webengage plugin

* refactor
2018-07-29 09:11:05 +02:00
Jan Piotrowski
c6713862c5 refactor: Improve Ionic Native warnings (#2611)
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
2018-07-29 09:10:48 +02:00
Daniel
3b32e19bf1 feat(facebook): add getDeferredApplink function
closes: #2510
2018-07-29 09:10:17 +02:00
Daniel
4092831754 fix(http): add correct return types for downloadFile and uploadFile
closes: #2615
2018-07-29 08:57:16 +02:00
Daniel Sogl
c2fe5f8336 docs(contacts): mark as deprecated 2018-07-27 21:39:58 +02:00
Daniel
3f9067d090 chore(): update changelog 2018-07-25 12:57:52 +02:00
Daniel
36a4e81fe4 4.10.1 2018-07-25 12:57:38 +02:00
Gustavo Maximiliano Cortez
79cb478c26 fix(user-agent): Plugin not installed (#2607)
fix(user-agent): Plugin not installed
2018-07-24 16:59:19 +02:00
Dominik Geng
b635ba99ea fix(nfs): Optional arguments for records like textRecord (#2605)
fix(nfs): Optional arguments for records like textRecord
2018-07-24 16:59:02 +02:00
50 changed files with 10005 additions and 6214 deletions

1
.gitignore vendored
View File

@@ -4,6 +4,7 @@ node_modules/
.tmp
aot/
scripts/ionic-native-bower
scripts/docs-json/*.json
dist/
src/@ionic-native/plugins/**/ngx
*.d.ts

View File

@@ -1,24 +1,142 @@
# [5.0.0-beta.24](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.23...v5.0.0-beta.24) (2019-01-20)
# [5.4.0](https://github.com/ionic-team/ionic-native/compare/v5.3.0...v5.4.0) (2019-04-07)
### Bug Fixes
* **background-mode:** update types definitions ([#2982](https://github.com/ionic-team/ionic-native/issues/2982)) ([c75aeb9](https://github.com/ionic-team/ionic-native/commit/c75aeb9))
* **ble:** fix definitions ([#2974](https://github.com/ionic-team/ionic-native/issues/2974)) ([6a19509](https://github.com/ionic-team/ionic-native/commit/6a19509))
* **facebook:** use object notation, otherwise EVENTS is´ undefined ([#2955](https://github.com/ionic-team/ionic-native/issues/2955)) ([aa138c4](https://github.com/ionic-team/ionic-native/commit/aa138c4))
* **in-app-purchase2:** Registering a product with an alias is now optional ([#2946](https://github.com/ionic-team/ionic-native/issues/2946)) ([4e60c63](https://github.com/ionic-team/ionic-native/commit/4e60c63))
### Features
* **google-play-games-services:** add getPlayerScore function ([#2949](https://github.com/ionic-team/ionic-native/issues/2949)) ([767d3b3](https://github.com/ionic-team/ionic-native/commit/767d3b3))
* **in-app-purchase-2:** add manageSubscriptions() ([#2980](https://github.com/ionic-team/ionic-native/issues/2980)) ([f874185](https://github.com/ionic-team/ionic-native/commit/f874185))
* **in-app-purchase-2:** add missing property ([#2961](https://github.com/ionic-team/ionic-native/issues/2961)) ([029f82f](https://github.com/ionic-team/ionic-native/commit/029f82f))
* **nativegeocoder:** update plugin to v3.2.0 ([#2958](https://github.com/ionic-team/ionic-native/issues/2958)) ([4de49c3](https://github.com/ionic-team/ionic-native/commit/4de49c3))
* **purchases:** add new plugin for purchases ([#2940](https://github.com/ionic-team/ionic-native/issues/2940)) ([39be275](https://github.com/ionic-team/ionic-native/commit/39be275))
# [5.3.0](https://github.com/ionic-team/ionic-native/compare/v5.2.0...v5.3.0) (2019-03-19)
### Bug Fixes
* **scripts:** check for TypeDoc tags when selecting plugin class ([#2963](https://github.com/ionic-team/ionic-native/issues/2963)) ([06654af](https://github.com/ionic-team/ionic-native/commit/06654af))
* **ssr:** check for window and document ([e3e8c85](https://github.com/ionic-team/ionic-native/commit/e3e8c85))
* **ssr:** fix window references ([c2029f7](https://github.com/ionic-team/ionic-native/commit/c2029f7))
* **ssr:** fix window references ([5b1bdc3](https://github.com/ionic-team/ionic-native/commit/5b1bdc3))
* **ssr:** remove cordova warning during ssr ([7e090cc](https://github.com/ionic-team/ionic-native/commit/7e090cc))
### Features
* **nativegeocoder:** update plugin to v3.2.0 ([cd97375](https://github.com/ionic-team/ionic-native/commit/cd97375))
* **scripts:** add docs-json script ([#2947](https://github.com/ionic-team/ionic-native/issues/2947)) ([b0dea6d](https://github.com/ionic-team/ionic-native/commit/b0dea6d))
* Revert "refactor(template): update Inject decorator" ([d827db2](https://github.com/ionic-team/ionic-native/commit/d827db2))
### BREAKING CHANGES
* This reverts commit c5ae6362d7771b62ae35a6b8ddc6e866aa9964a9.
# [5.2.0](https://github.com/ionic-team/ionic-native/compare/v5.1.0...v5.2.0) (2019-02-20)
### Code Refactoring
* optimize plugins for angular treeshaking ([8b53c04](https://github.com/ionic-team/ionic-native/commit/8b53c04))
### Features
* **apple-wallet:** update wrapper to release 2.0 ([#2935](https://github.com/ionic-team/ionic-native/issues/2935)) ([7ae2ad4](https://github.com/ionic-team/ionic-native/commit/7ae2ad4))
* **linkedin:** delete plugin ([6423031](https://github.com/ionic-team/ionic-native/commit/6423031)), closes [#2925](https://github.com/ionic-team/ionic-native/issues/2925)
### BREAKING CHANGES
* You can remove the plugin import from the app.module.ts because of the changed Inject decorator
# [5.1.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.24...v5.1.0) (2019-02-14)
### Bug Fixes
* **bluetooth-le:** Fix typo in InitializeResult interface definition ([#2891](https://github.com/ionic-team/ionic-native/issues/2891)) ([b6f340a](https://github.com/ionic-team/ionic-native/commit/b6f340a))
* **build:** fixed duplicate import identifiers ([3aedde5](https://github.com/ionic-team/ionic-native/commit/3aedde5))
* **build:** remove wrong jsdoc ([63124f3](https://github.com/ionic-team/ionic-native/commit/63124f3))
* **google-play-games-services:** correct Cordova plugin name typo ([#2920](https://github.com/ionic-team/ionic-native/issues/2920)) ([fc0a238](https://github.com/ionic-team/ionic-native/commit/fc0a238)), closes [ionic-team/ionic-docs#424](https://github.com/ionic-team/ionic-docs/issues/424)
* **http:** add 'legacy' as valid option to setSSLCertMode ([#2913](https://github.com/ionic-team/ionic-native/issues/2913)) ([e1a4903](https://github.com/ionic-team/ionic-native/commit/e1a4903)), closes [#2912](https://github.com/ionic-team/ionic-native/issues/2912)
### Features
* **abbyy-rtr:** add new options ([#2915](https://github.com/ionic-team/ionic-native/issues/2915)) ([959a913](https://github.com/ionic-team/ionic-native/commit/959a913))
* **app-launcher:** add plugin ([9bdb2fa](https://github.com/ionic-team/ionic-native/commit/9bdb2fa)), closes [#2889](https://github.com/ionic-team/ionic-native/issues/2889)
* **clevertap:** update for latest CleverTap Cordova plugin ([#2931](https://github.com/ionic-team/ionic-native/issues/2931)) ([aed25a6](https://github.com/ionic-team/ionic-native/commit/aed25a6))
* **firebase-crashlytics:** add plugin ([41c6bca](https://github.com/ionic-team/ionic-native/commit/41c6bca)), closes [#2889](https://github.com/ionic-team/ionic-native/issues/2889)
* **http:** add sendRequest function ([#2910](https://github.com/ionic-team/ionic-native/issues/2910)) ([daf0456](https://github.com/ionic-team/ionic-native/commit/daf0456)), closes [#2824](https://github.com/ionic-team/ionic-native/issues/2824)
* **luxand:** add plugin ([#2883](https://github.com/ionic-team/ionic-native/issues/2883)) ([632dec2](https://github.com/ionic-team/ionic-native/commit/632dec2))
* **magnetometer:** add plugin ([#2917](https://github.com/ionic-team/ionic-native/issues/2917)) ([fd27136](https://github.com/ionic-team/ionic-native/commit/fd27136))
* **photo-viewer:** add new params ([#2895](https://github.com/ionic-team/ionic-native/issues/2895)) ([c5ceba1](https://github.com/ionic-team/ionic-native/commit/c5ceba1))
* **quikkly:** add plugin([#2923](https://github.com/ionic-team/ionic-native/issues/2923)) ([2833da4](https://github.com/ionic-team/ionic-native/commit/2833da4))
* **zoom:** add plugin ([#2916](https://github.com/ionic-team/ionic-native/issues/2916)) ([50e0534](https://github.com/ionic-team/ionic-native/commit/50e0534))
# [5.0.0-beta.24](https://github.com/ionic-team/ionic-native/compare/v4.20.0...v5.0.0-beta.24) (2019-01-20)
# [4.20.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.23...v4.20.0) (2019-01-20)
### Bug Fixes
* **bluetooth-le:** Fix typo in interface definition ([#2881](https://github.com/ionic-team/ionic-native/issues/2881)) ([c2f4561](https://github.com/ionic-team/ionic-native/commit/c2f4561))
### Features
* **background-geolocation:** add v3 functions and interfaces ([#2393](https://github.com/ionic-team/ionic-native/issues/2393)) ([1ba6f97](https://github.com/ionic-team/ionic-native/commit/1ba6f97))
* **lottie-splash-screen:** add new plugin ([#2880](https://github.com/ionic-team/ionic-native/issues/2880)) ([603d694](https://github.com/ionic-team/ionic-native/commit/603d694))
* **web-intent:** Add missing type info ([#2878](https://github.com/ionic-team/ionic-native/issues/2878)) ([3226f76](https://github.com/ionic-team/ionic-native/commit/3226f76))
# [5.0.0-beta.23](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.22...v5.0.0-beta.23) (2019-01-19)
### Bug Fixes
* **health:** fix typos ([#2831](https://github.com/ionic-team/ionic-native/issues/2831)) ([ea3150e](https://github.com/ionic-team/ionic-native/commit/ea3150e))
### Features
* add analytics-firebase plugin ([e374b52](https://github.com/ionic-team/ionic-native/commit/e374b52))
* **adjust:** add adjust sdk plugin ([#2872](https://github.com/ionic-team/ionic-native/issues/2872)) ([9e6705d](https://github.com/ionic-team/ionic-native/commit/9e6705d))
* **admob:** add plugin ([#2864](https://github.com/ionic-team/ionic-native/issues/2864)) ([707ce1c](https://github.com/ionic-team/ionic-native/commit/707ce1c))
* **analytics-firebase:** add plugin ([#2862](https://github.com/ionic-team/ionic-native/issues/2862)) ([5df3de7](https://github.com/ionic-team/ionic-native/commit/5df3de7))
* **audio-management:** add plugin for audio streams ([#2877](https://github.com/ionic-team/ionic-native/issues/2877)) ([34ecd29](https://github.com/ionic-team/ionic-native/commit/34ecd29))
* **baidu-push:** add plugin ([#2838](https://github.com/ionic-team/ionic-native/issues/2838)) ([c3de8df](https://github.com/ionic-team/ionic-native/commit/c3de8df))
* **blinkid:** add plugin ([#2833](https://github.com/ionic-team/ionic-native/issues/2833)) ([8e405cc](https://github.com/ionic-team/ionic-native/commit/8e405cc))
* **firebase:** add clearAllNotifications method ([#2867](https://github.com/ionic-team/ionic-native/issues/2867)) ([7c46d8c](https://github.com/ionic-team/ionic-native/commit/7c46d8c))
* **gao-de-location:** add plugin ([#2857](https://github.com/ionic-team/ionic-native/issues/2857)) ([e2b25de](https://github.com/ionic-team/ionic-native/commit/e2b25de))
* **in-app-browser:** add 'beforeload' as option ([#2863](https://github.com/ionic-team/ionic-native/issues/2863)) ([d33bcb0](https://github.com/ionic-team/ionic-native/commit/d33bcb0))
# [5.0.0-beta.22](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.21...v5.0.0-beta.22) (2018-12-01)
### Bug Fixes
* **local-notifications:** update type of the every property ([#2825](https://github.com/ionic-team/ionic-native/issues/2825)) ([31e4058](https://github.com/ionic-team/ionic-native/commit/31e4058))
# [5.0.0-beta.22](https://github.com/ionic-team/ionic-native/compare/v4.18.0...v5.0.0-beta.22) (2018-12-01)
### chore
@@ -26,18 +144,74 @@
* update deps ([649dca1](https://github.com/ionic-team/ionic-native/commit/649dca1))
### Features
* **downloader:** add plugin ([#2820](https://github.com/ionic-team/ionic-native/issues/2820)) ([b9e9aa1](https://github.com/ionic-team/ionic-native/commit/b9e9aa1))
### BREAKING CHANGES
* Requires Angular 7.1 and TypeScript 3.1
# [5.0.0-beta.21](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.20...v5.0.0-beta.21) (2018-09-25)
# [4.18.0](https://github.com/ionic-team/ionic-native/compare/v4.17.0...v4.18.0) (2018-12-01)
### Bug Fixes
* **local-notifications:** update type of the every property ([#2825](https://github.com/ionic-team/ionic-native/issues/2825)) ([b166cc5](https://github.com/ionic-team/ionic-native/commit/b166cc5))
* **local-notifications:** update type of the every property ([#2825](https://github.com/ionic-team/ionic-native/issues/2825)) ([31e4058](https://github.com/ionic-team/ionic-native/commit/31e4058))
### Features
* **downloader:** add plugin ([#2820](https://github.com/ionic-team/ionic-native/issues/2820)) ([0065704](https://github.com/ionic-team/ionic-native/commit/0065704))
* **downloader:** add plugin ([#2820](https://github.com/ionic-team/ionic-native/issues/2820)) ([b9e9aa1](https://github.com/ionic-team/ionic-native/commit/b9e9aa1))
* **line-login:** add loginWeb function ([#2810](https://github.com/ionic-team/ionic-native/issues/2810)) ([7145afa](https://github.com/ionic-team/ionic-native/commit/7145afa))
# [4.17.0](https://github.com/ionic-team/ionic-native/compare/v4.16.0...v4.17.0) (2018-11-02)
### Bug Fixes
* **contacts plugin:** add the rawId parameter ([#2799](https://github.com/ionic-team/ionic-native/issues/2799)) ([b61b339](https://github.com/ionic-team/ionic-native/commit/b61b339))
### Features
* **crashlytics:** allow user to set userIdentifier for crashlytics ([#2792](https://github.com/ionic-team/ionic-native/issues/2792)) ([a3bd197](https://github.com/ionic-team/ionic-native/commit/a3bd197))
* **firebase-authentication:** add plugin ([#2797](https://github.com/ionic-team/ionic-native/issues/2797)) ([43bfeb4](https://github.com/ionic-team/ionic-native/commit/43bfeb4))
* **line-login:** add plugin ([#2782](https://github.com/ionic-team/ionic-native/issues/2782)) ([dc4183d](https://github.com/ionic-team/ionic-native/commit/dc4183d))
# [4.16.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.21...v4.16.0) (2018-10-17)
### Bug Fixes
* **local-notifications:** add missing functions ([#2779](https://github.com/ionic-team/ionic-native/issues/2779)) ([336b3ff](https://github.com/ionic-team/ionic-native/commit/336b3ff)), closes [#2778](https://github.com/ionic-team/ionic-native/issues/2778)
### Features
* **admob-plus:** Add admob-plus ([#2753](https://github.com/ionic-team/ionic-native/issues/2753)) ([6c99ec8](https://github.com/ionic-team/ionic-native/commit/6c99ec8))
* **firebase-messaging:** add revokeToken function ([#2763](https://github.com/ionic-team/ionic-native/issues/2763)) ([1a2dc3e](https://github.com/ionic-team/ionic-native/commit/1a2dc3e))
* **lastCam:** add plugin ([#2759](https://github.com/ionic-team/ionic-native/issues/2759)) ([99cebcb](https://github.com/ionic-team/ionic-native/commit/99cebcb))
* **nfc:** add NFC readerMode ([#2777](https://github.com/ionic-team/ionic-native/issues/2777)) ([2aa73b5](https://github.com/ionic-team/ionic-native/commit/2aa73b5))
* **speechkit:** plugin updated with voice parameter ([#2761](https://github.com/ionic-team/ionic-native/issues/2761)) ([4468b52](https://github.com/ionic-team/ionic-native/commit/4468b52))
# [5.0.0-beta.21](https://github.com/ionic-team/ionic-native/compare/v4.15.0...v5.0.0-beta.21) (2018-09-25)
### Bug Fixes
* **keyboard:** add missing property ([fcd6d26](https://github.com/ionic-team/ionic-native/commit/fcd6d26))
* **keyboard:** include the mode parameter in setResizeMode() ([8d57df3](https://github.com/ionic-team/ionic-native/commit/8d57df3))
# [4.15.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.20...v4.15.0) (2018-09-25)
### Bug Fixes
@@ -45,7 +219,7 @@
* **admob-free:** fix duplicated class ([95b9262](https://github.com/ionic-team/ionic-native/commit/95b9262))
* **bluetooth-le:** Removed a wrong cordova decorator param ([#2733](https://github.com/ionic-team/ionic-native/issues/2733)) ([cbeb413](https://github.com/ionic-team/ionic-native/commit/cbeb413))
* **build:** fix macos mojave build errors ([358474d](https://github.com/ionic-team/ionic-native/commit/358474d))
* **keyboard:** include the mode parameter in setResizeMode() ([8d57df3](https://github.com/ionic-team/ionic-native/commit/8d57df3))
* **keyboard:** use cordova-plugin-ionic-keyboard ([#2743](https://github.com/ionic-team/ionic-native/issues/2743)) ([1457a16](https://github.com/ionic-team/ionic-native/commit/1457a16)), closes [#2306](https://github.com/ionic-team/ionic-native/issues/2306)
* **keyboard:** use cordova-plugin-ionic-keyboard ([#2743](https://github.com/ionic-team/ionic-native/issues/2743)) ([fbf7463](https://github.com/ionic-team/ionic-native/commit/fbf7463)), closes [#2306](https://github.com/ionic-team/ionic-native/issues/2306)
* **printer:** import getPromise ([15cd285](https://github.com/ionic-team/ionic-native/commit/15cd285))
* **screenshot:** import getPromise ([e661f2e](https://github.com/ionic-team/ionic-native/commit/e661f2e))
@@ -53,6 +227,14 @@
* **secure-storage:** import getPromise ([653f5a2](https://github.com/ionic-team/ionic-native/commit/653f5a2))
### Features
* **plugins:** add AppleWallet ([#2740](https://github.com/ionic-team/ionic-native/issues/2740)) ([307477d](https://github.com/ionic-team/ionic-native/commit/307477d))
* **plugins:** add web-server plugin ([#2726](https://github.com/ionic-team/ionic-native/issues/2726)) ([8116ddd](https://github.com/ionic-team/ionic-native/commit/8116ddd))
* **siri-shortcuts:** Add clear option for the activated shortcut ([#2734](https://github.com/ionic-team/ionic-native/issues/2734)) ([3eff280](https://github.com/ionic-team/ionic-native/commit/3eff280))
* **taptic-engine:** add missing functions and types ([a6bcc9a](https://github.com/ionic-team/ionic-native/commit/a6bcc9a))
# [5.0.0-beta.20](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.19...v5.0.0-beta.20) (2018-09-18)
@@ -63,29 +245,145 @@
# [5.0.0-beta.19](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.18...v5.0.0-beta.19) (2018-09-18)
# [5.0.0-beta.19](https://github.com/ionic-team/ionic-native/compare/v4.14.0...v5.0.0-beta.19) (2018-09-18)
# [4.14.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.18...v4.14.0) (2018-09-18)
### Bug Fixes
* **index-app-content:** fix lint ([2611061](https://github.com/ionic-team/ionic-native/commit/2611061))
* **mobile-accessibility:** add correct pluginRef ([3699fa9](https://github.com/ionic-team/ionic-native/commit/3699fa9)), closes [#1860](https://github.com/ionic-team/ionic-native/issues/1860)
* **ms-adal:** remove duplicate imports ([4803912](https://github.com/ionic-team/ionic-native/commit/4803912))
* **onesignal:** add missing setLocationShared method ([#2723](https://github.com/ionic-team/ionic-native/issues/2723)) ([8bab321](https://github.com/ionic-team/ionic-native/commit/8bab321))
* **push:** add missing Chanel options ([3ef9593](https://github.com/ionic-team/ionic-native/commit/3ef9593)), closes [#2712](https://github.com/ionic-team/ionic-native/issues/2712)
* **web-intent:** add missing properties ([d077c48](https://github.com/ionic-team/ionic-native/commit/d077c48)), closes [#2701](https://github.com/ionic-team/ionic-native/issues/2701)
* **web-intent:** fix lint ([9feefe8](https://github.com/ionic-team/ionic-native/commit/9feefe8))
### Features
# [5.0.0-beta.18](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v5.0.0-beta.18) (2018-09-15)
* **chooster:** add plugin ([04db233](https://github.com/ionic-team/ionic-native/commit/04db233)), closes [#2612](https://github.com/ionic-team/ionic-native/issues/2612)
* **local-notifications:** add missing functions ([10d222d](https://github.com/ionic-team/ionic-native/commit/10d222d))
* **onesignal:** add missing functions ([51006a7](https://github.com/ionic-team/ionic-native/commit/51006a7)), closes [#2504](https://github.com/ionic-team/ionic-native/issues/2504)
# [5.0.0-beta.18](https://github.com/ionic-team/ionic-native/compare/v4.13.0...v5.0.0-beta.18) (2018-09-15)
# [4.13.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.17...v4.13.0) (2018-09-15)
### Bug Fixes
* **bluetooth-le:** Various methods fixes ([#2707](https://github.com/ionic-team/ionic-native/issues/2707)) ([7047920](https://github.com/ionic-team/ionic-native/commit/7047920))
* **in-app-review:** Transfer Plugin to the correct folder ([#2688](https://github.com/ionic-team/ionic-native/issues/2688)) ([22fd49b](https://github.com/ionic-team/ionic-native/commit/22fd49b))
* **ms-adal:** Update createAuthenticationContext ([#2705](https://github.com/ionic-team/ionic-native/issues/2705)) ([890129b](https://github.com/ionic-team/ionic-native/commit/890129b))
### Features
* **appsflyer:** Added Appsflyer Cordova SDK as ionic native plugin ([#2690](https://github.com/ionic-team/ionic-native/issues/2690)) ([3b3f942](https://github.com/ionic-team/ionic-native/commit/3b3f942))
* **branch-io:** Add branch.io attribution and invitation plugin ([#2691](https://github.com/ionic-team/ionic-native/issues/2691)) ([90d75af](https://github.com/ionic-team/ionic-native/commit/90d75af))
* **calldirectory:** add log function ([#2708](https://github.com/ionic-team/ionic-native/issues/2708)) ([9601a64](https://github.com/ionic-team/ionic-native/commit/9601a64))
* **janalytics:** add plugin ([#2711](https://github.com/ionic-team/ionic-native/issues/2711)) ([0b97176](https://github.com/ionic-team/ionic-native/commit/0b97176))
* **local-notifications:** Added local additional local notification action fields ([#2713](https://github.com/ionic-team/ionic-native/issues/2713)) ([267149b](https://github.com/ionic-team/ionic-native/commit/267149b))
* **mixpanel:** Update/add functions ([#2697](https://github.com/ionic-team/ionic-native/issues/2697)) ([ac467c5](https://github.com/ionic-team/ionic-native/commit/ac467c5))
* **wechat:** add plugin ([#2716](https://github.com/ionic-team/ionic-native/issues/2716)) ([10ac9ff](https://github.com/ionic-team/ionic-native/commit/10ac9ff))
# [5.0.0-beta.17](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.16...v5.0.0-beta.17) (2018-08-31)
### Bug Fixes
* **in-app-browser:** fix mandatory options ([#2684](https://github.com/ionic-team/ionic-native/issues/2684)) ([d82e675](https://github.com/ionic-team/ionic-native/commit/d82e675))
## [4.12.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.15...v4.12.1) (2018-08-31)
### Bug Fixes
* **camera:** fixing builds ([c8d25a1](https://github.com/ionic-team/ionic-native/commit/c8d25a1))
* **clevertap:** fix jsdoc ([e47a3e1](https://github.com/ionic-team/ionic-native/commit/e47a3e1))
* **contacts:** remove double import of checkAvailability ([#2659](https://github.com/ionic-team/ionic-native/issues/2659)) ([1ad4cc1](https://github.com/ionic-team/ionic-native/commit/1ad4cc1))
* **core:** wrapEventObservable ([#2660](https://github.com/ionic-team/ionic-native/issues/2660)) ([bd34581](https://github.com/ionic-team/ionic-native/commit/bd34581))
* **open-native-settings:** allow supported input ([#2666](https://github.com/ionic-team/ionic-native/issues/2666)) ([be0dc3d](https://github.com/ionic-team/ionic-native/commit/be0dc3d))
### Features
* **aes256:** Added new utility methods to generate secure key and secure IV ([#2675](https://github.com/ionic-team/ionic-native/issues/2675)) ([a731466](https://github.com/ionic-team/ionic-native/commit/a731466))
* **in-app-browser:** Add missing InAppBrowserOptions-properties ([#2669](https://github.com/ionic-team/ionic-native/issues/2669)) ([d90724e](https://github.com/ionic-team/ionic-native/commit/d90724e))
* **push:** Added voip property to IOSPushOptions ([#2681](https://github.com/ionic-team/ionic-native/issues/2681)) ([03e4f0e](https://github.com/ionic-team/ionic-native/commit/03e4f0e))
# [5.0.0-beta.15](https://github.com/ionic-team/ionic-native/compare/v4.12.0...v5.0.0-beta.15) (2018-08-25)
### Bug Fixes
* **contacts:** remove double import of checkAvailability ([#2659](https://github.com/ionic-team/ionic-native/issues/2659)) ([1ad4cc1](https://github.com/ionic-team/ionic-native/commit/1ad4cc1))
* **extended-device-information:** fix wrong decorator ([5e9c92a](https://github.com/ionic-team/ionic-native/commit/5e9c92a))
### Features
* **bluetooth-le:** add bluetooth-le plugin ([#2651](https://github.com/ionic-team/ionic-native/issues/2651)) ([591ee87](https://github.com/ionic-team/ionic-native/commit/591ee87))
* **http:** add setSSLCertMode function ([8db1dbe](https://github.com/ionic-team/ionic-native/commit/8db1dbe))
# [4.12.0](https://github.com/ionic-team/ionic-native/compare/v4.11.0...v4.12.0) (2018-08-16)
### Bug Fixes
* **clevertap:** fix jsdoc ([e47a3e1](https://github.com/ionic-team/ionic-native/commit/e47a3e1))
* **extended-device-information:** Fixed Memory Display Bug ([#2641](https://github.com/ionic-team/ionic-native/issues/2641)) ([2ac5282](https://github.com/ionic-team/ionic-native/commit/2ac5282))
* **network:** bind listener to document instead of window ([#2622](https://github.com/ionic-team/ionic-native/issues/2622)) ([d10777a](https://github.com/ionic-team/ionic-native/commit/d10777a))
* **photo-library:** interface missing includeVideos ([3f415f9](https://github.com/ionic-team/ionic-native/commit/3f415f9)), closes [#2624](https://github.com/ionic-team/ionic-native/issues/2624)
### Features
* **fabric:** add fabric plugin ([#2618](https://github.com/ionic-team/ionic-native/issues/2618)) ([9b4fd02](https://github.com/ionic-team/ionic-native/commit/9b4fd02))
* **local-notifications:** add new foreground property ([#2633](https://github.com/ionic-team/ionic-native/issues/2633)) ([229b62c](https://github.com/ionic-team/ionic-native/commit/229b62c))
* **webengage:** add optional config with initialization ([#2637](https://github.com/ionic-team/ionic-native/issues/2637)) ([ca9a702](https://github.com/ionic-team/ionic-native/commit/ca9a702))
# [4.11.0](https://github.com/ionic-team/ionic-native/compare/v4.10.1...v4.11.0) (2018-07-29)
### Bug Fixes
* **http:** add correct return types for downloadFile and uploadFile ([4092831](https://github.com/ionic-team/ionic-native/commit/4092831)), closes [#2615](https://github.com/ionic-team/ionic-native/issues/2615)
### Features
* **clevertap:** add CleverTap plugin ([#2609](https://github.com/ionic-team/ionic-native/issues/2609)) ([27d380e](https://github.com/ionic-team/ionic-native/commit/27d380e))
* **facebook:** add getDeferredApplink function ([3b32e19](https://github.com/ionic-team/ionic-native/commit/3b32e19)), closes [#2510](https://github.com/ionic-team/ionic-native/issues/2510)
* **webengage:** add webengage plugin ([#2604](https://github.com/ionic-team/ionic-native/issues/2604)) ([bd5bd7e](https://github.com/ionic-team/ionic-native/commit/bd5bd7e))
## [4.10.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v4.10.1) (2018-07-25)
### Bug Fixes
* **nfs:** Optional arguments for records like textRecord ([#2605](https://github.com/ionic-team/ionic-native/issues/2605)) ([b635ba9](https://github.com/ionic-team/ionic-native/commit/b635ba9))
* **user-agent:** Plugin not installed ([#2607](https://github.com/ionic-team/ionic-native/issues/2607)) ([79cb478](https://github.com/ionic-team/ionic-native/commit/79cb478))
# [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18)

View File

@@ -11,13 +11,11 @@ Ionic Native wraps plugin callbacks in a Promise or Observable, providing a comm
Run following command to install Ionic Native in your project.
```bash
npm install @ionic-native/core@beta --save
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](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
**NOTE: to use Ionic Native v5, you must use the `@beta` tag when installing any NPM package.**
## Documentation
For the full Ionic Native documentation, please visit [https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/).

View File

@@ -3,7 +3,7 @@ jobs:
build:
working_directory: ~/ionic-native/
docker:
- image: node:8
- image: node:10
steps:
- checkout
- restore_cache:

View File

@@ -32,9 +32,7 @@ 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,
spaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1'),
kebabCase = _.kebabCase(pluginName);

13077
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "5.0.0-beta.24",
"version": "5.4.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -17,49 +17,51 @@
"npmpub": "ts-node -P scripts/tsconfig.json scripts/tasks/publish",
"lint": "gulp lint",
"readmes": "gulp readmes",
"docs-json": "ts-node -P scripts/tsconfig.json scripts/docs-json",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"postchangelog": "git commit -am \"chore(): update changelog\"",
"shipit": "npm run build && npm run readmes && npm run npmpub"
},
"devDependencies": {
"@angular/common": "^7.2.1",
"@angular/compiler": "^7.2.1",
"@angular/compiler-cli": "^7.2.1",
"@angular/core": "^7.2.1",
"@angular/common": "^7.2.12",
"@angular/compiler": "^7.2.12",
"@angular/compiler-cli": "^7.2.12",
"@angular/core": "^7.2.12",
"@types/cordova": "0.0.34",
"@types/fs-extra": "^5.0.4",
"@types/jest": "^23.3.13",
"@types/lodash": "^4.14.120",
"@types/node": "^10.12.18",
"@types/fs-extra": "^5.0.5",
"@types/jest": "^24.0.11",
"@types/lodash": "^4.14.123",
"@types/node": "^10.14.4",
"@types/rimraf": "^2.0.2",
"@types/webpack": "^4.4.23",
"ajv": "^6.7.0",
"@types/webpack": "^4.4.27",
"ajv": "^6.10.0",
"async-promise-queue": "^1.0.4",
"conventional-changelog-cli": "^2.0.11",
"conventional-changelog-cli": "^2.0.12",
"cz-conventional-changelog": "^2.1.0",
"dgeni": "^0.4.11",
"dgeni": "^0.4.12",
"dgeni-packages": "0.16.10",
"fs-extra": "^7.0.1",
"gulp": "3.9.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "^8.1.3",
"jest": "^23.6.0",
"gulp-tslint": "^8.1.4",
"jest": "^24.7.1",
"lodash": "^4.17.11",
"minimist": "1.2.0",
"natives": "^1.1.6",
"rimraf": "^2.6.3",
"rxjs": "^6.3.3",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
"tslint": "^5.12.1",
"rxjs": "^6.4.0",
"ts-jest": "^24.0.2",
"ts-node": "^8.0.3",
"tslint": "^5.15.0",
"tslint-ionic-rules": "0.0.21",
"typedoc": "^0.14.2",
"typescript": "3.2.4",
"uglifyjs-webpack-plugin": "^2.1.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"unminified-webpack-plugin": "^2.0.0",
"webpack": "^4.28.4",
"winston": "^3.1.0",
"zone.js": "^0.8.26"
"webpack": "^4.29.6",
"winston": "^3.2.1",
"zone.js": "^0.8.29"
},
"jest": {
"transform": {

View File

@@ -37,10 +37,15 @@ function transformImports(file: ts.SourceFile, ctx: ts.TransformationContext, ng
decorators.forEach(d => methods = getMethodsForDecorator(d).concat(methods));
const methodElements = methods.map(m => ts.createIdentifier(m));
const methodNames = methodElements.map((el) => el.escapedText);
importStatement.importClause.namedBindings.elements = [
ts.createIdentifier('IonicNativePlugin'),
...methods.map(m => ts.createIdentifier(m)),
...importStatement.importClause.namedBindings.elements.filter(el => keep.indexOf(el.name.text) !== -1)
...methodElements,
...importStatement.importClause.namedBindings.elements.filter(
el => keep.indexOf(el.name.text) !== -1 && methodNames.indexOf(el.name.text) === -1
)
];
if (ngcBuild) {

View File

@@ -0,0 +1,99 @@
import * as fs from 'fs-extra';
import { Application } from 'typedoc';
import { basename, dirname, resolve } from 'path';
import { runInNewContext } from 'vm';
interface Plugin {
packageName: string;
displayName: string;
description: string;
platforms: string[];
usage: string;
repo: string;
cordovaPlugin: {
name: string;
};
}
const rootDir = resolve(__dirname, '../..');
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
const typedoc = new Application({
mode: 'modules',
tsconfig: resolve(rootDir, 'tsconfig.json'),
ignoreCompilerErrors: true
});
run(pluginsDir);
async function run(pluginsDir: string) {
const typedocData = await generateTypedoc(pluginsDir);
const modules = typedocData.children.filter(isModule);
const plugins = modules.filter(hasPlugin).map(processPlugin);
await fs.outputJson(resolve(__dirname, 'plugins.json'), plugins, {
spaces: 2
});
}
async function generateTypedoc(root: string, outputPath = typedocTmp) {
const pluginDirs = await fs.readdir(root);
const paths = pluginDirs.map(dir => resolve(root, dir, 'index.ts'));
typedoc.generateJson(paths, outputPath);
return fs.readJson(outputPath);
}
function processPlugin(pluginModule): Plugin {
const pluginClass = pluginModule.children.find(isPlugin);
const decorator = getPluginDecorator(pluginClass);
const packageName = `@ionic-native/${basename(dirname(pluginModule.originalName))}`;
const displayName = getTag(pluginClass, 'name');
const usage = getTag(pluginClass, 'usage');
const description = getTag(pluginClass, 'description');
return {
packageName,
displayName,
description,
usage,
platforms: decorator.platforms,
repo: decorator.repo,
cordovaPlugin: {
name: decorator.plugin
}
};
}
/**
* Typedoc only gives us the Plugin decorator internals
* as a string. So, rather than try to parse that with a RegExp,
* we evaluate it using Node's vm module.
*/
const getPluginDecorator = (child: any) => {
if (isPlugin(child)) {
const decorator = child.decorators.find(d => d.name === 'Plugin');
return runInNewContext(`(${decorator.arguments.config})`);
}
};
const getTag = (child: any, tagName: string): string => {
if (hasTags(child)) {
const tag = child.comment.tags.find(t => t.tag === tagName);
if (tag) {
return tag.text;
}
}
};
const isModule = (child: any): boolean =>
child.kind === 1;
const isClass = (child: any): boolean =>
child.kind === 128;
const isPlugin = (child: any): boolean =>
isClass(child) && hasTags(child) && Array.isArray(child.decorators) && child.decorators.some(d => d.name === 'Plugin');
const hasPlugin = (child: any): boolean =>
child.children.some(isPlugin);
const hasTags = (child: any): boolean =>
child.comment && Array.isArray(child.comment.tags);

View File

@@ -0,0 +1,3 @@
# docs-json
This script reads and generates [typedoc](https://github.com/TypeStrong/typedoc) data for each of the plugins in `src/@ionic-native/plugins`. That data is then formatted and output as `plugins.json` in this directory.

View File

@@ -187,7 +187,7 @@ docType: "<$ doc.docType $>"
<ol class="installation">
<li>Install the Cordova and Ionic Native plugins:<br>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install | replace('<', '&lt;').replace('>', '&gt;') $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install @ionic-native/<$ doc.npmId $>@beta
$ npm install @ionic-native/<$ doc.npmId $>
</code></pre>
</li>
<li><a href="https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module">Add this plugin to your app's module</a></li>

View File

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

View File

@@ -34,4 +34,4 @@ function run {
}
source $(dirname $0)/../utils.inc.sh
source $(dirname $0)/utils.inc.sh

View File

@@ -47,4 +47,4 @@ function run {
fi
}
source $(dirname $0)/../utils.inc.sh
source $(dirname $0)/utils.inc.sh

View File

@@ -1,244 +1,241 @@
# bash utils from angularjs
# This file provides:
# - a default control flow
# * initializes the environment
# * call a function in your script based on the arguments
# - named argument parsing and automatic generation of the "usage" for your script
# - utility functions
#
# Usage:
# - define the variable ARGS_DEF (see below) with the arguments for your script
# - include this file using `source utils.inc` at the end of your script.
#
# Default control flow:
# 0. Set the current directory to the directory of the script. By this
# the script can be called from anywhere.
# 1. Parse the named arguments
# 2. [Redacted]
# 3. If the parameter "verbose" is set, the `-x` flag will be set in bash.
# 4. The function "init" will be called if it exists
# 5. If the parameter "action" is set, it will call the function with the name of that parameter.
# Otherwise the function "run" will be called.
#
# Named Argument Parsing:
# - The variable ARGS_DEF defines the valid command arguments
# * Required args syntax: --paramName=paramRegex
# * Optional args syntax: [--paramName=paramRegex]
# * e.g. ARG_DEFS=("--required_param=(.+)" "[--optional_param=(.+)]")
# - Checks that:
# * all arguments match to an entry in ARGS_DEF
# * all required arguments are present
# * all arguments match their regex
# - Afterwards, every paramter value will be stored in a variable
# with the name of the parameter in upper case (with dash converted to underscore).
#
# Special arguments that are always available:
# - "--action=.*": This parameter will be used to dispatch to a function with that name when the
# script is started
# - "--verbose=true": This will set the `-x` flag in bash so that all calls will be logged
#
# Utility functions:
# - readJsonProp
# - replaceJsonProp
# - resolveDir
# - getVar
# - serVar
# - isFunction
# always stop on errors
set -e
function usage {
echo "Usage: ${0} ${ARG_DEFS[@]}"
exit 1
}
function parseArgs {
local REQUIRED_ARG_NAMES=()
# -- helper functions
function varName {
# everything to upper case and dash to underscore
echo ${1//-/_} | tr '[:lower:]' '[:upper:]'
}
function readArgDefs {
local ARG_DEF
local AD_OPTIONAL
local AD_NAME
local AD_RE
# -- helper functions
function parseArgDef {
local ARG_DEF_REGEX="(\[?)--([^=]+)=(.*)"
if [[ ! $1 =~ $ARG_DEF_REGEX ]]; then
echo "Internal error: arg def has wrong format: $ARG_DEF"
exit 1
fi
AD_OPTIONAL="${BASH_REMATCH[1]}"
AD_NAME="${BASH_REMATCH[2]}"
AD_RE="${BASH_REMATCH[3]}"
if [[ $AD_OPTIONAL ]]; then
# Remove last bracket for optional args.
# Can't put this into the ARG_DEF_REGEX somehow...
AD_RE=${AD_RE%?}
fi
}
# -- run
for ARG_DEF in "${ARG_DEFS[@]}"
do
parseArgDef $ARG_DEF
local AD_NAME_UPPER=$(varName $AD_NAME)
setVar "${AD_NAME_UPPER}_OPTIONAL" "$AD_OPTIONAL"
setVar "${AD_NAME_UPPER}_RE" "$AD_RE"
if [[ ! $AD_OPTIONAL ]]; then
REQUIRED_ARG_NAMES+=($AD_NAME)
fi
done
}
function readAndValidateArgs {
local ARG_NAME
local ARG_VALUE
local ARG_NAME_UPPER
# -- helper functions
function parseArg {
local ARG_REGEX="--([^=]+)=?(.*)"
if [[ ! $1 =~ $ARG_REGEX ]]; then
echo "Can't parse argument $i"
usage
fi
ARG_NAME="${BASH_REMATCH[1]}"
ARG_VALUE="${BASH_REMATCH[2]}"
ARG_NAME_UPPER=$(varName $ARG_NAME)
}
function validateArg {
local AD_RE=$(getVar ${ARG_NAME_UPPER}_RE)
if [[ ! $AD_RE ]]; then
echo "Unknown option: $ARG_NAME"
usage
fi
if [[ ! $ARG_VALUE =~ ^${AD_RE}$ ]]; then
echo "Wrong format: $ARG_NAME"
usage;
fi
# validate that the "action" option points to a valid function
if [[ $ARG_NAME == "action" ]] && ! isFunction $ARG_VALUE; then
echo "No action $ARG_VALUE defined in this script"
usage;
fi
}
# -- run
for i in "$@"
do
parseArg $i
validateArg
setVar "${ARG_NAME_UPPER}" "$ARG_VALUE"
done
}
function checkMissingArgs {
local ARG_NAME
for ARG_NAME in "${REQUIRED_ARG_NAMES[@]}"
do
ARG_VALUE=$(getVar $(varName $ARG_NAME))
if [[ ! $ARG_VALUE ]]; then
echo "Missing: $ARG_NAME"
usage;
fi
done
}
# -- run
readArgDefs
readAndValidateArgs "$@"
checkMissingArgs
}
# getVar(varName)
function getVar {
echo ${!1}
}
# setVar(varName, varValue)
function setVar {
eval "$1=\"$2\""
}
# isFunction(name)
# - to be used in an if, so return 0 if successful and 1 if not!
function isFunction {
if [[ $(type -t $1) == "function" ]]; then
return 0
else
return 1
fi
}
# readJsonProp(jsonFile, property)
# - restriction: property needs to be on an own line!
function readJsonProp {
echo $(sed -En 's/.*"'$2'"[ ]*:[ ]*"(.*)".*/\1/p' $1)
}
# replaceJsonProp(jsonFile, property, newValue)
# - note: propertyRegex will be automatically placed into a
# capturing group! -> all other groups start at index 2!
function replaceJsonProp {
replaceInFile $1 "\"$2\": \".*?\"" "\"$2\": \"$3\""
}
# replaceInFile(file, findPattern, replacePattern)
function replaceInFile {
perl -pi -e "s/$2/$3/g;" $1
}
# resolveDir(relativeDir)
# - resolves a directory relative to the current script
function resolveDir {
echo $(cd $SCRIPT_DIR; cd $1; pwd)
}
function main {
# normalize the working dir to the directory of the script
cd $(dirname $0);SCRIPT_DIR=$(pwd)
ARG_DEFS+=("[--verbose=(true|false)]")
parseArgs "$@"
# --verbose argument
if [[ $VERBOSE == "true" ]]; then
set -x
fi
if isFunction init; then
init "$@"
fi
# jump to the function denoted by the --action argument,
# otherwise call the "run" function
if [[ $ACTION ]]; then
$ACTION "$@"
else
run "$@"
fi
}
main "$@"
# bash utils from angularjs
# This file provides:
# - a default control flow
# * initializes the environment
# * call a function in your script based on the arguments
# - named argument parsing and automatic generation of the "usage" for your script
# - utility functions
#
# Usage:
# - define the variable ARGS_DEF (see below) with the arguments for your script
# - include this file using `source utils.inc` at the end of your script.
#
# Default control flow:
# 0. Set the current directory to the directory of the script. By this
# the script can be called from anywhere.
# 1. Parse the named arguments
# 2. [Redacted]
# 3. If the parameter "verbose" is set, the `-x` flag will be set in bash.
# 4. The function "init" will be called if it exists
# 5. If the parameter "action" is set, it will call the function with the name of that parameter.
# Otherwise the function "run" will be called.
#
# Named Argument Parsing:
# - The variable ARGS_DEF defines the valid command arguments
# * Required args syntax: --paramName=paramRegex
# * Optional args syntax: [--paramName=paramRegex]
# * e.g. ARG_DEFS=("--required_param=(.+)" "[--optional_param=(.+)]")
# - Checks that:
# * all arguments match to an entry in ARGS_DEF
# * all required arguments are present
# * all arguments match their regex
# - Afterwards, every paramter value will be stored in a variable
# with the name of the parameter in upper case (with dash converted to underscore).
#
# Special arguments that are always available:
# - "--action=.*": This parameter will be used to dispatch to a function with that name when the
# script is started
# - "--verbose=true": This will set the `-x` flag in bash so that all calls will be logged
#
# Utility functions:
# - readJsonProp
# - replaceJsonProp
# - resolveDir
# - getVar
# - serVar
# - isFunction
# always stop on errors
set -e
function usage {
echo "Usage: ${0} ${ARG_DEFS[@]}"
exit 1
}
function parseArgs {
local REQUIRED_ARG_NAMES=()
# -- helper functions
function varName {
# everything to upper case and dash to underscore
echo ${1//-/_} | tr '[:lower:]' '[:upper:]'
}
function readArgDefs {
local ARG_DEF
local AD_OPTIONAL
local AD_NAME
local AD_RE
# -- helper functions
function parseArgDef {
local ARG_DEF_REGEX="(\[?)--([^=]+)=(.*)"
if [[ ! $1 =~ $ARG_DEF_REGEX ]]; then
echo "Internal error: arg def has wrong format: $ARG_DEF"
exit 1
fi
AD_OPTIONAL="${BASH_REMATCH[1]}"
AD_NAME="${BASH_REMATCH[2]}"
AD_RE="${BASH_REMATCH[3]}"
if [[ $AD_OPTIONAL ]]; then
# Remove last bracket for optional args.
# Can't put this into the ARG_DEF_REGEX somehow...
AD_RE=${AD_RE%?}
fi
}
# -- run
for ARG_DEF in "${ARG_DEFS[@]}"
do
parseArgDef $ARG_DEF
local AD_NAME_UPPER=$(varName $AD_NAME)
setVar "${AD_NAME_UPPER}_OPTIONAL" "$AD_OPTIONAL"
setVar "${AD_NAME_UPPER}_RE" "$AD_RE"
if [[ ! $AD_OPTIONAL ]]; then
REQUIRED_ARG_NAMES+=($AD_NAME)
fi
done
}
function readAndValidateArgs {
local ARG_NAME
local ARG_VALUE
local ARG_NAME_UPPER
# -- helper functions
function parseArg {
local ARG_REGEX="--([^=]+)=?(.*)"
if [[ ! $1 =~ $ARG_REGEX ]]; then
echo "Can't parse argument $i"
usage
fi
ARG_NAME="${BASH_REMATCH[1]}"
ARG_VALUE="${BASH_REMATCH[2]}"
ARG_NAME_UPPER=$(varName $ARG_NAME)
}
function validateArg {
local AD_RE=$(getVar ${ARG_NAME_UPPER}_RE)
if [[ ! $AD_RE ]]; then
echo "Unknown option: $ARG_NAME"
usage
fi
if [[ ! $ARG_VALUE =~ ^${AD_RE}$ ]]; then
echo "Wrong format: $ARG_NAME"
usage;
fi
# validate that the "action" option points to a valid function
if [[ $ARG_NAME == "action" ]] && ! isFunction $ARG_VALUE; then
echo "No action $ARG_VALUE defined in this script"
usage;
fi
}
# -- run
for i in "$@"
do
parseArg $i
validateArg
setVar "${ARG_NAME_UPPER}" "$ARG_VALUE"
done
}
function checkMissingArgs {
local ARG_NAME
for ARG_NAME in "${REQUIRED_ARG_NAMES[@]}"
do
ARG_VALUE=$(getVar $(varName $ARG_NAME))
if [[ ! $ARG_VALUE ]]; then
echo "Missing: $ARG_NAME"
usage;
fi
done
}
# -- run
readArgDefs
readAndValidateArgs "$@"
checkMissingArgs
}
# getVar(varName)
function getVar {
echo ${!1}
}
# setVar(varName, varValue)
function setVar {
eval "$1=\"$2\""
}
# isFunction(name)
# - to be used in an if, so return 0 if successful and 1 if not!
function isFunction {
if [[ $(type -t $1) == "function" ]]; then
return 0
else
return 1
fi
}
# readJsonProp(jsonFile, property)
# - restriction: property needs to be on an own line!
function readJsonProp {
echo $(sed -En 's/.*"'$2'"[ ]*:[ ]*"(.*)".*/\1/p' $1)
}
# replaceJsonProp(jsonFile, property, newValue)
# - note: propertyRegex will be automatically placed into a
# capturing group! -> all other groups start at index 2!
function replaceJsonProp {
replaceInFile $1 "\"$2\": \".*?\"" "\"$2\": \"$3\""
}
# replaceInFile(file, findPattern, replacePattern)
function replaceInFile {
perl -pi -e "s/$2/$3/g;" $1
}
# resolveDir(relativeDir)
# - resolves a directory relative to the current script
function resolveDir {
echo $(cd $SCRIPT_DIR; cd $1; pwd)
}
function main {
# normalize the working dir to the directory of the script
cd $(dirname $0);SCRIPT_DIR=$(pwd)
ARG_DEFS+=("[--verbose=(true|false)]")
parseArgs "$@"
# --verbose argument
if [[ $VERBOSE == "true" ]]; then
set -x
fi
if isFunction init; then
init "$@"
fi
# jump to the function denoted by the --action argument,
# otherwise call the "run" function
if [[ $ACTION ]]; then
$ACTION "$@"
else
run "$@"
fi
}
main "$@"

View File

@@ -11,7 +11,7 @@ import { Logger } from '../logger';
// tslint:disable-next-line:no-var-requires
const MAIN_PACKAGE_JSON = require('../../package.json');
const VERSION = MAIN_PACKAGE_JSON.version;
const FLAGS = '--access public --tag beta';
const FLAGS = '--access public';
const PACKAGE_JSON_BASE = {
description: 'Ionic Native - Native plugins for ionic apps',
@@ -29,14 +29,15 @@ const DIST = path.resolve(ROOT, 'dist/@ionic-native');
const PACKAGES = [];
const RXJS_VERSION = '*';
const MIN_CORE_VERSION = '^5.1.0';
const RXJS_VERSION = '^6.3.0';
const PLUGIN_PEER_DEPENDENCIES = {
'@ionic-native/core': VERSION, // TODO change this in production
'@ionic-native/core': MIN_CORE_VERSION,
rxjs: RXJS_VERSION
};
function getPackageJsonContent(name, peerDependencies = {}, dependencies = {}) {
function getPackageJsonContent(name: string, peerDependencies = {}, dependencies = {}) {
return merge(PACKAGE_JSON_BASE, {
name: '@ionic-native/' + name,
dependencies,
@@ -61,10 +62,7 @@ function prepare() {
// write plugin package.json files
PLUGIN_PATHS.forEach((pluginPath: string) => {
const pluginName = pluginPath.split(/[\/\\]+/).slice(-2)[0];
const packageJsonContents = getPackageJsonContent(
pluginName,
PLUGIN_PEER_DEPENDENCIES
);
const packageJsonContents = getPackageJsonContent(pluginName, PLUGIN_PEER_DEPENDENCIES);
const dir = path.resolve(DIST, 'plugins', pluginName);
writePackageJson(packageJsonContents, dir);
@@ -74,28 +72,27 @@ function prepare() {
async function publish(ignoreErrors = false) {
Logger.profile('Publishing');
// upload 1 package per CPU thread at a time
const worker = Queue.async.asyncify((pkg: any) =>
new Promise<any>((resolve, reject) => {
exec(`npm publish ${pkg} ${FLAGS}`, (err, stdout) => {
if (stdout) {
Logger.verbose(stdout.trim());
resolve(stdout);
}
if (err) {
if (!ignoreErrors) {
if (
err.message.includes(
'You cannot publish over the previously published version'
)
) {
Logger.verbose('Ignoring duplicate version error.');
return resolve();
}
reject(err);
const worker = Queue.async.asyncify(
(pkg: any) =>
new Promise<any>((resolve, reject) => {
exec(`npm publish ${pkg} ${FLAGS}`, (err, stdout) => {
if (stdout) {
Logger.verbose(stdout.trim());
resolve(stdout);
}
}
});
})
if (err) {
if (!ignoreErrors) {
if (
err.message.includes('You cannot publish over the previously published version')
) {
Logger.verbose('Ignoring duplicate version error.');
return resolve();
}
reject(err);
}
}
});
})
);
try {

View File

@@ -1,25 +1,26 @@
export function checkReady() {
const DEVICE_READY_TIMEOUT = 5000;
if (typeof process === 'undefined') {
const win: any = typeof window !== 'undefined' ? window : {};
const DEVICE_READY_TIMEOUT = 5000;
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
const before = Date.now();
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
const before = Date.now();
let didFireReady = false;
document.addEventListener('deviceready', () => {
console.log(
`Ionic Native: deviceready event fired after ${Date.now() - before} ms`
);
didFireReady = true;
});
let didFireReady = false;
win.document.addEventListener('deviceready', () => {
console.log(`Ionic Native: deviceready event fired after ${Date.now() - before} ms`);
didFireReady = true;
});
setTimeout(() => {
if (!didFireReady && window.cordova) {
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);
}
}, DEVICE_READY_TIMEOUT);
setTimeout(() => {
if (!didFireReady && win.cordova) {
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);
}
}, DEVICE_READY_TIMEOUT);
}
}

View File

@@ -30,13 +30,9 @@ class MockInstancePluginObject {
class MockCordovaPlugin {
static ping = jest.fn((arg: string) => 'pong');
static pingAsync = jest.fn(
(arg: string, success: Function, error: Function) => success('pong')
);
static pingAsync = jest.fn((arg: string, success: Function, error: Function) => success('pong'));
ping = jest.fn((arg: string) => 'pong');
pingAsync = jest.fn((arg: string, success: Function, error: Function) =>
success('pong')
);
pingAsync = jest.fn((arg: string, success: Function, error: Function) => success('pong'));
}
describe('Common decorator functions', () => {
@@ -73,12 +69,8 @@ describe('Common decorator functions', () => {
test('original method should have received args', () => {
expect(MockCordovaPlugin.pingAsync.mock.calls[0][0]).toBe('pingpong');
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][1]).toBe(
'function'
);
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][2]).toBe(
'function'
);
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][1]).toBe('function');
expect(typeof MockCordovaPlugin.pingAsync.mock.calls[0][2]).toBe('function');
});
});

View File

@@ -1,4 +1,4 @@
import { Observable, fromEvent } from 'rxjs';
import { fromEvent, Observable } from 'rxjs';
import { CordovaOptions } from './interfaces';
@@ -7,9 +7,7 @@ declare const window: any;
export const ERR_CORDOVA_NOT_AVAILABLE = { error: 'cordova_not_available' };
export const ERR_PLUGIN_NOT_INSTALLED = { error: 'plugin_not_installed' };
export function getPromise<T>(
callback: (resolve: Function, reject?: Function) => any
): Promise<T> {
export function getPromise<T>(callback: (resolve: Function, reject?: Function) => any): Promise<T> {
const tryNativePromise = () => {
if (Promise) {
return new Promise<T>((resolve, reject) => {
@@ -22,9 +20,10 @@ export function getPromise<T>(
}
};
if (window.angular) {
if (typeof window !== 'undefined' && window.angular) {
const doc = window.document;
const injector = window.angular
.element(document.querySelector('[ng-app]') || document.body)
.element(doc.querySelector('[ng-app]') || doc.body)
.injector();
if (injector) {
const $q = injector.get('$q');
@@ -58,14 +57,7 @@ export function wrapPromise(
(...args: any[]) => reject(args)
);
} else {
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});
@@ -79,12 +71,7 @@ export function wrapPromise(
return p;
}
function wrapOtherPromise(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
return getPromise((resolve: Function, reject: Function) => {
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
if (pluginResult) {
@@ -99,12 +86,7 @@ function wrapOtherPromise(
});
}
function wrapObservable(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
return new Observable(observer => {
let pluginResult;
@@ -162,12 +144,12 @@ function wrapObservable(
/**
* Wrap the event with an observable
* @private
* @param event even name
* @param event event name
* @param element The element to attach the event listener to
* @returns {Observable}
*/
function wrapEventObservable(event: string, element: any): Observable<any> {
element = element ? get(window, element) : window;
element = (typeof window !== 'undefined' && element) ? get(window, element) : element || typeof window !== 'undefined' || {};
return fromEvent(element, event);
}
@@ -203,11 +185,8 @@ export function checkAvailability(
pluginInstance = getPlugin(pluginRef);
if (
!pluginInstance ||
(!!methodName && typeof pluginInstance[methodName] === 'undefined')
) {
if (!window.cordova) {
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
if (typeof window === 'undefined' || !window.cordova) {
cordovaWarn(pluginName, methodName);
return ERR_CORDOVA_NOT_AVAILABLE;
}
@@ -223,23 +202,14 @@ export function checkAvailability(
* Checks if _objectInstance exists and has the method/property
* @private
*/
export function instanceAvailability(
pluginObj: any,
methodName?: string
): boolean {
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
return (
pluginObj._objectInstance &&
(!methodName ||
typeof pluginObj._objectInstance[methodName] !== 'undefined')
(!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined')
);
}
export function setIndex(
args: any[],
opts: any = {},
resolve?: Function,
reject?: Function
): any {
export function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
// ignore resolve and reject in case sync
if (opts.sync) {
return args;
@@ -258,19 +228,12 @@ export function setIndex(
resolve(result);
}
});
} else if (
opts.callbackStyle === 'object' &&
opts.successName &&
opts.errorName
) {
} else if (opts.callbackStyle === 'object' && opts.successName && opts.errorName) {
const obj: any = {};
obj[opts.successName] = resolve;
obj[opts.errorName] = reject;
args.push(obj);
} else if (
typeof opts.successIndex !== 'undefined' ||
typeof opts.errorIndex !== 'undefined'
) {
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
const setSuccessIndex = () => {
// If we've specified a success/error index
if (opts.successIndex > args.length) {
@@ -339,15 +302,15 @@ export function callInstance(
args = setIndex(args, opts, resolve, reject);
if (instanceAvailability(pluginObj, methodName)) {
return pluginObj._objectInstance[methodName].apply(
pluginObj._objectInstance,
args
);
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
}
}
export function getPlugin(pluginRef: string): any {
return get(window, pluginRef);
if (typeof window !== 'undefined') {
return get(window, pluginRef);
}
return null;
}
export function get(element: Element | Window, path: string) {
@@ -362,11 +325,7 @@ export function get(element: Element | Window, path: string) {
return obj;
}
export function pluginWarn(
pluginName: string,
plugin?: string,
method?: string
): void {
export function pluginWarn(pluginName: string, plugin?: string, method?: string): void {
if (method) {
console.warn(
'Native: tried calling ' +
@@ -378,14 +337,10 @@ export function pluginWarn(
' plugin is not installed.'
);
} else {
console.warn(
`Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
console.warn(`Native: tried accessing the ${pluginName} plugin but it's not installed.`);
}
if (plugin) {
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
console.warn(`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`);
}
}
@@ -395,20 +350,22 @@ export function pluginWarn(
* @param method
*/
export function cordovaWarn(pluginName: string, method?: string): void {
if (method) {
console.warn(
'Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
if (typeof process === 'undefined') {
if (method) {
console.warn(
'Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
);
}
}
}
@@ -419,11 +376,7 @@ export type WrapFn = (...args: any[]) => any;
/**
* @private
*/
export const wrap = (
pluginObj: any,
methodName: string,
opts: CordovaOptions = {}
): WrapFn => {
export const wrap = (pluginObj: any, methodName: string, opts: CordovaOptions = {}): WrapFn => {
return (...args: any[]) => {
if (opts.sync) {
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
@@ -443,11 +396,7 @@ export const wrap = (
/**
* @private
*/
export function wrapInstance(
pluginObj: any,
methodName: string,
opts: any = {}
): Function {
export function wrapInstance(pluginObj: any, methodName: string, opts: any = {}): Function {
return (...args: any[]) => {
if (opts.sync) {
return callInstance(pluginObj, methodName, args, opts);
@@ -515,14 +464,7 @@ export function wrapInstance(
(...args: any[]) => reject(args)
);
} else {
result = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
if (result && result.then) {
result.then(resolve, reject);
@@ -543,14 +485,7 @@ export function wrapInstance(
(...args: any[]) => reject(args)
);
} else {
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
}
rej = reject;
});

View File

@@ -1,4 +1,5 @@
import { Observable, Observer } from 'rxjs';
import { checkAvailability, getPlugin } from './common';
function overrideFunction(pluginObj: any, methodName: string): Observable<any> {

View File

@@ -1,7 +1,12 @@
import { wrapInstance } from './common';
import { CordovaOptions } from './interfaces';
export function cordovaInstance(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) {
export function cordovaInstance(
pluginObj: any,
methodName: string,
config: CordovaOptions,
args: IArguments | any[]
) {
args = Array.from(args);
return wrapInstance(pluginObj, methodName, config).apply(this, args);
}

View File

@@ -1,6 +1,11 @@
import { wrap } from './common';
import { CordovaOptions } from './interfaces';
export function cordova(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) {
export function cordova(
pluginObj: any,
methodName: string,
config: CordovaOptions,
args: IArguments | any[]
) {
return wrap(pluginObj, methodName, config).apply(this, args);
}

View File

@@ -18,31 +18,45 @@ export class IonicNativePlugin {
* Returns a boolean that indicates whether the plugin is installed
* @return {boolean}
*/
static installed(): boolean { return checkAvailability(this.pluginRef) === true; }
static installed(): boolean {
return checkAvailability(this.pluginRef) === true;
}
/**
* Returns the original plugin object
*/
static getPlugin(): any { return get(window, this.pluginRef); }
static getPlugin(): any {
if (typeof window !== 'undefined') {
return get(window, this.pluginRef);
}
return null;
}
/**
* Returns the plugin's name
*/
static getPluginName(): string { return this.pluginName; }
static getPluginName(): string {
return this.pluginName;
}
/**
* Returns the plugin's reference
*/
static getPluginRef(): string { return this.pluginRef; }
static getPluginRef(): string {
return this.pluginRef;
}
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string { return this.plugin; }
static getPluginInstallName(): string {
return this.plugin;
}
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] { return this.platforms || []; }
static getSupportedPlatforms(): string[] {
return this.platforms || [];
}
}

View File

@@ -6,7 +6,7 @@ declare const window: any;
* creates Angular 1 services of the form $cordovaSERVICE, ex: $cordovaStatusBar.
*/
export function initAngular1(plugins: any) {
if (window.angular) {
if (typeof window !== 'undefined' && window.angular) {
const ngModule = window.angular.module('ionic.native', []);
for (const name in plugins) {

View File

@@ -7,7 +7,9 @@ export function get(element: Element | Window, path: string) {
const paths: string[] = path.split('.');
let obj: any = element;
for (let i = 0; i < paths.length; i++) {
if (!obj) { return null; }
if (!obj) {
return null;
}
obj = obj[paths[i]];
}
return obj;
@@ -17,9 +19,8 @@ export function get(element: Element | Window, path: string) {
* @private
*/
export function getPromise(callback: Function = () => {}): Promise<any> {
const tryNativePromise = () => {
if (window.Promise) {
if (typeof Promise === 'function' || (typeof window !== 'undefined' && window.Promise)) {
return new Promise<any>((resolve, reject) => {
callback(resolve, reject);
});

View File

@@ -9,7 +9,6 @@ declare const AbbyyRtrSdk: any;
* default setting will be used.
*/
export interface TextCaptureOptions {
/**
* The name of the license file. This file must be located in the
* www/rtr_assets/ directory in your project.
@@ -57,6 +56,11 @@ export interface TextCaptureOptions {
* the latest recognition result.
*/
isStopButtonVisible?: boolean;
/**
* Specify the orientation, possible values 'landscape' or 'portrait'.
*/
orientation?: string;
}
/**
@@ -64,7 +68,6 @@ export interface TextCaptureOptions {
* The callback you implement should parse this object and show results to user.
*/
export interface TextCaptureResult {
/**
* An array of objects representing recognized lines of text.
* These objects have the following keys:
@@ -75,7 +78,7 @@ export interface TextCaptureResult {
* · rect (string): position and size of the bounding rectangle,
* a string of 4 integers separated with whitespaces ("x y width height").
*/
textLines: { text: string, quadrangle: string, rect?: string }[];
textLines: { text: string; quadrangle: string; rect?: string }[];
/**
* Additional information. This object has the following keys:
@@ -91,10 +94,10 @@ export interface TextCaptureResult {
* the array contains language identifiers (["English", "French", "German"]).
*/
resultInfo: {
stabilityStatus: string,
userAction: string,
frameSize: string,
recognitionLanguages: string[]
stabilityStatus: string;
userAction: string;
frameSize: string;
recognitionLanguages: string[];
};
/**
@@ -114,7 +117,6 @@ export interface TextCaptureResult {
* keys: you must specify either one of them, but not both at the same time.
*/
export interface DataCaptureOptions {
/**
* The predefined data capture profile to use, for example: "MRZ".
* Note: For the list of supported documents, see Specifications — Data
@@ -134,10 +136,10 @@ export interface DataCaptureOptions {
* the regular expression that should be matched when capturing a field.
*/
customDataCaptureScenario?: {
name: string,
description: string,
recognitionLanguages: string[],
fields: { regEx: string }[]
name: string;
description: string;
recognitionLanguages: string[];
fields: { regEx: string }[];
};
/**
@@ -175,6 +177,11 @@ export interface DataCaptureOptions {
* the latest recognition result.
*/
isStopButtonVisible?: boolean;
/**
* Specify the orientation, possible values 'landscape' or 'portrait'.
*/
orientation?: string;
}
/**
@@ -182,7 +189,6 @@ export interface DataCaptureOptions {
* implement should parse this object and show results to user.
*/
export interface DataCaptureResult {
/**
* The data scheme which was applied during data capture.
* The value is an object which has two keys:
@@ -195,8 +201,8 @@ export interface DataCaptureResult {
* present in the result.
*/
dataScheme?: {
id: string,
name: string
id: string;
name: string;
};
/**
@@ -222,15 +228,15 @@ export interface DataCaptureResult {
* of 4 integers separated with whitespaces ("x y width height").
*/
dataFields: {
id: string,
name: string,
text: string,
quadrangle: string,
id: string;
name: string;
text: string;
quadrangle: string;
components: {
text: string,
quadrangle: string,
rect: string
}
text: string;
quadrangle: string;
rect: string;
};
};
/**
@@ -245,9 +251,9 @@ export interface DataCaptureResult {
* with 2 integers separated with a whitespace ("720 1280").
*/
resultInfo: {
stabilityStatus: string,
userAction: string,
frameSize: string
stabilityStatus: string;
userAction: string;
frameSize: string;
};
/**
@@ -297,7 +303,6 @@ export interface DataCaptureResult {
})
@Injectable()
export class AbbyyRTR extends IonicNativePlugin {
/**
* Opens a modal dialog with controls for the Text Capture scenario.
* @param {TextCaptureOptions} options

View File

@@ -0,0 +1,66 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppLauncherOptions {
uri?: string;
packageName?: string;
}
/**
* @name App Launcher
* @description
* Simple Cordova plugin to see if other apps are installed and launch them.
*
* @usage
* ```typescript
* import { AppLauncher, AppLauncherOptions } from '@ionic-native/app-launcher/ngx';
* import { Platform } from '@ionic/angular';
*
* constructor(private appLauncher: AppLauncher, private platform: Platform) { }
*
* ...
*
* const options: AppLauncherOptions = {
* }
*
* if(this.platform.is('ios')) {
* options.uri = 'fb://'
* } else {
* options.packageName = 'com.facebook.katana'
* }
*
* this.appLauncher.canLaunch(options)
* .then((canLaunch: boolean) => console.log('Facebook is available'))
* .catch((error: any) => console.error('Facebook is not available'));
*
* ```
*/
@Plugin({
pluginName: 'AppLauncher',
plugin: 'cordova-plugin-app-launcher',
pluginRef: 'window.plugins.launcher',
repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher',
platforms: ['Android', 'iOS']
})
@Injectable()
export class AppLauncher extends IonicNativePlugin {
/**
* Check if any apps are installed that can launch via a specified URI or Package Name.
* @param options App Launcher options
* @return {Promise<any>} Returns a promise that resolves if the app is installed
*/
@Cordova()
canLaunch(options: AppLauncherOptions): Promise<boolean> {
return;
}
/**
* Launches the app via a specified URI or Package Name
* @param options App Launcher options
* @return {Promise<any>} Returns a promise that resolves the launched app
*/
@Cordova()
launch(options: AppLauncherOptions): Promise<any> {
return;
}
}

View File

@@ -7,11 +7,32 @@ export interface EncryptedCardData {
wrappedKey: string;
}
export interface SignatureCertificatesData {
certificateSubCA: string;
certificateLeaf: string;
nonce: string;
nonceSignature: string;
}
export interface CardData {
cardholderName: string;
primaryAccountNumberSuffix: string;
localizedDescription?: string;
paymentNetwork: string;
paymentNetwork?: string;
}
export interface EligibilityData {
isInWallet: boolean;
isInWatch: boolean;
FPANID: string;
}
export interface WatchExistData {
isWatchPaired: boolean;
}
export interface CardPrimarySuffixData {
primaryAccountSuffix: string;
}
/**
@@ -26,55 +47,83 @@ export interface CardData {
*
* constructor(private appleWallet: AppleWallet) { }
*
*
* ...
*
*
* this.appleWallet.available()
* .then((res) => {
* // res is a boolean value, either true or false
* console.log("Is Apple Wallet available? ", res);
* // Simple call to determine if the current device supports Apple Pay and has a supported card installed.
* this.appleWallet.isAvailable()
* .then((res: boolean) => {
* // Expect res to be boolean
* })
* .catch((message) => {
* console.error("ERROR AVAILBLE>> ", message);
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
* let data: cardData = {
* cardholderName: 'Test User',
* primaryAccountNumberSuffix: '1234',
* localizedDescription: 'Description of payment card',
* paymentNetwork: 'VISA'
* }
*
* // Simple call to check existence and ellibagility to add a card
* this.appleWallet.isCardExistInWalletOrWatch(data: CardPrimarySuffixData)
* .then((res: EligibilityData) => {
* // object contains boolean values that ensure that card is already exists in wallet or paired-watch
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
*
* // Simple call to check out if there is any paired Watches so that you can toggle visibility of 'Add to Watch' button
* this.appleWallet.isPairedWatchExist()
* .then((res: WatchExistData) => {
* // object contains boolean value that ensure that there is already a paired Watch
* })
* .catch((err) => {
* // Catch {{err}} here
* });
*
*
* ...
*
*
* // Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* // This method provides the data needed to create a request to add your payment pass (credit/debit card). After a successful callback, pass the certificate chain to your issuer server-side using our callback delegate method `AppleWallet.completeAddPaymentPass`. The issuer server-side should returns an encrypted JSON payload containing the encrypted card data, which is required to be get the final response
*
* this.appleWallet.startAddPaymentPass(data: cardData)
* .then((res) => {
* console.log("startAddPaymentPass success response ", res);
* .then((res: SignatureCertificatesData) => {
* // User proceed and successfully asked to add card to his wallet
* // Use the callback response JSON payload to complete addition process
* })
* .catch((err) => {
* console.error("startAddPaymentPass ERROR response", err);
* // Catch {{err}} here
* });
*
*
* ...
*
* let data: encryptedCardData = {
* activationData: 'encoded Base64 activationData from your server',
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
* wrappedKey: 'encoded Base64 wrappedKey from your server',
* }
*
* this.appleWallet.encryptedCardData(data: encryptedCardData)
* .then((res) => {
* console.log("completeAddCardToAppleWallet success response ", res);
* this.appleWallet.completeAddPaymentPass(data: encryptedCardData)
* .then((res: string) => {
* // Expect res to be string either 'success' or 'error'
* })
* .catch((err) => {
* console.error("completeAddCardToAppleWallet ERROR response", err);
* // Catch {{err}} here
* // Error and can not add the card, or something wrong happend
* // PKAddPaymentPassViewController will be dismissed
* });
*
* ```
* @Interfaces
* EncryptedCardData
* SignatureCertificatesData
* CardData
* EligibilityData
* WatchExistData
* CardPrimarySuffixData
*/
@Plugin({
pluginName: 'AppleWallet',
@@ -86,31 +135,50 @@ export interface CardData {
@Injectable()
export class AppleWallet extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Wallet
* @return {Promise<boolean>} Returns a promise
* Simple call to determine if the current device supports Apple Pay and has a supported card installed.
* @return {Promise<boolean>}
*/
@Cordova()
available(): Promise<boolean> {
isAvailable(): Promise<boolean> {
return;
}
/**
* Simple call to check existence and ellibagility to add a card
* @param {CardPrimarySuffixData} data
* @return {Promise<EligibilityData>}
*/
@Cordova()
isCardExistInWalletOrWatch(data: CardPrimarySuffixData): Promise<EligibilityData> {
return;
}
/**
* Simple call to check out if there is any paired Watches so that you can toggle visibility of 'Add to Watch' button
* @return {Promise<WatchExistData>}
*/
@Cordova()
isPairedWatchExist(): Promise<WatchExistData> {
return;
}
/**
* Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* @param {cardData} data
* @return {Promise<any>} Returns a promise
* @return {Promise<SignatureCertificatesData>}
*/
@Cordova()
startAddPaymentPass(data: CardData): Promise<any> {
startAddPaymentPass(data: CardData): Promise<SignatureCertificatesData> {
return;
}
/**
* Simple call contains the card data needed to add a card to Apple Pay.
* Simple completion handler that takes encrypted card data returned from your server side, in order to get the final response from Apple to know if the card is added succesfully or not.
* @param {encryptedCardData} data
* @return {Promise<any>} Returns a promise
* @return {Promise<string>}
*/
@Cordova()
completeAddPaymentPass(data: EncryptedCardData): Promise<any> {
completeAddPaymentPass(data: EncryptedCardData): Promise<string> {
return;
}
}

View File

@@ -514,14 +514,16 @@ export declare enum BackgroundGeolocationIOSActivity {
* };
*
* this.backgroundGeolocation.configure(config)
* .subscribe((location: BackgroundGeolocationResponse) => {
* .then(() => {
*
* console.log(location);
* this.backgroundGeolocation.on('location').subscribe((location: BackgroundGeolocationResponse) => {
* console.log(location);
*
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
* // and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
* this.backgroundGeolocation.finish(); // FOR IOS ONLY
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
* // and the background-task may be completed. You must do this regardless if your operations are successful or not.
* // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
* this.backgroundGeolocation.finish(); // FOR IOS ONLY
* });
*
* });
*
@@ -549,7 +551,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
* Configure the plugin.
*
* @param options {BackgroundGeolocationConfig} options An object of type Config
* @return {Observable<BackgroundGeolocationResponse>}
* @return {Promise<any>}
*/
@Cordova()
configure(options: BackgroundGeolocationConfig): Promise<any> {

View File

@@ -91,8 +91,37 @@ export class BackgroundMode extends IonicNativePlugin {
* Disable the background mode.
* Once the background mode has been disabled, the app will be paused when in background.
*/
@Cordova()
disable(): Promise<any> {
@Cordova({
sync: true
})
disable(): void {
return;
}
/**
* Enable or disable the background mode.
*
* @param enable {boolean} The status to set for.
*
* @return {void}
*/
@Cordova({
sync: true
})
setEnabled(enable: boolean): void {}
/**
* Fire event with given arguments.
*
* @param event {string} event The event's name.
* @param args {array} The callback's arguments.
*
* @return {string}
*/
@Cordova({
sync: true
})
fireEvent(event: string, ...args: any[]): string {
return;
}
@@ -119,17 +148,15 @@ export class BackgroundMode extends IonicNativePlugin {
}
/**
* Override the default title, ticker and text.
* Overwrite the default settings.
* Available only for Android platform.
* @param {BackgroundModeConfiguration} options List of option to configure. See table below
* @param overrides {BackgroundModeConfiguration} Dict of options to be overridden.
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
setDefaults(options?: BackgroundModeConfiguration): Promise<any> {
return;
}
setDefaults(overrides?: BackgroundModeConfiguration): void {}
/**
* Modify the displayed information.
@@ -143,8 +170,11 @@ export class BackgroundMode extends IonicNativePlugin {
configure(options?: BackgroundModeConfiguration): void {}
/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* Register callback for given event.
* > Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* @param event {string} Event name
* @param callback {function} The function to be exec as callback.
* @param scope {object} The callback function's scope.
* @returns {Observable<any>}
*/
@Cordova({
@@ -152,7 +182,18 @@ export class BackgroundMode extends IonicNativePlugin {
clearFunction: 'un',
clearWithArgs: true
})
on(event: string): Observable<any> {
on(event: string, callback: (...args: any[]) => void, scope?: object): Observable<any> {
return;
}
/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* @param event {string} Event name
* @param callback {function} The function to be exec as callback.
* @returns {Observable<any>}
*/
@Cordova()
un(event: string, callback: (...args: any[]) => void): void {
return;
}
@@ -202,15 +243,14 @@ export class BackgroundMode extends IonicNativePlugin {
excludeFromTaskList(): void {}
/**
* The method works async instead of isActive() or isEnabled().
* If the screen is off.
* @param fn {function} Callback function to invoke with boolean arg.
* @returns {Promise<boolean>}
*/
@Cordova({
platforms: ['Android']
})
isScreenOff(): Promise<boolean> {
return;
}
isScreenOff(fn: (arg0: boolean) => void): void {}
/**
* Turn screen on

View File

@@ -339,7 +339,7 @@ export interface InitializeResult {
/** Service's UUID */
service: string;
/** Characteristic UUID */
characterisitc: string;
characteristic: string;
/** This integer value will be incremented every read/writeRequested */
requestId: number;
/** Offset value */
@@ -431,20 +431,20 @@ export class BluetoothLE extends IonicNativePlugin {
* @name initialize
* Initialize Bluetooth on the device
* @param {InitParams} [params]
* @returns {(Promise<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)
* @returns {(Observable<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)
*/
@Cordova({ callbackOrder: 'reverse' })
initialize(params?: InitParams): Promise<{ status: 'enabled' | 'disabled' }> {
@Cordova({ successIndex: 0, errorIndex: 2, observable: true })
initialize(params?: InitParams): Observable<{ status: 'enabled' | 'disabled' }> {
return;
}
/**
* @name enable (Android)
* Enable Bluetooth on the device. Android support only
* @returns {Promise<{ status: boolean }>}
* @returns void
*/
@Cordova({ callbackOrder: 'reverse', sync: true })
enable(): Promise<{ status: boolean }> {
enable() {
return;
}
@@ -480,10 +480,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Android API >= 23 also requires location services to be enabled. Use isLocationEnabled to determine whether location services are enabled.
* If not enabled, use requestLocation to prompt the location services settings page.
* @param {ScanParams} params Scan params
* @returns {(Observable<{ status: ScanStatus }>)}
* @returns {(Observable< ScanStatus >)}
*/
@Cordova({ callbackOrder: 'reverse', observable: true })
startScan(params: ScanParams): Observable<{ status: ScanStatus }> {
startScan(params: ScanParams): Observable< ScanStatus > {
return;
}
@@ -559,7 +559,7 @@ export class BluetoothLE extends IonicNativePlugin {
connect(params: {
address: string;
autoConnect?: boolean;
}): Observable<{ status: DeviceInfo }> {
}): Observable< DeviceInfo > {
return;
}
@@ -579,10 +579,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Disconnect from a Bluetooth LE device.
* Note: It's simpler to just call close(). Starting with iOS 10, disconnecting before closing seems required!
* @param {{address: string}} params The address/identifier
* @returns {Promise<{ status: DeviceInfo }>}
* @returns {Promise<DeviceInfo>}
*/
@Cordova({ callbackOrder: 'reverse' })
disconnect(params: { address: string }): Promise<{ status: DeviceInfo }> {
disconnect(params: { address: string }): Promise<DeviceInfo> {
return;
}
@@ -592,10 +592,10 @@ export class BluetoothLE extends IonicNativePlugin {
* Prior to 2.7.0, you needed to disconnect to the device before closing, but this is no longer the case.
* Starting with iOS 10, disconnecting before closing seems required!
* @param {{ address: string }} params The address/identifier
* @returns {Promise<{ status: DeviceInfo }>}
* @returns {Promise<DeviceInfo>}
*/
@Cordova({ callbackOrder: 'reverse' })
close(params: { address: string }): Promise<{ status: DeviceInfo }> {
close(params: { address: string }): Promise<DeviceInfo> {
return;
}
@@ -609,7 +609,7 @@ export class BluetoothLE extends IonicNativePlugin {
* Subsequent discover events will make use of this cache.
* If your device's services change, set the clearCache parameter to force Android to re-discover services.
* @param {{ address: string, clearCache: boolean }} params The address/identifier
* @returns {Promise<{ device: Device }>}
* @returns {Promise<Device>}
* success: device object (contains array of service objects)
* error: The callback that will be triggered when the unbond operation fails
*/
@@ -617,7 +617,7 @@ export class BluetoothLE extends IonicNativePlugin {
discover(params: {
address: string;
clearCache?: boolean;
}): Promise<{ device: Device }> {
}): Promise<Device> {
return;
}
@@ -626,13 +626,13 @@ export class BluetoothLE extends IonicNativePlugin {
* Discover the device's services.
* Not providing an array of services will return all services and take longer to discover. iOS support only.
* @param {{address: string, services: string[]}} params
* @returns {Promise<{ services: Services }>}
* @returns {Promise<Services>}
*/
@Cordova({ callbackOrder: 'reverse' })
services(params: {
address: string;
services?: string[];
}): Promise<{ services: Services }> {
}): Promise<Services> {
return;
}
@@ -747,10 +747,10 @@ export class BluetoothLE extends IonicNativePlugin {
* @name rssi
* Read RSSI of a connected device. RSSI is also returned with scanning.
* @param {{ address: string }} params
* @returns {Promise<{ rssi: RSSI }>}
* @returns {Promise< RSSI >}
*/
@Cordova({ callbackOrder: 'reverse' })
rssi(params: { address: string }): Promise<{ rssi: RSSI }> {
rssi(params: { address: string }): Promise< RSSI > {
return;
}
@@ -758,10 +758,10 @@ export class BluetoothLE extends IonicNativePlugin {
* @name mtu (Android, Android 5+)
* Set MTU of a connected device. Android only.
* @param {{ address: string, mtu: number }} params
* @returns {Promise<{ mtu: MTU }>}
* @returns {Promise< MTU >}
*/
@Cordova({ callbackOrder: 'reverse' })
mtu(params: { address: string; mtu?: number }): Promise<{ mtu: MTU }> {
mtu(params: { address: string; mtu?: number }): Promise< MTU > {
return;
}
@@ -1057,7 +1057,7 @@ export class BluetoothLE extends IonicNativePlugin {
@CordovaProperty()
SCAN_MODE_LOW_LATENCY: number;
@CordovaProperty()
MATCH_MODE_AGRESSIVE: number;
MATCH_MODE_AGGRESSIVE: number;
@CordovaProperty()
MATCH_MODE_STICKY: number;
@CordovaProperty()

View File

@@ -577,6 +577,43 @@ export class CleverTap extends IonicNativePlugin {
return;
}
/****************************
* Notification Inbox methods
****************************/
/**
* Call this method to initialize the App Inbox
*/
@Cordova()
initializeInbox(): Promise<any> {
return;
}
/**
* Call this method to get the count of unread Inbox messages
*/
@Cordova()
getInboxMessageUnreadCount(): Promise<any> {
return;
}
/**
* Call this method to get the count of total Inbox messages
*/
@Cordova()
getInboxMessageCount(): Promise<any> {
return;
}
/**
* Call this method to open the App Inbox
* @param styleConfig : any or empty object
*/
@Cordova()
showInbox(styleConfig: any): Promise<any> {
return;
}
/*******************
* Developer Options
******************/

View File

@@ -117,39 +117,39 @@ export interface FacebookLoginResponse {
})
@Injectable()
export class Facebook extends IonicNativePlugin {
EVENTS: {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app';
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app';
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions';
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions';
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration';
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view';
EVENT_NAME_SEARCHED: 'fb_mobile_search';
EVENT_NAME_RATED: 'fb_mobile_rate';
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion';
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token';
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart';
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist';
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout';
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info';
EVENT_NAME_PURCHASED: 'fb_mobile_purchase';
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved';
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked';
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits';
EVENT_PARAM_CURRENCY: 'fb_currency';
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method';
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type';
EVENT_PARAM_CONTENT_ID: 'fb_content_id';
EVENT_PARAM_SEARCH_STRING: 'fb_search_string';
EVENT_PARAM_SUCCESS: 'fb_success';
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value';
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available';
EVENT_PARAM_NUM_ITEMS: 'fb_num_items';
EVENT_PARAM_LEVEL: 'fb_level';
EVENT_PARAM_DESCRIPTION: 'fb_description';
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source';
EVENT_PARAM_VALUE_YES: '1';
EVENT_PARAM_VALUE_NO: '0';
EVENTS = {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app',
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app',
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions',
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions',
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration',
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view',
EVENT_NAME_SEARCHED: 'fb_mobile_search',
EVENT_NAME_RATED: 'fb_mobile_rate',
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion',
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token',
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart',
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist',
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout',
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info',
EVENT_NAME_PURCHASED: 'fb_mobile_purchase',
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved',
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked',
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits',
EVENT_PARAM_CURRENCY: 'fb_currency',
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method',
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type',
EVENT_PARAM_CONTENT_ID: 'fb_content_id',
EVENT_PARAM_SEARCH_STRING: 'fb_search_string',
EVENT_PARAM_SUCCESS: 'fb_success',
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value',
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available',
EVENT_PARAM_NUM_ITEMS: 'fb_num_items',
EVENT_PARAM_LEVEL: 'fb_level',
EVENT_PARAM_DESCRIPTION: 'fb_description',
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source',
EVENT_PARAM_VALUE_YES: '1',
EVENT_PARAM_VALUE_NO: '0'
};
/**

View File

@@ -0,0 +1,182 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Firebase Crashlytics
* @description
* A Google Firebase Crashlytics plugin to enable capture of crash reports.
*
* @usage
* ```typescript
* import { FirebaseCrashlytics } from '@ionic-native/firebase-crashlytics/ngx';
*
*
* constructor(private firebaseCrashlytics: FirebaseCrashlytics) { }
*
* ...
*
*
* const crashlytics = this.firebaseCrashlytics.initialize();
* crashlytics.logException('my caught exception');
*
* ```
*/
@Plugin({
pluginName: 'FirebaseCrashlytics',
plugin: 'cordova-plugin-firebase-crashlytics',
pluginRef: 'FirebaseCrashlytics',
repo: 'https://github.com/ReallySmallSoftware/cordova-plugin-firebase-crashlytics',
install: 'ionic cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0',
installVariables: ['ANDROID_FIREBASE_CORE_VERSION'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseCrashlytics extends IonicNativePlugin {
/**
* Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used:
*
* @returns {void}
*/
@Cordova({
sync: true
})
initialize(): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
/**
* Generate a forced crash. Visible in console after restart of application.
*
* @returns {void}
*/
@Cordova({
sync: true
})
crash(): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
/**
* Log a priority message. Will only be logged in the event of a crash.
*
* @param {number} priority
* @param {string} tag
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
logPriority(priority: number, tag: string, message: string): void {
return;
}
/**
* Log a message. Will only be logged in the event of a crash.
*
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
log(message: string): void {
return;
}
/**
* Log when a handled exception has happened. Visible in console after restart of application.
*
* @param {string} message
* @returns {void}
*/
@Cordova({
sync: true
})
logException(message: string): void {
return;
}
/**
* Set extra key/value string value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {string} value
* @returns {void}
*/
@Cordova({
sync: true
})
setString(key: string, value: string): void {
return;
}
/**
* Set extra key/value bool value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {boolean} value
* @returns {void}
*/
@Cordova({
sync: true
})
setBool(key: string, value: boolean): void {
return;
}
/**
* Set extra key/value double value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setDouble(key: string, value: number): void {
return;
}
/**
* Set extra key/value float value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setFloat(key: string, value: number): void {
return;
}
/**
* Set extra key/value integer value. Will only be logged in the event of a crash.
*
* @param {string} key
* @param {number} value
* @returns {void}
*/
@Cordova({
sync: true
})
setInt(key: string, value: number): void {
return;
}
/**
* Set the identifier for the user. Take care when using this method and ensure you privacy policy is updated accordingly.
*
* @param {string} identifier
* @returns {void}
*/
@Cordova({
sync: true
})
setUserIdentifier(identifier: string): void {
return;
}
}

View File

@@ -145,7 +145,7 @@ export class Geofence extends IonicNativePlugin {
*/
onNotificationClicked(): Observable<any> {
return new Observable<any>(observer => {
window &&
typeof window !== 'undefined' &&
window.geofence &&
(window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => (window.geofence.onNotificationClicked = () => {});

View File

@@ -15,6 +15,13 @@ export interface ScoreData {
}
export interface PlayerScoreData {
/**
* The player score.
*/
playerScore: number;
}
export interface LeaderboardData {
/**
@@ -126,6 +133,13 @@ export interface Player {
* leaderboardId: 'SomeLeaderboardId'
* });
*
* // Get the player score on a leaderboard.
* this.googlePlayGamesServices.getPlayerScore({
* leaderboardId: 'SomeLeaderBoardId'
* }).then((data: PlayerScoreData) => {
* console.log('Player score', data);
* });
*
* // Show the native leaderboards window.
* this.googlePlayGamesServices.showAllLeaderboards()
* .then(() => console.log('The leaderboard window is visible.'));
@@ -154,7 +168,7 @@ export interface Player {
*/
@Plugin({
pluginName: 'GooglePlayGamesServices',
plugin: 'cordova-plugin-play-games-service',
plugin: 'cordova-plugin-play-games-services',
pluginRef: 'plugins.playGamesServices',
repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
platforms: ['Android'],
@@ -220,6 +234,19 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
return;
}
/**
* Get the player score on a leaderboard. You should ensure that you have a
* successful return from auth() before requesting a score.
*
* @param data {LeaderboardData} The leaderboard score you want to request.
* @return {Promise<PlayerScoreData>} Returns a promise that resolves when Play
* Games Services returns the player score.
*/
@Cordova()
getPlayerScore(data: LeaderboardData): Promise<PlayerScoreData> {
return;
}
/**
* Launches the native Play Games leaderboard view controller to show all the
* leaderboards.

View File

@@ -77,10 +77,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'}
*/
@Cordova({ sync: true })
getBasicAuthHeader(
username: string,
password: string
): { Authorization: string } {
getBasicAuthHeader(username: string, password: string): { Authorization: string } {
return;
}
@@ -177,13 +174,14 @@ export class HTTP extends IonicNativePlugin {
/**
* Set SSL Cert handling mode, being one of the following values
* default: default SSL cert handling using system's CA certs
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android)
* nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes)
* pinned: trust only provided certs
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode
* @param {'default' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
* @param {'default' | 'legacy' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
*/
@Cordova()
setSSLCertMode(mode: 'default' | 'nocheck' | 'pinned'): Promise<void> {
setSSLCertMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
return;
}
@@ -279,13 +277,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/
@Cordova()
uploadFile(
url: string,
body: any,
headers: any,
filePath: string,
name: string
): Promise<any> {
uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<any> {
return;
}
@@ -298,12 +290,39 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/
@Cordova()
downloadFile(
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<any> {
return;
}
/**
*
* @param url {string} The url to send the request to
* @param options {Object} options for individual request
* @param options.method {string} request method
* @param options.data {Object} payload to be send to the server (only applicable on post, put or patch methods)
* @param options.params {Object} query params to be appended to the URL (only applicable on get, head, delete, upload or download methods)
* @param options.serializer {string} data serializer to be used (only applicable on post, put or patch methods), defaults to global serializer value, see setDataSerializer for supported values
* @param options.timeout {number} timeout value for the request in seconds, defaults to global timeout value
* @param options.headers {Object} headers object (key value pair), will be merged with global values
* @param options.filePath {string} filePath to be used during upload and download see uploadFile and downloadFile for detailed information
* @param options.name {string} name to be used during upload see uploadFile for detailed information
*
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
sendRequest(
url: string,
body: any,
headers: any,
filePath: string
): Promise<any> {
options: {
method: 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'upload' | 'download';
data?: { [index: string]: any };
params?: { [index: string]: string | number };
serializer?: 'json' | 'urlencoded' | 'utf8';
timeout?: number;
headers?: { [index: string]: string };
filePath?: string;
name?: string;
}
): Promise<HTTPResponse> {
return;
}
}

View File

@@ -129,7 +129,9 @@ export class InAppBrowserObject {
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
} catch (e) {
window.open(url, target);
if (typeof window !== 'undefined') {
window.open(url, target);
}
console.warn(
'Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.'
);

View File

@@ -73,7 +73,7 @@ import { Injectable } from '@angular/core';
export interface IAPProductOptions {
id: string;
alias: string;
alias?: string;
type: string;
}
@@ -225,6 +225,13 @@ export class InAppPurchase2 extends IonicNativePlugin {
@CordovaProperty()
verbosity: number;
/**
* Set to true to clear the transaction queue. Not recommended for production.
* https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#random-tips
*/
@CordovaProperty()
autoFinishTransactions: boolean;
/**
* Set to true to invoke the platform purchase sandbox. (Windows only)
*/
@@ -433,4 +440,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
refresh(): void {
}
@Cordova({ sync: true })
manageSubscriptions(): void {}
}

View File

@@ -1,130 +0,0 @@
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_company_admin' | 'w_share';
/**
* @name LinkedIn
* @description
* A Cordova plugin that lets you use LinkedIn Native SDKs for Android and iOS.
*
* Please see the [plugin's repo](https://github.com/zyramedia/cordova-plugin-linkedin#installation) for detailed installation steps.
*
* @usage
* ```typescript
* import { LinkedIn } from '@ionic-native/linkedin/ngx';
*
* constructor(private linkedin: LinkedIn) { }
*
* ...
*
* // check if there is an active session
* this.linkedin.hasActiveSession().then((active) => console.log('has active session?', active));
*
* // login
* const scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
* this.linkedin.login(scopes, true)
* .then(() => console.log('Logged in!'))
* .catch(e => console.log('Error logging in', e));
*
*
* // get connections
* this.linkedin.getRequest('people/~')
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
* // share something on profile
* const body = {
* comment: 'Hello world!',
* visibility: {
* code: 'anyone'
* }
* }
*
* this.linkedin.postRequest('~/shares', body)
* .then(res => console.log(res))
* .catch(e => console.log(e));
*
*
* ```
*/
@Plugin({
pluginName: 'LinkedIn',
plugin: 'cordova-plugin-linkedin',
pluginRef: 'cordova.plugins.LinkedIn',
repo: 'https://github.com/zyra/cordova-plugin-linkedin',
install: 'ionic cordova plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
installVariables: ['APP_ID'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class LinkedIn extends IonicNativePlugin {
/**
* Login with the LinkedIn App
* @param scopes {string[]} Scopes to authorize
* @param promptToInstall {boolean} set to true to prompt the user to download the LinkedIn app if it's not installed
* @return {Promise<any>}
*/
@Cordova()
login(scopes: LinkedInLoginScopes[], promptToInstall: boolean): Promise<any> {
return;
}
/**
* Clears the current session
*/
@Cordova({ sync: true })
logout(): void {
}
/**
* Make a get request
* @param path {string} request path
* @return {Promise<any>}
*/
@Cordova()
getRequest(path: string): Promise<any> {
return;
}
/**
* Make a post request
* @param path {string} request path
* @param body {Object} request body
* @return {Promise<any>}
*/
@Cordova()
postRequest(path: string, body: any): Promise<any> {
return;
}
/**
* Opens a member's profile
* @param memberId {string} Member id
* @return {Promise<any>}
*/
@Cordova()
openProfile(memberId: string): Promise<any> {
return;
}
/**
* Checks if there is already an existing active session. This should be used to avoid unnecessary login.
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether there is an active session
*/
@Cordova()
hasActiveSession(): Promise<boolean> {
return;
}
/**
* Checks if there is an active session and returns the access token if it exists.
* @return {Promise<any>} returns a promise that resolves with an object that contains an access token if there is an active session
*/
@Cordova()
getActiveSession(): Promise<any> {
return;
}
}

View File

@@ -0,0 +1,140 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface LuxandConfig {
/** The licence key got from Luxand */
licence: string;
/** The internal database name the tracker should use */
dbname: string;
/** the number of retry when registering of identifying a face */
loginTryCount: number;
}
export interface OMLFacialData {
/** The status message */
status: string;
/** The message returned by the plugin */
message: string;
/** The unique name generated and associated to a face when registering */
name: string;
/** The unique id Luxand Face SDK tracker associate to a face in it's internal database */
id: number;
/** Extra information about the face including age, expressions */
extra: {
AGE?: any;
GENDER?: any;
EYESOPENED?: any;
SMILE: any;
};
}
/**
* @name Luxand
* @description
* This plugin let you integrat Luxand Face SDK into your ionic projects, so you can implements face authentication easily in your applications.
*
* @usage
* ```typescript
* import { Luxand } from '@ionic-native/luxand';
*
*
* constructor(private luxand: Luxand) { }
*
* ...
*
* //init Luxand Face SDK
*
* this.luxand.init({
* licence: "",
* dbname: "data.dat",
* loginTryCount: 3
* })
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
* // register a face
* this.luxand.register({
* timeout: 20000//20 seconds
* })
* .then(r=>{
* console.log("Your FACE ID:", r.id);
* console.log("Your AGE:", r.extra.AGE);
* console.log("Your GENDER:", r.extra.GENDER);
* console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO");
* console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO");
* })
* .catch(err=>{
* if(err.messgae === "Already registered") {
* //extra data available
* console.log("Your AGE:", r.extra.AGE);
* console.log("Your GENDER:", r.extra.GENDER);
* console.log("SIMILING:", r.extra.SMILE>35? "YES": "NO");
* console.log("EYE OPENED:", r.extra.EYESOPENED>45? "YES": "NO");
* }
* })
* //to login using a face
* this.luxand.login({
* timeout: 20000
* }).then(r=>console.log(r))
* .catch(err=>console.log(err));
*
* ```
* @interfaces
* OMLFacialData
* LuxandConfig
*/
@Plugin({
pluginName: 'Luxand',
plugin: 'codova-plugin-luxand',
pluginRef: 'window.Luxand',
repo: 'https://github.com/molobala/cordova-plugin-luxand',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Luxand extends IonicNativePlugin {
/**
* Initialize Luxand SDK
* @param config {LuxandConfig} LuxandConfig configuration object to use to init the SDK
* @return {Promise<any>} // Returns a promise that resolves if Luxand FaceSDK is initialized succesffully
*/
@Cordova()
init(config: LuxandConfig): Promise<any> {
return;
}
/**
* Identify methode, try to register a face in internal data base
* @param params {any} Allow to specify the timeout value
* @return {Promise<OMLFacialData>} // Returns a promise that resolve if a face has been detected and saved by the tracker in the internal database
*/
@Cordova()
register(params: {timeout: number}): Promise<OMLFacialData> {
return;
}
/**
* Login method, try to authenticated a face
* @param params {any} Allow to specify the timeout value
* @return {Promise<OMLFacialData>}
*/
@Cordova()
login(params: {timeout: number}): Promise<OMLFacialData> {
return; // Returns a promise that resolve if a face is recognize successfully
}
/**
* clear method, try to remove a face from internal database
* @param id {number}
* @return {Promise<any>}
*/
@Cordova()
clear(id: number): Promise<any> {
return;
}
/**
* clearMemory method, try to clear internal database
* @return {Promise<any>}
*/
@Cordova()
clearMemory(): Promise<any> {
return;
}
}

View File

@@ -0,0 +1,96 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface MagnetometerReading {
/**
* X reading of magnetometer. (Number)
*/
x: number;
/**
* Y reading of magnetometer. (Number)
*/
y: number;
/**
* Z reading of magnetometer. (Number)
*/
z: number;
/**
* Calculated total - always positive of magnetometer. (Number)
*/
magnitude: number;
}
/**
* @name Device eMagnetometer
* @description
* Requires Cordova plugin: `cordova-plugin-magnetometer`. For more info, please see the [Device Orientation docs](https://github.com/sdesalas/cordova-plugin-magnetometer).
*
* @usage
* ```typescript
* // DeviceOrientationCompassHeading is an interface for compass
* import { Magnetometer, MagnetometerReading } from '@ionic-native/device-orientation/ngx';
*
* constructor(private magnetometer: Magnetometer) { }
*
* ...
*
* // Get the device current compass heading
* this.deviceOrientation.getReading().then(
* (data: MagnetometerReading) => console.log(data),
* (error: any) => console.log(error)
* );
*
* // Watch the device compass heading change
* var subscription = this.deviceOrientation.watchReadings().subscribe(
* (data: MagnetometerReading) => console.log(data)
* );
*
* // Stop watching heading change
* subscription.unsubscribe();
* ```
* @interfaces
* MagnetometerReading
*/
@Plugin({
pluginName: 'Magnetometer',
plugin: 'cordova-plugin-magnetometer',
pluginRef: 'cordova.plugins.magnetometer',
repo: 'https://github.com/sdesalas/cordova-plugin-magnetometer',
platforms: [
'Android',
'iOS',
]
})
@Injectable()
export class Magnetometer extends IonicNativePlugin {
/**
* Get the current compass reading.
* @returns {Promise<MagnetometerReading>}
*/
@Cordova()
getReading(): Promise<MagnetometerReading> {
return;
}
/**
* Get the device current heading at a regular interval
*
* Stop the watch by unsubscribing from the observable
* @param {DeviceOrientationCompassOptions} [options] Options for compass. Frequency and Filter. Optional
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
clearFunction: 'stop'
})
watchReadings(
): Observable<MagnetometerReading> {
return;
}
}

View File

@@ -8,7 +8,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* @usage
* ```typescript
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
* import { NativeGeocoder, NativeGeocoderResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder/ngx';
*
* constructor(private nativeGeocoder: NativeGeocoder) { }
*
@@ -20,16 +20,15 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* };
*
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
* .then((result: NativeGeocoderReverseResult[]) => console.log(JSON.stringify(result[0])))
* .then((result: NativeGeocoderResult[]) => console.log(JSON.stringify(result[0])))
* .catch((error: any) => console.log(error));
*
* this.nativeGeocoder.forwardGeocode('Berlin', options)
* .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude))
* .then((result: NativeGeocoderResult[]) => console.log('The coordinates are latitude=' + result[0].latitude + ' and longitude=' + result[0].longitude))
* .catch((error: any) => console.log(error));
* ```
* @interfaces
* NativeGeocoderReverseResult
* NativeGeocoderForwardResult
* NativeGeocoderResult
* NativeGeocoderOptions
*/
@Plugin({
@@ -47,32 +46,40 @@ export class NativeGeocoder extends IonicNativePlugin {
* @param latitude {number} The latitude
* @param longitude {number} The longitude
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderReverseResult[]>}
* @return {Promise<NativeGeocoderResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderReverseResult[]> { return; }
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
/**
* Forward geocode a given address to find coordinates
* @param addressString {string} The address to be geocoded
* @param options {NativeGeocoderOptions} The options
* @return {Promise<NativeGeocoderForwardResult[]>}
* @return {Promise<NativeGeocoderResult[]>}
*/
@Cordova({
callbackOrder: 'reverse'
})
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderForwardResult[]> { return; }
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderResult[]> { return; }
}
/**
* Encapsulates format information about a reverse geocoding result.
* Encapsulates format information about a geocoding result.
* more Info:
* - https://developer.apple.com/documentation/corelocation/clplacemark
* - https://developer.android.com/reference/android/location/Address.html
*/
export interface NativeGeocoderReverseResult {
export interface NativeGeocoderResult {
/**
* The latitude.
*/
latitude: string;
/**
* The longitude.
*/
longitude: string;
/**
* The country code.
*/
@@ -109,20 +116,10 @@ export interface NativeGeocoderReverseResult {
* The subThoroughfare.
*/
subThoroughfare: string;
}
/**
* Encapsulates format information about a forward geocoding result.
*/
export interface NativeGeocoderForwardResult {
/**
* The latitude.
* The areasOfInterest
*/
latitude: string;
/**
* The longitude.
*/
longitude: string;
areasOfInterest: string[];
}
/**

View File

@@ -6,6 +6,27 @@ export interface PhotoViewerOptions {
* Set to false to disable the share button (Android only). Default: true
*/
share?: boolean;
/**
* Add HTTP headers to the request. Useful for authenticated pages.
* The value is a string in a JSON format. Default: ''
*/
headers?: string;
/**
* Option for close button visibility when share false [ONLY FOR iOS]
*/
closeButton?: boolean;
/**
* If you need to copy image to reference before show then set it true [ONLY FOR iOS]
*/
copyToReference?: boolean;
/**
* Enable or Disable Picasso Options ( Only Android ): fit, centerInside, centerCrop.
*/
piccasoOptions?: {
fit?: boolean;
centerInside?: boolean;
centerCrop?: boolean;
};
}
/**
@@ -22,6 +43,8 @@ export interface PhotoViewerOptions {
* this.photoViewer.show('https://mysite.com/path/to/image.jpg');
*
* this.photoViewer.show('https://mysite.com/path/to/image.jpg', 'My image title', {share: false});
*
* this.photoViewer.show('https://mysecuresite.com/path/to/image.jpg', 'My image title', {share: false, headers: '{username:foo,password:bar}'});
* ```
*/
@Plugin({

View File

@@ -0,0 +1,419 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Purchases
* @description
* Purchases is a cross platform solution for managing in-app subscriptions. A backend is also provided via [RevenueCat](https://www.revenuecat.com)
*
* ## Features
* | | RevenueCat |
* | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
* | ✅ | Server-side receipt validation |
* | ➡️ | [Webhooks](https://docs.revenuecat.com/docs/webhooks) - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more |
* | 🎯 | Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web |
* | 📊 | Analytics - automatic calculation of metrics like conversion, mrr, and churn |
* | 📝 | [Online documentation](https://docs.revenuecat.com/docs) up to date |
* | 🔀 | [Integrations](https://www.revenuecat.com/integrations) - over a dozen integrations to easily send purchase data where you need it |
* | 💯 | Well maintained - [frequent releases](https://github.com/RevenueCat/purchases-ios/releases) |
* | 📮 | Great support - [Help Center](https://docs.revenuecat.com/discuss) |
* | 🤩 | Awesome [new features](https://trello.com/b/RZRnWRbI/revenuecat-product-roadmap) |
*
* ## Getting Started
*
* For more detailed information, you can view our complete documentation at [docs.revenuecat.com](https://docs.revenuecat.com/docs).
*
* @usage
* #### 1. Get a RevenueCat API key
*
* Log in to the [RevenueCat dashboard](https://app.revenuecat.com) and obtain a free API key for your application.
*
* #### 2. Initialize the SDK
*
* You should only configure _Purchases_ once (usually on app launch) as soon as your app has a unique user id for your user. This can be when a user logs in if you have accounts or on launch if you can generate a random user identifier.
*
* ```typescript
* import { Platform } from "@ionic/angular";
* import { Purchases } from "@ionic-native/purchases/ngx";
*
* constructor(public platform: Platform, private purchases: Purchases) {
* platform.ready().then(() => {
* this.purchases.setDebugLogsEnabled(true); // Enable to get debug logs
* this.purchases.setup("my_api_key", "my_app_user_id");
* }
* }
* ```
* #### 3. Displaying Available Products
*
* _Purchases_ will automatically fetch the latest _active_ entitlements and get the product information from Apple or Google. This means when users launch your purchase screen, products will already be loaded.
*
* Below is an example of fetching entitlements and launching an upsell screen.
*
* ```typescript
* this.purchases.getEntitlements()
* .subscribe(entitlements => )
* error => );
* ```
*
* #### 4. Make a purchase
*
* When it comes time to make a purchase, _Purchases_ has a simple method, `makePurchase`. The code sample below shows the process of purchasing a product and confirming it unlocks the "my_entitlement_identifier" content.
*
* ```typescript
* this.purchases.makePurchase("product_id")
* .subscribe(response => {
* if (response.purchaserInfo.activeEntitlements.includes("my_entitlement_identifier")) {
* // Unlock content
* }
* },
* error => // Error making purchase. You can check error.userCancelled to check if user cancelled the purchase
* );
*
* ```
*
* `makePurchase` handles the underlying framework interaction and automatically validates purchases with Apple and Google through our secure servers. This helps reduce in-app purchase fraud and decreases the complexity of your app. Receipt tokens are stored remotely and always kept up-to-date.
*
* #### 5. Get Subscription Status
*
* _Purchases_ makes it easy to check what active subscriptions the current user has. This can
* be done two ways within the `.purchaserInfo` method:
*
* 1. Checking active Entitlements - this lets you see what entitlements ([from RevenueCat dashboard](https://app.revenuecat.com))
* are active for the user.
* 2. Checking the active subscriptions - this lets you see what product ids (from iTunes Connect or Play Store) are active for the user.
*
* ```typescript
* this.purchases.getPurchaserInfo()
* .subscribe(info => {
* // Option 1: Check if user has access to entitlement (from RevenueCat dashboard)
* const isPro =
* info.activeEntitlements !== "undefined" &&
* info.activeEntitlements.includes("pro");
* // Option 2: Check if user has active subscription (from App Store Connect or Play Store)
* const isPro =
* info.activeSubscriptions !== "undefined" &&
* info.activeSubscriptions.includes("my_product_identifier");
* },
* error => );
* ```
*
* > Since the SDK updates and caches the latest PurchaserInfo when the app becomes active, the completion block in `.purchaserInfo` won't need to make a network request in most cases.
*
* ### Restoring Purchases
*
* Restoring purchases is a mechanism by which your user can restore their in-app purchases, reactivating any content that had previously been purchased from the same store account (Apple or Google).
*
* If two different App User IDs try to restore transactions from the same underlying store account (Apple or Google) RevenueCat will create an alias between the two App User IDs and count them as the same user going forward.
*
* This is a common if your app does not have accounts and is relying on RevenueCat's random App User IDs.
*
* ```typescript
* this.purchases.restore()
* .subscribe(info => {
* //... check purchaserInfo to see if entitlement is now active
* },
* error => );
* ```
* > If you've provided your own App User ID, calling restoreTransactions could alias the logged in user to another generated App User ID that has made a purchase on the same device.
*
* > By default, RevenueCat will not let you reuse an App or Play Store account that already has an active subscription. If you set allowSharingAppStoreAccount = True the SDK will be permissive in accepting shared accounts, creating aliases as needed.
*
* > By default allowSharingAppStoreAccount is True for RevenueCat random App User IDs but must be enabled manually if you want to allow permissive sharing for your own App User IDs.
*
* ## Debugging
*
* You can enabled detailed debug logs by setting `debugLogsEnabled = true`. You can set this **before** you configure Purchases.
*
* ```typescript
* this.purchases.setDebugLogsEnabled(true);
* this.purchases.setup("my_api_key", "my_app_user_id");
* ```
*
* **OS_ACTIVITY_MODE**
* > On iOS, disabling `OS_ACTIVITY_MODE` in your XCode scheme will block debug logs from printing in the console. If you have debug logs enabled, but don't see any output, go to `Product -> Scheme -> Edit Scheme...` in Xcode and uncheck the `OS_ACTIVITY_MODE` environment variable.
*
* Example output:
* ```
* [Purchases] - DEBUG: Debug logging enabled.
* [Purchases] - DEBUG: SDK Version - 2.0.0
* [Purchases] - DEBUG: Initial App User ID - (null)
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products
* [Purchases] - DEBUG: No cached entitlements, fetching
* [Purchases] - DEBUG: Vending purchaserInfo from cache
* [Purchases] - DEBUG: applicationDidBecomeActive
* [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products 200
* ```
* ## Entitlements
*
* An entitlement represents features or content that a user is "entitled" to. With Entitlements, you can set up your available in-app products remotely and control their availability without the need to update your app. For more information on configuring entitlements, look at our [entitlements documetation](https://docs.revenuecat.com/docs/entitlements).
*
* ## Sample App
*
* We've added an [example](https://github.com/RevenueCat/purchases-ionic-example) showing a simple example using _Purchases_ with the RevenueCat backend. Note that the pre-registered in app purchases in the demo apps are for illustration purposes only and may not be valid in App Store Connect. [Set up your own purchases](https://docs.revenuecat.com/docs/entitlements) with RevenueCat when running the example.
*
* #### Additional iOS Setup
*
* ##### Add Strip Frameworks Phase
* The App Store, in it's infinite wisdom, still rejects fat frameworks, so we need to strip our framework before it is deployed. To do this, add the following script phase to your build.
* 1. In Xcode, in project manager, select your app target.
* 2. Open the `Build Phases` tab
* 3. Add a new `Run Script`, name it `Strip Frameworks`
* 4. Add the following command `"${PROJECT_DIR}/../../node_modules/cordova-plugin-purchases/src/ios/strip-frameworks.sh"` (quotes included)
*
* ![](https://media.giphy.com/media/39zTmnsW1CIrJNk5AM/giphy.gif)
*
* ## Next Steps
* - Head over to our **[online documentation](https://docs.revenuecat.com/docs)** for complete setup guides
* - If you haven't already, make sure your products are configured correctly in the RevenueCat dashboard by checking out our [guide on entitlements](https://docs.revenuecat.com/docs/entitlements)
* - If you want to use your own user identifiers, read about [setting app user ids](https://docs.revenuecat.com/docs/user-ids)
* - If you're moving to RevenueCat from another system, see our guide on [migrating your existing subscriptions](https://docs.revenuecat.com/docs/migrating-existing-subscriptions)
* - Once you're ready to test your integration, you can follow our guides on [testing purchases](https://docs.revenuecat.com/docs/testing-purchases)
*
* ## Reporting Issues
*
* You can use Github Issues to report any bugs and issues with _Purchases_. Here is some advice for users that want to report an issue:
*
* 1. Make sure that you are using the latest version of _Purchases_. The issue that you are about to report may be already fixed in the latest master branch version: https://github.com/revenuecat/cordova-plugin-purchases/tree/master.
* 2. Providing reproducible steps for the issue will shorten the time it takes for it to be fixed - a Gist is always welcomed!
* 3. Since some issues are Sandbox specific, specifying what environment you encountered the issue might help.
*
* ## Technical Support or Questions
*
* If you have questions or need help integrating _Purchases_ please [contact us](https://www.revenuecat.com/contact) or email _support@revenuecat.com_ instead of opening an issue.
*
* ## Feature Requests
*
* If there is something you'd like to see included or feel anything is missing you can add a feature to our [public roadmap](https://trello.com/b/RZRnWRbI/revenuecat-product-roadmap). If the feature already exists, or you see something else you'd like, upvote it.
*
* ## Pricing
*
* _Purchases_ SDK is free to use but some features require a paid plan. You can find more about that on our website on the [pricing plan page](https://www.revenuecat.com/pricing).
*
* @interfaces
* RCPurchaserInfo
* RCProduct
* RCMakePurchaseResponse
* RCError
*/
@Plugin({
pluginName: 'Purchases',
plugin: 'cordova-plugin-purchases',
pluginRef: 'Purchases', // the variable reference to call the plugin, example: navigator.geolocation
repo: 'https://github.com/RevenueCat/cordova-plugin-purchases', // the github repository URL for the plugin
platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS']
})
@Injectable({
providedIn: 'root'
})
export class Purchases extends IonicNativePlugin {
/**
* Sets up Purchases with your API key and an app user id.
* @param apiKey {string} RevenueCat API Key. Needs to be a String
* @param appUserID {string?} A unique id for identifying the user
*/
@Cordova({ sync: true })
setup(apiKey: string, appUserID: string): void {}
/**
* Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
* If a user tries to purchase a product that is active on the current app store account, we will treat it as a restore and alias
* the new ID with the previous id.
* @param allowSharing {boolean} true if enabled, false to diabled
*/
@Cordova({ sync: true })
setAllowSharingStoreAccount(allowSharing: boolean): void {}
/**
* Add a dict of attribution information
* @param data { Object.<string, any> } Attribution data from any of the attribution networks in ATTRIBUTION_NETWORKS
* @param network {ATTRIBUTION_NETWORKS} Which network, see ATTRIBUTION_NETWORKS
*/
@Cordova({ sync: true })
addAttributionData(
data: { [key: string]: any },
network: ATTRIBUTION_NETWORKS
): void {}
/**
* Gets the map of entitlements -> offerings -> products
*
* @return {Observable<Map<String, Map<String, Product>>>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
getEntitlements(): Observable<Map<String, Map<String, RCProduct>>> {
return;
}
/**
* Fetch the product info
* @param productIdentifiers {string[]} Array of product identifiers
* @param type {ProductType} Optional type of products to fetch, can be inapp or subs. Subs by default
*
* @return {Observable<Array>} Will return an [RCError] if the products are not properly configured in RevenueCat or if there is another error retrieving them.
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
observable: true
})
getProducts(
productIdentifiers: string[],
type: ProductType = ProductType.SUBS
): Observable<[RCProduct]> {
return;
}
/**
* Make a purchase
* @param productIdentifier {string} The product identifier of the product you want to purchase.
* @param oldSkus {string[]} Optional array of skus you wish to upgrade from.
* @param type {String} Optional type of product, can be inapp or subs. Subs by default
*
* @return {Observable<MakePurchaseResponse>} An [RCError] is thrown when user cancels. error.usercancelled will be true if user cancelled
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
observable: true
})
makePurchase(
productIdentifier: string,
oldSkus: string[] = [],
type: ProductType = ProductType.SUBS
): Observable<RCMakePurchaseResponse> {
return;
}
/**
* Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
*
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
restoreTransactions(): Observable<RCPurchaserInfo> {
return;
}
/**
* Get the appUserID that is currently in placed in the SDK
*
* @return {Promise<string>}
*/
@Cordova()
getAppUserID(): Promise<string> {
return;
}
/**
* This function will alias two appUserIDs together.
* @param newAppUserID {String} The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
*
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
createAlias(newAppUserID: string): Observable<RCPurchaserInfo> {
return;
}
/**
* This function will identify the current user with an appUserID. Typically this would be used after a logout to identify a new user without calling configure
* @param newAppUserID {String} The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
*
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
identify(newAppUserID: string): Observable<RCPurchaserInfo> {
return;
}
/**
* Resets the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
*
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
reset(): Observable<RCPurchaserInfo> {
return;
}
/**
* Gets the current purchaser info. This call will return the cached purchaser info unless the cache is stale, in which case,
* it will make a network call to retrieve it from the servers.
*
* @return {Observable<PurchaserInfo>} Errors are of type [RCError]
*/
@Cordova({ observable: true })
getPurchaserInfo(): Observable<RCPurchaserInfo> {
return;
}
/**
* Returns an observable that can be used to receive updates on the purchaser info
*
* @return {Observable<PurchaserInfo>}
*/
@Cordova({
eventObservable: true,
event: 'onPurchaserInfoUpdated',
element: 'window'
})
onPurchaserInfoUpdated(): Observable<RCPurchaserInfo> {
return;
}
/**
* Enables/Disables debugs logs
* @param enabled {boolean} true to enable debug logs, false to disable
*/
@Cordova({ sync: true })
setDebugLogsEnabled(enabled: boolean): void {}
}
export enum ProductType {
SUBS = 'subs',
INAPP = 'inapp'
}
export enum ATTRIBUTION_NETWORKS {
APPLE_SEARCH_ADS = 0,
ADJUST = 1,
APPSFLYER = 2,
BRANCH = 3,
TENJIN = 4
}
export interface RCProduct {
identifier: string;
description: string;
title: string;
price: number;
price_string: string;
intro_price?: string;
intro_price_string?: string;
intro_price_period?: string;
intro_price_cycles?: number;
currency_code: string;
}
export interface RCPurchaserInfo {
activeEntitlements: string[];
activeSubscriptions: string[];
allPurchasedProductIdentifiers: string[];
latestExpirationDate?: string;
allExpirationDates: { [key: string]: string | null };
expirationsForActiveEntitlements: { [key: string]: string | null };
}
export interface RCMakePurchaseResponse {
productIdentifier: string;
purchaserInfo: RCPurchaserInfo;
}
export interface RCError {
code: number;
domain: string;
message: string;
userCancelled?: string;
}

View File

@@ -389,7 +389,9 @@ export class PushObject {
if (
checkAvailability('PushNotification', 'init', 'PushNotification') === true
) {
this._objectInstance = window.PushNotification.init(options);
if (typeof window !== 'undefined') {
this._objectInstance = window.PushNotification.init(options);
}
}
}

View File

@@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name QuikklyPlugin
* @description ionic wrapper for cordova-plugin-quikkly
* Use the quikkly scanner in your ionic app
*/
@Plugin({
pluginName: 'QuikklyPlugin',
plugin: 'cordova-plugin-quikkly',
pluginRef: 'cordova.plugins.quikkly',
repo: 'https://github.com/quikkly/cordova-plugin-quikkly.git',
platforms: ['Android', 'iOS']
})
@Injectable()
export class QuikklyPlugin extends IonicNativePlugin {
@Cordova()
openScanner(): Promise<string[]> { return ; }
}

View File

@@ -85,7 +85,9 @@ export class ThemeableBrowserObject {
styleOptions
);
} catch (e) {
window.open(url);
if (typeof window !== 'undefined') {
window.open(url);
}
console.warn(
'Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.'
);

View File

@@ -0,0 +1,170 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Zoom
* @description
* A Cordova plugin to use Zoom Video Conferencing services on Cordova applications.
*
* @usage
* ```typescript
* import { Zoom } from '@ionic-native/zoom';
*
*
* constructor(private zoomService: Zoom) { }
*
* ...
*
* // Initialize Zoom SDK, need to be called when app fired up.
* this.zoomService.initialize(API_KEY, API_SECRET)
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Log user in with Zoom username and password.
* this.zoomService.login(userName, password)
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Log user out.
* this.zoomService.logout()
* .then((success: boolean) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Check whether user is logged in.
* this.zoomService.isLoggedIn()
* .then((success: boolean) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // meeting options (Only available for Android)
* let options = {
* "no_driving_mode":true,
* "no_invite":true,
* "no_meeting_end_message":true,
* "no_titlebar":false,
* "no_bottom_toolbar":false,
* "no_dial_in_via_phone":true,
* "no_dial_out_to_phone":true,
* "no_disconnect_audio":true,
* "no_share":true,
* "no_audio":true,
* "no_video":true,
* "no_meeting_error_message":true
* };
*
* // Join meeting.
* this.zoomService.joinMeeting(meetingNumber, meetingPassword, displayName, options)
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Start an existing meeting for non-login user.
* this.zoomService.startMeetingWithZAK(meetingNumber, displayName, zoomToken, zoomAccessToken, userId, options)
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Start an existing meeting for logged in user.
* this.zoomService.startMeeting(meetingNumber, vanityId, options)
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Start an instant meeting for logged in user.
* this.zoomService.startInstantMeeting()
* .then((success: anu) => console.log(success))
* .catch((error: any) => console.log(error));
*
* // Set language.
* this.zoomService.setLanguage("en-US")
* .then((success: any) => console.log(success))
* .catch((error: any) => console.log(error));
* ```
*/
@Plugin({
pluginName: 'Zoom',
plugin: 'cordova.plugin.zoom', // npm package name, example: cordova-plugin-camera
pluginRef: 'cordova.plugins.Zoom', // the variable reference to call the plugin, example: navigator.geolocation
repo: 'https://github.com/zoom/zoom-sdk-ionic', // the github repository URL for the plugin
platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS']
})
@Injectable()
export class Zoom extends IonicNativePlugin {
/**
* Initialize Zoom SDK.
* @param appKey Zoom SDK app key.
* @param appSecret Zoom SDK app secret.
* @return {Promise<any>}
*/
@Cordova()
initialize(appKey: string, appSecret: string): Promise<any> { return; }
/**
* Log user in with Zoom username and password.
* @param username user's Zoom username.
* @param password user's Zoom password.
* @return {Promise<any>}
*/
@Cordova()
login(username: string, password: string): Promise<any> { return; }
/**
* Log user out.
* @return {Promise<any>} true if logout success / false if failed.
*/
@Cordova()
logout(): Promise<any> { return; }
/**
* Check whether the user is logged in.
* @return {Promise<boolean>} true if is logged in / false if not.
*/
@Cordova()
isLoggedIn(): Promise<boolean> { return; }
/**
* Join a meeting for logged in user.
* @param meetingNo meeting number.
* @param meetingPassword meeting password.
* @param options meeting options.
* @return {Promise<any>}
*/
@Cordova()
joinMeeting(meetingNo: string, meetingPassword: string, displayName: string, options: any): Promise<any> { return; }
/**
* Start a meeting for non-login user.
* @param meetingNo meeting number.
* @param displayName display name shown in meeting.
* @param zoomToken zoom token retrieved from Zoom Rest API.
* @param zoomAccessToken zoom access token retrieved from Zoom Rest API.
* @param userId user ID retrieved from Zoom Rest API.
* @param options meeting options.
* @return {Promise<any>}
*/
@Cordova()
startMeetingWithZAK(meetingNo: string, displayName: string, zoomToken: string, zoomAccessToken: string, userId: string, options: any): Promise<any> { return; }
/**
* Start a meeting for logged in user.
* @param meetingNo meeting number.
* @param options meeting option.
* @return {Promise<any>}
*/
@Cordova()
startMeeting(meetingNo: string, options: any): Promise<any> { return; }
/**
* Start an instant meeting for logged in user.
* @param options meeting option.
* @return {Promise<any>}
*/
@Cordova()
startInstantMeeting(options: any): Promise<any> { return; }
/**
* Set language.
* @param languageTag language name.
* @return {Promise<any>}
*/
@Cordova()
setLocale(languageTag: string): Promise<any> { return; }
}

View File

@@ -10,6 +10,8 @@
"no-extra-boolean-cast": false,
"adjacent-overload-signatures": false,
"ter-no-proto": false,
"callable-types": false
"callable-types": false,
"ordered-imports": false,
"prefer-conditional-expression": false
}
}