How to add Android Network Security Config for API less than 24

拈花ヽ惹草 提交于 2019-12-01 01:55:01

问题


Facebook Audience Network states that.

In the Audience Network Android SDK, we use 127.0.0.1 (localhost) as a caching proxy to cache media files in the SDK. Since Android P, 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.

Now if I try to add this line android:networkSecurityConfig="@xml/network_security_config" in my AndroidManifest I am getting warning that attribute networkSecurityConfig is used in API 24 and higher as my app supports minSdkVersion 15 .

How should I add the android:networkSecurityConfig so that it won't be impacting API less than 24


回答1:


It works that way by default. Older devices will not recognize android:networkSecurityConfig, since it did not exist prior to API Level 24 (Android 7.0).



来源:https://stackoverflow.com/questions/52691058/how-to-add-android-network-security-config-for-api-less-than-24

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!