I develop cordova cross platform app using HTML5 & Javascript. But recently I encountered some problems with android.
Previously I was using Cordova 7 where android version was 6.3 Which supports android API 16 to 26. But as per new google rule, from August 2019, All app must be targeted Android API 28 which is Android 8 & Android 9.
Cordova's latest version is Cordova 9 which supports Android 8. Cordova did not release any version which supports Android 9.
So to develop App targeting API 28, I've to use Android 8. But I'm facing some problems with the app. Previously my app was working fine. When I develop app with Android 8 with Cordova 9, it is working fine with all phones which are Android 8 and below but showing error in Android 9. Specially with AJAX requests.
I'm sending AJAX requests to a server with http (not https). In some blog I see it might cause error. But I don't see any way to fix and currently I've no option to use https.
Another way is to set <preference name="android-targetSdkVersion" value="26" />
which works fine in all android version (6~9) but when I upload with this config in Google Play store, it shows warning to update to target API to 28.
So for now what should I do?
Thanks in advance.
N.B: I found a way to use http but did not understand it at all. If anyone can explain I'll be glad. Link given below: https://developer.android.com/training/articles/security-config
Ajax error in Cordova App after upgrade phone to Android 9 Pie API 28 Revision 6