Claudio
Posts: 0
Joined: Thu May 31, 2012 9:29 pm

How can I detect if my app is running in webpreview mode?

Hi,
I would like to know if there is a way to detect if the app is running in webpreview and/or in a device (android/iphone) and if is in debug mode or not.

Thanks

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How can I detect if my app is running in webpreview mode?

What do you mean by webpreview mode..? Are you referring to the phone frame that you see when testing..?

Claudio
Posts: 0
Joined: Thu May 31, 2012 9:29 pm

How can I detect if my app is running in webpreview mode?

Yes, sorry if I was not clear.
I need a way to detect if the app is running inside a device or in the desktop browser.

This because I use the BarCode Scanner Service and when the app runs inside the browser, obviously it does not work.
So I want implement a workround to detect such situation and skip the service call and return a fake value so I can continue to test the app.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How can I detect if my app is running in webpreview mode?

You can try to invoke the barcode scanner and if it returns an error (or undefined), you are running in a web browser.

Claudio
Posts: 0
Joined: Thu May 31, 2012 9:29 pm

How can I detect if my app is running in webpreview mode?

Just for you know, I used the "echo" option on the barcode scan service when I test and debug my App inside the browser.
Obviously I switch off the echo mode when I deploy the app on the device

Return to “Issues”