blinkcard / blinkcard-react-native

AI-driven credit card scanning for cross-platform apps built with ReactNative.
1 stars 0 forks source link

License expired crashes app #12

Open tubibuto opened 3 weeks ago

tubibuto commented 3 weeks ago

We have the issue where we can't properly catch the exception coming from native code in our Javascript code and it results in the App crash.

2024-11-05 16:10:04.274 24961-2439  line:54                 com.taptapsend.debug                 E  License has expired on 2024-11-03
2024-11-05 16:10:04.276 24961-2439  unknown:ReactNative     com.taptapsend.debug                 E  Exception in native call
                                                                                                    com.microblink.blinkcard.licence.exception.InvalidLicenceKeyException: License has expired on 2024-11-03
                                                                                                        at com.microblink.blinkcard.licence.LicenceManager.llIIlIlIIl(line:19)
                                                                                                        at com.microblink.blinkcard.licence.LicenceManager.IllIIIllII(line:2)
                                                                                                        at com.microblink.blinkcard.MicroblinkSDK.setLicenseKey(line:2)
                                                                                                        at com.microblink.blinkcard.reactnative.MicroblinkModule.setLicense(MicroblinkModule.java:243)
                                                                                                        at com.microblink.blinkcard.reactnative.MicroblinkModule.prepareScanning(MicroblinkModule.java:175)
                                                                                                        at com.microblink.blinkcard.reactnative.MicroblinkModule.scanWithCamera(MicroblinkModule.java:78)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
                                                                                                        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
                                                                                                        at com.facebook.jni.NativeRunnable.run(Native Method)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:226)
                                                                                                        at android.os.Looper.loop(Looper.java:313)
                                                                                                        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
somyaguptagit commented 2 weeks ago

Hello, thank you for reaching out! Could you please share the license number(starting LIC0..) with us so that we can inspect it and check its validity? You can find it in the developer hub portal.

tubibuto commented 2 weeks ago

Hello, thank you for reaching out! Could you please share the license number(starting LIC0..) with us so that we can inspect it and check its validity? You can find it in the developer hub portal.

@somyaguptagit It was trial license which did expire. I think the best course of action for this issue would be to actually reject promise if this part of the code responsible for license check fails. This way RN developer on JS side would be able to properly handle this new LICENSE_ERROR type and prevent app from crashing.

What do you think?

somyaguptagit commented 2 weeks ago

Hello @tubibuto Thank you for your response! In order for our SDK to work properly, you need a valid license key so that you don't encounter any issues running it. However, we would kindly request you to contact us at support@microblink.com so that we can assist you further.

tubibuto commented 2 weeks ago

Hello @tubibuto Thank you for your response! In order for our SDK to work properly, you need a valid license key so that you don't encounter any issues running it. However, we would kindly request you to contact us at support@microblink.com so that we can assist you further.

@somyaguptagit I understand that and we updated the license with valid key, however we'd like to be able to have more control over unexpected errors coming form BlinkCard SDK side - for instance:

Currently if the license check code throws an exception, our app will crash since you don't reject promise in native code meaning we can't properly do error handling.