Additional Meta AudienceNetwork steps - cleveradssolutions/CAS-Android GitHub Wiki

Data Processing Options for US Users

Meta Audience Network Data Processing Options for US Users Limited Data Use is a data processing option that gives you more control over how your data is used in Meta’s systems and better supports your compliance efforts with various US state privacy regulations. To utilize this feature, you must proactively enable Limited Data Use.
Visit Meta’s developer documentation for details.

If you do not want to enable Limited Data Use (LDU) mode, pass an empty string array:

AudienceNetworkSettings.setDataProcessingOptions( new String[] {} );  

To enable LDU for users and specify user geography, call setDataProcessingOptions in a form like this:

AudienceNetworkSettings.setDataProcessingOptions( new String[] {"LDU"}, 1, 1000 );

Network security configuration

The Audience Network Android SDK use 127.0.0.1 (localhost) as a caching proxy to cache media files in the SDK. Since Android 9, cleartext traffic (unencrypted HTTP) will be blocked by default, which will affect the functionality of media caching of the SDK and could affect user experience and ads revenue.

  1. Create res/xml/network_security_config.xml file, add domain-config tag with sets cleartextTrafficPermitted attribute to true:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
    </domain-config>
</network-security-config>
  1. Add the network_security_config.xml file to your AndroidManifest.xml:
<manifest>
    <application 
		...
        android:networkSecurityConfig="@xml/network_security_config">
    </application>
</manifest>
⚠️ **GitHub.com Fallback** ⚠️