![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@thegrizzlylabs/cordova-plugin-genius-scan
Advanced tools
Readme
This Cordova plugin allows you to access the Genius Scan SDK core features from a Cordova application:
This plugin is based on the Genius Scan SDK for which you need to setup a licence. You can aleady try the "demo" version for free by not setting a licence key, the only limitation being that the app will exit after 60 seconds.
To buy a licence or for any question regarding the SDK, please contact us at sdk@thegrizzlylabs.com!
As an example, you can check our demo application
This plugin requires cordova-cli
above 7.0.0: see this page for upgrading if you have an older version.
cordova-ios
above 4.3.0
Nothing to do on a new project; use cordova platform update ios --save
within your existing cordova project to upgrade it.cordova-android
at least 6.x.xNote for Xcode 10 users: Cordova-ios is not fully compatible with Xcode 10 yet, you may need to use cordova run ios --buildFlag="-UseModernBuildSystem=0"
command to build the project properly
If you are using an older plugin version, you will first need to remove the plugin from your cordova project:
cordova plugin remove @thegrizzlylabs/cordova-plugin-genius-scan
Then you can install the new version following the instructions below.
You can install the plugin with Cordova CLI, plugman, or using the config.yml
file.
Note for Phonegap, Ionic and other cordova-based tools:
You can usually run cordova commands from the phonegap
/ionic
cli.
ionic cordova prepare
ionic cordova plugin add ....
phonegap cordova prepare
(or, shorter phonegap prepare
)From your Cordova project folder, install the plugin with the following command:
cordova plugin add @thegrizzlylabs/cordova-plugin-genius-scan
Add the following lines to your project's config.yml file:
<plugin name="@thegrizzlylabs/cordova-plugin-genius-scan" spec="~2.3.0"/>
And run cordova prepare
.
From your Cordova project folder, you can also use plugman to install the plugin only for a specific platform.
plugman install --platform ios --project ./platforms/ios --plugin @thegrizzlylabs/cordova-plugin-genius-scan
Once the deviceReady
Cordova event has been fired, the following methods will be available:
Initialize the SDK with a valid licence key:
cordova.plugins.GeniusScan.setLicenceKey(licenceKey, onSuccess, onFail)
setLicenseKey
returns a promise that is resolved if the licence key is valid and rejected if it is not. Note that, for testing purpose, you can also use the plugin without a licence key, but it will only work for 60 seconds.
cordova.plugins.GeniusScan.scanWithConfiguration(configuration, onSuccess, onFail)
The method scanWithConfiguration
takes a configuration
parameter which can take the following options:
source
: camera
or imageUrl
(defaults to camera)sourceImageUrl
: an absolute image url, required if source
is image
. Example: file:///var/…/image.png
multiPage
: boolean (defaults to true). If true, after a page is scanned, a prompt to scan another page will be displayed. If false, a single page will be scanned.defaultFilter
: none
, blackAndWhite
, color
, photo
(by default, the filter is chosen automatically)pdfPageSize
: fit
, a4
, letter
, defaults to fit.postProcessingActions
: an array with the desired actions to display during the post processing screen (defaults to all actions). Possible actions are rotate
, editFilter
.flashButtonHidden
: boolean (default to false)defaultFlashMode
: auto
, on
, off
(default to off
)foregroundColor
: string representing a color, must start with a #
. The color of the icons, text (defaults to '#ffffff').backgroundColor
: string representing a color, must start with a #
. The color of the toolbar, screen background (defaults to black)highlightColor
: string representing a color, must start with a #
. The color of the image overlays (default to blue)menuColor
: string representing a color, must start with a #
. The color of the menus (defaults to system defaults.)It returns a promise with result
object containing:
pdfUrl
: a PDF file of the scanned pages (example: "file://.pdf")scans
: an array of scan objects. Each scan object has:
originalUrl
: The original file as scanned from the camera. "file://.jpeg"enhancedUrl
: The cropped and enhanced file, as processed by the SDK. "file://.jpeg"In case of failure, error callback function is called with an error message as a string
You can use this plugin with any Cordova-based framework, for example Ionic. The way to detect that the device is ready is slightly different, but after that you also access the plugin with cordova.plugins.GeniusScan.scanImage(imageFileUri, onSuccess, onFail)
In the controller where you need the plugin, you will have to import Platform
and pass it to the constructor, and also declare the cordova
variable so that TypeScript recognizes it.
import { Platform } from 'ionic-angular';
declare var cordova:any;
export class HomePage {
constructor(private platform: Platform) {
platform.ready().then(() => {
// platform.ready is the equivalent of the deviceReady event described above
// the plugin method is now available:
cordova.plugins.GeniusScan.scanCamera(...)
});
}
}
You must remove the x86_64 and i386 slices before submitting your application to the App Store. They are only used for the iOS smiulator and iTunes rejects any binary that contains non-ARM slices.
They can stripped out with a script like this one.
Make sure you have an ongoing contract with us. Contact us at sdk@thegrizzlylabs.com for any information.
See changelog
FAQs
Cordova Plugin for Genius Scan SDK
We found that @thegrizzlylabs/cordova-plugin-genius-scan demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.