created a scanBarcode() function in the appServices service