on 03-05-2017 6:56 PM
Hi All,
I have created a custom UI5 app using Barcode scanner plugin for github. The application works as expected when used as .apk or .ipa. However after integrating the application into fiori Launchpad and accessed through Fiori Client on iOS, the Scan button on which camera is called to scan Barcode/QR code is not working.
Is there any specific settings or configuration needs to be done for using in Fiori Client. I am attaching my index.html, scan code, project structure.
However i also have question that after uploading the project in ABAP Repository,i cannot see cordova.js file. Do i have to include it manually in my project structure?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />
<title>Asset Scan</title>
<script
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap" data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal" data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async" data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-frameOptions="trusted"
data-sap-ui-resourceroots='{
"com.ega": "./"
}'>
</script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="util/datajs-1.0.1.min.js"></script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script>
sap.ui.getCore().attachInit(
function() {
sap.ui.define(
[ "sap/m/Shell", "sap/ui/core/ComponentContainer" ],
function(Shell, ComponentContainer) {
async:true;
new Shell({
showLogout : false,
app : new ComponentContainer({
height : "100%",
name : "com.ega"
})
}).placeAt("content");
});
});
</script>
</head>
<body class="sapUiBody" id="content">
<img id="ajax_loader" src="assetscan/images/Home.png"
style="width: 100%; position: absolute; top: 0; left: 0;"></img>
<img id="ajax_loader1" src="assetscan/images/loading.gif"
style="POSITION: absolute; TOP: 65%; LEFT: 10%"></img>
</body>
</html>
Scan code
onBarcodeScan : function() {
oStyle = "";
cordova.plugins.barcodeScanner
.scan(
function(result) {
barcode_result = result.text;
var remStrLngth = barcode_result.length - 6;
var oAssetno = barcode_result
.substring(
remStrLngth,
barcode_result.length);
oThis1
.onPopupImage(oAssetno);
},
function(error) {
sap.m.MessageToast
.show("Scanning failed:");
});
}
Project Structure
Regards,
Dhruv
Hi All,
I have not found any solution for this, however as a workaround i asked mobile developer for this issue, and he created some callback function and then calling the barcode plugin.
Regards,
Dhruv
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhruv,
Did you solved the issue?
Regards,
Aniu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.