* Improved the docs for firebase dynamic links
The config.xml example needed to switch the ios and android tag.
Added an example how to use onDynamicLink()
* (doc) Reverted change and expanded example
* (doc) Even more comments for clarity
As seen in the Cordova plugin (https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth) the isAvailable method returns an object that contains 3 parameters, {isAvailable:, isHardwareDetected, hasEnrolledFingerprints}.
If you do a console log on
this.androidFingerprintAuth.isAvailable()
.then(res => console.log(res)) //Outputs the Object {isAvailable: true, isHardwareDetected: true, hasEnrolledFingerprints: true}
.catch(err => console.error(err));
So we are getting the data, just need to make the interface expose it.
CircleCI can only save files one to a specific cache key. I set the cache key to depend on the checksum of package.json, so it updates the cache every time we update Ionic Native. In the long run, CircleCI will have to download the ionic-site changes less often.
Document the fact that confirm() will return a promise that resolves to 0 if the user clicks outside the dialog box. This behavior was previously undocummented and could lead to issues if not handled properly.
* chore(package): bump dependencies
I updated the dependencies to the latest bugfix and feature releases without any breaking changes.
* Update package.json
* Update package.json
Using the example in the previous version of this document, calling prepareInterstitial(adId) resulted in an
"-[__NSCFString count]: unrecognized selector sent to instance"
exception. This was alleviated by changing the call to prepareInterstitial({adId: adId})
(e.g. passing in an options object vs. just the adid string)
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* added phonegap-local-notifications
* update #1
* update #3
* update #4
* cleaned up the usage part
* removed old folder
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* Update index.ts
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Initial commit
* updated interface
* updated interface
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Added AppMinimize plugin
* promisse
* usage
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* Initial commit
- added Plugin infos
- added methods
* Added Interface
* Implemented all methods
* fixed retun types
TODO: Improve Interface Docs
* Interface discription
Still needs some improvements
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
* initial commit
Added wrapper
* Added usage guide
* Added parms
* refactor(diagnostic plugin): update camera API function signatures to support cordova.plugins.diagnostic@3.6.0. See 515317e89a
* fix(diagnostic plugin): fix whitespace linting errors in previous commit
* * fix(diagnostic plugin): add callback indices to Cordova decorator in camera API so externalStorage parameter can be optionally omitted.
See https://github.com/driftyco/ionic-native/pull/1458#issuecomment-299030833
* fix(diagnostic plugin): fix incorrect return type on getCameraRollAuthorizationStatus()
I struggled to figure out what options I had for target until I read them from the github repo.
I'm assuming that the documentation is generated from the comments and I think addition clarifies the intent of `target` a bit.
* typo(barcode-scanner): fixe circle lint error
* typo(docs): Unified the documentations
In some plugins the typescript markup was missing.
I also unified the console.log string from console.log("hello") to console.log('Hello') so any plugin page look the same.
The function never returns an object of MediaObject. The onSuccess callback is wrongly used to return the object. In fact, onSuccess/onError callbacks are only invoked after the current play, record, or stop action is called.
ShareViaEmail parameter for providing email "must be null or an array" because it's type is "string:[]" and the provided syntax is wrong, so i have updated that syntax.
I made changes to cordova-plugin-health to accept the following array as datatypes. Earlier it was just an array of strings. Now it also contains an object with `read` and `write` array.
```
[
'calories', 'distance', //read and write permissions
{
read : ['steps'], //read only permission
write : ['height', 'weight'] //write only permission
}
]
```
Don't know how to specify this array in typescript so just replaced by 'any'
The sample code does not work...this change returns the observable first with subscribe() before actually calling the Observable's subscribe method.
In fact, the way it's written in the example, the code would not build because of typescript errors.
remove the dash "import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob';" to import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/admob' because typescript will not import the specified clases
* Initial plugin pass
* Remove unneeded imports, or else plugins will not build.
* Add try-catch blocks.
Applications will not bomb if the plugin is not installed or user is running in browser.
* handle missing intel variable.
* Add documentation
* Conform to Cordova decorators.
* Add IntelSecurityDataOptions
* Update plugin to use plain `return` method statements.
* Better conform to Ionic Native
* feat(push): plugin is now instance based
no more callbacks
closes#250
* fix(push): fix typo in PushEvents enum
* fix constructor
* feat(push): add subscribe/unsubscribe
fixes#861
* First try
* Moving to modules
* Removed
* Moving things aroudn
* tsconfig for plugins
* Plugin tsconfigs
* Core kind of buidls
* Core
* Plugin tsconfig
* Test
* Remove core
* Build
* Individual packages
* Build and push
* Some stuff
* Bump
* Update core-package.json.template
* Update plugin-package.json.template
* 3.0.0
* Working on injectable
* Updates
* Checkpoint
* More stuff
* Remove duplicate injectables
* Remove lots of static stuff with a fancy regex
* Fix build errors
* chore(): nodejs build script
* chore(): move fs-extra-promise to devDeps
* feat(): make instance based plugins injectable
* Cleanup
* chore(build): convert dependencies to peer dependencies
* chore(build): add auto install scripts (#1059)
* feat(core): auto install scripts
* minor fixes
* minor fixes
* remove prompt message
* fix(plugins): rename packages/classes
* rename google maps
* gulp task to generate readme files
* readme templates
* automating readme file generation and adding it to CI
# Conflicts:
# src/@ionic-native/plugins/googlemap/index.ts
# src/@ionic-native/plugins/inappbrowser/index.ts
# src/@ionic-native/plugins/media/index.ts
# src/@ionic-native/plugins/sqlite/index.ts
* outputting readmes to dist dir instead of src
* updating package name in usage instructions
* chore(): ngc build
* fix build
* 3.0.1-0
* 3.1.0-alpha.1
* fix AoT support and add publish script
* 3.1.0-alpha.2
* edit publish command
* remove alpha tag
* remove auto-install and cleanup
* 3.1.0-alpha.3
* remove utils from publish command
* refactor(): remove some prefixes
* remove console logs
closes#1145
* chore(): merge master into v3-injectable (#1146)
* 2.5.0
* chore(): update changelog
* fix(pin-dialog): add missing errorIndex
* 2.5.1
* chore(): update changelog
* fix(zip): progress callback is optional (#1049)
* fix(apprate): add missing Windows Store option (#1072)
* Update file-chooser.ts (#1071)
Removed semicolon after .then() in usage instructions
* docs(device-motion): update interface names (#1076)
AccelerationData interface is wrongly named in docs. It should be DeviceMotionAccelerationData. And I added it to import statement.
* feat(inappbrowser): add interface for IAB options (#1065)
* Add InAppBrowserOptions Interface for better tooling.
* feat(inappbrowser): add interface for IAB options
* Add more constructor tests.
* Add missing iOS options.
* docs(media): update method usage (#1089)
* fix(push): add the missing option clearBadge (#1087)
* docs(badge): fix example (#1096)
Error in code example (supplied parameters do not match call signature)
* fix(imagepicker): add outputType option (#1098)
* fix(facebook): fixes issue when not supplying default params (#1088)
* Fix default facebook logEvent parameters
* Implement correct parameters format in facebook logEvent method
* Update ibeacon.ts (#1099)
Return type of `getAuthorizationStatus()` made more explicit.
* fix(file): add missing exports (#1101)
Any declaration that is not being exported is missing from the resulting d.ts declaration files.
* Add InAppBrowserOptions interface to documentation. (#1103)
* Update sqlite.ts (#1106)
Added a bracket to remove the syntax error
* update device orientation docs to reflect renaming of CompassHeading interface (#1107)
* Move marker code inside MAP_READY (#1108)
The code to set the camera position and marker should be moved inside the function handling MAP_READY. Otherwise they execute before the event is fired and it doesn't work.
* refactor(file): accept ArrayBuffer for data to write (#1109)
* docs(google-maps): fix param type
closes#1110
* fix(media): add missing pauseRecord and resumeRecord methods (#1122)
* docs(stripe): fix type and naming issues (#1129)
* refactor(paypal): fix type of items (#1125)
Type of items should be Array<PayPalItem> instead of string.
* fix(serial): Serial.requestPermission() options are optional (#1128)
* add success/error indices
* feat(browser-tab): add browser tab plugin (#1126)
* feature: added hasPermission function to Firebase fixes#1115
* feat: Implemented support for BrowserTab #1077
* docs(browser-tab): add proper docs
* fix(background-geolocation): configure returns a promise
closes#1118
* docs(background-geolocation): add return types and platforms
* fix(contacts): allow passing asterisk as contact field type
closes 1093
* fix(contacts): allow passing asterisk as contact field type
closes#1093
* fix(plugin): revert changes to support stable version (#1116)
fix#1001
* feat(file): add system paths
* feat(app-update): add cordova-plugin-app-update support (#1105)
* add new app-update plugin
* update plugin info
* docs(app-update): add docs
* feat(alipay): add alipay support. (#1097)
* add cordova-alipay-base plugin. to support Alipay payment
* change ALI_PID to APP_ID, make it same with the latest SDK
* rewrite comments
* docs(google-maps): improve docs (#1095)
Move `map.moveCamera(position);` inside the MAP_READY event.
Allow to zoom the map on first launch (both iOS and Android).
* fix(file): remove FileError from return type (#1086)
Promises that reject with a `FileError` are not of the type `Promise<T|FileError>`, but `Promise<T>`.
The previous declarations of `Promise<T|FileError>` would break typing further down the chain where you are trying to use the value that the typing says could be `T|FileError` but in reality could only be `T`.
* feat(google-maps): add constant for map type
* fix(file): platform Browser will raise a an DOMException (#1082)
fix(File): Platform Browser will raise a an DOMException on resoleLocalFilesystemUrl and tries to write on readonly property DOMException err.message in fillErrorMessage
* feat(local-notifications): support for icon background color (#1079)
The Cordova plugin Ionic Natives uses allows specifying the background color of the smallIcon. By not including it in your interface you force users to use the default color for their version of Android. While the LocalNotification plugin is not well documented, it does include this feature, see Options.java line 253:
```
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
public int getColor() {
String hex = options.optString("color", null);
if (hex == null) {
return NotificationCompat.COLOR_DEFAULT;
}
int aRGB = Integer.parseInt(hex, 16);
return aRGB + 0xFF000000;
}
```
I've simply added the option to the interface as well as a short description.
This lets you go from the default color (varies by Android version): https://goo.gl/photos/nERcj4GZgapy8aee9
To any color you'd like: https://goo.gl/photos/t8V9WVba8jDU49aHA
And also works if you also specify a large icon: https://goo.gl/photos/gWQYwa12djmdXfYcA
* feat(unique-device-add): add UniqueDeviceId plugin (#1064)
* fix plugin
* feat(text-to-speech): Add stop method (#1063)
https://github.com/vilic/cordova-plugin-tts/pull/32
* feat(appodeal): adds Appodeal SDK wrappers for iOS and Android (#1031)
* feat(Appodeal) bootrapping
* starting docs
* more docs
* feat(appodeal): add event Observables
* feat(appodeal): replace Cordova Observable events with #.fromEvent()
* feat(appodeal): update decorator metadata
* feat(couchbase-lite): add CouchbaseLite cordova plugin (#1025)
* feat(CouchbaseLite): add CouchbaseLite cordova plugin
* add plugin url
* feat(background-fetch): Adding Background Fetch requested in #990 (#1013)
* Adding Background Fetch (https://github.com/transistorsoft/cordova-plugin-background-fetch) requested in #990
* Adding BackgroundFetch to index
* feat(gyroscope): add Gyroscope plugin (#1004)
* add gyroscope.ts to plugins
* add gyroscope to index
* Update gyroscope.ts
* Update gyroscope.ts
* Revert "fix(File): typing where `FileError` can be thrown" (#1130)
* tslint and fix build issues
* 2.6.0
* chore(): update changelog
* fix(core): dont check if method exists when overriding
fixes#1043
* fix(file): fix writeExistingFile
closes#1044
* feat(diagnostic): add new methods
closes#1045
* feat(background-mode): replace event listeners with on method
The methods onactivate, ondeactive and onfailure no longer exist. You must now use `on` method.
* feat(background-mode): add missing functions
closes#1078
* tslint
* set GoogleMapsMapTypeId to private
* remove beta from stripe
* 2.7.0
* chore(): update changelog
* feat(app-preferences): added cordova-plugin-app-preferences support (#1084)
* (feat) added cordova-plugin-app-preferences support
* replaced callback functions with promises
* updated example
* (feat) added cordova-plugin-browsertab support
* Revert "(feat) added cordova-plugin-browsertab support"
This reverts commit 00eb5cf5d8.
* (update) synchronize fetch
* feat(photo-library): added cordova-plugin-photo-library (#1102)
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* refactor(photo-library): fixed circleci failing in 2.7.0 (#1132)
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* fixed typescript error in 2.7.0
* feat(health): add wrapper for cordova-plugin-health (#1039)
* feat(health): add wrapper for cordova-plugin-health
* fix(Health): add optional params to QueryOptions for .query()
* docs(health): fix javadoc of interfaces
* fix(health): remove unused Plugin option
* docs(health): add missing documentation
* doc(health): add promise to return
* doc(health): remove empty lines
* doc(health): Add description & reference to repo
* doc(health: add "return {Promise<any>}"
* refactor(safari-view-controller): hide returns promise
* fix typo in ibeacon plugin (#1138)
* fix(file): fix return types
fixes#1139
* docs(background-geolocation): fix param docs
* refactor(health): fix return types and prefix interfaces
* 2.8.0
* chore(): update changelog
* docs(sqlite): syntax error resolved (#1142)
* Syntax error resolved
The `{}` should be `[]`, but since there is no binding we do not get error. In case we add one, then the syntax will be incorrect.
* Fixed a syntax error
* fix(background-geolocation): configure returns an observable
* docs(): update docs
* 3.1.0-rc.1
* refactor(background-geolocation): update imports
* docs(background-fetch): fix return type
* docs(health): fix return type
* chore(CI): fixing npm install instructions in generated readmes
* set concurrency to number of cores
* chore(): update deps
* 3.1.0-rc.2
* chore(): update angular to 2.4.8
* 3.1.0-rc.3
* chore(): update angular to 2.4.8
* chore(): update rxjs to 5.0.1
* chore(): organize and enhance decorators (#1171)
* fix/add decorators
* fix google maps design
* chore(): add root tsconfig to resolve imports in IDE
* updates
* more fixes
* chore(): add options to InstanceCheck
* chore(decorators): promise is default for Cordova/Instance check
* chore(): add check decroators
* docs(): update plugin docs
* chore(decorators): fix cordovaCheck and instanceCheck
* 3.1.0-rc.4
* chore(docs): remove gitPackage from doc generator
* chore(docs): update to latest dgeni version
* fix diagnostic
* feat(media): create method now returns a promise
Breaking change: create no longer returns a MediaObject instance. Make changes to your app accordingly.
* docs update + remove any static methods/properties
* remove duplicate method
* remove extra docs
* remove extra docs
* docs(): rename plugins
* chore(decorators): do not check method name on instancecheck
* chore(decorators): do not check method name on cordovacheck
* chore(plugin): fix pluginWarn
* chore(plugin): fix pluginWarn
* fix(decorators): fix InstanceCheck decorator
* 3.1.0-rc.5
* chore(docs): fix readme generation
* fix(transfer): fix v3 implementation
* refactor(paypal): PayPal is brand name
* chore(docs): replace all spaces with dashes
* chore(): add dashify filter
* chore(build): add aot path to core tsconfig
* feat(action-sheet): add ANDROID_THEMES constant
* refactor(): general cleanup (#1193)
* feat(screen-orientation): update wrapper to match v2 of the plugin
The whole implementation has changed now. You must update your code.
* feat(stripe): add new methods
* feat(linkedin): add LinkedIn plugin
* 3.1.0-rc.6
* style(screen-orientation): double quote to single
* tslint
* refactor(pedometer): rename file to index
* Syntax error resolved
The `{}` should be `[]`, but since there is no binding we do not get error. In case we add one, then the syntax will be incorrect.
* Fixed a syntax error
* feat(photo-library): added cordova-plugin-photo-library
* CordovaFiniteObservable moved to photo-library.
Overloads are marked as private.
* fixed typescript error in 2.7.0
The Cordova plugin Ionic Natives uses allows specifying the background color of the smallIcon. By not including it in your interface you force users to use the default color for their version of Android. While the LocalNotification plugin is not well documented, it does include this feature, see Options.java line 253:
```
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
public int getColor() {
String hex = options.optString("color", null);
if (hex == null) {
return NotificationCompat.COLOR_DEFAULT;
}
int aRGB = Integer.parseInt(hex, 16);
return aRGB + 0xFF000000;
}
```
I've simply added the option to the interface as well as a short description.
This lets you go from the default color (varies by Android version): https://goo.gl/photos/nERcj4GZgapy8aee9
To any color you'd like: https://goo.gl/photos/t8V9WVba8jDU49aHA
And also works if you also specify a large icon: https://goo.gl/photos/gWQYwa12djmdXfYcA
fix(File): Platform Browser will raise a an DOMException on resoleLocalFilesystemUrl and tries to write on readonly property DOMException err.message in fillErrorMessage
Promises that reject with a `FileError` are not of the type `Promise<T|FileError>`, but `Promise<T>`.
The previous declarations of `Promise<T|FileError>` would break typing further down the chain where you are trying to use the value that the typing says could be `T|FileError` but in reality could only be `T`.
The code to set the camera position and marker should be moved inside the function handling MAP_READY. Otherwise they execute before the event is fired and it doesn't work.
Adding a link to **cordova plugin file** for ease of understanding file management using cordova.
It took me almost a day to figure out how to properly save things like a pdf/image in a publicly accessible directory. Having a link to the main **cordova file** documentation will save a lot of time.
This reverts part of commit 67adb23, which moved the call to getPlugin()
from within CordovaProperty() to a point where it was called too early.
When the CordovaProperty decorator is called on a property, the class
containing that call has not yet had its Plugin decorator called. Only
when the latter happens does pluginRef get set. Thus, attempting to
access pluginRef within CordovaProperty at the time of the call will
give undefined, and attemping to call getPlugin with an undefined value
will throw an exception:
Runtime Error
Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
at get
at getPlugin
at CordovaProperty
at __decorate
...
The above message can be seen in the browser after running the 'ionic
serve' command.
This commit moves the getPlugin call back to the getters and setters
established by CordovaProperty, which are only called *after* the Plugin
decorator has finished executing.
closes#992
* feat(broadcaster): add Broadcaster plugin
* fix(broadcaster): return Obserable for addEventListener
- also remove the listener when clearing observable
I added a change that makes it clear that the map element needs a height to be visible.
I tried to follow the docs but It didn't work, after that I thought my API keys were invalid, at the end it turned out the map wasn't visible at all.
* update to use plugin v1.1.0
Updated example
Added new configuration options.
Added new show() result fields
Added new delete method
* Update to plugin v1.2.0
Removed show()
Added encrypt()
Added decrypt()
Removed requirement of username
* edit comments
* edited comments
The routeWithNavController method returns an observable, thus it has to be subscribed to, to get it working.
Change the documentation of the method to show that we need to subscribe to the observable, just like when using the route method.
`db.executeSql()` was documented as `db.executeSQL()` that caused error:
main.js:13 Error openening database TypeError: t.executeSQL is not a function
at file:///android_asset/www/build/main.js:13:11718
at t.invoke (file:///android_asset/www/build/polyfills.js:3:13422)
at Object.onInvoke (file:///android_asset/www/build/main.js:3:3341)
at t.invoke (file:///android_asset/www/build/polyfills.js:3:13373)
at e.run (file:///android_asset/www/build/polyfills.js:3:10809)
at file:///android_asset/www/build/polyfills.js:3:8911
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:14051)
at Object.onInvokeTask (file:///android_asset/www/build/main.js:3:3241)
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:13987)
at e.runTask (file:///android_asset/www/build/polyfills.js:3:11411)
The issue is fixed in this commit
* Update camera-preview.ts
This missing parameter would cause TS to spew
* Update camera-preview.ts
Sending preview to back is initially confusing and causes it to appear to not work.
* docs(camera preview): update to correct repo
* docs(camera preview): fix typo
* docs(camera preview): Update to other repo
* fix(camera preview): revert to old plugin and update repo to matching repo
The plugin reference is available as part of the global `cordova` object and not the global `plugins` object. This caused the plugin to `Plugin not installed warning` even though the plugin is installed and works when using through `cordova.plugins.market.open(appId);`
The way this was setup previously, if an error occurred on the watchPosition observable, the observer was sent an error, which would have to be caught. This also has the side effect of completing the observable, which means anything down stream that would be subscribed would be unsubscribed and no longer receive updates.
Instead of using binding the error callback to ```observer.error``` this change just binds the error callback to ```observer.next``` and lets the subscriber filter out results that match ```PositionError``` rather than having to manage re-subscribing (which could just immediately fail and enter a loop of catch/retry)
* feat - introduce the plugin wrapper for code-push and type definitions
* feat(code-push) - change the signature of the methods to return Promise & decorate them with Cordova decorator
* fix(code push) - in sync method call the native method
* fix(code-push) : use decorator on syc to mark it as an observable / add sample usage
* docs(code-push) : add the link to the sample repository
* fix - merge errors
* fix(code-push) : add description field on CodePush class / remove not needed IWindow interface declaration
* Fixes syntax error in usage example, and improves usage formatting
* Moves error codes into usage section
* Adds basics of geofence plugin
* Updates exports to include Geofence
* Adds geofence docs and tested functions
* Corrects promise types and comments out unimplemented functions
* Minor updates to geofence
* Reverts camera-preview changes for this branch to master
* Removes preview settings from options obj and creates proper rect interface
* Changes startCamera() signature to match plugin
* Adds alpha to function signature
* Removes CameraPreviewOptions and CameraPreviewSize interfaces that don't match plugin
* Adds back CameraPreviewSize interface - oops
* Updates docs for startCamera()
* Changes CameraPreviewSize interface to Size to match plugin
* Adds docs for takePicture
* Reverts change to signature of setOnPictureTakenHandler
* Adds CameraPreview prefix to interfaces
We don't want that the reject cb takes the position of an optional
argument that has not been defined
For example the Dialogs.alert method takes an optional 'buttonLabel'
string. In case we do not set this value, and thus want to use the
default value, the 'reject'
callback get spliced into this position due the fact that the splice
start index is bigger than the array length.
Dialogs.alert("title", "message", "My button text") --> args =
["title", resolve, "message", "My button text", reject]
Dialogs.alert("title", "message") --> args = ["title", resolve,
"message", reject] --> reject is on the position of the buttontitle!
The cordova-plugin-dialogs alert function receives the wrong arguments
—> alert: function(message, completeCallback, title, buttonLabel)
The buttonLabel will receive the "reject" callback instead of a
undefined value.
* Additions to documentations and type definitions
Added return types to documentation as well as modified return type definition to match actual types returned.
Used union types for promises where applicable.
Builds and gulp docs ok.
* Update file.ts
* feat(inappbrowser): the inAppBrowser class is no longer static
* feat(inappbrowser): fallback on window.open if plugin not available
* change warning text to match expected release version
Since the plugin's methods return already a promise, the workaround with the `sync` option was used. This worked well for the method calls. However, when either cordova or the plugin was not available, an error was thrown, instead of rejecting the returned promise.
Therefore a better way is to use the `otherPromise` option, introduced with https://github.com/driftyco/ionic-native/releases/tag/v1.3.8.
* Added OneSignal wrapper
* documentation
* Changes for callback of notification revieced
* fixes for @Cordova decorators without Promise return
* Merge
* Improvements to OneSignal
extended init function with notificationOpenedCallback as an optional parameter
* Platforms removed
OneSignal supports more than only these 3 platforms. It's available to nearly all Cordova platforms.
* Init method turned into observable
* Screen Orientation Plugin added. Closes#342
* Added VideoPlayer plugin #318
walkingriver commented 9 minutes ago
When installing the bower package created from this, a couple of warnings are printed:
bower ionic-native#* invalid-meta The "main" field cannot contain minified files
bower ionic-native#* invalid-meta The "main" field has to contain only 1 file per filetype; found multiple .js files: ["ionic.native.js","ionic.native.min.js"]
* Added OneSignal wrapper
* documentation
* Changes for callback of notification revieced
* fixes for @Cordova decorators without Promise return
* Merge
* Improvements to OneSignal
extended init function with notificationOpenedCallback as an optional parameter
* Platforms removed
OneSignal supports more than only these 3 platforms. It's available to nearly all Cordova platforms.
* Init method turned into observable
* Screen Orientation Plugin added. Closes#342
* Added OneSignal wrapper
* documentation
* Changes for callback of notification revieced
* fixes for @Cordova decorators without Promise return
* Merge
* Improvements to OneSignal
extended init function with notificationOpenedCallback as an optional parameter
* Platforms removed
OneSignal supports more than only these 3 platforms. It's available to nearly all Cordova platforms.
* Init method turned into observable
* Add SecureStorage plugin.
* Add SecureStorage plugin.
* Added create() and removed init() to provide more consistency to ionic-native plugins.
Edited comments to reflect changes.
* Removed init and comment edit.
* Updates docs for CameraPreview, Base64ToGallery and Developer.MD
-DEVELOPER.md: Corrects 'npm run tslint' instruction to 'npm run lint'
-CameraPreview: Fixes syntax error in hide
-Base64ToGallery: Adds desc of options obj props
* Fixes resolveLocalFileSystemURL bug in File.readAsText() and adds File.readAsDataUrl()
- File.readAsText(): window.resolveLocalFileSystemURL() was incorrectly implemented
* Updates callback arg in File.checkFile()
Callback arg of window.resolveLocalFileSystemURL was fileSystem, but it actually returns fileEntry
* Corrects repo link and comments out setFlashMode()
- Repo prop and link in desc were not pointing to the same gh repo as the plugin
- setFlashMode() is not currently available in the repo that gets pulled by the corodova plugin
-DEVELOPER.md: Corrects 'npm run tslint' instruction to 'npm run lint'
-CameraPreview: Fixes syntax error in hide
-Base64ToGallery: Adds desc of options obj props
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
## Have an issue?
#### There are no rules, but here are a few things to consider:
###### Before you submit an issue:
* Do a quick search to see if there are similar issues
* Check that you are using the latest version of `ionic-native`
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
* **Check that you are using the latest version of**`ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
###### Still having problems? submit an issue with the following details:
* Short description of the issue
* Steps to reproduce
* Stack trace (if available)
## Feature request?
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
Take a look at our [Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
<!-- Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/ -->
**Current behavior:**
<!-- Describe how the bug manifests. -->
**Expected behavior:**
<!-- Describe what the behavior would be without the bug. -->
**Steps to reproduce:**
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce. -->
**Related code:**
```
insert any relevant code here
```
**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
@@ -5,6 +5,20 @@ This is a short guide on creating new plugin wrappers for Ionic Native.
## Creating Plugin Wrappers
First, let's start by creating a new plugin wrapper from template.
```
// Call this command, and replace PluginName with the name of the plugin you wish to add
// Make sure to capitalize the first letter, or use CamelCase if necessary.
gulp plugin:create -n PluginName
// add -m flag to get a minimal template to start with
gulp plugin:create -m -n PluginName
```
Running the command above will create a new directory `src/@ionic-native/plugins/plugin-name/` with a single file in there: `index.ts`. This file is where all the plugin definitions should be.
Let's take a look at the existing plugin wrapper for Geolocation to see what goes into an Ionic Native plugin (comments have been removed for clarity):
```
@@ -12,17 +26,18 @@ Let's take a look at the existing plugin wrapper for Geolocation to see what goe
It's just a stub. The `return` is only there to keep the TypeScript type-checker from complaining since we indicate that `getCurrentPosition` returns a `Promise<Geoposition>`.
@@ -81,12 +98,12 @@ Next, let's look at the `watchPosition` method.
The `@Cordova` decorator has a few more options now.
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/driftyco/ionic-native#promises-and-observables) instead of a Promise.
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/ionic-team/ionic-native#promises-and-observables) instead of a Promise.
`callbackOrder` refers to the method signature of the underlying Cordova plugin, and tells Ionic Native which arguments are the callbacks to map to the wrapping Promise or Observable. In this case, the signature is [`watchPosition(success, error, options)`](https://github.com/apache/cordova-plugin-geolocation#navigatorgeolocationwatchposition), so we need to tell `@Cordova` that the callbacks are the first arguments, not the last arguments. For rare cases, you can also specify the options `successIndex` and `errorIndex` to indicate where in the argument list the callbacks are located.
@@ -94,12 +111,102 @@ The `@Cordova` decorator has a few more options now.
### Testing your changes
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. Then, you must go to your ionic application folder and replace your current `node_modules/ionic-native/dist/` with the newly generated one.
You need to run `npm run build` in the `ionic-native` project, this will create a `dist` directory. The`dist` directory will contain a sub directory `@ionic-native` with all the packages compiled in there. Copy the package(s) you created/modified to your app's node_modules under the `@ionic-native` directory. (e.g. `cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/`).
### Cleaning the code
You need to run `npm run tslint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
### 'Wrapping' Up
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
## Commit Message Format
We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the our change log. (Ok you got us, it's basically Angular's commit message format).
`type(scope): subject`
#### Type
Must be one of the following:
* **fix**: A bug fix
* **feat**: A new feature
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
#### Scope
The scope could be anything specifying place of the commit change. For example, the name of the plugin being changed
#### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* do not capitalize first letter
* do not place a period (.) at the end
* entire length of the commit message must not go over 50 characters
### Ionic Native Decorators
#### Plugin
A decorator to wrap the main plugin class, and any other classes that will use `@Cordova` or `@CordovaProperty` decorators. This decorator accepts the following configuration:
- *pluginName*: Plugin name, this should match the class name
- *plugin*: The plugin's NPM package, or Github URL if NPM is not available.
- *pluginRef*: The plugin object reference. Example: 'cordova.file'.
- *repo*: The plugin's Github Repository URL
- *install*: (optional) Install command. This is used in case a plugin has a custom install command (takes variables).
- *platforms*: An array of strings indicating the supported platforms.
#### Cordova
Checks if the plugin and the method are available before executing. By default, the decorator will wrap the callbacks of the function and return a Promise. This decorator takes the following configuration options:
- **observable**: set to true to return an Observable
- **clearFunction**: an optional name of a method to clear the observable we returned
- **clearWithArgs**: This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used in the initial function.
- **sync**: set to true if the method should return the value as-is without wrapping with Observable/Promise
- **callbackOrder**: set to `reverse` if the success and error callbacks are the first two arguements of the method
- **callbackStyle**: set to `node` if the plugin has one callback with a node style (e.g: `function(err, result){}`), or set to `object` if the callbacks are part of an object
- **successName**: Success function property name. This must be set if callbackStyle is set to object.
- **errorName**: Error function property name. This must be set if callbackStyle is set to object.
- **successIndex**: Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **errorIndex**: Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
- **eventObservable**: set to true to return an observable that wraps an event listener
- **event**: Event name, this must be set if eventObservable is set to true
- **element**: Element to attach the event listener to, this is optional, defaults to `window`
- **otherPromise**: Set to true if the wrapped method returns a promise
- **platforms**: array of strings indicating supported platforms. Specify this if the supported platforms doesn't match the plugin's supported platforms.
Example:
```ts
@Cordova()
someMethod():Promise<any>{return;}
@Cordova({sync: true})
syncMethod():number{}
```
#### CordovaProperty
Checks if the plugin and property exist before getting/setting the property's value
Example:
```ts
@CordovaProperty
someProperty: string;
```
#### CordovaCheck
Checks if the plugin exists before performing a custom written method. By default, the method will return a promise that will reject with an error if the plugin is not available. This wrapper accepts two optional configurations:
- **observable**: set to true to return an empty Observable if the plugin isn't available
- **sync**: set to true to return nothing if the plugin isn't available
Example:
```ts
@CordovaCheck()
someMethod():Promise<any>{
// anything here will only run if the plugin is available
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](http://ionicframework.com/), Cordova, or Web View mobile app easy.
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](https://ionicframework.com/) mobile app easy.
### Documentation
Ionic Native wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and making it easy to use plugins with Angular change detection.
For the full Ionic Native documentation, please visit [http://ionicframework.com/docs/v2/native/](http://ionicframework.com/docs/v2/native/).
### Promises and Observables
Ionic Native wraps plugin callbacks in a Promise or [Observable](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754), providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.
## Installation
Run following command to install Ionic Native in your project.
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.
let watch = Geolocation.watchPosition().subscribe(pos => {
// Currently, observables from Ionic Native plugins
// need to run inside of zone to trigger change detection
ngZone.run(()=>{
this.position=pos;
})
});
// to stop watching
watch.unsubscribe();
});
}
}
```
### Mocking and Browser Development
Ionic Native 3.x makes it possible to mock plugins and develop nearly the entirety of your app in the browser or in `ionic serve`.
To do this, you need to provide a mock implementation of the plugins you wish to use. Here's an example of mocking the `Camera` plugin to return a stock image while in development:
First import the `Camera` class in your `src/app/app.module.ts` file:
```typescript
import{Camera}from'@ionic-native/camera';
```
Then create a new class that extends the `Camera` class with a mock implementation:
```typescript
classCameraMockextendsCamera{
getPicture(options){
returnnewPromise((resolve,reject)=>{
resolve("BASE_64_ENCODED_DATA_GOES_HERE");
})
}
}
```
Finally, override the previous `Camera` class in your `providers` for this module:
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
## Installation
Run following commmand to install ionic-native in your project.
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
## Ionic V1/Angular 1 support
For Ionic V1/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
# Credits
Ibrahim Hadeed - [@ihadeed](http://github.com/ihadeed)
// 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.
constbefore=Date.now();
letdidFireReady=false;
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.`);
// We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
if(opts.errorIndex>args.length){
args[opts.errorIndex]=reject;// insert the reject fn at the correct specific index
}else{
args.splice(opts.errorIndex,0,reject);// otherwise just splice it into the array
}
};
if(opts.successIndex>opts.errorIndex){
setErrorIndex();
setSuccessIndex();
}else{
setSuccessIndex();
setErrorIndex();
}
}else{
// Otherwise, let's tack them on to the end of the argument list
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.');
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');
* The ActionSheet plugin shows a native list of options the user can choose from.
*
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet).
*
* @usage
* ```typescript
* import { ActionSheet, ActionSheetOptions } from '@ionic-native/action-sheet';
* Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM`
*/
adSize?: AdSize;
/**
* Banner width, valid when `adSize` is set to `CUSTOM`
*/
width?: number;
/**
* Banner height, valid when `adSize` is set to `CUSTOM`
*/
height?: number;
/**
* Allow banner to overlap webview, or else it will push webview up or down to avoid overlap. Defaults to false.
*/
overlap?: boolean;
/**
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
*/
position?: number;
/**
* X in pixels. Valid when `position` is set to `POS_XY`
*/
x?: number;
/**
* Y in pixels. Valid when `position` is set to `POS_XY`
*/
y?: number;
/**
* Set to true to receive test ad for testing purposes
*/
isTesting?: boolean;
/**
* Auto show interstitial ad when loaded. Set to false if hope to control the show timing with prepareInterstitial/showInterstitial
*/
autoShow?: boolean;
/**
* Re-create the banner on web view orientation change (not screen orientation), or else just move the banner. Default:true.
*/
orientationRenew?: boolean;
/**
* Set extra color style for Ad
*/
adExtras?: AdExtras;
/**
* License key for the plugin
*/
license?: any;
}
exportinterfaceAdExtras{
color_bg: string;
color_bg_top: string;
color_border: string;
color_link: string;
color_text: string;
color_url: string;
}
/**
* @name AdMob
* @description
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
*
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMob Free](../admob-free).
* Used as the alias for your key in the Android Key Store.
*/
clientId: string;
/**
* Used to create credential string for encrypted token and as alias to retrieve the cipher.
*/
username?: string;
/**
* Used to create credential string for encrypted token
*/
password?: string;
/**
* Required for decrypt()
* Encrypted user credentials to decrypt upon successful authentication.
*/
token?: string;
/**
* Set to true to remove the "USE BACKUP" button
*/
disableBackup?: boolean;
/**
* Change the language. (en_US or es)
*/
locale?: string;
/**
* The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts.
*/
maxAttempts?: number;
/**
* Require the user to authenticate with a fingerprint to authorize every use of the key.
* New fingerprint enrollment will invalidate key and require backup authenticate to
* re-enable the fingerprint authentication dialog.
*/
userAuthRequired?: boolean;
/**
* Set the title of the fingerprint authentication dialog.
*/
dialogTitle?: string;
/**
* Set the message of the fingerprint authentication dialog.
*/
dialogMessage?: string;
/**
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
*/
dialogHint?: string;
}
exportinterfaceAFADecryptOptions{
/**
* Biometric authentication
*/
withFingerprint: boolean;
/**
* Authentication using backup credential activity
*/
withBackup: boolean;
/**
* FingerprintAuth.CipherMode.DECRYPT
* Decrypted password
*/
password: string;
}
exportinterfaceAFAEncryptResponse{
/**
* Biometric authentication
*/
withFingerprint: boolean;
/**
* Authentication using backup credential activity
*/
withBackup: boolean;
/**
* base64encoded string representation of user credentials
*/
token: string;
}
/**
* @name Android Fingerprint Auth
* @description
* This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup.
* @usage
* ```typescript
* import { AndroidFingerprintAuth } from '@ionic-native/android-fingerprint-auth';
* This plugin enables developers to offer users a true full screen experience in their Cordova and PhoneGap apps for Android.
* Using Android 4.0+, you can use true full screen in "lean mode", the way you see in apps like YouTube, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts. This is ideally suited to video or cut-scene content.
* In Android 4.4+, however, you can now enter true full screen, fully interactive immersive mode. In this mode, your app will remain in true full screen until you choose otherwise; users can swipe down from the top of the screen to temporarily display the system UI.
* @usage
* ```typescript
* import { AndroidFullScreen } from '@ionic-native/android-full-screen';
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.