[英]$http requests not working in signed apk Ionic
when i run my cordova ionic app directly on android studio,it's working and send $http request perfectly. 当我直接在android studio上运行我的cordova ionic应用程序时,它正在运行并完美发送$ http请求。
but when i installed signed .apk,http requests doesn't work 但是当我安装签名的.apk时,http请求不起作用
Controller.js Controller.js
var postObject = new Object();
postObject.User = $scope.data.username;
postObject.Secret = $scope.data.password;
$http({
url: 'https://example.com/',
method: "POST",
data: {
'message': postObject
}
})
.then(function(response) {
$cordovaDialogs.alert('Success', 'Info', 'OK');
},
function(response) {
$cordovaDialogs.alert('Error', 'Info', 'Error');
});
Config.xml Config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="1" id="com.example.abc" version="0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Cordova project.</name>
<description>
Cordova project.
</description>
<author email="example@gmail.com" href="https://www.example.lk/">
example
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="*" />
<allow-navigation href="*" />
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-console" spec="^1.0.7" />
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-firebase" spec="^0.1.24" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
why this happen?how can i solve this problem? 为什么会这样?我该如何解决这个问题?
If the request is sent to a website with an invalid certificate the requests are dropped. 如果将请求发送到带有无效证书的网站,则请求将被丢弃。 This happens only for release built of your application. 这仅在应用程序构建的版本中发生。 Check the SSL certificate and try again. 检查SSL证书,然后重试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.