David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Starting the Barcode Scanner as the app loads.

Hi

Is it possible to start the Barcode Scanner as the app loads.

I have tried including:

Invoke Service Datasource: mobilebarcode1

At startScreen "Load" and "Before Load" but the startScreen just loads.

Thanks

David

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Starting the Barcode Scanner as the app loads.

Hi David,

You can try Page Show event.
Make sure you call service on the start screen.
Run code on browser to see if there are errors in JS code (F12).
Please, note this can work on device only.

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Starting the Barcode Scanner as the app loads.

Hi Katya

When using:

startScreen Page show Invoke Service Datasource: mobilebarcode1

We get an error when testing in browser:

TypeError Cannot read property 'barcodeScanner' of undefined

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Starting the Barcode Scanner as the app loads.

All phone gap(cordova) plugins run on Device only. Not in the browser.
So things like childbrowser, contacts, barcode scanner etc.

I always test for phonegap b4 calling the function. Avoids errors when browser testing...

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Starting the Barcode Scanner as the app loads.

Hi Neil, I learnt that the hard way..

However in this case Katya asked me to run the code on the browser to see if there were any errors...

which resulted in

TypeError Cannot read property 'barcodeScanner' of undefined

I had first tried running in the phone but the barcode scanner doesn't open using any of these:

Load
Before Load
Page Show

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Starting the Barcode Scanner as the app loads.

Hello! You need to install app on device to get it working. It won't work in browser.

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Starting the Barcode Scanner as the app loads.

Hi Marina

As previously stated

I have tried running in the phone but the barcode scanner doesn't open using any of these:

Load
Before Load
Page Show

It will work if I call it from a button... but I want the scanner to open as soon as the app loads.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Starting the Barcode Scanner as the app loads.

Could you please try one more event - Device ready?

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Starting the Barcode Scanner as the app loads.

That works a treat, fantastic, thank you.

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Starting the Barcode Scanner as the app loads.

Also you can use JS to call Scanner service.

I Use
codesetTimeout(function(){YOURSERVICENAME.execute({});},1500);//Start auto scanner service/code

This works on load,show,button, code, etc..

Return to “Issues”