Skip to Content
0

Barcode scanner not working thorugh Launchpad in Fiori Client

Mar 05, 2017 at 06:56 PM

347

avatar image
Former Member

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

capture1.jpg (38.1 kB)
capture2.jpg (35.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Jan 25 at 03:44 PM
0

Hi Dhruv,

Did you solved the issue?

Regards,

Aniu

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

Regards,

Kevin

0
Former Member

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...

0
avatar image
Former Member May 07 at 11:13 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded