Reputation: 107
I've create an app in Xamarin, the app will call a WebAPI to login and retrieve data from server.
The WebAPI is http, not https.
The calling of web API success in iOS emulator, iOS device, and Android emulator. (I do not have android device to test).
But when deploy to user using Android phone, calling of Web API fail with error message Connection Fail.
No idea why this happen. Please guide me what I can check.
Thanks
Upvotes: 0
Views: 150
Reputation: 14475
Check if the setting is set correctly in Properties .
HttpClient implementation -> Android
SSL/TLS implementaiton -> Native TLS 1.2+
Add android:networkSecurityConfig="@xml/network_security_config"
into AndroidManifest .
Create a new xml named network_security_config.xml , add it into res/xml folder .
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
Upvotes: 1
Reputation: 584
Make sure your android emulator is set up correctly and is connected to the internet
Upvotes: 0