klippa-app / react-native-klippa-scanner-sdk

A React Native plugin to use the Klippa Scanner SDK
MIT License
2 stars 0 forks source link

Upgrade to support Android 2.0.6 and iOS 0.4.10 of KlippaScanner SDK. #17

Closed RobinFarmer closed 2 years ago

RobinFarmer commented 2 years ago

This PR includes the changes to support the newest iOS and Android SDK's.

Users can now use the following:

Whether the Timer is allowed, if not it hides the button entirely.

Timer: {allowed: true, enabled: true, duration: 0.4},

ImageLimit?: number; & ImageLimitReachedMessage?: string; can now also be used on both Android and iOS.

We also now return whether the Timer was enabled or not so the user can store this in device. For example:

KlippaScannerSDK.getCameraResult({
    License: "your-license",
    Timer: {allowed: true, enabled: true, duration: 0.4},
    ImageLimit: 2,
    ImageLimitReachedMessage: "Limiet bereikt",
}).then((res) => {
    Alert.alert("Timer was enabled " + res.TimerEnabled);
}).catch((rej) => {
   console.log(rej);
    Alert.alert(rej.toString());
})