in android/src/main/java/com/google/recaptchaenterprisereactnative/RecaptchaEnterpriseReactNativeModule.kt [53:66]
fun fetchClient(siteKey: String, promise: Promise) {
GlobalScope.launch {
try {
recaptchaClient = Recaptcha.fetchClient(application, siteKey)
promise.resolve(null)
} catch (exception: Exception) {
if (exception is RecaptchaException) {
promise.reject(exception.errorCode.toString(), exception.errorMessage, exception)
} else {
promise.reject(exception)
}
}
}
}