Skip to content

Androidセットアップ

GitHub

Create an Android mobile application key in Google Cloud reCAPTCHA. Register the package name used by your Capacitor app, then set the key in capacitor.config.ts.

Android uses Google’s mobile reCAPTCHA SDK. Regular, non-Enterprise reCAPTCHA v3 is only available on Web in this plugin; enterprise: false is rejected on Android.

import type { CapacitorConfig } from '@capacitor/cli';
import '@capgo/capacitor-recaptcha';
const config: CapacitorConfig = {
plugins: {
Recaptcha: {
androidSiteKey: 'ANDROID_SITE_KEY',
},
},
};
export default config;

プラグインには、Google Android reCAPTCHA依存関係が含まれます:

com.google.android.recaptcha:recaptcha:18.8.0

GoogleのAndroid reCAPTCHA SDKは、消費者アプリでコアライブラリをデスガージングする必要があります。プラグインは自動的に有効にし、 npx cap sync android コピー

com.android.tools:desugar_jdk_libs:2.1.5

必要な場合にGoogleの__CAPGO_KEEP_0__の新しいリリースを固定することができます。 依存関係のデスガージングを上書きできます。 recaptchaVersion when you need to pin a newer Google SDK release. You can override the desugaring dependency with desugarJdkLibsVersion.

セクション「実行」

コピー
import { Recaptcha } from '@capgo/capacitor-recaptcha';
const { token } = await Recaptcha.execute({
action: 'checkout',
timeout: 10000,
});

Androidセットアップから続けてください

__CAPGO_KEEP_0__が使用されている場合 Android セットアップ 認証とアカウントフローの計画に使用し、__CAPGO_KEEP_0__と接続する capgo/capacitor-recaptcha capgo/capacitor-recaptchaのネイティブ機能 capgo/capacitor-social-login capgo/capacitor-social-loginの実装詳細 capgo/capacitor-passkey capgo/capacitor-passkeyの実装詳細 capgo/capacitor-native-biometric capgo/capacitor-native-biometricの実装詳細 2要素認証 __CAPGO_KEEP_0__の2要素認証の実装詳細です。