cancel
Showing results for 
Search instead for 
Did you mean: 

Barcode scanner not working thorugh Launchpad in Fiori Client

dhruv_shah3
Active Contributor
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

dhruv_shah3
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Dhruv,

Did you solved the issue?

Regards,

Aniu

Kevin_SAP
Advisor
Advisor
0 Kudos

When you open the tile on the Launchpad, does it open in a new window when testing on Desktop or Mobile browser?

Regards,

Kevin

Former Member
0 Kudos

Have exactly the same problem... and yes, when we open the tile on the launchpad, it opens in a new window.

And if in the Firori client we use the direct URL to the app (and NOT the URL of the launchpad) it works like a charm...