- My View
The cabrillo.camera.getBarcode() method is extremely useful and powerful, but is there a way to extend the cabrillo client so the mobile app can access a device's camera to take photos rather than scanning barcodes? If it cannot be extended, does anyone know of another way to hook into a mobile device's native camera api through ServiceNow?
We're currently working on Cabrillo documentation. It's not possible to extend Cabrillo, but we do have an API for adding a file. This will allow you to take a photo that will be uploaded as a file.
Here is an example of the addFile API. Please note that this is not official documentation. https://gist.github.com/wlisac/e74bffa25e08b611d98c3321f380372c
Does this solve your use case or are you looking for a direct "Take a Photo" API?
Hi Will! Thanks for the quick response!
Yeah, I'm definitely looking for a direct 'take a photo' API. For a little background... I'm working on a concept/demo that requires a photo be taken of a new user prior to that user being verified to use the application. So the idea is that anyone assisting with the new user registration process would have an iPad or android device available from which a photo could be taken and automatically uploaded to the user record for verification. I'm trying to keep it down to a single step to keep it as simple as possible. One button that says 'Take photo', and it's done!
Do you know of any solutions that would fit this requirement?
Also, while I'm on the subject, why is the cabrillo.geolocation.getCurrentLocation() method so slow to return coordinates? The coordinates I get back have 14 decimal places. Is there a way to quickly return a set of less precise coordinates?
addFile currently requires a second step to "Take a Photo". We can investigate adding an option to go directly to "Take a Photo" to create a better UX in the future, but this isn't currently supported.
We're definitely aware of the slow getCurrentLocation() API. We're exploring ways to improve this – possibly by allowing you to specify precision.
I'll post back to this thread when we make progress on either/both requests.
Glad you're using Cabrillo. We should have official documentation available soon. Don't hesitate to reach out with more questions / feedback.
Thank you Will. I look forward to hearing from you as Cabrillo progresses.
Also very much enjoyed the sneak peak into Cabrillo at K17. Thanks so much !
Out of curiosity, about how long does it take to return a location ? 5s ? 10s ? 30s ? Just want to set expectations on the current API here at the home site...
I would say it's between 5 and 10 seconds. You could alleviate this time burden by loading coordinates in a cache at certain intervals, allowing the user to view the cached coordinates very quickly. Of course this would do you no good if you're looking to calculate coordinates while the user is in a moving vehicle.