Skip to content

Instantly share code, notes, and snippets.

@MohammadAzimi
Created May 9, 2021 09:28
Show Gist options
  • Save MohammadAzimi/36af9a98e74a287c55bd1f9d714fc4e5 to your computer and use it in GitHub Desktop.
Save MohammadAzimi/36af9a98e74a287c55bd1f9d714fc4e5 to your computer and use it in GitHub Desktop.
android network_security_config file for react-native. should be added to android/app/src/main/res/xml
<!-- react native -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">example.net</domain>
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment