If you want to add material to the layout of your scanner, you need to write the code in the plugin itself.
YOU CANNOT INTERACT WITH THE SCANNER FROM JS.
In fact, the plugin you use uses cordova.exec to start scanning the scanner by passing its arguments.
- For Android, you just need to know Java and some XML.
- For iOS, you need to know Objective-C / Swift.
For Android, you can have 4 files to modify:
- plugin.xml: home of all your dependencies
- Your_Activity.java: a java file that allows you to interact with the scanner itself by invoking buttons, text images, layouts, etc.
- Your_Main.java: a java file that receives and returns parameters from the js file of your plugin.
- Your_Layout.xml: xml file in res / layout, which consists of xml attributes interpreted by java
In addition, I found two good plugins for cordon-ion applications from GitHub:
- Phonegap / Phonegap-plugin-barcodescanner
- tjwoon / csZBar
And there dear, Scandit, which solves all your problems for about $ 200 a month, check the prices for each proposed solution.
If you use your SDK, you can interact with the scanner from js files because of their work, but this is the only company I know for this. (maybe ManateeWorks ...)
As part of this part, I have been doing this since mid-July to give you ideas.
I am currently creating a ANDROID scanner layout for my ionic application. Here you can find the GitHub repository, I unlocked it from tjwoon csZBar, and I added some things I need for the ionic app.
I canโt guarantee anything, but Iโm sure that I will soon implement the iOS layout (at least I will try), and, unfortunately, I really donโt know mobile programming for Android and iOS.
Here is a screenshot of the layout
I created a โtab barโ consisting of 3 image buttons, a โtop barโ consisting of text views and image buttons. A scanner is embedded between the two.
Pop-up windows will appear for application functions that pause the scanner and respond to click events.
See the README and Java files (csZBar / android /) for more information.
Feel free to ask questions and / or check my code.
Attention!
- 1) It is currently being developed, so use it at your own risk (use the branch wizard, do not develop).
- 2) I only modified part of Android, not iOS!
- 3) It does not work for a Windows phone ...