Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ private Task<Void> activate(Map<String, Object> arguments) {
PlayIntegrityAppCheckProviderFactory.getInstance());
break;
}
case recaptchaEnterprise:
{
FirebaseAppCheck firebaseAppCheck = getAppCheck(arguments);
firebaseAppCheck.installAppCheckProviderFactory(
ReCaptchaEnterpriseAppCheckProviderFactory.getInstance());
break;
}
}
taskCompletionSource.setResult(null);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ - (void)configure:(FIRApp *)app
self.delegateProvider = [[FIRDeviceCheckProvider alloc] initWithApp:app];
}
}

if ([providerName isEqualToString:@"recaptchaEnterprise"]) {
self.delegateProvider = [[FIRReCaptchaEnterpriseProvider alloc] initWithApp:app];
}
}

- (void)getTokenWithCompletion:(nonnull void (^)(FIRAppCheckToken *_Nullable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export 'package:firebase_app_check_platform_interface/firebase_app_check_platfor
AppleAppAttestProvider,
AppleAppAttestWithDeviceCheckFallbackProvider,
ReCaptchaEnterpriseProvider,
ReCaptchaV3Provider;
AndroidReCaptchaEnterpriseProvider,
AppleReCaptchaEnterpriseProvider;
export 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebaseException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ class AndroidDebugProvider extends AndroidAppCheckProvider {
class AndroidPlayIntegrityProvider extends AndroidAppCheckProvider {
const AndroidPlayIntegrityProvider() : super('playIntegrity');
}

/// ReCaptcha Enterprise provider for Android.
///
/// See documentation: <link to docs>
class AndroidReCaptchaEnterpriseProvider extends AndroidAppCheckProvider {
const AndroidReCaptchaEnterpriseProvider(this.siteKey)
: super('recaptchaEnterprise');
final String siteKey;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,12 @@ class AppleAppAttestWithDeviceCheckFallbackProvider
const AppleAppAttestWithDeviceCheckFallbackProvider()
: super('appAttestWithDeviceCheckFallback');
}

/// ReCaptcha Enterprise provider for Apple platforms.
///
/// See documentation: <link to docs>
class AppleReCaptchaEnterpriseProvider extends AppleAppCheckProvider {
const AppleReCaptchaEnterpriseProvider(this.siteKey)
: super('recaptchaEnterprise');
final String siteKey;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@ void main() {
},
skip: defaultTargetPlatform != TargetPlatform.iOS,
);

test(
'recaptchaEnterprise on Android',
() async {
await expectLater(
FirebaseAppCheck.instance.activate(
providerAndroid: const AndroidReCaptchaEnterpriseProvider(
siteKey: '6Lemcn0dAAAAABLkf6aiiHvpGD6x-zF3nOSDU2M8',
),
),
completes,
);
},
skip: defaultTargetPlatform != TargetPlatform.android,
);

test(
'recaptchaEnterprise on iOS',
() async {
await expectLater(
FirebaseAppCheck.instance.activate(
providerApple: const AppleReCaptchaEnterpriseProvider(
siteKey: '6Lemcn0dAAAAABLkf6aiiHvpGD6x-zF3nOSDU2M8',
),
),
completes,
);
},
skip: defaultTargetPlatform != TargetPlatform.iOS,
);
},
);
}
Loading