cancel
Showing results for 
Search instead for 
Did you mean: 

Cordova is undefined, SAP Fiori Client, Fiori Launchpad

Former Member
0 Kudos

Hello,

I've created an application, which scans BarCodes. When I add target URL of application directly to the SAP Fiori Client, everything works fine. Cordova plugins are available as I expected. When I add url of Fiori Launchpad to SAP Fiori Client and I run application from FLP, cordova is undefined. I found similar problem here, however there is mentioned that in that case I need to use window.parent.cordova. Problem is that window.parent.cordova is undefined as well. I am not using semantic object, only url to index.html of application. Could it be a reason that I don't see plugins? Is there any solution for a such situation?

I've tried add folder with plugins built by Hybrid Toolkit in SAP Web IDE to the project, with cordova.js file, and I added below line into index.html:

<scripttype="text/javascript"charset="utf-8"src="cordova.js"></script> 

Then cordova plugins are available but after running scan nothing happens. I suppose it is because event deviceready doesn't fire at all:

document.addEventListener("deviceready", onDeviceReady, false);

Thanks in advance for your help.

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

kiran_jakkaraju
Contributor
0 Kudos

Cordova plugins will work only in a Mobile Device and will not run in a PC's Browser.

Either you have to run your app in Fiori Client in a mobile device or an emulator (in a PC).

pawel_kedzia
Explorer
0 Kudos

I wrote that I run it from SAP Fiori Client - It is mobile application, so I execute it on mobile device.