---
title: "Kids Mode trong Kotlin Multiplatform SDK"
description: "Dễ dàng bật Kids Mode để tuân thủ chính sách Google. Không thu thập GAID hay dữ liệu quảng cáo trong Kotlin Multiplatform SDK."
---

Nếu ứng dụng Kotlin Multiplatform của bạn dành cho trẻ em, bạn phải tuân theo các chính sách của [Google](https://support.google.com/googleplay/android-developer/answer/9893335). Nếu bạn đang sử dụng Adapty SDK, một vài bước đơn giản sẽ giúp bạn cấu hình để đáp ứng các chính sách này và vượt qua quá trình kiểm duyệt của cửa hàng.

## Yêu cầu là gì? \{#whats-required\}

Bạn cần cấu hình Adapty SDK để tắt việc thu thập:

- [IDFA (Identifier for Advertisers)](https://en.wikipedia.org/wiki/Identifier_for_Advertisers) (iOS)
- [Android Advertising ID (AAID/GAID)](https://support.google.com/googleplay/android-developer/answer/6048248) (Android)
- [Địa chỉ IP](https://www.ftc.gov/system/files/ftc_gov/pdf/p235402_coppa_application.pdf)

Ngoài ra, chúng tôi khuyến nghị sử dụng customer user ID một cách cẩn thận. User ID theo định dạng `<FirstName.LastName>` chắc chắn sẽ bị coi là thu thập dữ liệu cá nhân, tương tự như việc dùng email. Với Kids Mode, thực hành tốt nhất là sử dụng các định danh ngẫu nhiên hoặc ẩn danh (ví dụ: ID đã hash hoặc UUID do thiết bị tạo ra) để đảm bảo tuân thủ.

## Bật Kids Mode \{#enabling-kids-mode\}

### Cập nhật trong Adapty Dashboard \{#updates-in-the-adapty-dashboard\}

Trong Adapty Dashboard, bạn cần tắt tính năng thu thập địa chỉ IP. Để thực hiện, hãy vào [App settings](https://app.adapty.io/settings/general) và nhấn **Disable IP address collection** trong phần **Collect users' IP address**.

### Cập nhật trong code ứng dụng \{#updates-in-your-mobile-app-code\}

Để tuân thủ các chính sách, bạn cần tắt việc thu thập Android Advertising ID (AAID/GAID) và địa chỉ IP khi khởi tạo Adapty SDK:

```kotlin showLineNumbers

override fun onCreate() {
    super.onCreate()

    val config = AdaptyConfig
        .Builder("PUBLIC_SDK_KEY")
        // highlight-start
        .withGoogleAdvertisingIdCollectionDisabled(true) // set to `true`
        .withIpAddressCollectionDisabled(true)           // set to `true`
        // highlight-end
        .build()

    Adapty.activate(configuration = config)
        .onSuccess {
            Log.d("Adapty", "SDK initialised with privacy settings")
        }
        .onError { error ->
            Log.e("Adapty", "Adapty init error: ${error.message}")
        }
}
```