thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 39 forks source link

How to handle the Cancel event #82

Closed rajiniyadav closed 6 months ago

rajiniyadav commented 6 months ago

Hello,

I need to handle if user clicked cancel or quit the Genius camera? I need show some popup/log the data to server.

Could you pls help on this

Thanks

guillaume-tgl commented 6 months ago

Do you have a native integration or do you use a crossplatform plugin? If it's a native integration, for which platform do you need help? Android, iOS, both?

rajiniyadav commented 6 months ago

I'm using native android using Java.

rajiniyadav commented 6 months ago

Following demo-simple

guillaume-tgl commented 6 months ago

Ok, then, you can check if a user cancels a ScanFlow by checking if the resultCode is RESULT_CANCELED in the onActivityResult callback. Here is where you would check this in the SimpleDemo: https://github.com/thegrizzlylabs/geniusscan-sdk-demo/blob/master/android/demo-simple/src/main/java/com/geniusscansdk/simpledemo/MainActivity.java#L123

rajiniyadav commented 6 months ago

Thanks a lot, its works.

kristabel-wong commented 2 months ago

i'm using react-native and need to handle a Cancel event. Could you assist please?

guillaume-tgl commented 1 month ago

i'm using react-native and need to handle a Cancel event. Could you assist please?

You can catch the exceptions from RNGeniusScan.scanWithConfiguration and check if the error code is E_SCAN_CANCELED