The Client Library offers a method for scanning physical receipts via the mobile device camera.
Use the TikiClient.scan
method to trigger the receipt scanning process. It uses the native camera APIs in Android and iOS.
The result of this method changes based on the platform:
- Android: The method accepts a callback function, which is invoked with a
Bitmap?
parameter containing the data of the captured image. If the image capture is canceled by the user, the parameter will benull
. - iOS: The method takes a callback function as its parameter. This callback is called with a
UIImage?
, which contains the captured image data. If the image capture is canceled by the user, theUIImage?
will benil
. - Capacitor: The method returns a
Promise
that resolves to the base64 representation of the capturedimage/jpg
. If the capture is canceled by the user, thePromise
resolves toundefined
.
TikiClient.scan{ image ->
// use image
}
TikiClient.scan{ image in
// use image
}
const image = await TikiClient.scan();
// use image