diff --git a/android/src/main/java/com/recaptchaenterprise/RecaptchaEnterpriseModule.java b/android/src/main/java/com/recaptchaenterprise/RecaptchaEnterpriseModule.java index 551a047..7b278cb 100644 --- a/android/src/main/java/com/recaptchaenterprise/RecaptchaEnterpriseModule.java +++ b/android/src/main/java/com/recaptchaenterprise/RecaptchaEnterpriseModule.java @@ -53,8 +53,12 @@ public void initializeRecaptcha(String siteKey, Promise promise) { } Application application = currentActivity.getApplication(); - if(!checkPlayServices()) { - promise.reject("NotAvailable", "Recaptcha is not available as no Google Play Services."); + try { + if(!checkPlayServices()) { + promise.reject("NotAvailable", "Recaptcha is not available as no Google Play Services."); + } + } catch (Exception e) { + promise.reject("NotAvailable", "Recaptcha is not available as no Google Play Services."); } Recaptcha diff --git a/ios/RecaptchaEnterprise.swift b/ios/RecaptchaEnterprise.swift index a9cad3f..6a7d501 100644 --- a/ios/RecaptchaEnterprise.swift +++ b/ios/RecaptchaEnterprise.swift @@ -13,7 +13,7 @@ class RecaptchaEnterprise: NSObject { } if let error = error { print("RecaptchaClient creation error: \(error).") - reject(String(error.errorCode), error.errorMessage, error) + reject(String(error.errorCode), error.errorMessage, error) } } } @@ -33,7 +33,7 @@ class RecaptchaEnterprise: NSObject { if let executeResult = executeResult { resolve(executeResult.recaptchaToken) } else if let error = error { - reject(String(error.errorCode), error.errorMessage, error) + reject(String(error.errorCode), error.errorMessage, error) } } } diff --git a/react-native-recaptcha-enterprise.podspec b/react-native-recaptcha-enterprise.podspec index 1586a33..fab38fc 100644 --- a/react-native-recaptcha-enterprise.podspec +++ b/react-native-recaptcha-enterprise.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" s.dependency "React-Core" - s.dependency "RecaptchaEnterprise", '18.1.1' + s.dependency "RecaptchaEnterprise", '18.5.1' # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then