- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2018 06:11 AM
Hi All,
To give a bit of background on my question, I have successfully used Cabrillo in my Service Portal custom widgets to invoke the camera for scanning the barcodes. However, service portal is not working in the mobile app in the Android 4.4 devices.
Because of this reason, and to get the same look and feel of the Service Portal pages in the Platform view I'm trying to use UI Pages with AngularJS. As part of my POC, I'm trying to use barcode scanning functionality of Cabrillo in the platform UI Page.
I have created an Angular controller in the UI page and passed Cabrillo in the parameters as below. But getting injector error in the console.
Controller function outline in the Client Script of UI Page:
sampleApps.controller('mainCtrl', ['$scope', 'cabrillo',function($scope, cabrillo){
cabrillo.camera.getBarcode().then(function(barcode) {
if (barcode) {
alert(barcode);
console.log('Scanned barcode.', barcode);
} else {
console.log('User cancelled scanning barcode.');
}
}, function(error) {
console.log('Failed to scan barcode.', error);
});
}]);
Error in the console:
Error: [$injector:unpr] http://errors.angularjs.org/1.2.20/$injector/unpr?p0=cabrilloProvider%20%3C-%20cabrillo
My questions are
- how to use Cabrillo in the platform UI Page.
- If using Cabrillo in the platform UI Page is not possible, is there any other way to invoke barcode scanning functionality from the UI Page. ( I know we can use barcode field attribute in the back end view. But I'm trying to use UI Pages).
Any help on this is very much appreciated.
Thanks!
Karteek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2019 10:01 PM
ServiceNow HI support confirmed that Calibro js plugin was inbuilt into the portal, and there is no available mechanism to use it into UI Pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2018 10:14 AM
Hello karteek, did you manage to make this work? how did you do it? I'm trying to read barcode on load of an ui page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2019 04:47 PM
Hi Leonardo, ServiceNow HI support confirmed that Calibro js plugin was inbuilt into the portal, and there is no available mechanism to use it into UI Pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2019 03:00 PM
Hello I was able to make this work in a widget but it only works with the camera in the back of the device, is there any way to make this work with the front camera?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2019 10:01 PM
ServiceNow HI support confirmed that Calibro js plugin was inbuilt into the portal, and there is no available mechanism to use it into UI Pages.