Additional Meta AudienceNetwork steps - cleveradssolutions/CAS-Android GitHub Wiki
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 );
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.
Note
Read more on Meta developers documentation
- Create
res/xml/network_security_config.xml
file, adddomain-config
tag with setscleartextTrafficPermitted
attribute totrue
:
<?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>
- Add the
network_security_config.xml
file to your AndroidManifest.xml:
<manifest>
<application
...
android:networkSecurityConfig="@xml/network_security_config">
</application>
</manifest>