0.1.0 • Published 12 months ago

@adatechnology/react-native-android-getnet-pos v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-native-getnet-pos

react-native module to work getnet-pos by react-native module

Installation

npm install react-native-getnet-pos

Usage

import {
  ledMethod,
  printView,
  printMethod,
  beeperMethod,
  cameraMethod,
  startingServices,
  checkConnections,
  cardStopConnectAntenna,
  cardStartConnectAntenna,
} from 'react-native-getnet-pos';

// ...

const result = await startingServices();
// returns always true

const connection = await checkConnections();
// returns a object { "connection": boolean }. 'true' for connected and 'false' for not connected.

const beeper = await beeperMethod('nfc'); // input type: 'ncf' | 'error' | 'digit' | 'success'
// returns a object { "beeper": boolean, "type": string }.

const leds = await ledMethod('all', true); // inputs color and turnOn:
// to color: 'all' | 'red' | 'green' | 'blue' | 'yellow'
// to turnOn: boolean
// returns a object { "color": string, "turn": boolean}.

const camera = await cameraMethod('back', 30); // inputs camera type and timeout:
// to cameraType: 'back' | 'front'
// to timeOut: a number
// returns a object { "message": string, "error": boolean}.

const startCard = await cardStartConnectAntenna('magnetic', 30); // inputs card type and timeout:
// to cardType: 'magnetic' | 'nfc' | 'chip' | 'all'
// to timeOut: a number
// on success returns a object { "pan": string,  "type": string, "track1": string, "track2": string, "track3": string, "dataExpired": string, "numberCard": number }
// on error returns a object { "message": string, "error": boolean}.

const stopCard = await cardStopConnectAntenna();
// returns a object { "stop": boolean}.

 const data = [
  {
    type: 'text',
    align: 'left',
    fontSize: 'small', // max 54 cacharacters until break line
    value: 'Printable text on the left with small size',
  },
  {
    type: 'text',
    align: 'left',
    fontSize: 'medium', // max 42 cacharacters until break line
    value: 'Printable text on the left with medium size',
  },
  {
    type: 'text',
    align: 'left',
    fontSize: 'large', // max 29 cacharacters until break line
    value: 'Printable text on the left with large size',
  },
  {
    type: 'text',
    align: 'right',
    fontSize: 'small', // max 54 cacharacters until break line
    value: 'Printable text on the right with small size',
  },
  {
    type: 'text',
    align: 'center',
    fontSize: 'small', // max 54 cacharacters until break line
    value: 'Printable text in the center with small size',
  },
  {
    type: 'image',
    align: 'center',
    fontSize: 'large',
    value: 'image',
  },
];
const printView = await printView(data); // an array with the following properties: type, align, fontSize and value.
// to type: 'image' | 'text'
// to align: 'center' | 'left' | 'right'
// to fontSize: 'large' | 'medium' | 'small'
// to value: a custom string
// returns arrays with formatted texts.

const data = [
  {
    weight: 5,
    type: 'text',
    align: 'left',
    fontSize: 'small', // max 54 cacharacters until break line
    value: 'Printable large text on the left with small size',
  },
  {
    weight: 10,
    type: 'text',
    align: 'center',
    fontSize: 'medium', // max 42 cacharacters until break line
    value: 'Printable text on the center',
  },
  {
    weight: 15,
    type: 'text',
    align: 'right',
    fontSize: 'large', // max 29 cacharacters until break line
    value: 'Printable text on the right',
  },
  {
    weight: 15,
    type: 'imagem',
    align: 'center',
    fontSize: '', // no relevance
    value: 'iiVBORw0...AP//GY5XuWK0Wk0AAAAASUVORK5CYII=',
  },
]
const printMethod = await printMethod(data); // an array with the following properties: weight, type,align, fontSize and value.
// to weight: a number
// to type: 'image' | 'barcode' | 'qrcode' | 'text'
// to align: 'center' | 'left' | 'right'
// to fontSize: 'large' | 'medium' | 'small'
// to value: a custom string
// returns a object { "printer": boolean, "message": string}.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Step to use

  • Install serviceposdigital-2.2.2-30-realses.apk
    • Option 1 Genymotion
      • Install Genymotion
      • Create Android device with 5.1 (Pixel 2)
      • Install Genymotion ARM Translator
    • Option 2 Native Emulator
JSONStreamabort-controlleracceptsacornacorn-jsxacorn-walkadd-streamagent-baseaggregate-errorajvanseransi-alignansi-escapesansi-fragmentsansi-regexansi-stylesanymatchappdirsjsargargparsearray-buffer-byte-lengtharray-ifyarray-includesarray-unionarray.prototype.findlastarray.prototype.flatarray.prototype.flatmaparray.prototype.maparray.prototype.toreversedarray.prototype.tosortedarraybuffer.prototype.slicearrifyasapast-typesastral-regexasync-limiterasync-retryavailable-typed-arraysbabel-corebabel-jestbabel-plugin-istanbulbabel-plugin-jest-hoistbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-transform-flow-enumsbabel-preset-current-node-syntaxbabel-preset-jestbalanced-matchbase64-jsbasic-ftpbefore-after-hookbig-integerblboxenbplist-parserbrace-expansionbracesbrowserslistbserbufferbuffer-frombundle-namebytescacheable-lookupcacheable-requestcall-bindcaller-callsitecaller-pathcallsitescamelcasecamelcase-keyscaniuse-litechalkchar-regexchardetchrome-launcherci-infocjs-module-lexerclean-stackcli-boxescli-cursorcli-spinnerscli-widthcliuicloneclone-deepcocollect-v8-coveragecolor-convertcolor-namecolorettecommand-existscommandercommondircompare-funccompressiblecompressionconcat-mapconcat-streamconfig-chainconfigstoreconnectconventional-changelogconventional-changelog-angularconventional-changelog-atomconventional-changelog-codemirrorconventional-changelog-conventionalcommitsconventional-changelog-coreconventional-changelog-emberconventional-changelog-eslintconventional-changelog-expressconventional-changelog-jqueryconventional-changelog-jshintconventional-changelog-preset-loaderconventional-changelog-writerconventional-commits-filterconventional-commits-parserconventional-recommended-bumpconvert-source-mapcore-js-compatcore-util-iscosmiconfigcosmiconfig-typescript-loadercreate-jestcreate-requirecross-spawncrypto-random-stringcsstypedargsdata-uri-to-bufferdata-view-bufferdata-view-byte-lengthdata-view-byte-offsetdateformatdayjsdebugdecamelizedecamelize-keysdecompress-responsededentdeep-extenddeep-isdeepmergedefault-browserdefault-browser-iddefaultsdefer-to-connectdefine-data-propertydefine-lazy-propdefine-propertiesdegeneratordeldenodeifydepddeprecationdestroydetect-newlinediffdiff-sequencesdir-globdoctrinedot-propeastasianwidthee-firstelectron-to-chromiumemitteryemoji-regexencodeurlend-of-streamenvinfoerror-exerror-stack-parsererrorhandleres-abstractes-array-method-boxes-properlyes-define-propertyes-errorses-get-iteratores-iterator-helperses-object-atomses-set-tostringtages-shim-unscopableses-to-primitiveescaladeescape-goatescape-htmlescape-string-regexpescodegeneslint-plugin-eslint-commentseslint-plugin-ft-floweslint-plugin-jesteslint-plugin-reacteslint-plugin-react-hookseslint-plugin-react-nativeeslint-plugin-react-native-globalseslint-scopeeslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsetagevent-target-shimexecaexitexpectexternal-editorfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfast-xml-parserfastqfb-watchmanfetch-blobfiguresfile-entry-cachefill-rangefinalhandlerfind-cache-dirfind-upflat-cacheflattedflow-enums-runtimeflow-parserfor-eachform-data-encoderformdata-polyfillfreshfs-extrafs.realpathfunction-bindfunction.prototype.namefunctions-have-namesgensyncget-caller-fileget-intrinsicget-package-typeget-pkg-repoget-streamget-symbol-descriptionget-urigit-raw-commitsgit-remote-origin-urlgit-semver-tagsgit-upgit-url-parsegitconfiglocalglobglob-parentglobal-dirsglobalsglobalthisglobbygopdgotgraceful-fsgraphemerhandlebarshard-rejectionhas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtaghas-yarnhasownhermes-estreehermes-parserhermes-profile-transformerhosted-git-infohtml-escaperhttp-cache-semanticshttp-errorshttp-proxy-agenthttp2-wrapperhttps-proxy-agenthuman-signalsiconv-liteieee754ignoreimage-sizeimport-freshimport-lazyimport-localimurmurhashindent-stringinflightinheritsiniinquirerinternal-slotinterpretinvariantipip-addressis-absoluteis-argumentsis-array-bufferis-arrayishis-async-functionis-bigintis-boolean-objectis-callableis-ciis-core-moduleis-data-viewis-date-objectis-directoryis-dockeris-extglobis-finalizationregistryis-fullwidth-code-pointis-generator-fnis-generator-functionis-git-dirtyis-git-repositoryis-globis-inside-containeris-installed-globallyis-interactiveis-mapis-negative-zerois-npmis-numberis-number-objectis-objis-path-cwdis-path-insideis-plain-objis-plain-objectis-regexis-relativeis-setis-shared-array-bufferis-sshis-streamis-stringis-symbolis-text-pathis-typed-arrayis-typedarrayis-unc-pathis-unicode-supportedis-weakmapis-weakrefis-weaksetis-windowsis-wslis-yarn-globalisarrayisexeisobjectissue-parseristanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsiterate-iteratoriterate-valueiterator.prototypejest-changed-filesjest-circusjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-snapshotjest-utiljest-validatejest-watcherjest-workerjetifierjoijs-tokensjs-yamljsbnjsc-androidjsc-safe-urljscodeshiftjsescjson-bufferjson-parse-better-errorsjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson-stringify-safejson5jsonfilejsonparsejsx-ast-utilskeyvkind-ofkleurlatest-versionlevenlevnlighthouse-loggerlines-and-columnsload-json-filelocate-pathlodashlodash.camelcaselodash.capitalizelodash.debouncelodash.escaperegexplodash.isfunctionlodash.ismatchlodash.isplainobjectlodash.isstringlodash.kebabcaselodash.mergelodash.mergewithlodash.snakecaselodash.startcaselodash.throttlelodash.uniqlodash.uniqbylodash.upperfirstlog-symbolslogkittyloose-envifylowercase-keyslru-cachemacos-releasemake-dirmake-errormakeerrormap-objmarkymemoize-onemeowmerge-streammerge2metrometro-babel-transformermetro-cachemetro-cache-keymetro-configmetro-coremetro-file-mapmetro-minify-tersermetro-resolvermetro-runtimemetro-source-mapmetro-symbolicatemetro-transform-pluginsmetro-transform-workermicromatchmimemime-dbmime-typesmimic-fnmimic-responsemin-indentminimatchminimistminimist-optionsmkdirpmodify-valuesmsmute-streamnatural-comparenatural-compare-litenegotiatorneo-asyncnetmasknew-github-release-urlnocachenode-abort-controllernode-dirnode-domexceptionnode-fetchnode-forgenode-int64node-releasesnode-stream-zipnormalize-package-datanormalize-pathnormalize-urlnpm-run-pathnullthrowsob1object-assignobject-inspectobject-keysobject.assignobject.entriesobject.fromentriesobject.hasownobject.valueson-finishedon-headersonceonetimeopenoptionatororaos-nameos-tmpdirp-cancelablep-limitp-locatep-mapp-trypac-proxy-agentpac-resolverpackage-jsonparent-moduleparse-jsonparse-pathparse-urlparseurlpath-existspath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpifypiratespkg-dirpossible-typed-array-namesprelude-lsprettier-linter-helperspretty-formatprocess-nextick-argspromisepromise.allsettledpromptsprop-typesproto-listprotocolsproxy-agentproxy-from-envpumppunycodepupapure-randqquerystringqueuequeue-microtaskquick-lrurange-parserrcreact-devtools-corereact-isreact-refreshreact-shallow-rendererread-pkgread-pkg-upreadable-streamreadlinerecastrechoirredentreflect.getprototypeofregenerateregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregexp.prototype.flagsregexpu-coreregistry-auth-tokenregistry-urlregjsparserrequire-directoryrequire-from-stringrequire-main-filenameresolveresolve-alpnresolve-cwdresolve-fromresolve-globalresolve.exportsresponselikerestore-cursorretryreusifyrimrafrun-applescriptrun-asyncrun-parallelrxjssafe-array-concatsafe-buffersafe-regex-testsafer-bufferschedulerselfsignedsemversemver-diffsendserialize-errorserve-staticset-blockingset-function-lengthset-function-namesetprototypeofshallow-cloneshebang-commandshebang-regexshell-quoteshelljsside-channelsignal-exitsisteransislashslice-ansismart-buffersockssocks-proxy-agentsource-mapsource-map-supportspdx-correctspdx-exceptionsspdx-expression-parsespdx-license-idssplitsplit2sprintf-jsstack-utilsstackframestacktrace-parserstatusesstdin-discarderstop-iteration-iteratorstring-lengthstring-natural-comparestring-widthstring.prototype.matchallstring.prototype.trimstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-ansistrip-bomstrip-final-newlinestrip-indentstrip-json-commentsstrnumsudo-promptsupports-colorsupports-preserve-symlinks-flagsynckittemptemp-dirtersertest-excludetext-extensionstext-tablethroatthroughthrough2titleizetmptmplto-fast-propertiesto-regex-rangetoidentifiertr46trim-newlinests-nodetslibtsutilsturbo-linux-64type-checktype-detecttype-festtyped-array-buffertyped-array-byte-lengthtyped-array-byte-offsettyped-array-lengthtypedarraytypedarray-to-bufferuglify-jsunbox-primitiveunc-path-regexundici-typesunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunique-stringuniversal-user-agentuniversalifyunpipeuntildifyupdate-browserslist-dbupdate-notifieruri-jsurl-joinutil-deprecateutils-mergev8-compile-cache-libv8-to-istanbulvalidate-npm-package-licensevaryvlqvm2walkerwcwidthweb-streams-polyfillwebidl-conversionswhatwg-fetchwhatwg-urlwhichwhich-boxed-primitivewhich-builtin-typewhich-collectionwhich-modulewhich-typed-arraywidest-linewildcard-matchwindows-releaseword-wrapwordwrapwrap-ansiwrappywrite-file-atomicwsxdg-basedirxtendy18nyallistyamlyargsyargs-parserynyocto-queue
0.1.0

12 months ago