diff --git a/packages/console/src/assets/docs/guides/native-android-java/README.mdx b/packages/console/src/assets/docs/guides/native-android-java/README.mdx index 59d10d4f7..166730616 100644 --- a/packages/console/src/assets/docs/guides/native-android-java/README.mdx +++ b/packages/console/src/assets/docs/guides/native-android-java/README.mdx @@ -12,11 +12,13 @@ import Step from '@/mdx-components/Step'; The minimum supported Android API is level 24 -Add the `mavenCentral()` repository to your Gradle project build file: +Before you add Logto Android SDK, ensure `mavenCentral()` is added to your repository configuration in the Gradle project build file: ```kotlin -repositories { - mavenCentral() +dependencyResolutionManagement { + repositories { + mavenCentral() + } } ``` @@ -24,10 +26,23 @@ Add Logto Android SDK to your dependencies: ```groovy dependencies { - implementation 'io.logto.sdk:android:1.0.0' + implementation 'io.logto.sdk:android:1.1.3' } ``` +Since the SDK needs internet access, you need to add the following permission to your `AndroidManifest.xml` file: + +```xml + + + + + + + +``` + {`import io.logto.sdk.android.LogtoClient; import io.logto.sdk.android.type.LogtoConfig; +import io.logto.sdk.core.constant.PromptValue; -public class MainActivity extends AppCompatActivity { - private LogtoClient logtoClient; +// ...other codes +LogtoConfig logtoConfig = new LogtoConfig( + "${props.endpoint}", + "${props.app.id}", + null, + null, + true, + PromptValue.CONSENT +); - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - LogtoConfig logtoConfig = new LogtoConfig( - "${props.endpoint}", - "${props.app.id}", - null, - null, - true - ); - - logtoClient = new LogtoClient(logtoConfig, getApplication()); - } -}`} +LogtoClient logtoClient = new LogtoClient(logtoConfig, getApplication());`} diff --git a/packages/console/src/assets/docs/guides/native-android-kt/README.mdx b/packages/console/src/assets/docs/guides/native-android-kt/README.mdx index 6b940e51d..a6b6a3edd 100644 --- a/packages/console/src/assets/docs/guides/native-android-kt/README.mdx +++ b/packages/console/src/assets/docs/guides/native-android-kt/README.mdx @@ -12,11 +12,13 @@ import Step from '@/mdx-components/Step'; The minimum supported Android API is level 24 -Add the `mavenCentral()` repository to your Gradle project build file: +Before you add Logto Android SDK, ensure `mavenCentral()` is added to your repository configuration in the Gradle project build file: ```kotlin -repositories { - mavenCentral() +dependencyResolutionManagement { + repositories { + mavenCentral() + } } ``` @@ -24,10 +26,23 @@ Add Logto Android SDK to your dependencies: ```kotlin dependencies { - implementation("io.logto.sdk:android:1.0.0") + implementation("io.logto.sdk:android:1.1.3") } ``` +Since the SDK needs internet access, you need to add the following permission to your `AndroidManifest.xml` file: + +```xml + + + + + + + +``` +