This is a migrated thread and some comments may be shown as answers.

Access BarcodeScanner from InAppBrowser

2 Answers 181 Views
Feedback & Suggestions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Travis
Top achievements
Rank 1
Travis asked on 12 Jun 2017, 09:33 PM

Hello,

Is there any way to access the BarcodeScanner from the In-App-Browser Plugin. I cant seem to get the cordova barcode scanner to pull up. I am currently running my webapp through our admin site into the cordova application using In-App-Browser Plugin. But i cant seem to access anything else. When i click on the scanner button I console log a message that it was clicked but the scanner seems to get skipped over or is not coming up. No error messages. Any help would be appreciated.

 

- Travis

2 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 15 Jun 2017, 03:35 PM
Hello Travis,

My assumption is that your app is opening an existing web admin interface via the InAppBrowser. 

However, I am not entirely sure if you would like your remote web page to have a button that opens the QR/barcode scanner on the device in the app, is this correct? If this is the case I am afraid that this cannot be achieved and you will need to add the logic in the mobile app, for example, you may point the user to open a menu in the app an access the scanner. 

The reason for this limitation is that the web browser is isolated from the app and cannot influence its behavior (as far as I am aware). Unfortunately, there is no meaningful way for the in app browser and the app to communicate (for example you can examine this issue in the Cordova framework). 

One idea which you may try with the existing options which may also come in handy in some case is to:

- execute a script with the plugin methods and its API (for example, executeScript)
- pass data from between pages or something similar to the approach shown in this blog post 

Make note for any possible security implications as with any browser requests or redirects, the same security problems as with other browsers apply to the InAppBrowser, especially if you need to make some modifications to the current web pages. 

I also advocate that you use a more straightforward approach by using a dedicated menu in the mobile app because of the following. 

If your app is going to be submitted to the Apple App Store it may not be approved if it only opens a web page inside an app. Apple require that applications give a different look and feel by accessing native device capabilities and options available on mobile devices. You can examine on this matter the following list of common rejections (see Web clippings, content aggregators, or a collections of links) or the official guidelines. 
 
I hope this answers your question. 
 
Regards,
Anton Dobrev
Progress Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Travis
Top achievements
Rank 1
answered on 15 Jun 2017, 06:22 PM
I was able to not use inappbrowser by changing a config.xml setting and to use the phones native capabilities. Thanks for the advice. Took a little more digging than usual.
Tags
Feedback & Suggestions
Asked by
Travis
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Travis
Top achievements
Rank 1
Share this question
or