### Configure LevelPlay MetaData for children-directed apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Set the device ID opt-out and COPPA flags before initializing the LevelPlay SDK. ```java LevelPlay.setMetaData("is_deviceid_optout","true"); LevelPlayPrivacySettings.setCOPPA(true); ``` -------------------------------- ### Configure LevelPlay MetaData for mixed-audience apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Set the device ID opt-out, COPPA, and Google Family Self-Certified SDKs flags before initializing the LevelPlay SDK for children or unknown-age users. ```java LevelPlay.setMetaData("is_deviceid_optout","true"); LevelPlayPrivacySettings.setCOPPA(true); LevelPlay.setMetaData("Google_Family_Self_Certified_SDKS","true"); ``` -------------------------------- ### Set GDPR consent for LevelPlay SDK 9.5.0+ (Unity) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this method to set the GDPR consent status for Unity. ```csharp LevelPlayPrivacySettings.SetGDPRConsent(true); ``` -------------------------------- ### Set CCPA consent for Unity (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API for Unity when the user has opted out of the sale or sharing of their personal information. ```csharp LevelPlayPrivacySettings.SetCCPA(true); ``` -------------------------------- ### Set individual network GDPR consents for LevelPlay SDK 9.4.0 (Unity) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Pass a dictionary of network keys to bool values to set individual network consent. This replaces all previously stored consents. ```csharp Dictionary consents = new Dictionary { { "UnityAds", true }, { "IronSource", false } }; LevelPlayPrivacySettings.SetGDPRConsents(consents); ``` -------------------------------- ### Add AppSet and Ads Identifier dependencies for mixed-audience apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Include the required Google Play services dependencies in your Gradle configuration. ```gradle implementation 'com.google.android.gms:play-services-appset:16.0.0' implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' ``` -------------------------------- ### LevelPlayPrivacySettings.setGDPRConsents(consents) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Sets GDPR consent individually for each network using a map of network keys to Boolean values. This API is used for LevelPlay SDK version 9.4.0. Each call replaces all previously stored GDPR consents. ```APIDOC ## LevelPlayPrivacySettings.setGDPRConsents(consents) ### Description Sets GDPR consent individually for each network using a map of network keys to Boolean values. This API is used for LevelPlay SDK version 9.4.0. Each call replaces all previously stored GDPR consents. ### Method setGDPRConsents ### Parameters - **consents** (map of string to boolean) - Required - A map of network keys to Boolean values indicating whether the user has granted each network permission to collect and share data. ### Request Example ``` val consents = mapOf( "UnityAds" to true, "IronSource" to false) LevelPlayPrivacySettings.setGDPRConsents(consents) ``` ### Response No response is returned. ``` -------------------------------- ### LevelPlayPrivacySettings.setCOPPA (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Flags an end-user as child-directed across all supported networks. Use this API for LevelPlay SDK version 9.4.0 and higher. ```APIDOC ## LevelPlayPrivacySettings.setCOPPA ### Description Flags an end-user as child-directed across all supported networks. Use this API for LevelPlay SDK version 9.4.0 and higher. ### Method setCOPPA ### Parameters - **coppa** (boolean) - Required - Set to true to indicate the end-user is a child. ### Code Examples #### Android ```java LevelPlayPrivacySettings.setCOPPA(true) ``` #### iOS ```objectivec LPMPrivacySettings.setCOPPA(true) ``` #### Unity ```csharp LevelPlayPrivacySettings.SetCOPPA(true); ``` #### Flutter ```dart LevelPlayPrivacySettings.setCOPPA(true); ``` #### React Native ```javascript LevelPlayPrivacySettings.setCOPPA(true); ``` ``` -------------------------------- ### LevelPlay.setMetaData (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for flagging an end-user as child-directed per network. Use for LevelPlay SDK version 9.3.0 and lower. ```APIDOC ## LevelPlay.setMetaData ### Description Deprecated API for flagging an end-user as child-directed per network. Use for LevelPlay SDK version 9.3.0 and lower. ### Method setMetaData ### Parameters - **key** (string) - Required - The metadata key, e.g., "is_child_directed". - **value** (string or array) - Required - The value indicating child-directed status: "true"/"false" or ["true"]/["false"]. ### Code Examples #### Android ```java // If the end-user is a child LevelPlay.setMetaData("is_child_directed","true"); // If the end-user isn't a child LevelPlay.setMetaData("is_child_directed","false"); ``` #### iOS ```objectivec // If the end-user is a child [LevelPlay setMetaDataWithKey:@"is_child_directed" value:@"YES"]; // If the end-user isn't a child [LevelPlay setMetaDataWithKey:@"is_child_directed" value:@"NO"]; ``` #### Unity ```csharp // If the end-user is a child LevelPlay.setMetaData("is_child_directed","true"); // If the end-user isn't a child LevelPlay.setMetaData("is_child_directed","false"); ``` #### Flutter ```dart // If the end-user is a child LevelPlay.setMetaData({'is_child_directed': ['true']}); // If the end-user isn't a child LevelPlay.setMetaData({'is_child_directed': ['false']}); ``` #### React Native ```javascript // If the end-user is a child LevelPlay.setMetaData('is_child_directed', ['true']); // If the end-user isn't a child LevelPlay.setMetaData('is_child_directed', ['false']); ``` ``` -------------------------------- ### Set child-directed metadata for Android (SDK 9.3.0-) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Legacy API for Android to set child-directed status via metadata. ```java LevelPlay.setMetaData("is_child_directed","true"); ``` ```java LevelPlay.setMetaData("is_child_directed","false"); ``` -------------------------------- ### LevelPlayPrivacySettings.setGDPRConsent(true) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Sets the GDPR consent status for the user. This API is used for LevelPlay SDK version 9.5.0 and higher. ```APIDOC ## LevelPlayPrivacySettings.setGDPRConsent(true) ### Description Sets the GDPR consent status for the user. This API is used for LevelPlay SDK version 9.5.0 and higher. ### Method setGDPRConsent ### Parameters - **consent** (boolean) - Required - Indicates whether the user has granted consent. ### Request Example ``` LevelPlayPrivacySettings.setGDPRConsent(true) ``` ### Response No response is returned. ``` -------------------------------- ### Set COPPA flag for Unity (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API to flag an end-user as child-directed in Unity for SDK version 9.4.0 and higher. ```csharp LevelPlayPrivacySettings.SetCOPPA(true); ``` -------------------------------- ### Set GDPR consent for LevelPlay SDK 9.5.0+ (Android) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this method to set the GDPR consent status for Android. ```java LevelPlayPrivacySettings.setGDPRConsent(true) ``` -------------------------------- ### Set child-directed metadata for iOS (SDK 9.3.0-) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Legacy API for iOS to set child-directed status via metadata. ```objective-c [LevelPlay setMetaDataWithKey:@"is_child_directed" value:@"YES"]; ``` ```objective-c [LevelPlay setMetaDataWithKey:@"is_child_directed" value:@"NO"]; ``` -------------------------------- ### Set individual network GDPR consents for LevelPlay SDK 9.4.0 (Android) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Pass a map of network keys to Boolean values to set individual network consent. This replaces all previously stored consents. ```kotlin val consents = mapOf( "UnityAds" to true, "IronSource" to false) LevelPlayPrivacySettings.setGDPRConsents(consents) ``` -------------------------------- ### Set consent for LevelPlay SDK 9.3.0 and lower (Android) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use these methods to set the global consent flag for older SDK versions. ```java LevelPlay.setConsent(true); ``` ```java LevelPlay.setConsent(false); ``` -------------------------------- ### LevelPlay.setMetaData (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for setting CCPA consent status in LevelPlay SDK version 9.3.0 and lower. Use the 'do_not_sell' key with values 'true' or 'false' (or 'YES'/'NO' for iOS) to indicate whether the user has opted out of the sale or sharing of their personal information. ```APIDOC ## LevelPlay.setMetaData ### Description Deprecated API for setting CCPA consent status in LevelPlay SDK version 9.3.0 and lower. Use the 'do_not_sell' key with values 'true' or 'false' (or 'YES'/'NO' for iOS) to indicate whether the user has opted out of the sale or sharing of their personal information. ### Method setMetaData ### Parameters - **key** (string) - Required - The metadata key, must be 'do_not_sell'. - **value** (string or array) - Required - Set to 'true' (or 'YES' for iOS) if the user has opted out, or 'false' (or 'NO' for iOS) if the user consents. ### Code Examples #### Android - Opted out ``` LevelPlay.setMetaData("do_not_sell","true"); ``` #### Android - Consented ``` LevelPlay.setMetaData("do_not_sell","false"); ``` #### iOS - Opted out ``` [LevelPlay setMetaDataWithKey:@"do_not_sell" value:@"YES"]; ``` #### iOS - Consented ``` [LevelPlay setMetaDataWithKey:@"do_not_sell" value:@"NO"]; ``` #### Unity - Opted out ``` LevelPlay.setMetaData("do_not_sell","true"); ``` #### Unity - Consented ``` LevelPlay.setMetaData("do_not_sell","false"); ``` #### Flutter - Opted out ``` LevelPlay.setMetaData({'do_not_sell': ['true']}); ``` #### Flutter - Consented ``` LevelPlay.setMetaData({'do_not_sell': ['false']}); ``` #### React Native - Opted out ``` LevelPlay.setMetaData('do_not_sell', ['true']); ``` #### React Native - Consented ``` LevelPlay.setMetaData('do_not_sell', ['false']); ``` ``` -------------------------------- ### Set child-directed metadata for React Native (SDK 9.3.0-) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Legacy API for React Native to set child-directed status via metadata. ```javascript LevelPlay.setMetaData('is_child_directed', ['true']); ``` ```javascript LevelPlay.setMetaData('is_child_directed', ['false']); ``` -------------------------------- ### Set GDPR consent for LevelPlay SDK 9.5.0+ (iOS) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this method to set the GDPR consent status for iOS. ```objective-c LPMPrivacySettings.setGDPRConsent(true) ``` -------------------------------- ### Set child-directed metadata for Flutter (SDK 9.3.0-) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Legacy API for Flutter to set child-directed status via metadata. ```dart LevelPlay.setMetaData({'is_child_directed': ['true']}); ``` ```dart LevelPlay.setMetaData({'is_child_directed': ['false']}); ``` -------------------------------- ### Add AppSet dependency for children-directed apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Include the Google Play services AppSet dependency in your Gradle configuration. ```gradle implementation 'com.google.android.gms:play-services-appset:16.0.0' ``` -------------------------------- ### Set consent for LevelPlay SDK 9.3.0 and lower (iOS) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use these methods to set the global consent flag for older SDK versions. ```objective-c [LevelPlay setConsent:YES]; ``` ```objective-c [LevelPlay setConsent:NO]; ``` -------------------------------- ### Set COPPA flag for Android (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API to flag an end-user as child-directed on Android for SDK version 9.4.0 and higher. ```java LevelPlayPrivacySettings.setCOPPA(true) ``` -------------------------------- ### Set CCPA consent for Android (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API for Android when the user has opted out of the sale or sharing of their personal information. ```java LevelPlayPrivacySettings.setCCPA(true) ``` -------------------------------- ### Set GDPR consent for LevelPlay SDK 9.5.0+ (Flutter) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this method to set the GDPR consent status for Flutter. ```dart LevelPlayPrivacySettings.setGDPRConsent(true); ``` -------------------------------- ### Set CCPA consent for iOS (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API for iOS when the user has opted out of the sale or sharing of their personal information. ```objective-c LPMPrivacySettings.setCCPA(true) ``` -------------------------------- ### LevelPlay.setConsent(boolean) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Sets the GDPR consent status for the user. This API is used for LevelPlay SDK version 9.3.0 and lower. This API is deprecated and will be removed in a future SDK version. ```APIDOC ## LevelPlay.setConsent(boolean) ### Description Sets the GDPR consent status for the user. This API is used for LevelPlay SDK version 9.3.0 and lower. This API is deprecated and will be removed in a future SDK version. ### Method setConsent ### Parameters - **consent** (boolean) - Required - Indicates whether the user has granted consent. ### Request Example ``` LevelPlay.setConsent(true); ``` ### Response No response is returned. ``` -------------------------------- ### Set individual network GDPR consents for LevelPlay SDK 9.4.0 (iOS) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Pass a dictionary of network keys to NSNumber values to set individual network consent. This replaces all previously stored consents. ```swift let consents: [String: NSNumber] = [ "UnityAds": true, "IronSource": false ] LPMPrivacySettings.setGDPRConsents(consents) ``` -------------------------------- ### Set COPPA flag for iOS (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API to flag an end-user as child-directed on iOS for SDK version 9.4.0 and higher. ```objective-c LPMPrivacySettings.setCOPPA(true) ``` -------------------------------- ### Set individual network GDPR consents for LevelPlay SDK 9.4.0 (Flutter) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Pass a map of network keys to Boolean values to set individual network consent. This replaces all previously stored consents. ```dart LevelPlayPrivacySettings.setGDPRConsents( { 'UnityAds': true, 'IronSource': false } ); ``` -------------------------------- ### Set CCPA consent for Flutter (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API for Flutter when the user has opted out of the sale or sharing of their personal information. ```dart LevelPlayPrivacySettings.setCCPA(true); ``` -------------------------------- ### Allow AAID permission for mixed-audience apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Update the Android manifest to allow access to the Android Advertising ID for mixed-audience apps. ```xml ``` -------------------------------- ### LevelPlayPrivacySettings.setCCPA (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Sets the CCPA consent status for users who have opted out of the sale or sharing of their personal information. Available in LevelPlay SDK version 9.4.0 and higher. ```APIDOC ## LevelPlayPrivacySettings.setCCPA ### Description Sets the CCPA consent status for users who have opted out of the sale or sharing of their personal information. Available in LevelPlay SDK version 9.4.0 and higher. ### Method setCCPA ### Parameters - **value** (boolean) - Required - Set to true if the user has opted out of the sale or sharing of their personal information. ### Code Examples #### Android ``` LevelPlayPrivacySettings.setCCPA(true) ``` #### iOS ``` LPMPrivacySettings.setCCPA(true) ``` #### Unity ``` LevelPlayPrivacySettings.SetCCPA(true); ``` #### Flutter ``` LevelPlayPrivacySettings.setCCPA(true); ``` #### React Native ``` LevelPlayPrivacySettings.setCCPA(true); ``` ``` -------------------------------- ### Set CCPA metadata for Android (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for Android to set CCPA metadata. Use 'true' to opt out and 'false' to consent. ```java LevelPlay.setMetaData("do_not_sell","true"); ``` ```java LevelPlay.setMetaData("do_not_sell","false"); ``` -------------------------------- ### Set CCPA metadata for iOS (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for iOS to set CCPA metadata. Use 'YES' to opt out and 'NO' to consent. ```objective-c [LevelPlay setMetaDataWithKey:@"do_not_sell" value:@"YES"]; ``` ```objective-c [LevelPlay setMetaDataWithKey:@"do_not_sell" value:@"NO"]; ``` -------------------------------- ### Set CCPA metadata for React Native (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for React Native to set CCPA metadata. Use 'true' to opt out and 'false' to consent. ```javascript LevelPlay.setMetaData('do_not_sell', ['true']); ``` ```javascript LevelPlay.setMetaData('do_not_sell', ['false']); ``` -------------------------------- ### Set COPPA flag for Flutter (SDK 9.4.0+) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Use this API to flag an end-user as child-directed in Flutter for SDK version 9.4.0 and higher. ```dart LevelPlayPrivacySettings.setCOPPA(true); ``` -------------------------------- ### Set CCPA metadata for Flutter (SDK 9.3.0 and lower) Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Deprecated API for Flutter to set CCPA metadata. Use 'true' to opt out and 'false' to consent. ```dart LevelPlay.setMetaData({'do_not_sell': ['true']}); ``` ```dart LevelPlay.setMetaData({'do_not_sell': ['false']}); ``` -------------------------------- ### Remove AAID permission for children-directed apps Source: https://docs.unity.com/en-us/grow/levelplay/sdk/android/regulation-advanced-settings Update the Android manifest to remove access to the Android Advertising ID for apps primarily directed at children. ```xml ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.