Hello Friends,

Welcome To Infinitbility!

React Native provide default block all unsecure or not encrypted url but we made changes on project to call unencrypted url for development and when we want to deploy then we have to re-block unencrypted url calls, this article help you to reblock unsecure urls.

Let start today’s topic How to block calling unencrypted URL in react native


We wil remove code on react native to block calling unsecured url and those code are we added when we want to call not encrypted url. then first we understand what are unsecured and unencrypted url?

unsecured and unencrypted urls are those who haven’t ssl certificate they looks like ( http://example.com ) and secured and encrypted url looks like ( https://example.com ) the diffrance is S.

Block unencrypted url in android

React Native provide android:usesCleartextTraffic="true" for allow unencrypted url in android then you have to remove android:usesCleartextTraffic="true" from AndroidManifest.xml ( project/android/app/src/main/AndroidManifest.xml ). it’s something looks like


        <!--remove this line android:usesCleartextTraffic="true"   -->

Block unencrypted url in iOS

React Native provide NSAllowsArbitraryLoads for allow unencrypted url in iOS then we have to remove from info.plist ( project/ios/project/info.plist ). it’s looks something like


Search NSAppTransportSecurity on info.plist file remove key dict pair and test your app.

Thanks for reading…