Native App Connection Error

0
Native App deployed to my mobile is throwing Connection Error when I try to test the offline capability by turning off the wifi & mobile data. Followed below steps: Deploy the App to mobile Open the App with wifi on and login to app using credentials. This is working fine Now close the app Turn off the wifi and opening the app again throws below error Any idea what is wrong? or any suggestions to test offline capability
asked
2 answers
0

 

Any updates on this as I am experiencing the same issue?

answered
0

There are few things to check here:

Follow below steps if you are building the APK file locally

  • Add below entry to AndroidManifest.xml: 

             

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application android:networkSecurityConfig="@xml/network_security_config"
                    ... >
        ...
    </application>
</manifest>
  • create network_security_config.xml file with below contents under xml directory
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" />
        </trust-anchors>
    </base-config>
</network-security-config>

If you are not building locally then make sure no external API/Service calls are triggered while launching the App in offline mode

Make sure to first synchronize the data before testing offline functionality

answered